Skip to contentSkip to conversation

iio: adc: ad7192: fix GPOCON register access annotation

PATCH In review Stepan Ionichev 3 participants 3 messages May 13 – May 16

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

PATCH 1/1 iio: adc: ad7192: fix GPOCON register access annotation

The comment next to AD7192_REG_GPOCON marks the register as RO, but the AD7192 datasheet (Rev. A, page 24, GPOCON REGISTER) says:
"The GPOCON register is an 8-bit register from which data can be read or to which data can be written."

The driver itself uses ad_sd_write_reg() against this register in ad7192_show_scale() / write paths to control the bridge power-down switch and digital outputs, which matches the RW datasheet description. Update the comment to RW so it does not mislead future readers.

---
 drivers/iio/adc/ad7192.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7192.c +1 -1
index 8b1664f6b..98c1420a9 100644
@@ -39,7 +39,7 @@
 #define AD7192_REG_CONF		2 /* Configuration Register  (RW, 24-bit) */
 #define AD7192_REG_DATA		3 /* Data Register	     (RO, 24/32-bit) */
 #define AD7192_REG_ID		4 /* ID Register	     (RO, 8-bit) */
-#define AD7192_REG_GPOCON	5 /* GPOCON Register	     (RO, 8-bit) */
+#define AD7192_REG_GPOCON	5 /* GPOCON Register	     (RW, 8-bit) */
 #define AD7192_REG_OFFSET	6 /* Offset Register	     (RW, 16-bit */
 				  /* (AD7792)/24-bit (AD7192)) */
 #define AD7192_REG_FULLSALE	7 /* Full-Scale Register */
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Stepan Ionichev

The comment next to AD7192_REG_GPOCON marks the register as RO, but the AD7192 datasheet (Rev. A, page 24, GPOCON REGISTER) says:
"The GPOCON register is an 8-bit register from which data can be read or to which data can be written."

The driver itself uses ad_sd_write_reg() against this register in ad7192_show_scale() / write paths to control the bridge power-down switch and digital outputs, which matches the RW datasheet description. Update the comment to RW so it does not mislead future readers.

Makes sense,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#2 lore raw
Quoted 6 lines · On Wed, 13 May 2026 16:35:30 +0300 Andy Shevchenko…
Quoted 5 lines · Stepan Ionichev

The comment next to AD7192_REG_GPOCON marks the register as RO, but the AD7192 datasheet (Rev. A, page 24, GPOCON REGISTER) says:
"The GPOCON register is an 8-bit register from which data can be read or to which data can be written."

Quoted 9 lines
Quoted 5 lines

The driver itself uses ad_sd_write_reg() against this register in ad7192_show_scale() / write paths to control the bridge power-down switch and digital outputs, which matches the RW datasheet description. Update the comment to RW so it does not mislead future readers.

Makes sense,

Applied to the testing branch of iio.git.

thanks,

Jonathan