Skip to contentSkip to conversation

iio: light: ltr390: Replaced mask values with GENMASK()

PATCH Applied Abhash Jha 2 participants 2 messages Sep 14, 2024 – Sep 28, 2024

Subsystems (2)
lore
Share & tools
lore

Abhash Jha

author
#0 lore raw

PATCH 1/1 iio: light: ltr390: Replaced mask values with GENMASK()

Changed the hardcoded mask values for GAIN_MASK and INT_TIME_MASK to use GENMASK() instead.

---
 drivers/iio/light/ltr390.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/light/ltr390.c +2 -2
index a51ad6704..8f44453a7 100644
@@ -46,9 +46,9 @@
 #define LTR390_THRESH_LOW		0x24
 
 #define LTR390_PART_NUMBER_ID		0xb
-#define LTR390_ALS_UVS_GAIN_MASK	0x07
+#define LTR390_ALS_UVS_GAIN_MASK	GENMASK(2, 0)
 #define LTR390_ALS_UVS_MEAS_RATE_MASK	GENMASK(2, 0)
-#define LTR390_ALS_UVS_INT_TIME_MASK	0x70
+#define LTR390_ALS_UVS_INT_TIME_MASK	GENMASK(6, 4)
 #define LTR390_ALS_UVS_INT_TIME(x)	FIELD_PREP(LTR390_ALS_UVS_INT_TIME_MASK, (x))
 #define LTR390_INT_PST_MASK		GENMASK(7, 4)
 #define LTR390_INT_PST_VAL(x)		FIELD_PREP(LTR390_INT_PST_MASK, (x))
Signature · 1 line
2.43.0