From 4a65a62f85ece242588d9316bf624bbd12cd54f7 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Mon, 21 May 2018 15:56:28 -0600 Subject: ppc: making driver non-const We need to update the driver based on the runtime board id, so we need to remove the const attribute. BRANCH=none BUG=b:78896495,b:78021059 TEST=build all -j Change-Id: I5f751c33cf4ec68a38aeb8644170df4987c87d7b Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1068030 Reviewed-by: Aseda Aboagye Reviewed-by: Furquan Shaikh --- baseboard/octopus/variant_usbc_ec_tcpcs.c | 4 ++-- baseboard/octopus/variant_usbc_standalone_tcpcs.c | 4 ++-- board/cheza/board.c | 4 ++-- board/grunt/board.c | 4 ++-- board/nocturne/board.c | 4 ++-- board/zoombini/board.c | 4 ++-- include/usbc_ppc.h | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/baseboard/octopus/variant_usbc_ec_tcpcs.c b/baseboard/octopus/variant_usbc_ec_tcpcs.c index 20296b63f6..a4676f6f40 100644 --- a/baseboard/octopus/variant_usbc_ec_tcpcs.c +++ b/baseboard/octopus/variant_usbc_ec_tcpcs.c @@ -78,7 +78,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { /******************************************************************************/ /* USB-C PPC Configuration */ -const struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { +struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { [USB_PD_PORT_ITE_0] = { .i2c_port = I2C_PORT_USBC0, .i2c_addr = SN5S330_ADDR0, @@ -90,7 +90,7 @@ const struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { .drv = &sn5s330_drv }, }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); /******************************************************************************/ /* Power Delivery and charing functions */ diff --git a/baseboard/octopus/variant_usbc_standalone_tcpcs.c b/baseboard/octopus/variant_usbc_standalone_tcpcs.c index 095bcb76c7..a027e6ed42 100644 --- a/baseboard/octopus/variant_usbc_standalone_tcpcs.c +++ b/baseboard/octopus/variant_usbc_standalone_tcpcs.c @@ -59,7 +59,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { /******************************************************************************/ /* USB-C PPC Configuration */ -const struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { +struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { [USB_PD_PORT_ANX7447] = { .i2c_port = I2C_PORT_TCPC0, .i2c_addr = NX20P3483_ADDR2, @@ -74,7 +74,7 @@ const struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { .src_gpio = GPIO_EN_USB_C1_5V_OUT, }, }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); /******************************************************************************/ /* Power Delivery and charing functions */ diff --git a/board/cheza/board.c b/board/cheza/board.c index 80039166ab..a7933cff45 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -169,7 +169,7 @@ const struct i2c_port_t i2c_ports[] = { const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); /* Power Path Controller */ -const struct ppc_config_t ppc_chips[] = { +struct ppc_config_t ppc_chips[] = { { .i2c_port = I2C_PORT_TCPC0, .i2c_addr = SN5S330_ADDR0, @@ -182,7 +182,7 @@ const struct ppc_config_t ppc_chips[] = { * which are controlled directly by EC GPIOs. */ }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); /* TCPC mux configuration */ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { diff --git a/board/grunt/board.c b/board/grunt/board.c index e522751ea1..5f6ac0084b 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -204,7 +204,7 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { } }; -const struct ppc_config_t ppc_chips[] = { +struct ppc_config_t ppc_chips[] = { { .i2c_port = I2C_PORT_TCPC0, .i2c_addr = SN5S330_ADDR0, @@ -216,7 +216,7 @@ const struct ppc_config_t ppc_chips[] = { .drv = &sn5s330_drv }, }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); /* BC 1.2 chip Configuration */ const struct bq24392_config_t bq24392_config[CONFIG_USB_PD_PORT_COUNT] = { diff --git a/board/nocturne/board.c b/board/nocturne/board.c index 180314ee7d..4692f94c63 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -247,7 +247,7 @@ const struct motion_sensor_t *motion_als_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); -const struct ppc_config_t ppc_chips[] = { +struct ppc_config_t ppc_chips[] = { { .i2c_port = I2C_PORT_USB_C0, .i2c_addr = SN5S330_ADDR0, @@ -259,7 +259,7 @@ const struct ppc_config_t ppc_chips[] = { .drv = &sn5s330_drv, }, }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { { diff --git a/board/zoombini/board.c b/board/zoombini/board.c index cb037d0d4d..2ff6b179a1 100644 --- a/board/zoombini/board.c +++ b/board/zoombini/board.c @@ -306,7 +306,7 @@ const struct motion_sensor_t *motion_als_sensors[] = { BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); /* TODO(aaboagye): Add the other ports. 3 for Zoombini, 2 for Meowth */ -const struct ppc_config_t ppc_chips[] = { +struct ppc_config_t ppc_chips[] = { { .i2c_port = I2C_PORT_TCPC0, .i2c_addr = SN5S330_ADDR0, @@ -325,7 +325,7 @@ const struct ppc_config_t ppc_chips[] = { } #endif /* defined(BOARD_ZOOMBINI) */ }; -const unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); +unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); #ifdef BOARD_ZOOMBINI /* BC 1.2 chip Configuration */ diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h index 1995654536..e846a6ecca 100644 --- a/include/usbc_ppc.h +++ b/include/usbc_ppc.h @@ -123,8 +123,8 @@ struct ppc_config_t { const struct ppc_drv *drv; }; -extern const struct ppc_config_t ppc_chips[]; -extern const unsigned int ppc_cnt; +extern struct ppc_config_t ppc_chips[]; +extern unsigned int ppc_cnt; /** * Initializes the PPC for the specified port. -- cgit v1.2.1