summaryrefslogtreecommitdiff
path: root/zephyr/projects
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2021-10-06 11:12:24 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-22 05:02:03 +0000
commitf972f4c883cc7d640eaaccf2b51a0894d894adda (patch)
treedfbde9112d76922f7c9975868bcfc15432bdc947 /zephyr/projects
parent9afe143e2ce0941590bc23e5924c92c9ac3f187d (diff)
downloadchrome-ec-f972f4c883cc7d640eaaccf2b51a0894d894adda.tar.gz
zephyr: Add ppc for herobrine_npcx9 to device tree
This patch removes custom ppc logic and uses device tree implementation instead. BRANCH=main BUG=b:194432779 TEST=Verified that the DUT charges from Port0 and Port1 C0: Req [3] 15000mV 3000mA C1: Req [3] 15000mV 3000mA Signed-off-by: Sam Hurst <shurst@google.org> Change-Id: Ic67265ddb99494559191cc322be72628b31ffdab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208914 Commit-Queue: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'zephyr/projects')
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/i2c.dts4
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/src/usbc_config.c15
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/usbc.dts12
3 files changed, 14 insertions, 17 deletions
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
index fd3afb4de4..44bc9c6707 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
+++ b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
@@ -38,12 +38,12 @@
enum-name = "I2C_PORT_CHARGER";
label = "CHARGER";
};
- tcpc0 {
+ i2c_tcpc0: tcpc0 {
i2c-port = <&i2c1_0>;
enum-name = "I2C_PORT_TCPC0";
label = "TCPC0";
};
- tcpc1 {
+ i2c_tcpc1: tcpc1 {
i2c-port = <&i2c2_0>;
enum-name = "I2C_PORT_TCPC1";
label = "TCPC1";
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/src/usbc_config.c b/zephyr/projects/herobrine/herobrine_npcx9/src/usbc_config.c
index 5feaf1e8e3..ab309b2804 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/src/usbc_config.c
+++ b/zephyr/projects/herobrine/herobrine_npcx9/src/usbc_config.c
@@ -143,21 +143,6 @@ enum ec_status charger_profile_override_set_param(uint32_t param,
return EC_RES_INVALID_PARAM;
}
-/* Power Path Controller */
-struct ppc_config_t ppc_chips[] = {
- {
- .i2c_port = I2C_PORT_TCPC0,
- .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
- .drv = &sn5s330_drv
- },
- {
- .i2c_port = I2C_PORT_TCPC1,
- .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
- .drv = &sn5s330_drv
- },
-};
-unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
-
static const struct ppc_config_t ppc_syv682x_port0 = {
.i2c_port = I2C_PORT_TCPC0,
.i2c_addr_flags = SYV682X_ADDR0_FLAGS,
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts b/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts
index 60bbad94a5..c742bcf386 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts
+++ b/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts
@@ -13,6 +13,12 @@
port = <&i2c_power>;
i2c-addr-flags = "PI3USB9201_I2C_ADDR_3_FLAGS";
};
+ ppc {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ port = <&i2c_tcpc0>;
+ i2c-addr-flags = "SN5S330_ADDR0_FLAGS";
+ };
};
port1: usbc-port1 {
@@ -23,6 +29,12 @@
port = <&i2c_eeprom>;
i2c-addr-flags = "PI3USB9201_I2C_ADDR_3_FLAGS";
};
+ ppc {
+ compatible = "ti,sn5s330";
+ status = "okay";
+ port = <&i2c_tcpc1>;
+ i2c-addr-flags = "SN5S330_ADDR0_FLAGS";
+ };
};
};
};