5739172ceb5c322133570f10ba5192f1b580e787
[openwrt/staging/nbd.git] / target / linux / sunxi / patches-6.1 / 002-v6.2-dt-bindings-phy-Add-special-clock-for-Allwinner-H616-PHY.patch
1 From 6964affe65066651eca21e97247d3b7cac5153dc Mon Sep 17 00:00:00 2001
2 From: Andre Przywara <andre.przywara@arm.com>
3 Date: Mon, 31 Oct 2022 11:13:53 +0000
4 Subject: [PATCH] dt-bindings: phy: Add special clock for Allwinner H616 PHY
5
6 The USB PHY IP in the Allwinner H616 SoC requires a quirk that involves
7 some resources from port 2's PHY and HCI IP. In particular the PMU clock
8 for port 2 must be surely ungated before accessing the REG_HCI_PHY_CTL
9 register of port 2. To allow each USB port to be controlled
10 independently of port 2, we need a handle to that particular PMU clock
11 in the *PHY* node, as the HCI and PHY part might be handled by separate
12 drivers.
13
14 Add that clock to the requirements of the H616 PHY binding, so that a
15 PHY driver can apply the quirk in isolation, without requiring help from
16 port 2's HCI driver.
17
18 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
19 Reviewed-by: Rob Herring <robh@kernel.org>
20 Link: https://lore.kernel.org/r/20221031111358.3387297-3-andre.przywara@arm.com
21 Signed-off-by: Vinod Koul <vkoul@kernel.org>
22 ---
23 .../phy/allwinner,sun8i-h3-usb-phy.yaml | 26 +++++++++++++++++++
24 1 file changed, 26 insertions(+)
25
26 --- a/Documentation/devicetree/bindings/phy/allwinner,sun8i-h3-usb-phy.yaml
27 +++ b/Documentation/devicetree/bindings/phy/allwinner,sun8i-h3-usb-phy.yaml
28 @@ -36,18 +36,22 @@ properties:
29 - const: pmu3
30
31 clocks:
32 + minItems: 4
33 items:
34 - description: USB OTG PHY bus clock
35 - description: USB Host 0 PHY bus clock
36 - description: USB Host 1 PHY bus clock
37 - description: USB Host 2 PHY bus clock
38 + - description: PMU clock for host port 2
39
40 clock-names:
41 + minItems: 4
42 items:
43 - const: usb0_phy
44 - const: usb1_phy
45 - const: usb2_phy
46 - const: usb3_phy
47 + - const: pmu2_clk
48
49 resets:
50 items:
51 @@ -96,6 +100,28 @@ required:
52 - resets
53 - reset-names
54
55 +allOf:
56 + - if:
57 + properties:
58 + compatible:
59 + contains:
60 + enum:
61 + - allwinner,sun50i-h616-usb-phy
62 + then:
63 + properties:
64 + clocks:
65 + minItems: 5
66 +
67 + clock-names:
68 + minItems: 5
69 + else:
70 + properties:
71 + clocks:
72 + maxItems: 4
73 +
74 + clock-names:
75 + maxItems: 4
76 +
77 additionalProperties: false
78
79 examples: