Skip to content

Commit 8402b32

Browse files
cjd8jic23
authored andcommitted
iio: light: opt3001: use macros from bits.h header
Use GENMASK() and BIT() macros from bits.h header where it makes sense. While at it, remove unused macro. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent b622051 commit 8402b32

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/iio/light/opt3001.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,24 @@
3333
#define OPT3001_MANUFACTURER_ID 0x7e
3434
#define OPT3001_DEVICE_ID 0x7f
3535

36-
#define OPT3001_CONFIGURATION_RN_MASK (0xf << 12)
36+
#define OPT3001_CONFIGURATION_RN_MASK GENMASK(15, 12)
3737
#define OPT3001_CONFIGURATION_RN_AUTO (0xc << 12)
3838

3939
#define OPT3001_CONFIGURATION_CT BIT(11)
4040

41-
#define OPT3001_CONFIGURATION_M_MASK (3 << 9)
41+
#define OPT3001_CONFIGURATION_M_MASK GENMASK(10, 9)
4242
#define OPT3001_CONFIGURATION_M_SHUTDOWN (0 << 9)
4343
#define OPT3001_CONFIGURATION_M_SINGLE (1 << 9)
4444
#define OPT3001_CONFIGURATION_M_CONTINUOUS (2 << 9) /* also 3 << 9 */
4545

46-
#define OPT3001_CONFIGURATION_OVF BIT(8)
4746
#define OPT3001_CONFIGURATION_CRF BIT(7)
4847
#define OPT3001_CONFIGURATION_FH BIT(6)
4948
#define OPT3001_CONFIGURATION_FL BIT(5)
5049
#define OPT3001_CONFIGURATION_L BIT(4)
5150
#define OPT3001_CONFIGURATION_POL BIT(3)
5251
#define OPT3001_CONFIGURATION_ME BIT(2)
5352

54-
#define OPT3001_CONFIGURATION_FC_MASK (3 << 0)
53+
#define OPT3001_CONFIGURATION_FC_MASK GENMASK(1, 0)
5554

5655
/* The end-of-conversion enable is located in the low-limit register */
5756
#define OPT3001_LOW_LIMIT_EOC_ENABLE 0xc000

0 commit comments

Comments
 (0)