hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/iio/chemical/bme680.h
....@@ -3,9 +3,9 @@
33 #define BME680_H_
44
55 #define BME680_REG_CHIP_ID 0xD0
6
-#define BME680_CHIP_ID_VAL 0x61
6
+#define BME680_CHIP_ID_VAL 0x61
77 #define BME680_REG_SOFT_RESET 0xE0
8
-#define BME680_CMD_SOFTRESET 0xB6
8
+#define BME680_CMD_SOFTRESET 0xB6
99 #define BME680_REG_STATUS 0x73
1010 #define BME680_SPI_MEM_PAGE_BIT BIT(4)
1111 #define BME680_SPI_MEM_PAGE_1_VAL 1
....@@ -16,6 +16,7 @@
1616 #define BME680_REG_GAS_MSB 0x2A
1717 #define BME680_REG_GAS_R_LSB 0x2B
1818 #define BME680_GAS_STAB_BIT BIT(4)
19
+#define BME680_GAS_RANGE_MASK GENMASK(3, 0)
1920
2021 #define BME680_REG_CTRL_HUMIDITY 0x72
2122 #define BME680_OSRS_HUMIDITY_MASK GENMASK(2, 0)
....@@ -24,9 +25,8 @@
2425 #define BME680_OSRS_TEMP_MASK GENMASK(7, 5)
2526 #define BME680_OSRS_PRESS_MASK GENMASK(4, 2)
2627 #define BME680_MODE_MASK GENMASK(1, 0)
27
-
28
-#define BME680_MODE_FORCED 1
29
-#define BME680_MODE_SLEEP 0
28
+#define BME680_MODE_FORCED 1
29
+#define BME680_MODE_SLEEP 0
3030
3131 #define BME680_REG_CONFIG 0x75
3232 #define BME680_FILTER_MASK GENMASK(4, 2)
....@@ -37,24 +37,21 @@
3737
3838 #define BME680_MAX_OVERFLOW_VAL 0x40000000
3939 #define BME680_HUM_REG_SHIFT_VAL 4
40
-#define BME680_BIT_H1_DATA_MSK 0x0F
40
+#define BME680_BIT_H1_DATA_MASK GENMASK(3, 0)
4141
4242 #define BME680_REG_RES_HEAT_RANGE 0x02
43
-#define BME680_RHRANGE_MSK 0x30
43
+#define BME680_RHRANGE_MASK GENMASK(5, 4)
4444 #define BME680_REG_RES_HEAT_VAL 0x00
4545 #define BME680_REG_RANGE_SW_ERR 0x04
46
-#define BME680_RSERROR_MSK 0xF0
46
+#define BME680_RSERROR_MASK GENMASK(7, 4)
4747 #define BME680_REG_RES_HEAT_0 0x5A
4848 #define BME680_REG_GAS_WAIT_0 0x64
49
-#define BME680_GAS_RANGE_MASK 0x0F
5049 #define BME680_ADC_GAS_RES_SHIFT 6
5150 #define BME680_AMB_TEMP 25
5251
5352 #define BME680_REG_CTRL_GAS_1 0x71
5453 #define BME680_RUN_GAS_MASK BIT(4)
5554 #define BME680_NB_CONV_MASK GENMASK(3, 0)
56
-#define BME680_RUN_GAS_EN_BIT BIT(4)
57
-#define BME680_NB_CONV_0_VAL 0
5855
5956 #define BME680_REG_MEAS_STAT_0 0x1D
6057 #define BME680_GAS_MEAS_BIT BIT(6)