From a0a6158f4b8074dd57d2bc2f4de49c9ed900c94f Mon Sep 17 00:00:00 2001 From: Keith Short Date: Thu, 18 Nov 2021 16:58:07 -0700 Subject: zephyr: i2c: Remove label from named-i2c-ports The label property was stored in the name field of i2c_ports[]. However the name field is only used by the legacy I2C console commands and not used by Zephyr builds. Remove the label property from named-i2c-ports and remove the name field from i2c_ports[] for Zephyr builds, saving a modest amount of flash space. BUG=none BRANCH=none TEST=zmake testall TEST=Boot zephyr on Herobrine, verify I2C console commands still functional. Signed-off-by: Keith Short Change-Id: I22c743c4e362d05d51432fa67f5be16989d39574 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300664 Commit-Queue: Abe Levkoy Reviewed-by: Abe Levkoy --- include/i2c.h | 2 +- zephyr/boards/arm/brya/brya.dts | 9 --------- zephyr/boards/arm/npcx9/npcx9.dts | 9 --------- zephyr/boards/arm/npcx_evb/npcx_evb.dtsi | 5 ----- zephyr/boards/arm/trogdor/trogdor.dts | 9 --------- zephyr/boards/arm/volteer/volteer.dts | 9 --------- zephyr/boards/riscv/asurada/asurada.dts | 13 ------------- zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts | 4 ---- zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml | 6 ------ zephyr/projects/corsola/i2c_krabby.dts | 13 ------------- zephyr/projects/herobrine/herobrine_npcx9/i2c.dts | 10 ---------- zephyr/projects/nissa/i2c_nivviks.dts | 5 ----- zephyr/projects/skyrim/i2c.dts | 5 ----- zephyr/shim/src/i2c.c | 1 - zephyr/test/drivers/overlay.dts | 8 -------- zephyr/test/i2c/overlay.dts | 1 - zephyr/test/i2c_dts/overlay.dts | 1 - 17 files changed, 1 insertion(+), 109 deletions(-) diff --git a/include/i2c.h b/include/i2c.h index 57996289dd..7b66d67589 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -106,9 +106,9 @@ struct i2c_drv { /* Data structure to define I2C port configuration. */ struct i2c_port_t { - const char *name; /* Port name */ int port; /* Port */ #ifndef CONFIG_ZEPHYR + const char *name; /* Port name */ int kbps; /* Speed in kbps */ enum gpio_signal scl; /* Port SCL GPIO line */ enum gpio_signal sda; /* Port SDA GPIO line */ diff --git a/zephyr/boards/arm/brya/brya.dts b/zephyr/boards/arm/brya/brya.dts index 0df9f8d0fe..fb5418976f 100644 --- a/zephyr/boards/arm/brya/brya.dts +++ b/zephyr/boards/arm/brya/brya.dts @@ -25,47 +25,38 @@ i2c_sensor: sensor { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; tcpc0_2 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_USB_C0_C2_TCPC"; - label = "TCPC0,2"; }; tcpc1 { i2c-port = <&i2c4_1>; enum-name = "I2C_PORT_USB_C1_TCPC"; - label = "TCPC1"; }; ppc0_2 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_USB_C0_C2_PPC"; - label = "PPC0,2"; }; ppc1 { i2c-port = <&i2c6_1>; enum-name = "I2C_PORT_USB_C1_PPC"; - label = "PPC1"; }; retimer0_2 { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_C0_C2_MUX"; - label = "RETIMER0,2"; }; battery { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; eeprom { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; charger { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_CHARGER"; - label = "EEPROM"; }; }; diff --git a/zephyr/boards/arm/npcx9/npcx9.dts b/zephyr/boards/arm/npcx9/npcx9.dts index ab44d8119e..da53b3b80b 100644 --- a/zephyr/boards/arm/npcx9/npcx9.dts +++ b/zephyr/boards/arm/npcx9/npcx9.dts @@ -35,47 +35,38 @@ i2c_sensor: sensor { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; tcpc0_2 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_USB_C0_C2_TCPC"; - label = "TCPC0,2"; }; tcpc1 { i2c-port = <&i2c4_1>; enum-name = "I2C_PORT_USB_C1_TCPC"; - label = "TCPC1"; }; ppc0_2 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_USB_C0_C2_PPC"; - label = "PPC0,2"; }; ppc1 { i2c-port = <&i2c6_1>; enum-name = "I2C_PORT_USB_C1_PPC"; - label = "PPC1"; }; retimer0_2 { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_C0_C2_MUX"; - label = "RETIMER0,2"; }; battery { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; eeprom { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; charger { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_CHARGER"; - label = "EEPROM"; }; }; diff --git a/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi b/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi index 61a1e79783..4995cd8af3 100644 --- a/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi +++ b/zephyr/boards/arm/npcx_evb/npcx_evb.dtsi @@ -22,27 +22,22 @@ i2c_evb_0_0 { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_EVB_0"; - label = "I2C0_0"; }; i2c_evb_1_0 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_EVB_1"; - label = "I2C1_0"; }; i2c_evb_2_0 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_EVB_2"; - label = "I2C2_0"; }; i2c_evb_3_0 { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_EVB_3"; - label = "I2C3_0"; }; i2c_evb_7_0 { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_EVB_7"; - label = "I2C7_0"; }; }; diff --git a/zephyr/boards/arm/trogdor/trogdor.dts b/zephyr/boards/arm/trogdor/trogdor.dts index a13861ad09..74a0dd5f79 100644 --- a/zephyr/boards/arm/trogdor/trogdor.dts +++ b/zephyr/boards/arm/trogdor/trogdor.dts @@ -63,48 +63,39 @@ power { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; battery { i2c-port = <&i2c0_0>; remote-port = <0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; virtual-battery { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_VIRTUAL_BATTERY"; - label = "VIRTUAL"; }; charger { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; tcpc0 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_TCPC0"; - label = "TCPC0"; }; tcpc1 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_TCPC1"; - label = "TCPC1"; }; eeprom { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; i2c_sensor: sensor { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; accel { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; }; diff --git a/zephyr/boards/arm/volteer/volteer.dts b/zephyr/boards/arm/volteer/volteer.dts index f25363f03f..4a3be3197a 100644 --- a/zephyr/boards/arm/volteer/volteer.dts +++ b/zephyr/boards/arm/volteer/volteer.dts @@ -53,48 +53,39 @@ i2c_sensor: sensor { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; i2c-accel { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; i2c_usb_c0: usb-c0 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_USB_C0"; - label = "USB_C0"; }; i2c_usb_c1: usb-c1 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_USB_C1"; - label = "USB_C1"; }; usb1-mix { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_1_MIX"; - label = "USB_1_MIX"; }; power { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; battery { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; eeprom { i2c-port = <&i2c7_0>; remote-port = <7>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; charger { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; }; diff --git a/zephyr/boards/riscv/asurada/asurada.dts b/zephyr/boards/riscv/asurada/asurada.dts index b0c46e4f6f..7fad8ed720 100644 --- a/zephyr/boards/riscv/asurada/asurada.dts +++ b/zephyr/boards/riscv/asurada/asurada.dts @@ -89,68 +89,55 @@ power { i2c-port = <&i2c0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; battery { i2c-port = <&i2c0>; remote-port = <0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; virtual-battery { i2c-port = <&i2c0>; enum-name = "I2C_PORT_VIRTUAL_BATTERY"; - label = "VIRTUAL_BATTERY"; }; eeprom { i2c-port = <&i2c0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; charger { i2c-port = <&i2c0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; i2c_sensor: sensor { i2c-port = <&i2c1>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; i2c-accel { i2c-port = <&i2c1>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; ppc0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_PPC0"; - label = "PPC0"; }; ppc1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_PPC1"; - label = "PPC1"; }; usb-c0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_USB_C0"; - label = "USB_C0"; }; usb-c1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_USB_C1"; - label = "USB_C1"; }; usb-mux0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_USB_MUX0"; - label = "USB_MUX0"; }; usb-mux1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_USB_MUX1"; - label = "USB_MUX1"; }; }; diff --git a/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts b/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts index 5bde541a6f..0e1297345e 100644 --- a/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts +++ b/zephyr/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts @@ -173,22 +173,18 @@ battery { i2c-port = <&i2c2>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; evb-1 { i2c-port = <&i2c0>; enum-name = "I2C_PORT_EVB_1"; - label = "EVB_1"; }; evb-2 { i2c-port = <&i2c1>; enum-name = "I2C_PORT_EVB_2"; - label = "EVB_2"; }; opt-4 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_OPT_4"; - label = "OPT_4"; }; }; diff --git a/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml b/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml index 7b13526fa4..c676adbe5f 100644 --- a/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml +++ b/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml @@ -50,12 +50,6 @@ properties: - I2C_PORT_USB_MUX1 - I2C_PORT_VIRTUAL_BATTERY - I2C_PORT_WLC - label: - required: true - type: string - description: - Human readable string describing the device (used as device_get_binding() - argument). dynamic-speed: type: boolean required: false diff --git a/zephyr/projects/corsola/i2c_krabby.dts b/zephyr/projects/corsola/i2c_krabby.dts index 7205bf19bc..d8c9857d40 100644 --- a/zephyr/projects/corsola/i2c_krabby.dts +++ b/zephyr/projects/corsola/i2c_krabby.dts @@ -10,68 +10,55 @@ power { i2c-port = <&i2c0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; battery { i2c-port = <&i2c0>; remote-port = <0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; virtual-battery { i2c-port = <&i2c0>; enum-name = "I2C_PORT_VIRTUAL_BATTERY"; - label = "VIRTUAL_BATTERY"; }; eeprom { i2c-port = <&i2c0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; charger { i2c-port = <&i2c0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; i2c_sensor: sensor { i2c-port = <&i2c1>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; i2c-accel { i2c-port = <&i2c1>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; ppc0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_PPC0"; - label = "PPC0"; }; ppc1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_PPC1"; - label = "PPC1"; }; usb-c0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_USB_C0"; - label = "USB_C0"; }; usb-c1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_USB_C1"; - label = "USB_C1"; }; usb-mux0 { i2c-port = <&i2c2>; enum-name = "I2C_PORT_USB_MUX0"; - label = "USB_MUX0"; }; usb-mux1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_USB_MUX1"; - label = "USB_MUX1"; }; }; diff --git a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts index 44bc9c6707..e5a35c10d5 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts +++ b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts @@ -20,53 +20,43 @@ i2c_power: power { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; battery { i2c-port = <&i2c0_0>; remote-port = <0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; virtual-battery { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_VIRTUAL_BATTERY"; - label = "VIRTUAL"; }; charger { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; i2c_tcpc0: tcpc0 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_TCPC0"; - label = "TCPC0"; }; i2c_tcpc1: tcpc1 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_TCPC1"; - label = "TCPC1"; }; rtc { i2c-port = <&i2c4_1>; enum-name = "I2C_PORT_RTC"; - label = "RTC"; }; i2c_eeprom: eeprom { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; i2c_sensor: sensor { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; accel { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; }; diff --git a/zephyr/projects/nissa/i2c_nivviks.dts b/zephyr/projects/nissa/i2c_nivviks.dts index e7fdea2b08..9172d16b74 100644 --- a/zephyr/projects/nissa/i2c_nivviks.dts +++ b/zephyr/projects/nissa/i2c_nivviks.dts @@ -9,27 +9,22 @@ eeprom { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; i2c_sensor: sensor { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; tcpc0 { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_C0_TCPC"; - label = "TCPC0"; }; tcpc1 { i2c-port = <&i2c5_1>; enum-name = "I2C_PORT_USB_C1_TCPC"; - label = "TCPC1"; }; battery { i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; }; }; diff --git a/zephyr/projects/skyrim/i2c.dts b/zephyr/projects/skyrim/i2c.dts index 7b4c0753bc..b42f11ff16 100644 --- a/zephyr/projects/skyrim/i2c.dts +++ b/zephyr/projects/skyrim/i2c.dts @@ -20,32 +20,27 @@ i2c_tcpc0: tcpc0 { i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_TCPC0"; - label = "TCPC0"; }; i2c_tcpc1: tcpc1 { i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_TCPC1"; - label = "TCPC1"; }; battery { i2c-port = <&i2c2_0>; remote-port = <0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; usb_mux { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_MUX"; - label = "USB_MUX"; }; charger { i2c-port = <&i2c4_1>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; }; diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c index 40d94e6462..6e0505921c 100644 --- a/zephyr/shim/src/i2c.c +++ b/zephyr/shim/src/i2c.c @@ -33,7 +33,6 @@ #define I2C_PORT_INIT(id) \ { \ - .name = DT_LABEL(id), \ .port = I2C_PORT(id), \ .flags = I2C_PORT_FLAGS(id), \ }, diff --git a/zephyr/test/drivers/overlay.dts b/zephyr/test/drivers/overlay.dts index 868adc262e..be0f7449a6 100644 --- a/zephyr/test/drivers/overlay.dts +++ b/zephyr/test/drivers/overlay.dts @@ -101,42 +101,34 @@ usb-c0 { i2c-port = <&i2c0>; enum-name = "I2C_PORT_USB_C0"; - label = "USB_C0"; }; usb-c1 { i2c-port = <&i2c1>; enum-name = "I2C_PORT_USB_C1"; - label = "USB_C1"; }; battery { i2c-port = <&i2c0>; enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; }; power { i2c-port = <&i2c0>; enum-name = "I2C_PORT_POWER"; - label = "POWER"; }; charger { i2c-port = <&i2c0>; enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; }; eeprom { i2c-port = <&i2c0>; enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; }; i2c_accel: accel { i2c-port = <&i2c0>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; }; i2c_sensor: sensor { i2c-port = <&i2c1>; enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; }; }; diff --git a/zephyr/test/i2c/overlay.dts b/zephyr/test/i2c/overlay.dts index 2c56ee3b7a..1519bb1cb7 100644 --- a/zephyr/test/i2c/overlay.dts +++ b/zephyr/test/i2c/overlay.dts @@ -9,7 +9,6 @@ accel-0 { i2c-port = <&bmi_i2c>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL_0"; }; }; }; diff --git a/zephyr/test/i2c_dts/overlay.dts b/zephyr/test/i2c_dts/overlay.dts index 2c56ee3b7a..1519bb1cb7 100644 --- a/zephyr/test/i2c_dts/overlay.dts +++ b/zephyr/test/i2c_dts/overlay.dts @@ -9,7 +9,6 @@ accel-0 { i2c-port = <&bmi_i2c>; enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL_0"; }; }; }; -- cgit v1.2.1