From: Renato Lui Geh Date: Sat, 16 Mar 2019 02:14:27 +0000 (-0300) Subject: staging:iio:ad7780: add chip ID values and mask X-Git-Tag: v5.2-rc1~153^2~149^2~52 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=4812a14a78c82cfe81cb5fd7555a9de723b49a59;p=linux.git staging:iio:ad7780: add chip ID values and mask 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 8ee1f884e7cf..f064dcfc53f1 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -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)