diff options
-rw-r--r-- | zephyr/dts/bindings/usbc/named-usbc-ports.yaml | 25 | ||||
-rw-r--r-- | zephyr/projects/herobrine/herobrine_npcx9/usbc.dts | 9 | ||||
-rw-r--r-- | zephyr/shim/src/ppc_sn5s330.c | 2 |
3 files changed, 33 insertions, 3 deletions
diff --git a/zephyr/dts/bindings/usbc/named-usbc-ports.yaml b/zephyr/dts/bindings/usbc/named-usbc-ports.yaml new file mode 100644 index 0000000000..c4a55ba153 --- /dev/null +++ b/zephyr/dts/bindings/usbc/named-usbc-ports.yaml @@ -0,0 +1,25 @@ +# Copyright (c) 2021 The Chromium OS Authors +# SPDX-License-Identifier: Apache-2.0 + +description: Named USB-C ports parent node + +compatible: "named-usbc-ports" + +include: base.yaml + +properties: + "#address-cells": + required: true + const: 1 + "#size-cells": + required: true + const: 0 + +child-binding: + description: Named USB-C port + properties: + reg: + type: array + required: true + description: | + USB-C port number to serialize devices used for USB-C communication diff --git a/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts b/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts index c742bcf386..189bf6abd3 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts +++ b/zephyr/projects/herobrine/herobrine_npcx9/usbc.dts @@ -5,7 +5,11 @@ / { usbc { - port0: usbc-port0 { + compatible = "named-usbc-ports"; + #address-cells = <1>; + #size-cells = <0>; + port0: usbc-port@0 { + reg = <0>; bc12 { compatible = "pericom,pi3usb9201"; status = "okay"; @@ -21,7 +25,8 @@ }; }; - port1: usbc-port1 { + port1: usbc-port@1 { + reg = <1>; bc12 { compatible = "pericom,pi3usb9201"; status = "okay"; diff --git a/zephyr/shim/src/ppc_sn5s330.c b/zephyr/shim/src/ppc_sn5s330.c index b57f243c51..7bc11ec4ad 100644 --- a/zephyr/shim/src/ppc_sn5s330.c +++ b/zephyr/shim/src/ppc_sn5s330.c @@ -17,7 +17,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) > 0, "No compatible PPC instance found"); #define USBC_PORT_PPC(inst) \ - { \ + [DT_REG_ADDR(DT_PARENT(DT_DRV_INST(inst)))] = { \ .i2c_port = I2C_PORT(DT_PHANDLE(DT_DRV_INST(inst), port)), \ .i2c_addr_flags = DT_STRING_UPPER_TOKEN( \ DT_DRV_INST(inst), i2c_addr_flags), \ |