]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iio: light: ltr390: Replaced mask values with GENMASK()
authorAbhash Jha <abhashkumarjha123@gmail.com>
Sat, 14 Sep 2024 18:22:39 +0000 (23:52 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 5 Oct 2024 11:09:14 +0000 (12:09 +0100)
Changed the hardcoded mask values for GAIN_MASK and INT_TIME_MASK to use
GENMASK() instead.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20240914182239.507953-1-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/ltr390.c

index 1d9f2149a62772e993e3b34f39540e2d4d2326c6..a92034cdd67afeb5c9aecb50b75d2015bf6a3f17 100644 (file)
@@ -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))