summaryrefslogtreecommitdiff
path: root/driver/als_si114x.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 14:47:36 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-28 01:20:07 +0000
commit750f622729ecc00e6c6e30101e871a5baf95f929 (patch)
tree4465d3b3e54b17ef3b77ce74bc7fbc1ef9e0825a /driver/als_si114x.h
parent259636e25d8cde7d27d166bde7c8cb8ec3db9bc7 (diff)
downloadchrome-ec-750f622729ecc00e6c6e30101e871a5baf95f929.tar.gz
driver/als_si114x.h: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ie11107953516757d886154380c45499b0e707987 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729904 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'driver/als_si114x.h')
-rw-r--r--driver/als_si114x.h125
1 files changed, 62 insertions, 63 deletions
diff --git a/driver/als_si114x.h b/driver/als_si114x.h
index 2084c55f09..52424035cc 100644
--- a/driver/als_si114x.h
+++ b/driver/als_si114x.h
@@ -8,75 +8,75 @@
#ifndef __CROS_EC_ALS_SI114X_H
#define __CROS_EC_ALS_SI114X_H
-#define SI114X_ADDR_FLAGS 0x5a
-
-#define SI114X_PART_ID 0x00
-#define SI114X_SEQ_ID 0x02
-
-#define SI114X_INT_CFG 0x03
-#define SI114X_INT_CFG_INT_OE BIT(0)
-
-#define SI114X_IRQ_ENABLE 0x04
-#define SI114X_IRQ_ENABLE_PS3_IE BIT(4)
-#define SI114X_IRQ_ENABLE_PS2_IE BIT(3)
-#define SI114X_IRQ_ENABLE_PS1_IE BIT(2)
-#define SI114X_IRQ_ENABLE_ALS_IE_INT1 BIT(1)
-#define SI114X_IRQ_ENABLE_ALS_IE_INT0 BIT(0)
-
-#define SI114X_HW_KEY 0x07
-#define SI114X_HW_KEY_VALUE 0x17
-
-#define SI114X_MEAS_RATE 0x08
-#define SI114X_ALS_RATE 0x09
-#define SI114X_PS_RATE 0x0A
-
-#define SI114X_PS_LED21 0x0F
-#define SI114X_PS_LED3 0x10
-#define SI114X_NUM_LEDS (CONFIG_ALS_SI114X - 0x40)
-
-#define SI114X_PARAM_WR 0x17
-#define SI114X_COMMAND 0x18
-
-#define SI114X_COMMAND_PARAM_QUERY 0x80
-#define SI114X_COMMAND_PARAM_SET 0xA0
-#define SI114X_PARAM_CHLIST 0x01
-#define SI114X_PARAM_CHLIST_EN_ALS_VIS BIT(4)
-#define SI114X_PARAM_CHLIST_EN_PS3 BIT(2)
-#define SI114X_PARAM_CHLIST_EN_PS2 BIT(1)
-#define SI114X_PARAM_CHLIST_EN_PS1 BIT(0)
-#define SI114X_PARAM_PS_ADC_COUNTER 0x0A
-#define SI114X_PARAM_PS_ADC_GAIN 0x0B
-#define SI114X_PARAM_PS_ADC_MISC 0x0C
-#define SI114X_PARAM_PS_ADC_MISC_MODE BIT(2)
-#define SI114X_PARAM_PS_ADC_MISC_MODE_NORMAL_PROXIMITY BIT(2)
-#define SI114X_PARAM_ALS_VIS_ADC_COUNTER 0x10
-#define SI114X_PARAM_ALS_VIS_ADC_GAIN 0x11
-#define SI114X_PARAM_ALS_VIS_ADC_MISC 0x12
-
-#define SI114X_COMMAND_RESET 0x01
-#define SI114X_COMMAND_PS_FORCE 0x05
-#define SI114X_COMMAND_ALS_FORCE 0x06
-
-#define SI114X_IRQ_STATUS 0x21
-#define SI114X_ALS_VIS_DATA0 0x22
-
-#define SI114X_PARAM_RD 0x2E
+#define SI114X_ADDR_FLAGS 0x5a
+
+#define SI114X_PART_ID 0x00
+#define SI114X_SEQ_ID 0x02
+
+#define SI114X_INT_CFG 0x03
+#define SI114X_INT_CFG_INT_OE BIT(0)
+
+#define SI114X_IRQ_ENABLE 0x04
+#define SI114X_IRQ_ENABLE_PS3_IE BIT(4)
+#define SI114X_IRQ_ENABLE_PS2_IE BIT(3)
+#define SI114X_IRQ_ENABLE_PS1_IE BIT(2)
+#define SI114X_IRQ_ENABLE_ALS_IE_INT1 BIT(1)
+#define SI114X_IRQ_ENABLE_ALS_IE_INT0 BIT(0)
+
+#define SI114X_HW_KEY 0x07
+#define SI114X_HW_KEY_VALUE 0x17
+
+#define SI114X_MEAS_RATE 0x08
+#define SI114X_ALS_RATE 0x09
+#define SI114X_PS_RATE 0x0A
+
+#define SI114X_PS_LED21 0x0F
+#define SI114X_PS_LED3 0x10
+#define SI114X_NUM_LEDS (CONFIG_ALS_SI114X - 0x40)
+
+#define SI114X_PARAM_WR 0x17
+#define SI114X_COMMAND 0x18
+
+#define SI114X_COMMAND_PARAM_QUERY 0x80
+#define SI114X_COMMAND_PARAM_SET 0xA0
+#define SI114X_PARAM_CHLIST 0x01
+#define SI114X_PARAM_CHLIST_EN_ALS_VIS BIT(4)
+#define SI114X_PARAM_CHLIST_EN_PS3 BIT(2)
+#define SI114X_PARAM_CHLIST_EN_PS2 BIT(1)
+#define SI114X_PARAM_CHLIST_EN_PS1 BIT(0)
+#define SI114X_PARAM_PS_ADC_COUNTER 0x0A
+#define SI114X_PARAM_PS_ADC_GAIN 0x0B
+#define SI114X_PARAM_PS_ADC_MISC 0x0C
+#define SI114X_PARAM_PS_ADC_MISC_MODE BIT(2)
+#define SI114X_PARAM_PS_ADC_MISC_MODE_NORMAL_PROXIMITY BIT(2)
+#define SI114X_PARAM_ALS_VIS_ADC_COUNTER 0x10
+#define SI114X_PARAM_ALS_VIS_ADC_GAIN 0x11
+#define SI114X_PARAM_ALS_VIS_ADC_MISC 0x12
+
+#define SI114X_COMMAND_RESET 0x01
+#define SI114X_COMMAND_PS_FORCE 0x05
+#define SI114X_COMMAND_ALS_FORCE 0x06
+
+#define SI114X_IRQ_STATUS 0x21
+#define SI114X_ALS_VIS_DATA0 0x22
+
+#define SI114X_PARAM_RD 0x2E
/* Proximity sensor finds an object within 5 cm, disable light sensor */
-#define SI114X_COVERED_THRESHOLD 5
-#define SI114X_OVERFLOW 0xffff
+#define SI114X_COVERED_THRESHOLD 5
+#define SI114X_OVERFLOW 0xffff
/* Time to wait before re-initializing the device if access is denied */
-#define SI114X_DENIED_THRESHOLD (10 * SECOND)
+#define SI114X_DENIED_THRESHOLD (10 * SECOND)
/* Delay used for deferred callback when polling is enabled */
#define SI114x_POLLING_DELAY (8 * MSEC)
/* Min and Max sampling frequency in mHz */
-#define SI114X_PROX_MIN_FREQ 504
-#define SI114X_PROX_MAX_FREQ 50000
-#define SI114X_LIGHT_MIN_FREQ 504
-#define SI114X_LIGHT_MAX_FREQ 50000
+#define SI114X_PROX_MIN_FREQ 504
+#define SI114X_PROX_MAX_FREQ 50000
+#define SI114X_LIGHT_MIN_FREQ 504
+#define SI114X_LIGHT_MAX_FREQ 50000
#if (CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ <= SI114X_PROX_MAX_FREQ)
#error "EC too slow for light sensor"
#endif
@@ -109,12 +109,11 @@ struct si114x_drv_data_t {
struct si114x_typed_data_t type_data[2];
};
-#define SI114X_GET_DATA(_s) \
- ((struct si114x_drv_data_t *)(_s)->drv_data)
+#define SI114X_GET_DATA(_s) ((struct si114x_drv_data_t *)(_s)->drv_data)
#define SI114X_GET_TYPED_DATA(_s) \
(&SI114X_GET_DATA(_s)->type_data[(_s)->type - MOTIONSENSE_TYPE_PROX])
void si114x_interrupt(enum gpio_signal signal);
-#endif /* __CROS_EC_ALS_SI114X_H */
+#endif /* __CROS_EC_ALS_SI114X_H */