Skip to content

Commit

Permalink
staging:iio:ad7780: add chip ID values and mask
Browse files Browse the repository at this point in the history
The ad7780 supports both the ad778x and ad717x families. Each chip has
a corresponding ID. This patch provides a mask for extracting ID values
from the status bits and also macros for the correct values for the
ad7170, ad7171, ad7780 and ad7781.

Signed-off-by: Renato Lui Geh <renatogeh@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Renato Lui Geh authored and Jonathan Cameron committed Apr 4, 2019
1 parent 33e1f90 commit 4812a14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/staging/iio/adc/ad7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
#define AD7780_ID0 BIT(3)
#define AD7780_GAIN BIT(2)

#define AD7170_ID 0
#define AD7171_ID 1
#define AD7780_ID 1
#define AD7781_ID 0

#define AD7780_ID_MASK (AD7780_ID0 | AD7780_ID1)

#define AD7780_PATTERN_GOOD 1
#define AD7780_PATTERN_MASK GENMASK(1, 0)
Expand Down

0 comments on commit 4812a14

Please sign in to comment.