Skip to content

Commit b66d1ac

Browse files
mripardkishon
authored andcommitted
dt-bindings: usb: Convert Allwinner A80 USB PHY controller to a schema
The Allwinner A80 SoCs have a USB PHY controller that is used by Linux, with a matching Device Tree binding. Now that we have the DT validation in place, let's convert the device tree bindings for that controller over to a YAML schemas. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent b109c13 commit b66d1ac

File tree

2 files changed

+135
-37
lines changed

2 files changed

+135
-37
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/phy/allwinner,sun9i-a80-usb-phy.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Allwinner A80 USB PHY Device Tree Bindings
8+
9+
maintainers:
10+
- Chen-Yu Tsai <[email protected]>
11+
- Maxime Ripard <[email protected]>
12+
13+
properties:
14+
"#phy-cells":
15+
const: 0
16+
17+
compatible:
18+
const: allwinner,sun9i-a80-usb-phy
19+
20+
reg:
21+
maxItems: 1
22+
23+
clocks:
24+
anyOf:
25+
- description: Main PHY Clock
26+
27+
- items:
28+
- description: Main PHY clock
29+
- description: HSIC 12MHz clock
30+
- description: HSIC 480MHz clock
31+
32+
clock-names:
33+
oneOf:
34+
- const: phy
35+
36+
- items:
37+
- const: phy
38+
- const: hsic_12M
39+
- const: hsic_480M
40+
41+
resets:
42+
anyOf:
43+
- description: Normal USB PHY reset
44+
45+
- items:
46+
- description: Normal USB PHY reset
47+
- description: HSIC Reset
48+
49+
reset-names:
50+
oneOf:
51+
- const: phy
52+
53+
- items:
54+
- const: phy
55+
- const: hsic
56+
57+
phy_type:
58+
const: hsic
59+
description:
60+
When absent, the PHY type will be assumed to be normal USB.
61+
62+
phy-supply:
63+
description:
64+
Regulator that powers VBUS
65+
66+
required:
67+
- "#phy-cells"
68+
- compatible
69+
- reg
70+
- clocks
71+
- clock-names
72+
- resets
73+
- reset-names
74+
75+
additionalProperties: false
76+
77+
if:
78+
properties:
79+
phy_type:
80+
const: hsic
81+
82+
required:
83+
- phy_type
84+
85+
then:
86+
properties:
87+
clocks:
88+
maxItems: 3
89+
90+
clock-names:
91+
maxItems: 3
92+
93+
resets:
94+
maxItems: 2
95+
96+
reset-names:
97+
maxItems: 2
98+
99+
examples:
100+
- |
101+
#include <dt-bindings/clock/sun9i-a80-usb.h>
102+
#include <dt-bindings/reset/sun9i-a80-usb.h>
103+
104+
usbphy1: phy@a00800 {
105+
compatible = "allwinner,sun9i-a80-usb-phy";
106+
reg = <0x00a00800 0x4>;
107+
clocks = <&usb_clocks CLK_USB0_PHY>;
108+
clock-names = "phy";
109+
resets = <&usb_clocks RST_USB0_PHY>;
110+
reset-names = "phy";
111+
phy-supply = <&reg_usb1_vbus>;
112+
#phy-cells = <0>;
113+
};
114+
115+
- |
116+
#include <dt-bindings/clock/sun9i-a80-usb.h>
117+
#include <dt-bindings/reset/sun9i-a80-usb.h>
118+
119+
usbphy3: phy@a02800 {
120+
compatible = "allwinner,sun9i-a80-usb-phy";
121+
reg = <0x00a02800 0x4>;
122+
clocks = <&usb_clocks CLK_USB2_PHY>,
123+
<&usb_clocks CLK_USB_HSIC>,
124+
<&usb_clocks CLK_USB2_HSIC>;
125+
clock-names = "phy",
126+
"hsic_12M",
127+
"hsic_480M";
128+
resets = <&usb_clocks RST_USB2_PHY>,
129+
<&usb_clocks RST_USB2_HSIC>;
130+
reset-names = "phy",
131+
"hsic";
132+
phy_type = "hsic";
133+
phy-supply = <&reg_usb3_vbus>;
134+
#phy-cells = <0>;
135+
};

Documentation/devicetree/bindings/phy/sun9i-usb-phy.txt

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)