xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/misc/hisilicon-hikey-usb.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*4882a593Smuzhiyun# Copyright 2019 Linaro Ltd.
3*4882a593Smuzhiyun%YAML 1.2
4*4882a593Smuzhiyun---
5*4882a593Smuzhiyun$id: "http://devicetree.org/schemas/misc/hisilicon-hikey-usb.yaml#"
6*4882a593Smuzhiyun$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntitle: HiKey960 onboard USB GPIO Hub
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunmaintainers:
11*4882a593Smuzhiyun  - John Stultz <john.stultz@linaro.org>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  Supports the onboard HiKey960 USB GPIO hub, which acts as a
15*4882a593Smuzhiyun  role-switch intermediary to detect the state of the USB-C
16*4882a593Smuzhiyun  port, to switch the hub into dual-role USB-C or host mode,
17*4882a593Smuzhiyun  which enables the onboard USB-A host ports.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun  Schematics about the hub can be found here:
20*4882a593Smuzhiyun    https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunproperties:
23*4882a593Smuzhiyun  compatible:
24*4882a593Smuzhiyun    items:
25*4882a593Smuzhiyun      - const: hisilicon,gpio_hubv1
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun  typec-vbus-gpios:
28*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/phandle
29*4882a593Smuzhiyun    description: phandle to the typec-vbus gpio
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun  otg-switch-gpios:
32*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/phandle
33*4882a593Smuzhiyun    description: phandle to the otg-switch gpio
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun  hub-vdd33-en-gpios:
36*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/phandle
37*4882a593Smuzhiyun    description: phandle to the hub 3.3v power enablement gpio
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun  usb-role-switch:
40*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/flag
41*4882a593Smuzhiyun    description: Support role switch.
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun  port:
44*4882a593Smuzhiyun    description: |
45*4882a593Smuzhiyun      any connector to the data bus of this controller should be modelled
46*4882a593Smuzhiyun      using the OF graph bindings specified, if the "usb-role-switch"
47*4882a593Smuzhiyun      property is used. Note for this driver, two ports are supported,
48*4882a593Smuzhiyun      the first being the endpoint that will be notified by this driver,
49*4882a593Smuzhiyun      and the second being the endpoint that notifies this driver of a
50*4882a593Smuzhiyun      role switch.
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun
53*4882a593Smuzhiyunrequired:
54*4882a593Smuzhiyun  - compatible
55*4882a593Smuzhiyun  - typec-vbus-gpios
56*4882a593Smuzhiyun  - otg-switch-gpios
57*4882a593Smuzhiyun  - hub-vdd33-en-gpios
58*4882a593Smuzhiyun  - usb-role-switch
59*4882a593Smuzhiyun  - port
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunadditionalProperties: false
62*4882a593Smuzhiyun
63*4882a593Smuzhiyunexamples:
64*4882a593Smuzhiyun  - |
65*4882a593Smuzhiyun    hisi_hikey_usb: hisi_hikey_usb {
66*4882a593Smuzhiyun        compatible = "hisilicon,gpio_hubv1";
67*4882a593Smuzhiyun        typec-vbus-gpios = <&gpio25 2 GPIO_ACTIVE_HIGH>;
68*4882a593Smuzhiyun        otg-switch-gpios = <&gpio25 6 GPIO_ACTIVE_HIGH>;
69*4882a593Smuzhiyun        hub-vdd33-en-gpios = <&gpio5 6 GPIO_ACTIVE_HIGH>;
70*4882a593Smuzhiyun        usb-role-switch;
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun        port {
73*4882a593Smuzhiyun            #address-cells = <1>;
74*4882a593Smuzhiyun            #size-cells = <0>;
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun            hikey_usb_ep0: endpoint@0 {
77*4882a593Smuzhiyun                reg = <0>;
78*4882a593Smuzhiyun                remote-endpoint = <&dwc3_role_switch>;
79*4882a593Smuzhiyun            };
80*4882a593Smuzhiyun            hikey_usb_ep1: endpoint@1 {
81*4882a593Smuzhiyun                reg = <1>;
82*4882a593Smuzhiyun                remote-endpoint = <&rt1711h_ep>;
83*4882a593Smuzhiyun            };
84*4882a593Smuzhiyun        };
85*4882a593Smuzhiyun    };
86