Skip to contentSkip to conversation

iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits

PATCH Applied Cosmin Tanislav 2 participants 3 messages Jan 12, 2022 – Jan 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits

According to page 90 of the datasheet [1], AIN_BUFP is bit 6 and AIN_BUFM is bit 5 of the CONFIG_0 -> CONFIG_7 registers.

Fix the mask used for setting these bits.

[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf

Fixes 0eaecea6e487 ("iio: adc: ad7124: Add buffered input support")
---
 drivers/iio/adc/ad7124.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7124.c +1 -1
index e45c600fccc0..18c154afbd7a 100644
@@ -76,7 +76,7 @@
 #define AD7124_CONFIG_REF_SEL(x)	FIELD_PREP(AD7124_CONFIG_REF_SEL_MSK, x)
 #define AD7124_CONFIG_PGA_MSK		GENMASK(2, 0)
 #define AD7124_CONFIG_PGA(x)		FIELD_PREP(AD7124_CONFIG_PGA_MSK, x)
-#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(7, 6)
+#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(6, 5)
 #define AD7124_CONFIG_IN_BUFF(x)	FIELD_PREP(AD7124_CONFIG_IN_BUFF_MSK, x)
 
 /* AD7124_FILTER_X */
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 9 lines · On Wed, 12 Jan 2022 22:00:36 +0200 Cosmin Tanislav <[email protected]>…

According to page 90 of the datasheet [1], AIN_BUFP is bit 6 and AIN_BUFM is bit 5 of the CONFIG_0 -> CONFIG_7 registers.

Fix the mask used for setting these bits.

[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf

Fixes 0eaecea6e487 ("iio: adc: ad7124: Add buffered input support")

Curious that didn't cause problems anyone noticed before. Ah well.

Applied to the fixes-togreg branch of iio.git and marked for stable.

Note that branch will probably be rebased after rc1 as I have some other things that need rc1 which will be in same pull request.

Jonathan

Quoted 17 lines
---
 drivers/iio/adc/ad7124.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7124.c +1 -1
index e45c600fccc0..18c154afbd7a 100644
@@ -76,7 +76,7 @@
 #define AD7124_CONFIG_REF_SEL(x)	FIELD_PREP(AD7124_CONFIG_REF_SEL_MSK, x)
 #define AD7124_CONFIG_PGA_MSK		GENMASK(2, 0)
 #define AD7124_CONFIG_PGA(x)		FIELD_PREP(AD7124_CONFIG_PGA_MSK, x)
-#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(7, 6)
+#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(6, 5)
 #define AD7124_CONFIG_IN_BUFF(x)	FIELD_PREP(AD7124_CONFIG_IN_BUFF_MSK, x)
 
 /* AD7124_FILTER_X */
#2 lore raw
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Wed, 12 Jan 2022 22:00:36 +0200 Cosmin Tanislav <[email protected]>…

According to page 90 of the datasheet [1], AIN_BUFP is bit 6 and AIN_BUFM is bit 5 of the CONFIG_0 -> CONFIG_7 registers.

Quoted 8 lines
Quoted 6 lines

Fix the mask used for setting these bits.

[1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf

Fixes 0eaecea6e487 ("iio: adc: ad7124: Add buffered input support")

Curious that didn't cause problems anyone noticed before. Ah well.

I only noticed it because I'm writing a driver for a similar device, it was not even reported by anyone.

Quoted 25 lines

Applied to the fixes-togreg branch of iio.git and marked for stable.

Note that branch will probably be rebased after rc1 as I have some other things that need rc1 which will be in same pull request.

Jonathan

Quoted 17 lines
---
  drivers/iio/adc/ad7124.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7124.c +1 -1
index e45c600fccc0..18c154afbd7a 100644
@@ -76,7 +76,7 @@
  #define AD7124_CONFIG_REF_SEL(x)	FIELD_PREP(AD7124_CONFIG_REF_SEL_MSK, x)
  #define AD7124_CONFIG_PGA_MSK		GENMASK(2, 0)
  #define AD7124_CONFIG_PGA(x)		FIELD_PREP(AD7124_CONFIG_PGA_MSK, x)
-#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(7, 6)
+#define AD7124_CONFIG_IN_BUFF_MSK	GENMASK(6, 5)
  #define AD7124_CONFIG_IN_BUFF(x)	FIELD_PREP(AD7124_CONFIG_IN_BUFF_MSK, x)
 
  /* AD7124_FILTER_X */