summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMoses Christopher Bollavarapu <mosescb.dev@gmail.com>2022-04-19 22:20:51 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-05-17 09:16:49 +0200
commit786dc07be9e50039482de73bc48484ad9604e246 (patch)
tree41cf200b96604a9d181a0add29df8cf3bf179dcf /drivers/media
parentf0de79f6b78a233b39cc90ede59d829df350d735 (diff)
media: i2c: video-i2c: Use GENMASK for masking bits
Replace 0x0380 with GENMASK(9, 7) to obtain 0b0000_0011_1000_0000 Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/video-i2c.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 1d5f48329cb2..e08e3579c0a1 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -9,6 +9,7 @@
* - Melexis MLX90640 Thermal Cameras
*/
+#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/hwmon.h>
@@ -62,7 +63,7 @@
/* Control register */
#define MLX90640_REG_CTL1 0x800d
-#define MLX90640_REG_CTL1_MASK 0x0380
+#define MLX90640_REG_CTL1_MASK GENMASK(9, 7)
#define MLX90640_REG_CTL1_MASK_SHIFT 7
struct video_i2c_chip;