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>
This commit is contained in:
Родитель
a24b4d70c7
Коммит
8d3032c369
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче