Skip to contentSkip to conversation

arm64: dts: qcom: sc7180-trogdor: Wire up USB

PATCH Superseded Stephen Boyd 2 participants 5 messages Feb 10, 2025 – Feb 15, 2025

Subsystems (6)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover arm64: dts: qcom: sc7180-trogdor: Wire up USB

Wiring up the USB hub to the connectors allows us to gain the proper 'connect_type' and 'removable' values in sysfs for the USB devices on sc7180 trogdor devices. These two patches are split off of a larger series[1] so they can land faster and because we've come to the conclusion that the DisplayPort path is going to connect to the cros-ec-typec node, not the usb-c-connector node.

The first patch adds the pogo pin binding to describe the detachable keyboards found on some trogdor devices (actually strongbad). The second patch is the dts changes required to wire up all the USB stuff. This is sufficient to set the sysfs properties for USB devices so that the builtin USB webcam is considered "fixed" or hard-wired while devices plugged into the connectors or the keyboard are considered "removable" or hotpluggable.

Chamges from v2 https://lore.kernel.org/r/[email protected]
* Make binding specific to keyboard and move to usb/
* Update dts to reflect new compatible string for pogo pin keyboard

Changes from v1 https://lore.kernel.org/r/[email protected]
* Split out of larger series
* Added description to DT binding
* Removed DP part of dts changes

[1] https://lore.kernel.org/r/[email protected]

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Benson Leung <[email protected]>
Cc Pin-yen Lin <[email protected]>

Stephen Boyd (2):
dt-bindings: usb: Add binding for ChromeOS Pogo pin keyboard connector
arm64: dts: qcom: sc7180-trogdor: Wire up USB to usb-c-connectors

 .../usb/google,usb-pogo-keyboard.yaml         |  68 +++++++++++
 .../dts/qcom/sc7180-trogdor-clamshell.dtsi    |  21 ++++
 .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi  |  47 ++++++++
 .../dts/qcom/sc7180-trogdor-detachable.dtsi   |  15 +++
 .../dts/qcom/sc7180-trogdor-homestar.dtsi     |  47 ++++++++
 .../dts/qcom/sc7180-trogdor-kingoftown.dts    |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-lazor.dtsi   |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-pazquel.dtsi |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-pompom.dtsi  |  44 +++++++
 .../qcom/sc7180-trogdor-quackingstick.dtsi    |  31 +++++
 .../arm64/boot/dts/qcom/sc7180-trogdor-r1.dts |  56 ++++++++-
 .../dts/qcom/sc7180-trogdor-wormdingler.dtsi  |  47 ++++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi  | 109 ++++++++++++++++++
 13 files changed, 648 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml

base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b

Signature · 1 line
https://chromeos.dev
#1 lore raw

PATCH v3 1/2 dt-bindings: usb: Add binding for ChromeOS Pogo pin keyboard connector

Describe the set of pins used to connect the detachable keyboard on detachable ChromeOS devices. The set of pins is called the "pogo pins". It's basically USB 2.0 with an extra pin for base detection. We expect to find a keyboard on the other side of this connector with a specific vid/pid, so describe that as a child device at the port of the usb device connected upstream.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Benson Leung <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 .../usb/google,usb-pogo-keyboard.yaml         | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml
Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +68 -0
new file mode 100644
index 000000000000..e1b3b2c1711e
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/google,usb-pogo-keyboard.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google USB Pogo Pin Keyboard
+
+maintainers:
+  - Stephen Boyd <[email protected]>
+
+description:
+  ChromeOS devices with a detachable keyboard have a set of five pogo pins that
+  are the typical four pins for USB (D+/D-, VBUS, GND) and an extra pin for
+  base detection. The detachable keyboard is a USB device that connects to the
+  four USB pogo pins.
+
+properties:
+  compatible:
+    const: google,usb-pogo-keyboard
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: Connection to USB2 port providing USB HS signals
+    required:
+      - endpoint
+
+patternProperties:
+  "^keyboard@[0-9a-f]{1,2}$":
+    description: The detachable keyboard
+    type: object
+    $ref: /schemas/usb/usb-device.yaml
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - '#address-cells'
+  - '#size-cells'
+  - port
+
+additionalProperties: false
+
+examples:
+  - |
+    connector {
+      compatible = "google,usb-pogo-keyboard";
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      keyboard@2 {
+        compatible = "usb18d1,504c";
+        reg = <2>;
+      };
+
+      port {
+        pogo_connector_in: endpoint {
+          remote-endpoint = <&usb_hub_dsp3_hs>;
+        };
+      };
+    };
+
+...
Signature · 1 line
https://chromeos.dev
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: usb: Add binding for ChromeOS Pogo pin keyboard connector

Quoted 9 lines · Stephen Boyd

+$id: http://devicetree.org/schemas/usb/google,usb-pogo-keyboard.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +7 -0
+
+title: Google USB Pogo Pin Keyboard
+
+maintainers:
+  - Stephen Boyd <[email protected]>
+
+description:

Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml line 22

Quoted 10 lines
Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +10 -0
+  ChromeOS devices with a detachable keyboard have a set of five pogo pins that
+  are the typical four pins for USB (D+/D-, VBUS, GND) and an extra pin for
+  base detection. The detachable keyboard is a USB device that connects to the
+  four USB pogo pins.
+
+properties:
+  compatible:
+    const: google,usb-pogo-keyboard
+
+  '#address-cells':

If there is going to be any new version: please use consistent quotes, either ' or "

Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml line 35

Quoted 13 lines
Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +13 -0
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: Connection to USB2 port providing USB HS signals
+    required:
+      - endpoint
+
+patternProperties:
+  "^keyboard@[0-9a-f]{1,2}$":

What does the unit address represent here? Why this isn't just "keyboard"? One connector usually has only one keyboard, right?

Maybe it is only to fulfill the usb-device schema? The reg is there to represent USB hub or controller port, which is not true here.

I don't have any idea how to solve it. I assume you need the keyboard child, right?

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: usb: Add binding for ChromeOS Pogo pin keyboard connector

Quoting Krzysztof Kozlowski (2025-02-13 00:11:25)

Quoted 9 lines · Stephen Boyd
Quoted 8 lines
Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +8 -0
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: Connection to USB2 port providing USB HS signals
Quoted 8 lines

Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml line 35

Quoted 5 lines
Documentation/devicetree/bindings/usb/google,usb-pogo-keyboard.yaml new file +5 -0
+    required:
+      - endpoint
+
+patternProperties:
+  "^keyboard@[0-9a-f]{1,2}$":

What does the unit address represent here? Why this isn't just "keyboard"? One connector usually has only one keyboard, right?

Yes one connector has one keyboard.

Quoted 3 lines

Maybe it is only to fulfill the usb-device schema? The reg is there to represent USB hub or controller port, which is not true here.

Right, this is to fulfill the schema. These pins are connected to a USB hub or controller port, so we use that as the unit address.

Quoted 3 lines

I don't have any idea how to solve it. I assume you need the keyboard child, right?

Yes we need the keyboard child so that we can make sure the keyboard that's expected is plugged in instead of some other one that doesn't pair with the device. We treat the detachable keyboard as 'not external' or 'expected' when it matches this VID/PID we have listed in DT so that we trust it slightly more than a standard USB keyboard that you could plug in to a USB connector.

#4 lore raw

PATCH v3 2/2 arm64: dts: qcom: sc7180-trogdor: Wire up USB to usb-c-connectors

In reply to Stephen Boyd

Fully describe the USB type-c on sc7180 Trogdor devices. Most Trogdor devices have two USB type-c ports (i.e. usb-c-connector nodes), but Quackingstick only has one. Also, clamshell devices such as Lazor have a USB webcam connected to the USB hub, while detachable devices such as Wormdingler don't have a webcam, or a USB type-a connector. Instead they have the pogo pins for the detachable keyboard.

Fully describing the topology like this will let us expose information about what devices are connected to which physical USB connector (type-A or type-C).

Cc Bjorn Andersson <[email protected]>
Cc Konrad Dybcio <[email protected]>
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 .../dts/qcom/sc7180-trogdor-clamshell.dtsi    |  21 ++++
 .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi  |  47 ++++++++
 .../dts/qcom/sc7180-trogdor-detachable.dtsi   |  15 +++
 .../dts/qcom/sc7180-trogdor-homestar.dtsi     |  47 ++++++++
 .../dts/qcom/sc7180-trogdor-kingoftown.dts    |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-lazor.dtsi   |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-pazquel.dtsi |  55 +++++++++
 .../boot/dts/qcom/sc7180-trogdor-pompom.dtsi  |  44 +++++++
 .../qcom/sc7180-trogdor-quackingstick.dtsi    |  31 +++++
 .../arm64/boot/dts/qcom/sc7180-trogdor-r1.dts |  56 ++++++++-
 .../dts/qcom/sc7180-trogdor-wormdingler.dtsi  |  47 ++++++++
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi  | 109 ++++++++++++++++++
 12 files changed, 580 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-clamshell.dtsi +21 -0
index d91533b80e76..4e4f0b239f3c 100644
@@ -7,3 +7,24 @@
 
 /* This file must be included after sc7180-trogdor.dtsi to modify cros_ec */
 #include <arm/cros-ec-keyboard.dtsi>
+
+/ {
+	usb-a-connector {
+		compatible = "usb-a-connector";
+
+		port {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			usb_a0_hs: endpoint@0 {
+				reg = <0>;
+				/* Endpoint filled in by board */
+			};
+
+			usb_a0_ss: endpoint@1 {
+				reg = <1>;
+				/* Endpoint filled in by board */
+			};
+		};
+	};
+};
arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +47 -0

59 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-detachable.dtsi +15 -0
index 7c5d8a57ef7f..d33c73f4bac4 100644
@@ -6,6 +6,21 @@
  */
 
 /* This file must be included after sc7180-trogdor.dtsi to modify cros_ec */
+
+/ {
+	pogo_pins: keyboard-connector {
+		compatible = "google,usb-pogo-keyboard";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		/* Detachable keyboard filled in by board */
+		port {
+			pogo_pins_in: endpoint {
+				/* Endpoint filled in by board */
+			};
+		};
+	};
+};
+
 &cros_ec {
 	keyboard-controller {
 		compatible = "google,cros-ec-keyb-switches";
arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi +47 -0

59 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dts +55 -0

61 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi +55 -0

61 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi +55 -0

61 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi +44 -0

54 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi +31 -0
index ff8996b4de4e..174efd3abfa5 100644
@@ -105,6 +105,17 @@ &sdhc_2 {
 	status = "okay";
 };
 
+&pogo_pins {
+	keyboard@1 {
+		compatible = "usb18d1,505b";
+		reg = <1>;
+	};
+};
+
+&pogo_pins_in {
+	remote-endpoint = <&usb_hub_dfp1_hs>;
+};
+
 &pp1800_uf_cam {
 	status = "okay";
 };
@@ -129,11 +140,31 @@ pp3300_disp_on: &pp3300_dx_edp {
 	gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
 };
 
+&usb_c0_hs {
+	remote-endpoint = <&usb_hub_dfp2_hs>;
+};
+
+&usb_c0_ss {
+	remote-endpoint = <&usb_hub_dfp2_ss>;
+};
+
 /* This board only has 1 USB Type-C port. */
 &usb_c1 {
 	status = "disabled";
 };
 
+&usb_hub_dfp2_hs {
+	remote-endpoint = <&usb_c0_hs>;
+};
+
+&usb_hub_dfp2_ss {
+	remote-endpoint = <&usb_c0_ss>;
+};
+
+&usb_hub_dfp1_hs {
+	remote-endpoint = <&pogo_pins_in>;
+};
+
 /* PINCTRL - modifications to sc7180-trogdor.dtsi */
 
 /*
arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dts +54 -2

66 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi +47 -0

59 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +109 -0

133 lines not on this page · raw message

Signature · 1 line
https://chromeos.dev