diff options
author | Yuval Peress <peress@chromium.org> | 2021-05-13 22:52:47 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-14 17:32:10 +0000 |
commit | db63b8678627cf690f07792dfdbe703cf288b1c6 (patch) | |
tree | de1c5ef6e33512597dbf028afd73e0db97da27e5 /zephyr | |
parent | 483949de5dc234a038e361c562de5b5f4c2bd220 (diff) | |
download | chrome-ec-db63b8678627cf690f07792dfdbe703cf288b1c6.tar.gz |
zephyr: i2c: remove scl and sda references
The SDA and SCL components of the struct i2c_port_t are only used in
and for the i2c_wedge.c logic. This isn't needed in Zephyr. Remove
the values and functions that use them from the Zephyr build.
BRANCH=none
BUG=b:188179405
TEST=build volteer and trogdor
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I71a26fbd9bc51def744ef1f16a540728482c5a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2896235
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml | 6 | ||||
-rw-r--r-- | zephyr/projects/asurada/boards/riscv/asurada/asurada.dts | 32 | ||||
-rw-r--r-- | zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts | 8 | ||||
-rw-r--r-- | zephyr/projects/volteer/boards/arm/volteer/volteer.dts | 48 | ||||
-rw-r--r-- | zephyr/shim/include/i2c/i2c.h | 2 | ||||
-rw-r--r-- | zephyr/shim/src/i2c.c | 15 |
6 files changed, 6 insertions, 105 deletions
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 ee61a837b3..49d9ee53c4 100644 --- a/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml +++ b/zephyr/dts/bindings/i2c/cros-ec-i2c-port-base.yaml @@ -32,9 +32,3 @@ properties: description: Human readable string describing the device (used as device_get_binding() argument). - -child-binding: - description: Optional configuration bindings - child-binding: - description: SCL and SDA configurations - include: gpio-enum-name.yaml diff --git a/zephyr/projects/asurada/boards/riscv/asurada/asurada.dts b/zephyr/projects/asurada/boards/riscv/asurada/asurada.dts index f34a887892..e1858b1bd5 100644 --- a/zephyr/projects/asurada/boards/riscv/asurada/asurada.dts +++ b/zephyr/projects/asurada/boards/riscv/asurada/asurada.dts @@ -26,14 +26,6 @@ i2c-port = <&i2c0>; enum-name = "I2C_PORT_POWER"; label = "POWER"; - config { - scl { - enum-name = "GPIO_I2C_B_SCL"; - }; - sda { - enum-name = "GPIO_I2C_B_SDA"; - }; - }; }; battery { i2c-port = <&i2c0>; @@ -54,14 +46,6 @@ i2c-port = <&i2c1>; enum-name = "I2C_PORT_SENSOR"; label = "SENSOR"; - config { - scl { - enum-name = "GPIO_I2C_C_SCL"; - }; - sda { - enum-name = "GPIO_I2C_C_SDA"; - }; - }; }; i2c-accel { i2c-port = <&i2c1>; @@ -72,27 +56,11 @@ i2c-port = <&i2c2>; enum-name = "I2C_PORT_USB_C0"; label = "USB_C0"; - config { - scl { - enum-name = "GPIO_I2C_F_SCL"; - }; - sda { - enum-name = "GPIO_I2C_F_SDA"; - }; - }; }; usb-c1 { i2c-port = <&i2c4>; enum-name = "I2C_PORT_USB_C1"; label = "USB_C1"; - config { - scl { - enum-name = "GPIO_I2C_E_SCL"; - }; - sda { - enum-name = "GPIO_I2C_E_SDA"; - }; - }; }; }; }; diff --git a/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts b/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts index d361e56d5e..8eb41e67d9 100644 --- a/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts +++ b/zephyr/projects/trogdor/boards/arm/trogdor/trogdor.dts @@ -77,14 +77,6 @@ i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_SENSOR"; label = "SENSOR"; - config { - scl { - enum-name = "GPIO_EC_I2C_SENSOR_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C_SENSOR_SDA"; - }; - }; }; accel { i2c-port = <&i2c7_0>; diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts index 8a9b467c26..d17428209b 100644 --- a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts +++ b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts @@ -53,14 +53,6 @@ i2c-port = <&i2c0_0>; enum-name = "I2C_PORT_SENSOR"; label = "SENSOR"; - config { - scl { - enum-name = "GPIO_EC_I2C0_SENSOR_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C0_SENSOR_SDA"; - }; - }; }; i2c-accel { i2c-port = <&i2c0_0>; @@ -71,53 +63,21 @@ i2c-port = <&i2c1_0>; enum-name = "I2C_PORT_USB_C0"; label = "USB_C0"; - config { - scl { - enum-name = "GPIO_EC_I2C1_USB_C0_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C1_USB_C0_SDA"; - }; - }; }; usb-c1 { i2c-port = <&i2c2_0>; enum-name = "I2C_PORT_USB_C1"; label = "USB_C1"; - config { - scl { - enum-name = "GPIO_EC_I2C2_USB_C1_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C2_USB_C1_SDA"; - }; - }; }; usb1-mix { i2c-port = <&i2c3_0>; enum-name = "I2C_PORT_USB_1_MIX"; label = "USB_1_MIX"; - config { - scl { - enum-name = "GPIO_EC_I2C3_USB_1_MIX_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C3_USB_1_MIX_SDA"; - }; - }; }; power { i2c-port = <&i2c5_0>; enum-name = "I2C_PORT_POWER"; label = "POWER"; - config { - scl { - enum-name = "GPIO_EC_I2C5_BATTERY_SCL"; - }; - sda { - enum-name = "GPIO_EC_I2C5_BATTERY_SDA"; - }; - }; }; battery { i2c-port = <&i2c5_0>; @@ -128,14 +88,6 @@ i2c-port = <&i2c7_0>; enum-name = "I2C_PORT_EEPROM"; label = "EEPROM"; - config { - scl { - enum-name = "GPIO_EC_I2C7_EEPROM_PWR_SCL_R"; - }; - sda { - enum-name = "GPIO_EC_I2C7_EEPROM_PWR_SDA_R"; - }; - }; }; charger { i2c-port = <&i2c7_0>; diff --git a/zephyr/shim/include/i2c/i2c.h b/zephyr/shim/include/i2c/i2c.h index 4d3186b4d5..930a6447a1 100644 --- a/zephyr/shim/include/i2c/i2c.h +++ b/zephyr/shim/include/i2c/i2c.h @@ -17,7 +17,7 @@ enum i2c_ports { DT_FOREACH_CHILD(DT_PATH(named_i2c_ports), I2C_PORT_WITH_COMMA) - I2C_PORT_COUNT + I2C_PORT_COUNT }; #define NAMED_I2C(name) I2C_PORT(DT_PATH(named_i2c_ports, name)) #endif /* named_i2c_ports */ diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c index 9a1b19b61f..b3b2117b98 100644 --- a/zephyr/shim/src/i2c.c +++ b/zephyr/shim/src/i2c.c @@ -19,16 +19,11 @@ #define I2C_CONFIG_GPIO(id, type) \ DT_ENUM_UPPER_TOKEN(DT_CHILD(DT_CHILD(id, config), type), enum_name) -#define I2C_PORT_INIT(id) \ - COND_CODE_1(DT_NODE_EXISTS(DT_CHILD(id, config)), \ - ( \ - { \ - .name = DT_LABEL(id), \ - .port = I2C_PORT(id), \ - .scl = I2C_CONFIG_GPIO(id, scl), \ - .sda = I2C_CONFIG_GPIO(id, sda), \ - }, ), \ - ()) +#define I2C_PORT_INIT(id) \ + { \ + .name = DT_LABEL(id), \ + .port = I2C_PORT(id), \ + }, /* * Long term we will not need these, for now they're needed to get things to * build since these extern symbols are usually defined in |