summaryrefslogtreecommitdiffstats
path: root/drivers/iio/chemical
diff options
context:
space:
mode:
authorDavid Frey <dpfrey@gmail.com>2018-08-17 21:03:17 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-08-19 18:06:53 +0200
commit8d3032c3692d247ad625863e949d419952db8cbd (patch)
tree74f15a02e615aa0e3a60f26c000eb24fd2a240b7 /drivers/iio/chemical
parentiio: chemical: bme680: change MSK->MASK in #defines (diff)
downloadlinux-8d3032c3692d247ad625863e949d419952db8cbd.tar.xz
linux-8d3032c3692d247ad625863e949d419952db8cbd.zip
iio: chemical: bme680: use GENMASK macro
Replace hardcoded bit masks with GENMASK macro Signed-off-by: David Frey <dpfrey@gmail.com> Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com> Tested-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/chemical')
-rw-r--r--drivers/iio/chemical/bme680.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/chemical/bme680.h b/drivers/iio/chemical/bme680.h
index 437d75c2bad5..a9f2a9a6abc5 100644
--- a/drivers/iio/chemical/bme680.h
+++ b/drivers/iio/chemical/bme680.h
@@ -18,7 +18,7 @@
#define BME680_REG_GAS_MSB 0x2A
#define BME680_REG_GAS_R_LSB 0x2B
#define BME680_GAS_STAB_BIT BIT(4)
-#define BME680_GAS_RANGE_MASK 0x0F
+#define BME680_GAS_RANGE_MASK GENMASK(3, 0)
#define BME680_REG_CTRL_HUMIDITY 0x72
#define BME680_OSRS_HUMIDITY_MASK GENMASK(2, 0)
@@ -39,13 +39,13 @@
#define BME680_MAX_OVERFLOW_VAL 0x40000000
#define BME680_HUM_REG_SHIFT_VAL 4
-#define BME680_BIT_H1_DATA_MASK 0x0F
+#define BME680_BIT_H1_DATA_MASK GENMASK(3, 0)
#define BME680_REG_RES_HEAT_RANGE 0x02
-#define BME680_RHRANGE_MASK 0x30
+#define BME680_RHRANGE_MASK GENMASK(5, 4)
#define BME680_REG_RES_HEAT_VAL 0x00
#define BME680_REG_RANGE_SW_ERR 0x04
-#define BME680_RSERROR_MASK 0xF0
+#define BME680_RSERROR_MASK GENMASK(7, 4)
#define BME680_REG_RES_HEAT_0 0x5A
#define BME680_REG_GAS_WAIT_0 0x64
#define BME680_ADC_GAS_RES_SHIFT 6