diff options
-rw-r--r-- | board/coral/board.c | 7 | ||||
-rw-r--r-- | board/eve/board.c | 21 | ||||
-rw-r--r-- | board/glados/board.c | 4 | ||||
-rw-r--r-- | board/kevin/board.c | 8 | ||||
-rw-r--r-- | board/nucleo-f411re/board.c | 2 | ||||
-rw-r--r-- | board/oak/board.c | 4 | ||||
-rw-r--r-- | board/poppy/board.c | 4 | ||||
-rw-r--r-- | board/reef/board.c | 8 | ||||
-rw-r--r-- | board/rowan/board.c | 2 | ||||
-rw-r--r-- | board/ryu/board.c | 23 | ||||
-rw-r--r-- | board/scarlet/board.c | 4 | ||||
-rw-r--r-- | board/wheatley/board.c | 4 | ||||
-rw-r--r-- | driver/accelgyro_bmi160.h | 2 | ||||
-rw-r--r-- | driver/als_si114x.c | 21 | ||||
-rw-r--r-- | driver/als_si114x.h | 1 | ||||
-rw-r--r-- | driver/baro_bmp280.h | 1 |
16 files changed, 64 insertions, 52 deletions
diff --git a/board/coral/board.c b/board/coral/board.c index d722ca18db..6291b4d7b1 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -824,10 +824,9 @@ const matrix_3x3_t mag_standard_ref = { }; /* sensor private data */ -/* TODO(crbug.com/733352): Remove useless externs and declare these static. */ -struct kionix_accel_data g_kx022_data; -struct bmi160_drv_data_t g_bmi160_data; -struct opt3001_drv_data_t g_opt3001_data = { +static struct kionix_accel_data g_kx022_data; +static struct bmi160_drv_data_t g_bmi160_data; +static struct opt3001_drv_data_t g_opt3001_data = { .attenuation = 5, }; diff --git a/board/eve/board.c b/board/eve/board.c index 4879af450a..86e27d7f70 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -720,8 +720,25 @@ static struct mutex g_base_mutex; /* Lid Sensor mutex */ static struct mutex g_lid_mutex; -struct kionix_accel_data g_kxcj9_data; -struct bmi160_drv_data_t g_bmi160_data; +static struct kionix_accel_data g_kxcj9_data; +static struct bmi160_drv_data_t g_bmi160_data; + +static struct si114x_drv_data_t g_si114x_data = { + .state = SI114X_NOT_READY, + .covered = 0, + .type_data = { + /* Proximity - unused */ + { + }, + /* light */ + { + .base_data_reg = SI114X_REG_ALSVIS_DATA0, + .irq_flags = SI114X_ALS_INT_FLAG, + .scale = 1, + .offset = -256, + } + } +}; /* Matrix to rotate accelrator into standard reference frame */ const matrix_3x3_t mag_standard_ref = { diff --git a/board/glados/board.c b/board/glados/board.c index dd492b17f1..c666c61712 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -476,8 +476,8 @@ DECLARE_HOOK(HOOK_INIT, board_handle_reboot, HOOK_PRIO_FIRST); static struct mutex g_lid_mutex; static struct mutex g_base_mutex; -struct kionix_accel_data g_kx022_data; -struct bmi160_drv_data_t g_bmi160_data; +static struct kionix_accel_data g_kx022_data; +static struct bmi160_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { /* diff --git a/board/kevin/board.c b/board/kevin/board.c index c733d565a6..fb66da0051 100644 --- a/board/kevin/board.c +++ b/board/kevin/board.c @@ -474,11 +474,11 @@ int board_get_version(void) static struct mutex g_base_mutex; static struct mutex g_lid_mutex; -struct bmi160_drv_data_t g_bmi160_data; +static struct bmi160_drv_data_t g_bmi160_data; #ifdef BOARD_KEVIN /* BMA255 private data */ -struct bma2x2_accel_data g_bma255_data; +static struct bma2x2_accel_data g_bma255_data; /* Matrix to rotate accelrator into standard reference frame */ const matrix_3x3_t base_standard_ref = { @@ -506,8 +506,8 @@ const matrix_3x3_t lid_standard_ref = { { 0, 0, FLOAT_TO_FP(1)} }; -struct kionix_accel_data g_kx022_data; -struct bmp280_drv_data_t bmp280_drv_data; +static struct kionix_accel_data g_kx022_data; +static struct bmp280_drv_data_t bmp280_drv_data; /* ALS instances. Must be in same order as enum als_id. */ struct als_t als[] = { diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c index 6a8fc8e50c..237f896c8b 100644 --- a/board/nucleo-f411re/board.c +++ b/board/nucleo-f411re/board.c @@ -62,7 +62,7 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* Base Sensor mutex */ static struct mutex g_base_mutex; -struct bmi160_drv_data_t g_bmi160_data; +static struct bmi160_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [BASE_ACCEL] = { diff --git a/board/oak/board.c b/board/oak/board.c index df81a3ea7a..afaf16ab13 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -647,8 +647,8 @@ const matrix_3x3_t base_standard_ref = { }; #endif -struct kionix_accel_data g_kx022_data; -struct bmi160_drv_data_t g_bmi160_data; +static struct kionix_accel_data g_kx022_data; +static struct bmi160_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { #ifdef CONFIG_ACCELGYRO_BMI160 diff --git a/board/poppy/board.c b/board/poppy/board.c index 3055882cf9..73c7dff866 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -738,8 +738,8 @@ int board_get_version(void) /* Lid Sensor mutex */ static struct mutex g_lid_mutex; -struct bmi160_drv_data_t g_bmi160_data; -struct bmp280_drv_data_t bmp280_drv_data; +static struct bmi160_drv_data_t g_bmi160_data; +static struct bmp280_drv_data_t bmp280_drv_data; /* Matrix to rotate accelrator into standard reference frame */ const matrix_3x3_t mag_standard_ref = { diff --git a/board/reef/board.c b/board/reef/board.c index afe50feb63..77964411c6 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -823,10 +823,10 @@ const matrix_3x3_t mag_standard_ref = { }; /* sensor private data */ -struct kionix_accel_data g_kx022_data; -struct bmi160_drv_data_t g_bmi160_data; -struct bmp280_drv_data_t bmp280_drv_data; -struct opt3001_drv_data_t g_opt3001_data = { +static struct kionix_accel_data g_kx022_data; +static struct bmi160_drv_data_t g_bmi160_data; +static struct bmp280_drv_data_t bmp280_drv_data; +static struct opt3001_drv_data_t g_opt3001_data = { .attenuation = 5, }; diff --git a/board/rowan/board.c b/board/rowan/board.c index 4cd8b01345..630a810f1d 100644 --- a/board/rowan/board.c +++ b/board/rowan/board.c @@ -507,7 +507,7 @@ const matrix_3x3_t lid_standard_ref = { { 0, 0, FLOAT_TO_FP(1)} }; -struct bmi160_drv_data_t g_bmi160_data; +static struct bmi160_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { /* diff --git a/board/ryu/board.c b/board/ryu/board.c index 381b92fd0d..3b85a2df0d 100644 --- a/board/ryu/board.c +++ b/board/ryu/board.c @@ -269,7 +269,28 @@ const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); /* Sensor mutex */ static struct mutex g_mutex; -struct bmi160_drv_data_t g_bmi160_data; +static struct bmi160_drv_data_t g_bmi160_data; + +static struct si114x_drv_data_t g_si114x_data = { + .state = SI114X_NOT_READY, + .covered = 0, + .type_data = { + /* Proximity */ + { + .base_data_reg = SI114X_REG_PS1_DATA0, + .irq_flags = SI114X_PS_INT_FLAG, + .scale = 1, + .offset = -256, + }, + /* light */ + { + .base_data_reg = SI114X_REG_ALSVIS_DATA0, + .irq_flags = SI114X_ALS_INT_FLAG, + .scale = 1, + .offset = -256, + } + } +}; /* Matrix to rotate sensor vector into standard reference frame */ const matrix_3x3_t accelgyro_standard_ref = { diff --git a/board/scarlet/board.c b/board/scarlet/board.c index 59b634c905..0c2a64d424 100644 --- a/board/scarlet/board.c +++ b/board/scarlet/board.c @@ -422,7 +422,7 @@ int board_get_version(void) /* Mutexes */ static struct mutex g_base_mutex; -struct bmi160_drv_data_t g_bmi160_data; +static struct bmi160_drv_data_t g_bmi160_data; /* Matrix to rotate accelerometer into standard reference frame */ const matrix_3x3_t base_standard_ref = { @@ -431,7 +431,7 @@ const matrix_3x3_t base_standard_ref = { { 0, 0, FLOAT_TO_FP(1)} }; -struct bmp280_drv_data_t bmp280_drv_data; +static struct bmp280_drv_data_t bmp280_drv_data; struct motion_sensor_t motion_sensors[] = { /* diff --git a/board/wheatley/board.c b/board/wheatley/board.c index 5c985ea260..0e3772ef2c 100644 --- a/board/wheatley/board.c +++ b/board/wheatley/board.c @@ -456,8 +456,8 @@ DECLARE_HOOK(HOOK_INIT, board_handle_reboot, HOOK_PRIO_FIRST); static struct mutex g_lid_mutex; static struct mutex g_base_mutex; -struct kionix_accel_data g_kx022_data; -struct bmi160_drv_data_t g_bmi160_data; +static struct kionix_accel_data g_kx022_data; +static struct bmi160_drv_data_t g_bmi160_data; struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { diff --git a/driver/accelgyro_bmi160.h b/driver/accelgyro_bmi160.h index 6031d8fb4e..bc31186344 100644 --- a/driver/accelgyro_bmi160.h +++ b/driver/accelgyro_bmi160.h @@ -456,8 +456,6 @@ struct bmi160_drv_data_t { #define BMI160_GET_SAVED_DATA(_s) \ (&BMI160_GET_DATA(_s)->saved_data[(_s)->type]) -extern struct bmi160_drv_data_t g_bmi160_data; - void bmi160_interrupt(enum gpio_signal signal); #ifdef CONFIG_MAG_BMI160_BMM150 diff --git a/driver/als_si114x.c b/driver/als_si114x.c index f1b6d23966..dd01fc1a55 100644 --- a/driver/als_si114x.c +++ b/driver/als_si114x.c @@ -588,24 +588,3 @@ const struct accelgyro_drv si114x_drv = { .load_fifo = NULL, #endif }; - -struct si114x_drv_data_t g_si114x_data = { - .state = SI114X_NOT_READY, - .covered = 0, - .type_data = { - /* Proximity */ - { - .base_data_reg = SI114X_REG_PS1_DATA0, - .irq_flags = SI114X_PS_INT_FLAG, - .scale = 1, - .offset = -256, - }, - /* light */ - { - .base_data_reg = SI114X_REG_ALSVIS_DATA0, - .irq_flags = SI114X_ALS_INT_FLAG, - .scale = 1, - .offset = -256, - } - } -}; diff --git a/driver/als_si114x.h b/driver/als_si114x.h index aeb84dbfb3..3ca30300f8 100644 --- a/driver/als_si114x.h +++ b/driver/als_si114x.h @@ -258,7 +258,6 @@ struct si114x_drv_data_t { #define SI114X_GET_TYPED_DATA(_s) \ (&SI114X_GET_DATA(_s)->type_data[(_s)->type - MOTIONSENSE_TYPE_PROX]) -extern struct si114x_drv_data_t g_si114x_data; void si114x_interrupt(enum gpio_signal signal); #endif /* __CROS_EC_ALS_SI114X_H */ diff --git a/driver/baro_bmp280.h b/driver/baro_bmp280.h index c285d69b73..94da35dbe1 100644 --- a/driver/baro_bmp280.h +++ b/driver/baro_bmp280.h @@ -212,7 +212,6 @@ struct bmp280_drv_data_t { #define BMP280_RATE_SHIFT 1 extern const struct accelgyro_drv bmp280_drv; -extern struct bmp280_drv_data_t bmp280_drv_data; #ifdef CONFIG_CMD_I2C_STRESS_TEST_ACCEL extern struct i2c_stress_test_dev bmp280_i2c_stress_test_dev; |