On 11/06, Ardelean, Alexandru wrote:
Hey, You don't need to check any patterns, that's already being done in the driver (see `pattern` & `pattern_mask` fields). And see function ad7780_postprocess_sample(). Though I will admit it would have been nicer if those patterns were generated from AD7780_PAT1 & AD7780_PAT0. So (if you want), you could update those pattern assignments with some macros ; for AD717x you may need to add AD7170_PAT2 (BIT(2)) I am noticing a small bug with the driver now (in ad7780_postprocess_sample()). The AD7780_GAIN bit-field (for AD778x) overlaps with AD7170_PAT2 (for AD717x). So, maybe you could add a field called `is_ad778x` in `ad7780_chip_info` and initialize it to true in the `ad7780_chip_info_tbl` for AD7780 & AD7781 ; and only perform the AD7780_GAIN check for these devices. According to the datasheets AD7170 & AD7171 have a fixed gain of 1. I would ignore the ID0 & ID1 fields ; those seem to overlap a bit between AD717x & AD778x. And they're not very useful in the driver.
Hi, Thank you for the clues on what to work on. We've just now sent a patchset with the fixes you mentioned in the quoted block above.
For AD778x you could also add support for the GAIN & FILTER pins via GPIOs, to control these settings. And then in the ad7780_postprocess_sample() function check if the GPIO settings (stored on a gpio_desc on ad7780_state) match the expected GAIN & FILTER bit settings ; if not return -EIO. All-in-all, the driver is almost ready to move out of staging (from my point of view). Not sure if anyone else has anything else to add. The bug should be fixed, and the rest is nice-to-have, but not necessarily a must (again, from my point of view) to keep it in staging. Also, generally: maybe do a comparative sweep between AD717x & AD778x datasheets and see if there's something left that's incorrect for any of these chips.
We'll take a look on these issues and study them further and will start working on them once we're confident we understand them.
Thanks Alex
Thanks, Renato