Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'phy-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy

Pull generic phy updates from Vinod Koul:
"New Support:
- Qualcomm sa8775p qmp-pcie, IPQ5018, and SC7280 qmp-ufs support
- Mediatek MT8188 support

Updates:
- Device tree device_get_match_data() usage and dropping
of_match_device() calls
- Qualcomm qmp usb and combo phy updates for v6 register layout
- Qualcomm eusb2-repeater updates for tuning overrides, regmap fields
- STih407 usb binding and ralink usb-phy yaml conversion
- renesas r8a779f0 serdes init sequencing updates"

* tag 'phy-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (32 commits)
phy: Remove duplicated include in phy-ralink-usb.c
phy: Kconfig: Select GENERIC_PHY for GENERIC_PHY_MIPI_DPHY
phy: qcom-qmp-pcie: add endpoint support for sa8775p
dt-bindings: phy: ralink-usb-phy: convert to dtschema
dt-bindings: phy: Convert PXA1928 USB/HSIC PHY to DT schema
phy: Drop unnecessary of_match_device() calls
phy: rockchip-inno-usb2: Drop unnecessary DT includes
phy: Use device_get_match_data()
phy: realtek: Replace of_device.h with explicit includes
phy: renesas: r8a779f0-ether-serdes: Add .exit() ops
phy: renesas: r8a779f0-ether-serdes: Reset in .init()
phy: qcom-qmp-combo: use v6 registers in v6 regs layout
phy: qcom-qmp-usb: move PCS v6 register to the proper header
phy: qcom-qmp-combo: fix the prefix for the PCS_USB v6 registers
phy: sun4i-usb: update array size
phy: qualcomm: phy-qcom-eusb2-repeater: Add tuning overrides
phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs
phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields
dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides
dt-bindings: phy: Add compatible for Mediatek MT8188
...

+828 -650
+47
Documentation/devicetree/bindings/phy/marvell,pxa1928-usb-phy.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/phy/marvell,pxa1928-usb-phy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell PXA1928 USB/HSIC PHY 8 + 9 + maintainers: 10 + - Duje Mihanović <duje.mihanovic@skole.hr> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - marvell,pxa1928-usb-phy 16 + - marvell,pxa1928-hsic-phy 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + clocks: 22 + maxItems: 1 23 + 24 + '#phy-cells': 25 + const: 0 26 + 27 + resets: 28 + maxItems: 1 29 + 30 + required: 31 + - compatible 32 + - reg 33 + - clocks 34 + - '#phy-cells' 35 + 36 + additionalProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/clock/marvell,pxa1928.h> 41 + 42 + usbphy: phy@7000 { 43 + compatible = "marvell,pxa1928-usb-phy"; 44 + reg = <0x7000 0xe0>; 45 + clocks = <&apmu PXA1928_CLK_USB>; 46 + #phy-cells = <0>; 47 + };
+1
Documentation/devicetree/bindings/phy/mediatek,dsi-phy.yaml
··· 30 30 - const: mediatek,mt8173-mipi-tx 31 31 - items: 32 32 - enum: 33 + - mediatek,mt8188-mipi-tx 33 34 - mediatek,mt8365-mipi-tx 34 35 - const: mediatek,mt8183-mipi-tx 35 36 - const: mediatek,mt2701-mipi-tx
+74
Documentation/devicetree/bindings/phy/mediatek,mt7628-usbphy.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/phy/mediatek,mt7628-usbphy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek/Ralink USB PHY 8 + 9 + maintainers: 10 + - Sergio Paracuellos <sergio.paracuellos@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - mediatek,mt7620-usbphy 16 + - mediatek,mt7628-usbphy 17 + - ralink,rt3352-usbphy 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + "#phy-cells": 23 + const: 0 24 + 25 + ralink,sysctl: 26 + description: 27 + phandle to a ralink syscon register region. 28 + $ref: /schemas/types.yaml#/definitions/phandle 29 + 30 + resets: 31 + items: 32 + - description: USB Host reset controller 33 + - description: USB Device reset controller 34 + 35 + reset-names: 36 + items: 37 + - const: host 38 + - const: device 39 + 40 + required: 41 + - compatible 42 + - "#phy-cells" 43 + - ralink,sysctl 44 + - resets 45 + - reset-names 46 + 47 + allOf: 48 + - if: 49 + properties: 50 + compatible: 51 + contains: 52 + const: mediatek,mt7628-usbphy 53 + then: 54 + required: 55 + - reg 56 + else: 57 + properties: 58 + reg: false 59 + 60 + additionalProperties: false 61 + 62 + examples: 63 + - | 64 + phy@10120000 { 65 + compatible = "mediatek,mt7628-usbphy"; 66 + reg = <0x10120000 0x1000>; 67 + #phy-cells = <0>; 68 + ralink,sysctl = <&sysc>; 69 + resets = <&rstctrl 22>, 70 + <&rstctrl 25>; 71 + reset-names = "host", "device"; 72 + }; 73 + 74 + ...
-24
Documentation/devicetree/bindings/phy/phy-stih407-usb.txt
··· 1 - ST STiH407 USB PHY controller 2 - 3 - This file documents the dt bindings for the usb picoPHY driver which is the PHY for both USB2 and USB3 4 - host controllers (when controlling usb2/1.1 devices) available on STiH407 SoC family from STMicroelectronics. 5 - 6 - Required properties: 7 - - compatible : should be "st,stih407-usb2-phy" 8 - - st,syscfg : phandle of sysconfig bank plus integer array containing phyparam and phyctrl register offsets 9 - - resets : list of phandle and reset specifier pairs. There should be two entries, one 10 - for the whole phy and one for the port 11 - - reset-names : list of reset signal names. Should be "global" and "port" 12 - See: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml 13 - See: Documentation/devicetree/bindings/reset/reset.txt 14 - 15 - Example: 16 - 17 - usb2_picophy0: usbpicophy@f8 { 18 - compatible = "st,stih407-usb2-phy"; 19 - #phy-cells = <0>; 20 - st,syscfg = <&syscfg_core 0x100 0xf4>; 21 - resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 22 - <&picophyreset STIH407_PICOPHY0_RESET>; 23 - reset-names = "global", "port"; 24 - };
-18
Documentation/devicetree/bindings/phy/pxa1928-usb-phy.txt
··· 1 - * Marvell PXA1928 USB and HSIC PHYs 2 - 3 - Required properties: 4 - - compatible: "marvell,pxa1928-usb-phy" or "marvell,pxa1928-hsic-phy" 5 - - reg: base address and length of the registers 6 - - clocks - A single clock. From common clock binding. 7 - - #phys-cells: should be 0. From common phy binding. 8 - - resets: reference to the reset controller 9 - 10 - Example: 11 - 12 - usbphy: phy@7000 { 13 - compatible = "marvell,pxa1928-usb-phy"; 14 - reg = <0x7000 0xe0>; 15 - clocks = <&apmu_clocks PXA1928_CLK_USB>; 16 - #phy-cells = <0>; 17 - }; 18 -
+3 -1
Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml
··· 17 17 properties: 18 18 compatible: 19 19 items: 20 - - const: qcom,ipq5332-usb-hsphy 20 + - enum: 21 + - qcom,ipq5018-usb-hsphy 22 + - qcom,ipq5332-usb-hsphy 21 23 22 24 "#phy-cells": 23 25 const: 0
-287
Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
··· 1 - # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/phy/qcom,msm8996-qmp-usb3-phy.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Qualcomm QMP PHY controller (USB, MSM8996) 8 - 9 - maintainers: 10 - - Vinod Koul <vkoul@kernel.org> 11 - 12 - description: 13 - QMP PHY controller supports physical layer functionality for a number of 14 - controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. 15 - 16 - Note that these bindings are for SoCs up to SC8180X. For newer SoCs, see 17 - qcom,sc8280xp-qmp-usb3-uni-phy.yaml. 18 - 19 - properties: 20 - compatible: 21 - enum: 22 - - qcom,ipq6018-qmp-usb3-phy 23 - - qcom,ipq8074-qmp-usb3-phy 24 - - qcom,msm8996-qmp-usb3-phy 25 - - qcom,msm8998-qmp-usb3-phy 26 - - qcom,sdm845-qmp-usb3-uni-phy 27 - - qcom,sdx55-qmp-usb3-uni-phy 28 - - qcom,sdx65-qmp-usb3-uni-phy 29 - - qcom,sm8150-qmp-usb3-uni-phy 30 - - qcom,sm8250-qmp-usb3-uni-phy 31 - - qcom,sm8350-qmp-usb3-uni-phy 32 - 33 - reg: 34 - items: 35 - - description: serdes 36 - 37 - "#address-cells": 38 - enum: [ 1, 2 ] 39 - 40 - "#size-cells": 41 - enum: [ 1, 2 ] 42 - 43 - ranges: true 44 - 45 - clocks: 46 - minItems: 3 47 - maxItems: 4 48 - 49 - clock-names: 50 - minItems: 3 51 - maxItems: 4 52 - 53 - power-domains: 54 - maxItems: 1 55 - 56 - resets: 57 - maxItems: 2 58 - 59 - reset-names: 60 - maxItems: 2 61 - 62 - vdda-phy-supply: true 63 - 64 - vdda-pll-supply: true 65 - 66 - vddp-ref-clk-supply: true 67 - 68 - patternProperties: 69 - "^phy@[0-9a-f]+$": 70 - type: object 71 - description: single PHY-provider child node 72 - properties: 73 - reg: 74 - minItems: 3 75 - maxItems: 6 76 - 77 - clocks: 78 - items: 79 - - description: PIPE clock 80 - 81 - clock-names: 82 - deprecated: true 83 - items: 84 - - const: pipe0 85 - 86 - "#clock-cells": 87 - const: 0 88 - 89 - clock-output-names: 90 - maxItems: 1 91 - 92 - "#phy-cells": 93 - const: 0 94 - 95 - required: 96 - - reg 97 - - clocks 98 - - "#clock-cells" 99 - - clock-output-names 100 - - "#phy-cells" 101 - 102 - additionalProperties: false 103 - 104 - required: 105 - - compatible 106 - - reg 107 - - "#address-cells" 108 - - "#size-cells" 109 - - ranges 110 - - clocks 111 - - clock-names 112 - - resets 113 - - reset-names 114 - - vdda-phy-supply 115 - - vdda-pll-supply 116 - 117 - additionalProperties: false 118 - 119 - allOf: 120 - - if: 121 - properties: 122 - compatible: 123 - contains: 124 - enum: 125 - - qcom,sdm845-qmp-usb3-uni-phy 126 - then: 127 - properties: 128 - clocks: 129 - maxItems: 4 130 - clock-names: 131 - items: 132 - - const: aux 133 - - const: cfg_ahb 134 - - const: ref 135 - - const: com_aux 136 - resets: 137 - maxItems: 2 138 - reset-names: 139 - items: 140 - - const: phy 141 - - const: common 142 - 143 - - if: 144 - properties: 145 - compatible: 146 - contains: 147 - enum: 148 - - qcom,ipq8074-qmp-usb3-phy 149 - - qcom,msm8996-qmp-usb3-phy 150 - - qcom,msm8998-qmp-usb3-phy 151 - - qcom,sdx55-qmp-usb3-uni-phy 152 - - qcom,sdx65-qmp-usb3-uni-phy 153 - then: 154 - properties: 155 - clocks: 156 - maxItems: 3 157 - clock-names: 158 - items: 159 - - const: aux 160 - - const: cfg_ahb 161 - - const: ref 162 - resets: 163 - maxItems: 2 164 - reset-names: 165 - items: 166 - - const: phy 167 - - const: common 168 - 169 - - if: 170 - properties: 171 - compatible: 172 - contains: 173 - enum: 174 - - qcom,sm8150-qmp-usb3-uni-phy 175 - - qcom,sm8250-qmp-usb3-uni-phy 176 - - qcom,sm8350-qmp-usb3-uni-phy 177 - then: 178 - properties: 179 - clocks: 180 - maxItems: 4 181 - clock-names: 182 - items: 183 - - const: aux 184 - - const: ref_clk_src 185 - - const: ref 186 - - const: com_aux 187 - resets: 188 - maxItems: 2 189 - reset-names: 190 - items: 191 - - const: phy 192 - - const: common 193 - 194 - - if: 195 - properties: 196 - compatible: 197 - contains: 198 - enum: 199 - - qcom,msm8998-qmp-usb3-phy 200 - then: 201 - patternProperties: 202 - "^phy@[0-9a-f]+$": 203 - properties: 204 - reg: 205 - items: 206 - - description: TX lane 1 207 - - description: RX lane 1 208 - - description: PCS 209 - - description: TX lane 2 210 - - description: RX lane 2 211 - 212 - - if: 213 - properties: 214 - compatible: 215 - contains: 216 - enum: 217 - - qcom,ipq6018-qmp-usb3-phy 218 - - qcom,ipq8074-qmp-usb3-phy 219 - - qcom,sdx55-qmp-usb3-uni-phy 220 - - qcom,sdx65-qmp-usb3-uni-phy 221 - - qcom,sm8150-qmp-usb3-uni-phy 222 - then: 223 - patternProperties: 224 - "^phy@[0-9a-f]+$": 225 - properties: 226 - reg: 227 - items: 228 - - description: TX 229 - - description: RX 230 - - description: PCS 231 - - description: PCS_MISC 232 - 233 - - if: 234 - properties: 235 - compatible: 236 - contains: 237 - enum: 238 - - qcom,msm8996-qmp-usb3-phy 239 - - qcom,sm8250-qmp-usb3-uni-phy 240 - - qcom,sm8350-qmp-usb3-uni-phy 241 - then: 242 - patternProperties: 243 - "^phy@[0-9a-f]+$": 244 - properties: 245 - reg: 246 - items: 247 - - description: TX 248 - - description: RX 249 - - description: PCS 250 - 251 - examples: 252 - - | 253 - #include <dt-bindings/clock/qcom,gcc-sdm845.h> 254 - usb_2_qmpphy: phy-wrapper@88eb000 { 255 - compatible = "qcom,sdm845-qmp-usb3-uni-phy"; 256 - reg = <0x088eb000 0x18c>; 257 - #address-cells = <1>; 258 - #size-cells = <1>; 259 - ranges = <0x0 0x088eb000 0x2000>; 260 - 261 - clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK >, 262 - <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, 263 - <&gcc GCC_USB3_SEC_CLKREF_CLK>, 264 - <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>; 265 - clock-names = "aux", "cfg_ahb", "ref", "com_aux"; 266 - 267 - resets = <&gcc GCC_USB3PHY_PHY_SEC_BCR>, 268 - <&gcc GCC_USB3_PHY_SEC_BCR>; 269 - reset-names = "phy", "common"; 270 - 271 - vdda-phy-supply = <&vdda_usb2_ss_1p2>; 272 - vdda-pll-supply = <&vdda_usb2_ss_core>; 273 - 274 - usb_2_ssphy: phy@200 { 275 - reg = <0x200 0x128>, 276 - <0x400 0x1fc>, 277 - <0x800 0x218>, 278 - <0x600 0x70>; 279 - 280 - clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>; 281 - 282 - #clock-cells = <0>; 283 - clock-output-names = "usb3_uni_phy_pipe_clk_src"; 284 - 285 - #phy-cells = <0>; 286 - }; 287 - };
+2
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml
··· 19 19 - qcom,msm8996-qmp-ufs-phy 20 20 - qcom,msm8998-qmp-ufs-phy 21 21 - qcom,sa8775p-qmp-ufs-phy 22 + - qcom,sc7280-qmp-ufs-phy 22 23 - qcom,sc8180x-qmp-ufs-phy 23 24 - qcom,sc8280xp-qmp-ufs-phy 24 25 - qcom,sdm845-qmp-ufs-phy ··· 86 85 contains: 87 86 enum: 88 87 - qcom,sa8775p-qmp-ufs-phy 88 + - qcom,sc7280-qmp-ufs-phy 89 89 - qcom,sm8450-qmp-ufs-phy 90 90 then: 91 91 properties:
+53 -2
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
··· 16 16 properties: 17 17 compatible: 18 18 enum: 19 + - qcom,ipq6018-qmp-usb3-phy 20 + - qcom,ipq8074-qmp-usb3-phy 19 21 - qcom,ipq9574-qmp-usb3-phy 22 + - qcom,msm8996-qmp-usb3-phy 23 + - qcom,msm8998-qmp-usb3-phy 20 24 - qcom,qcm2290-qmp-usb3-phy 21 25 - qcom,sa8775p-qmp-usb3-uni-phy 22 26 - qcom,sc8280xp-qmp-usb3-uni-phy 27 + - qcom,sdm845-qmp-usb3-uni-phy 28 + - qcom,sdx55-qmp-usb3-uni-phy 29 + - qcom,sdx65-qmp-usb3-uni-phy 23 30 - qcom,sdx75-qmp-usb3-uni-phy 24 31 - qcom,sm6115-qmp-usb3-phy 32 + - qcom,sm8150-qmp-usb3-uni-phy 33 + - qcom,sm8250-qmp-usb3-uni-phy 34 + - qcom,sm8350-qmp-usb3-uni-phy 35 + 25 36 26 37 reg: 27 38 maxItems: 1 28 39 29 40 clocks: 30 - maxItems: 4 41 + minItems: 4 42 + maxItems: 5 31 43 32 44 clock-names: 33 - maxItems: 4 45 + minItems: 4 46 + maxItems: 5 34 47 35 48 power-domains: 36 49 maxItems: 1 ··· 88 75 compatible: 89 76 contains: 90 77 enum: 78 + - qcom,ipq6018-qmp-usb3-phy 79 + - qcom,ipq8074-qmp-usb3-phy 91 80 - qcom,ipq9574-qmp-usb3-phy 81 + - qcom,msm8996-qmp-usb3-phy 82 + - qcom,msm8998-qmp-usb3-phy 83 + - qcom,sdx55-qmp-usb3-uni-phy 84 + - qcom,sdx65-qmp-usb3-uni-phy 92 85 - qcom,sdx75-qmp-usb3-uni-phy 93 86 then: 94 87 properties: 88 + clocks: 89 + maxItems: 4 95 90 clock-names: 96 91 items: 97 92 - const: aux ··· 132 111 enum: 133 112 - qcom,sa8775p-qmp-usb3-uni-phy 134 113 - qcom,sc8280xp-qmp-usb3-uni-phy 114 + - qcom,sm8150-qmp-usb3-uni-phy 115 + - qcom,sm8250-qmp-usb3-uni-phy 116 + - qcom,sm8350-qmp-usb3-uni-phy 135 117 then: 136 118 properties: 137 119 clocks: ··· 145 121 - const: ref 146 122 - const: com_aux 147 123 - const: pipe 124 + 125 + - if: 126 + properties: 127 + compatible: 128 + contains: 129 + enum: 130 + - qcom,sdm845-qmp-usb3-uni-phy 131 + then: 132 + properties: 133 + clocks: 134 + maxItems: 5 135 + clock-names: 136 + items: 137 + - const: aux 138 + - const: cfg_ahb 139 + - const: ref 140 + - const: com_aux 141 + - const: pipe 142 + 143 + - if: 144 + properties: 145 + compatible: 146 + contains: 147 + enum: 148 + - qcom,sa8775p-qmp-usb3-uni-phy 149 + - qcom,sc8280xp-qmp-usb3-uni-phy 150 + then: 148 151 required: 149 152 - power-domains 150 153
+21
Documentation/devicetree/bindings/phy/qcom,snps-eusb2-repeater.yaml
··· 32 32 33 33 vdd3-supply: true 34 34 35 + qcom,tune-usb2-disc-thres: 36 + $ref: /schemas/types.yaml#/definitions/uint8 37 + description: High-Speed disconnect threshold 38 + minimum: 0 39 + maximum: 7 40 + default: 0 41 + 42 + qcom,tune-usb2-amplitude: 43 + $ref: /schemas/types.yaml#/definitions/uint8 44 + description: High-Speed trasmit amplitude 45 + minimum: 0 46 + maximum: 15 47 + default: 8 48 + 49 + qcom,tune-usb2-preem: 50 + $ref: /schemas/types.yaml#/definitions/uint8 51 + description: High-Speed TX pre-emphasis tuning 52 + minimum: 0 53 + maximum: 7 54 + default: 5 55 + 35 56 required: 36 57 - compatible 37 58 - reg
+63
Documentation/devicetree/bindings/phy/st,stih407-usb2-phy.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/phy/st,stih407-usb2-phy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STMicroelectronics STiH407 USB PHY controller 8 + 9 + maintainers: 10 + - Patrice Chotard <patrice.chotard@foss.st.com> 11 + 12 + description: 13 + The USB picoPHY device is the PHY for both USB2 and USB3 host controllers 14 + (when controlling usb2/1.1 devices) available on STiH407 SoC family from 15 + STMicroelectronics. 16 + 17 + properties: 18 + compatible: 19 + const: st,stih407-usb2-phy 20 + 21 + st,syscfg: 22 + description: Phandle to the syscfg bank 23 + $ref: /schemas/types.yaml#/definitions/phandle-array 24 + items: 25 + - items: 26 + - description: phandle to syscfg 27 + - description: phyparam register offset 28 + - description: phyctrl register offset 29 + 30 + resets: 31 + items: 32 + - description: Phandle and reset specifier pair for the whole phy. 33 + - description: Phandle and reset specifier pair for the port. 34 + 35 + reset-names: 36 + items: 37 + - const: global 38 + - const: port 39 + 40 + "#phy-cells": 41 + const: 0 42 + 43 + required: 44 + - compatible 45 + - st,syscfg 46 + - resets 47 + - reset-names 48 + - "#phy-cells" 49 + 50 + additionalProperties: false 51 + 52 + examples: 53 + - | 54 + #include <dt-bindings/reset/stih407-resets.h> 55 + usb-phy { 56 + compatible = "st,stih407-usb2-phy"; 57 + #phy-cells = <0>; 58 + st,syscfg = <&syscfg_core 0x100 0xf4>; 59 + resets = <&softreset STIH407_PICOPHY_SOFTRESET>, 60 + <&picophyreset STIH407_PICOPHY0_RESET>; 61 + reset-names = "global", "port"; 62 + }; 63 + ...
+1 -1
drivers/phy/Kconfig
··· 18 18 19 19 config GENERIC_PHY_MIPI_DPHY 20 20 bool 21 - depends on GENERIC_PHY 21 + select GENERIC_PHY 22 22 help 23 23 Generic MIPI D-PHY support. 24 24
+1 -1
drivers/phy/allwinner/phy-sun4i-usb.c
··· 782 782 783 783 for (i = 0; i < data->cfg->num_phys; i++) { 784 784 struct sun4i_usb_phy *phy = data->phys + i; 785 - char name[16]; 785 + char name[32]; 786 786 787 787 if (data->cfg->missing_phys & BIT(i)) 788 788 continue;
+3 -6
drivers/phy/broadcom/phy-bcm-ns-usb3.c
··· 16 16 #include <linux/iopoll.h> 17 17 #include <linux/mdio.h> 18 18 #include <linux/module.h> 19 + #include <linux/of.h> 19 20 #include <linux/of_address.h> 20 - #include <linux/of_platform.h> 21 21 #include <linux/platform_device.h> 22 22 #include <linux/phy/phy.h> 23 + #include <linux/property.h> 23 24 #include <linux/slab.h> 24 25 25 26 #define BCM_NS_USB3_PHY_BASE_ADDR_REG 0x1f ··· 190 189 static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev) 191 190 { 192 191 struct device *dev = &mdiodev->dev; 193 - const struct of_device_id *of_id; 194 192 struct phy_provider *phy_provider; 195 193 struct device_node *syscon_np; 196 194 struct bcm_ns_usb3 *usb3; ··· 203 203 usb3->dev = dev; 204 204 usb3->mdiodev = mdiodev; 205 205 206 - of_id = of_match_device(bcm_ns_usb3_id_table, dev); 207 - if (!of_id) 208 - return -EINVAL; 209 - usb3->family = (uintptr_t)of_id->data; 206 + usb3->family = (enum bcm_ns_family)device_get_match_data(dev); 210 207 211 208 syscon_np = of_parse_phandle(dev->of_node, "usb3-dmp-syscon", 0); 212 209 err = of_address_to_resource(syscon_np, 0, &res);
+3 -4
drivers/phy/marvell/phy-berlin-usb.c
··· 8 8 9 9 #include <linux/io.h> 10 10 #include <linux/module.h> 11 - #include <linux/of_device.h> 11 + #include <linux/of.h> 12 12 #include <linux/phy/phy.h> 13 13 #include <linux/platform_device.h> 14 + #include <linux/property.h> 14 15 #include <linux/reset.h> 15 16 16 17 #define USB_PHY_PLL 0x04 ··· 163 162 164 163 static int phy_berlin_usb_probe(struct platform_device *pdev) 165 164 { 166 - const struct of_device_id *match = 167 - of_match_device(phy_berlin_usb_of_match, &pdev->dev); 168 165 struct phy_berlin_usb_priv *priv; 169 166 struct phy *phy; 170 167 struct phy_provider *phy_provider; ··· 179 180 if (IS_ERR(priv->rst_ctrl)) 180 181 return PTR_ERR(priv->rst_ctrl); 181 182 182 - priv->pll_divider = *((u32 *)match->data); 183 + priv->pll_divider = *((u32 *)device_get_match_data(&pdev->dev)); 183 184 184 185 phy = devm_phy_create(&pdev->dev, NULL, &phy_berlin_usb_ops); 185 186 if (IS_ERR(phy)) {
-7
drivers/phy/motorola/phy-cpcap-usb.c
··· 15 15 #include <linux/io.h> 16 16 #include <linux/module.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_platform.h> 19 18 #include <linux/iio/consumer.h> 20 19 #include <linux/pinctrl/consumer.h> 21 20 #include <linux/platform_device.h> ··· 611 612 struct phy *generic_phy; 612 613 struct phy_provider *phy_provider; 613 614 struct usb_otg *otg; 614 - const struct of_device_id *of_id; 615 615 int error; 616 - 617 - of_id = of_match_device(of_match_ptr(cpcap_usb_phy_id_table), 618 - &pdev->dev); 619 - if (!of_id) 620 - return -EINVAL; 621 616 622 617 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); 623 618 if (!ddata)
+111 -35
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
··· 24 24 #define EUSB2_FORCE_VAL_5 0xeD 25 25 #define V_CLK_19P2M_EN BIT(6) 26 26 27 + #define EUSB2_TUNE_USB2_CROSSOVER 0x50 27 28 #define EUSB2_TUNE_IUSB2 0x51 29 + #define EUSB2_TUNE_RES_FSDIF 0x52 30 + #define EUSB2_TUNE_HSDISC 0x53 28 31 #define EUSB2_TUNE_SQUELCH_U 0x54 32 + #define EUSB2_TUNE_USB2_SLEW 0x55 33 + #define EUSB2_TUNE_USB2_EQU 0x56 29 34 #define EUSB2_TUNE_USB2_PREEM 0x57 35 + #define EUSB2_TUNE_USB2_HS_COMP_CUR 0x58 36 + #define EUSB2_TUNE_EUSB_SLEW 0x59 37 + #define EUSB2_TUNE_EUSB_EQU 0x5A 38 + #define EUSB2_TUNE_EUSB_HS_COMP_CUR 0x5B 30 39 31 - #define QCOM_EUSB2_REPEATER_INIT_CFG(o, v) \ 40 + #define QCOM_EUSB2_REPEATER_INIT_CFG(r, v) \ 32 41 { \ 33 - .offset = o, \ 42 + .reg = r, \ 34 43 .val = v, \ 35 44 } 36 45 37 - struct eusb2_repeater_init_tbl { 38 - unsigned int offset; 39 - unsigned int val; 46 + enum reg_fields { 47 + F_TUNE_EUSB_HS_COMP_CUR, 48 + F_TUNE_EUSB_EQU, 49 + F_TUNE_EUSB_SLEW, 50 + F_TUNE_USB2_HS_COMP_CUR, 51 + F_TUNE_USB2_PREEM, 52 + F_TUNE_USB2_EQU, 53 + F_TUNE_USB2_SLEW, 54 + F_TUNE_SQUELCH_U, 55 + F_TUNE_HSDISC, 56 + F_TUNE_RES_FSDIF, 57 + F_TUNE_IUSB2, 58 + F_TUNE_USB2_CROSSOVER, 59 + F_NUM_TUNE_FIELDS, 60 + 61 + F_FORCE_VAL_5 = F_NUM_TUNE_FIELDS, 62 + F_FORCE_EN_5, 63 + 64 + F_EN_CTL1, 65 + 66 + F_RPTR_STATUS, 67 + F_NUM_FIELDS, 68 + }; 69 + 70 + static struct reg_field eusb2_repeater_tune_reg_fields[F_NUM_FIELDS] = { 71 + [F_TUNE_EUSB_HS_COMP_CUR] = REG_FIELD(EUSB2_TUNE_EUSB_HS_COMP_CUR, 0, 1), 72 + [F_TUNE_EUSB_EQU] = REG_FIELD(EUSB2_TUNE_EUSB_EQU, 0, 1), 73 + [F_TUNE_EUSB_SLEW] = REG_FIELD(EUSB2_TUNE_EUSB_SLEW, 0, 1), 74 + [F_TUNE_USB2_HS_COMP_CUR] = REG_FIELD(EUSB2_TUNE_USB2_HS_COMP_CUR, 0, 1), 75 + [F_TUNE_USB2_PREEM] = REG_FIELD(EUSB2_TUNE_USB2_PREEM, 0, 2), 76 + [F_TUNE_USB2_EQU] = REG_FIELD(EUSB2_TUNE_USB2_EQU, 0, 1), 77 + [F_TUNE_USB2_SLEW] = REG_FIELD(EUSB2_TUNE_USB2_SLEW, 0, 1), 78 + [F_TUNE_SQUELCH_U] = REG_FIELD(EUSB2_TUNE_SQUELCH_U, 0, 2), 79 + [F_TUNE_HSDISC] = REG_FIELD(EUSB2_TUNE_HSDISC, 0, 2), 80 + [F_TUNE_RES_FSDIF] = REG_FIELD(EUSB2_TUNE_RES_FSDIF, 0, 2), 81 + [F_TUNE_IUSB2] = REG_FIELD(EUSB2_TUNE_IUSB2, 0, 3), 82 + [F_TUNE_USB2_CROSSOVER] = REG_FIELD(EUSB2_TUNE_USB2_CROSSOVER, 0, 2), 83 + 84 + [F_FORCE_VAL_5] = REG_FIELD(EUSB2_FORCE_VAL_5, 0, 7), 85 + [F_FORCE_EN_5] = REG_FIELD(EUSB2_FORCE_EN_5, 0, 7), 86 + 87 + [F_EN_CTL1] = REG_FIELD(EUSB2_EN_CTL1, 0, 7), 88 + 89 + [F_RPTR_STATUS] = REG_FIELD(EUSB2_RPTR_STATUS, 0, 7), 40 90 }; 41 91 42 92 struct eusb2_repeater_cfg { 43 - const struct eusb2_repeater_init_tbl *init_tbl; 93 + const u32 *init_tbl; 44 94 int init_tbl_num; 45 95 const char * const *vreg_list; 46 96 int num_vregs; ··· 98 48 99 49 struct eusb2_repeater { 100 50 struct device *dev; 101 - struct regmap *regmap; 51 + struct regmap_field *regs[F_NUM_FIELDS]; 102 52 struct phy *phy; 103 53 struct regulator_bulk_data *vregs; 104 54 const struct eusb2_repeater_cfg *cfg; 105 - u16 base; 106 55 enum phy_mode mode; 107 56 }; 108 57 ··· 109 60 "vdd18", "vdd3", 110 61 }; 111 62 112 - static const struct eusb2_repeater_init_tbl pm8550b_init_tbl[] = { 113 - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_IUSB2, 0x8), 114 - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_SQUELCH_U, 0x3), 115 - QCOM_EUSB2_REPEATER_INIT_CFG(EUSB2_TUNE_USB2_PREEM, 0x5), 63 + static const u32 pm8550b_init_tbl[F_NUM_TUNE_FIELDS] = { 64 + [F_TUNE_IUSB2] = 0x8, 65 + [F_TUNE_SQUELCH_U] = 0x3, 66 + [F_TUNE_USB2_PREEM] = 0x5, 116 67 }; 117 68 118 69 static const struct eusb2_repeater_cfg pm8550b_eusb2_cfg = { ··· 140 91 141 92 static int eusb2_repeater_init(struct phy *phy) 142 93 { 94 + struct reg_field *regfields = eusb2_repeater_tune_reg_fields; 143 95 struct eusb2_repeater *rptr = phy_get_drvdata(phy); 144 - const struct eusb2_repeater_init_tbl *init_tbl = rptr->cfg->init_tbl; 145 - int num = rptr->cfg->init_tbl_num; 96 + struct device_node *np = rptr->dev->of_node; 97 + u32 init_tbl[F_NUM_TUNE_FIELDS] = { 0 }; 98 + u8 override; 146 99 u32 val; 147 100 int ret; 148 101 int i; ··· 153 102 if (ret) 154 103 return ret; 155 104 156 - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_EN_CTL1, 157 - EUSB2_RPTR_EN, EUSB2_RPTR_EN); 105 + regmap_field_update_bits(rptr->regs[F_EN_CTL1], EUSB2_RPTR_EN, EUSB2_RPTR_EN); 158 106 159 - for (i = 0; i < num; i++) 160 - regmap_update_bits(rptr->regmap, 161 - rptr->base + init_tbl[i].offset, 162 - init_tbl[i].val, init_tbl[i].val); 107 + for (i = 0; i < F_NUM_TUNE_FIELDS; i++) { 108 + if (init_tbl[i]) { 109 + regmap_field_update_bits(rptr->regs[i], init_tbl[i], init_tbl[i]); 110 + } else { 111 + /* Write 0 if there's no value set */ 112 + u32 mask = GENMASK(regfields[i].msb, regfields[i].lsb); 163 113 164 - ret = regmap_read_poll_timeout(rptr->regmap, 165 - rptr->base + EUSB2_RPTR_STATUS, val, 166 - val & RPTR_OK, 10, 5); 114 + regmap_field_update_bits(rptr->regs[i], mask, 0); 115 + } 116 + } 117 + memcpy(init_tbl, rptr->cfg->init_tbl, sizeof(init_tbl)); 118 + 119 + if (!of_property_read_u8(np, "qcom,tune-usb2-amplitude", &override)) 120 + init_tbl[F_TUNE_IUSB2] = override; 121 + 122 + if (!of_property_read_u8(np, "qcom,tune-usb2-disc-thres", &override)) 123 + init_tbl[F_TUNE_HSDISC] = override; 124 + 125 + if (!of_property_read_u8(np, "qcom,tune-usb2-preem", &override)) 126 + init_tbl[F_TUNE_USB2_PREEM] = override; 127 + 128 + for (i = 0; i < F_NUM_TUNE_FIELDS; i++) 129 + regmap_field_update_bits(rptr->regs[i], init_tbl[i], init_tbl[i]); 130 + 131 + ret = regmap_field_read_poll_timeout(rptr->regs[F_RPTR_STATUS], 132 + val, val & RPTR_OK, 10, 5); 167 133 if (ret) 168 134 dev_err(rptr->dev, "initialization timed-out\n"); 169 135 ··· 199 131 * per eUSB 1.2 Spec. Below implement software workaround until 200 132 * PHY and controller is fixing seen observation. 201 133 */ 202 - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_EN_5, 203 - F_CLK_19P2M_EN, F_CLK_19P2M_EN); 204 - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_VAL_5, 205 - V_CLK_19P2M_EN, V_CLK_19P2M_EN); 134 + regmap_field_update_bits(rptr->regs[F_FORCE_EN_5], 135 + F_CLK_19P2M_EN, F_CLK_19P2M_EN); 136 + regmap_field_update_bits(rptr->regs[F_FORCE_VAL_5], 137 + V_CLK_19P2M_EN, V_CLK_19P2M_EN); 206 138 break; 207 139 case PHY_MODE_USB_DEVICE: 208 140 /* ··· 211 143 * repeater doesn't clear previous value due to shared 212 144 * regulators (say host <-> device mode switch). 213 145 */ 214 - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_EN_5, 215 - F_CLK_19P2M_EN, 0); 216 - regmap_update_bits(rptr->regmap, rptr->base + EUSB2_FORCE_VAL_5, 217 - V_CLK_19P2M_EN, 0); 146 + regmap_field_update_bits(rptr->regs[F_FORCE_EN_5], 147 + F_CLK_19P2M_EN, 0); 148 + regmap_field_update_bits(rptr->regs[F_FORCE_VAL_5], 149 + V_CLK_19P2M_EN, 0); 218 150 break; 219 151 default: 220 152 return -EINVAL; ··· 243 175 struct device *dev = &pdev->dev; 244 176 struct phy_provider *phy_provider; 245 177 struct device_node *np = dev->of_node; 178 + struct regmap *regmap; 179 + int i, ret; 246 180 u32 res; 247 - int ret; 248 181 249 182 rptr = devm_kzalloc(dev, sizeof(*rptr), GFP_KERNEL); 250 183 if (!rptr) ··· 258 189 if (!rptr->cfg) 259 190 return -EINVAL; 260 191 261 - rptr->regmap = dev_get_regmap(dev->parent, NULL); 262 - if (!rptr->regmap) 192 + regmap = dev_get_regmap(dev->parent, NULL); 193 + if (!regmap) 263 194 return -ENODEV; 264 195 265 196 ret = of_property_read_u32(np, "reg", &res); 266 197 if (ret < 0) 267 198 return ret; 268 199 269 - rptr->base = res; 200 + for (i = 0; i < F_NUM_FIELDS; i++) 201 + eusb2_repeater_tune_reg_fields[i].reg += res; 202 + 203 + ret = devm_regmap_field_bulk_alloc(dev, regmap, rptr->regs, 204 + eusb2_repeater_tune_reg_fields, 205 + F_NUM_FIELDS); 206 + if (ret) 207 + return ret; 270 208 271 209 ret = eusb2_repeater_init_vregs(rptr); 272 210 if (ret < 0) {
+55 -4
drivers/phy/qualcomm/phy-qcom-m31.c
··· 82 82 unsigned int nregs; 83 83 }; 84 84 85 + static const struct m31_phy_regs m31_ipq5018_regs[] = { 86 + { 87 + .off = USB_PHY_CFG0, 88 + .val = UTMI_PHY_OVERRIDE_EN 89 + }, 90 + { 91 + .off = USB_PHY_UTMI_CTRL5, 92 + .val = POR_EN, 93 + .delay = 15 94 + }, 95 + { 96 + .off = USB_PHY_FSEL_SEL, 97 + .val = FREQ_SEL 98 + }, 99 + { 100 + .off = USB_PHY_HS_PHY_CTRL_COMMON0, 101 + .val = COMMONONN | FSEL | RETENABLEN 102 + }, 103 + { 104 + .off = USB_PHY_REFCLK_CTRL, 105 + .val = CLKCORE 106 + }, 107 + { 108 + .off = USB_PHY_UTMI_CTRL5, 109 + .val = POR_EN 110 + }, 111 + { 112 + .off = USB_PHY_HS_PHY_CTRL2, 113 + .val = USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN 114 + }, 115 + { 116 + .off = USB_PHY_UTMI_CTRL5, 117 + .val = 0x0 118 + }, 119 + { 120 + .off = USB_PHY_HS_PHY_CTRL2, 121 + .val = USB2_SUSPEND_N | USB2_UTMI_CLK_EN 122 + }, 123 + { 124 + .off = USB_PHY_CFG0, 125 + .val = 0x0 126 + }, 127 + }; 128 + 85 129 static struct m31_phy_regs m31_ipq5332_regs[] = { 86 130 { 87 131 USB_PHY_CFG0, ··· 285 241 qphy->clk = devm_clk_get(dev, NULL); 286 242 if (IS_ERR(qphy->clk)) 287 243 return dev_err_probe(dev, PTR_ERR(qphy->clk), 288 - "failed to get clk\n"); 244 + "failed to get clk\n"); 289 245 290 246 data = of_device_get_match_data(dev); 291 247 qphy->regs = data->regs; ··· 295 251 qphy->phy = devm_phy_create(dev, NULL, &m31usb_phy_gen_ops); 296 252 if (IS_ERR(qphy->phy)) 297 253 return dev_err_probe(dev, PTR_ERR(qphy->phy), 298 - "failed to create phy\n"); 254 + "failed to create phy\n"); 299 255 300 256 qphy->vreg = devm_regulator_get(dev, "vdda-phy"); 301 257 if (IS_ERR(qphy->vreg)) 302 - return dev_err_probe(dev, PTR_ERR(qphy->vreg), 303 - "failed to get vreg\n"); 258 + return dev_err_probe(dev, PTR_ERR(qphy->phy), 259 + "failed to get vreg\n"); 304 260 305 261 phy_set_drvdata(qphy->phy, qphy); 306 262 ··· 311 267 return PTR_ERR_OR_ZERO(phy_provider); 312 268 } 313 269 270 + static const struct m31_priv_data m31_ipq5018_data = { 271 + .ulpi_mode = false, 272 + .regs = m31_ipq5018_regs, 273 + .nregs = ARRAY_SIZE(m31_ipq5018_regs), 274 + }; 275 + 314 276 static const struct m31_priv_data m31_ipq5332_data = { 315 277 .ulpi_mode = false, 316 278 .regs = m31_ipq5332_regs, ··· 324 274 }; 325 275 326 276 static const struct of_device_id m31usb_phy_id_table[] = { 277 + { .compatible = "qcom,ipq5018-usb-hsphy", .data = &m31_ipq5018_data }, 327 278 { .compatible = "qcom,ipq5332-usb-hsphy", .data = &m31_ipq5332_data }, 328 279 { }, 329 280 };
+25 -25
drivers/phy/qualcomm/phy-qcom-qmp-combo.c
··· 194 194 }; 195 195 196 196 static const unsigned int qmp_v6_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { 197 - [QPHY_SW_RESET] = QPHY_V5_PCS_SW_RESET, 198 - [QPHY_START_CTRL] = QPHY_V5_PCS_START_CONTROL, 199 - [QPHY_PCS_STATUS] = QPHY_V5_PCS_PCS_STATUS1, 200 - [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V5_PCS_POWER_DOWN_CONTROL, 197 + [QPHY_SW_RESET] = QPHY_V6_PCS_SW_RESET, 198 + [QPHY_START_CTRL] = QPHY_V6_PCS_START_CONTROL, 199 + [QPHY_PCS_STATUS] = QPHY_V6_PCS_PCS_STATUS1, 200 + [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V6_PCS_POWER_DOWN_CONTROL, 201 201 202 202 /* In PCS_USB */ 203 - [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V5_PCS_USB3_AUTONOMOUS_MODE_CTRL, 204 - [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V5_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR, 203 + [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V6_PCS_USB3_AUTONOMOUS_MODE_CTRL, 204 + [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR, 205 205 206 206 [QPHY_COM_RESETSM_CNTRL] = QSERDES_V6_COM_RESETSM_CNTRL, 207 207 [QPHY_COM_C_READY_STATUS] = QSERDES_V6_COM_C_READY_STATUS, ··· 845 845 }; 846 846 847 847 static const struct qmp_phy_init_tbl sm8550_usb3_pcs_tbl[] = { 848 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG1, 0xc4), 849 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG2, 0x89), 850 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3, 0x20), 851 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6, 0x13), 852 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1, 0x21), 853 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_RX_SIGDET_LVL, 0x99), 854 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7), 855 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), 856 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_CDR_RESET_TIME, 0x0a), 857 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_ALIGN_DETECT_CONFIG1, 0x88), 858 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_ALIGN_DETECT_CONFIG2, 0x13), 859 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG, 0x0c), 860 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG1, 0x4b), 861 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_EQ_CONFIG5, 0x10), 848 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG1, 0xc4), 849 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG2, 0x89), 850 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG3, 0x20), 851 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG6, 0x13), 852 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_REFGEN_REQ_CONFIG1, 0x21), 853 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_RX_SIGDET_LVL, 0x99), 854 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7), 855 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), 856 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_CDR_RESET_TIME, 0x0a), 857 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG1, 0x88), 858 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG2, 0x13), 859 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_PCS_TX_RX_CONFIG, 0x0c), 860 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG1, 0x4b), 861 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG5, 0x10), 862 862 }; 863 863 864 864 static const struct qmp_phy_init_tbl sm8550_usb3_pcs_usb_tbl[] = { 865 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68), 866 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), 867 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), 868 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40), 869 - QMP_PHY_INIT_CFG(QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H, 0x00), 865 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), 866 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), 867 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L, 0x40), 868 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H, 0x00), 869 + QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_POWER_STATE_CONFIG1, 0x68), 870 870 }; 871 871 872 872 static const struct qmp_phy_init_tbl qmp_v4_dp_serdes_tbl[] = {
+37
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 2147 2147 QMP_PHY_INIT_CFG(QSERDES_V5_COM_CLK_SELECT, 0x34), 2148 2148 }; 2149 2149 2150 + static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl[] = { 2151 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_BG_TIMER, 0x02), 2152 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYS_CLK_CTRL, 0x07), 2153 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE0, 0x27), 2154 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE1, 0x0a), 2155 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE0, 0x17), 2156 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE1, 0x19), 2157 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE0, 0x00), 2158 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE1, 0x03), 2159 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYSCLK_EN_SEL, 0x00), 2160 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE0, 0xfb), 2161 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE0, 0x01), 2162 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE1, 0xfb), 2163 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE1, 0x01), 2164 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_CMN_MODE, 0x14), 2165 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE0, 0xff), 2166 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE0, 0x04), 2167 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE1, 0xff), 2168 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE1, 0x09), 2169 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE0, 0x19), 2170 + QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE1, 0x28), 2171 + }; 2172 + 2173 + static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl[] = { 2174 + QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_INSIG_MX_CTRL7, 0x00), 2175 + QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_INSIG_SW_CTRL7, 0x00), 2176 + }; 2177 + 2150 2178 struct qmp_pcie_offsets { 2151 2179 u16 serdes; 2152 2180 u16 pcs; ··· 3069 3041 .serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_rc_serdes_alt_tbl), 3070 3042 .pcs_misc = sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl, 3071 3043 .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl), 3044 + }, 3045 + 3046 + .tbls_ep = &(const struct qmp_phy_cfg_tbls) { 3047 + .serdes = sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl, 3048 + .serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl), 3049 + .pcs_misc = sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl, 3050 + .pcs_misc_num = ARRAY_SIZE(sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl), 3051 + .pcs = sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl, 3052 + .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl), 3072 3053 }, 3073 3054 3074 3055 .reset_list = sdm845_pciephy_reset_l,
+17
drivers/phy/qualcomm/phy-qcom-qmp-pcs-misc-v4.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (c) 2017, The Linux Foundation. All rights reserved. 4 + */ 5 + 6 + #ifndef QCOM_PHY_QMP_PCS_MISC_V4_H_ 7 + #define QCOM_PHY_QMP_PCS_MISC_V4_H_ 8 + 9 + /* Only for QMP V4 PHY - PCS_MISC registers */ 10 + #define QPHY_V4_PCS_MISC_TYPEC_CTRL 0x00 11 + #define QPHY_V4_PCS_MISC_TYPEC_PWRDN_CTRL 0x04 12 + #define QPHY_V4_PCS_MISC_PCS_MISC_CONFIG1 0x08 13 + #define QPHY_V4_PCS_MISC_CLAMP_ENABLE 0x0c 14 + #define QPHY_V4_PCS_MISC_TYPEC_STATUS 0x10 15 + #define QPHY_V4_PCS_MISC_PLACEHOLDER_STATUS 0x14 16 + 17 + #endif
+7 -22
drivers/phy/qualcomm/phy-qcom-qmp-pcs-usb-v6.h
··· 6 6 #ifndef QCOM_PHY_QMP_PCS_USB_V6_H_ 7 7 #define QCOM_PHY_QMP_PCS_USB_V6_H_ 8 8 9 - /* Only for QMP V6 PHY - USB3 have different offsets than V5 */ 10 - #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG1 0xc4 11 - #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG2 0xc8 12 - #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG3 0xcc 13 - #define QPHY_USB_V6_PCS_LOCK_DETECT_CONFIG6 0xd8 14 - #define QPHY_USB_V6_PCS_REFGEN_REQ_CONFIG1 0xdc 15 - #define QPHY_USB_V6_PCS_POWER_STATE_CONFIG1 0x90 16 - #define QPHY_USB_V6_PCS_RX_SIGDET_LVL 0x188 17 - #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190 18 - #define QPHY_USB_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194 19 - #define QPHY_USB_V6_PCS_CDR_RESET_TIME 0x1b0 20 - #define QPHY_USB_V6_PCS_ALIGN_DETECT_CONFIG1 0x1c0 21 - #define QPHY_USB_V6_PCS_ALIGN_DETECT_CONFIG2 0x1c4 22 - #define QPHY_USB_V6_PCS_PCS_TX_RX_CONFIG 0x1d0 23 - #define QPHY_USB_V6_PCS_EQ_CONFIG1 0x1dc 24 - #define QPHY_USB_V6_PCS_EQ_CONFIG5 0x1ec 25 - 26 - #define QPHY_USB_V6_PCS_USB3_POWER_STATE_CONFIG1 0x00 27 - #define QPHY_USB_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18 28 - #define QPHY_USB_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c 29 - #define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40 30 - #define QPHY_USB_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H 0x44 9 + #define QPHY_V6_PCS_USB3_POWER_STATE_CONFIG1 0x00 10 + #define QPHY_V6_PCS_USB3_AUTONOMOUS_MODE_CTRL 0x08 11 + #define QPHY_V6_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR 0x14 12 + #define QPHY_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18 13 + #define QPHY_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c 14 + #define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40 15 + #define QPHY_V6_PCS_USB3_RCVR_DTCT_DLY_U3_H 0x44 31 16 32 17 #endif
+2
drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h
··· 6 6 #ifndef QCOM_PHY_QMP_PCS_V5_20_H_ 7 7 #define QCOM_PHY_QMP_PCS_V5_20_H_ 8 8 9 + #define QPHY_V5_20_PCS_INSIG_SW_CTRL7 0x060 10 + #define QPHY_V5_20_PCS_INSIG_MX_CTRL7 0x07c 9 11 #define QPHY_V5_20_PCS_G3S2_PRE_GAIN 0x170 10 12 #define QPHY_V5_20_PCS_RX_SIGDET_LVL 0x188 11 13 #define QPHY_V5_20_PCS_EQ_CONFIG2 0x1d8
+18 -2
drivers/phy/qualcomm/phy-qcom-qmp-pcs-v6.h
··· 7 7 #define QCOM_PHY_QMP_PCS_V6_H_ 8 8 9 9 /* Only for QMP V6 PHY - USB/PCIe PCS registers */ 10 - #define QPHY_V6_PCS_REFGEN_REQ_CONFIG1 0xdc 10 + #define QPHY_V6_PCS_SW_RESET 0x000 11 + #define QPHY_V6_PCS_PCS_STATUS1 0x014 12 + #define QPHY_V6_PCS_POWER_DOWN_CONTROL 0x040 13 + #define QPHY_V6_PCS_START_CONTROL 0x044 14 + #define QPHY_V6_PCS_POWER_STATE_CONFIG1 0x090 15 + #define QPHY_V6_PCS_LOCK_DETECT_CONFIG1 0x0c4 16 + #define QPHY_V6_PCS_LOCK_DETECT_CONFIG2 0x0c8 17 + #define QPHY_V6_PCS_LOCK_DETECT_CONFIG3 0x0cc 18 + #define QPHY_V6_PCS_LOCK_DETECT_CONFIG6 0x0d8 19 + #define QPHY_V6_PCS_REFGEN_REQ_CONFIG1 0x0dc 11 20 #define QPHY_V6_PCS_RX_SIGDET_LVL 0x188 21 + #define QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_L 0x190 22 + #define QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_H 0x194 12 23 #define QPHY_V6_PCS_RATE_SLEW_CNTRL1 0x198 13 - #define QPHY_V6_PCS_EQ_CONFIG2 0x1e0 24 + #define QPHY_V6_PCS_CDR_RESET_TIME 0x1b0 25 + #define QPHY_V6_PCS_ALIGN_DETECT_CONFIG1 0x1c0 26 + #define QPHY_V6_PCS_ALIGN_DETECT_CONFIG2 0x1c4 14 27 #define QPHY_V6_PCS_PCS_TX_RX_CONFIG 0x1d0 28 + #define QPHY_V6_PCS_EQ_CONFIG1 0x1dc 29 + #define QPHY_V6_PCS_EQ_CONFIG2 0x1e0 30 + #define QPHY_V6_PCS_EQ_CONFIG5 0x1ec 15 31 16 32 #endif
+142
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 177 177 QMP_PHY_INIT_CFG(QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2, 0x0E), 178 178 }; 179 179 180 + static const struct qmp_phy_init_tbl sc7280_ufsphy_tx[] = { 181 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_PWM_GEAR_1_DIVIDER_BAND0_1, 0x06), 182 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_PWM_GEAR_2_DIVIDER_BAND0_1, 0x03), 183 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_PWM_GEAR_3_DIVIDER_BAND0_1, 0x01), 184 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_PWM_GEAR_4_DIVIDER_BAND0_1, 0x00), 185 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_LANE_MODE_1, 0x35), 186 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_TRAN_DRVR_EMP_EN, 0x0c), 187 + }; 188 + 189 + static const struct qmp_phy_init_tbl sc7280_ufsphy_rx[] = { 190 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_LVL, 0x24), 191 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_CNTRL, 0x0f), 192 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_DEGLITCH_CNTRL, 0x1e), 193 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_BAND, 0x18), 194 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FASTLOCK_FO_GAIN, 0x0a), 195 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x5a), 196 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CONTROLS, 0xf1), 197 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FASTLOCK_COUNT_LOW, 0x80), 198 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CTRL2, 0x80), 199 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0e), 200 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_GAIN, 0x04), 201 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_TERM_BW, 0x1b), 202 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2, 0x06), 203 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL3, 0x04), 204 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL4, 0x1d), 205 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_OFFSET_ADAPTOR_CNTRL2, 0x00), 206 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_MEASURE_TIME, 0x10), 207 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0xc0), 208 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x00), 209 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0x6d), 210 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0x6d), 211 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0xed), 212 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0x3b), 213 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x3c), 214 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0xe0), 215 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0xc8), 216 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xc8), 217 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH3, 0x3b), 218 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0xb1), 219 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_LOW, 0xe0), 220 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH, 0xc8), 221 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH2, 0xc8), 222 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH3, 0x3b), 223 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH4, 0xb1), 224 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_DCC_CTRL1, 0x0c), 225 + }; 226 + 227 + static const struct qmp_phy_init_tbl sc7280_ufsphy_pcs[] = { 228 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_SIGDET_CTRL2, 0x6d), 229 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0a), 230 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_SMALL_AMP_DRV_LVL, 0x02), 231 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_MID_TERM_CTRL1, 0x43), 232 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_DEBUG_BUS_CLKSEL, 0x1f), 233 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_MIN_HIBERN8_TIME, 0xff), 234 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_MULTI_LANE_CTRL1, 0x02), 235 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_PLL_CNTL, 0x03), 236 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TIMER_20US_CORECLK_STEPS_MSB, 0x16), 237 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TIMER_20US_CORECLK_STEPS_LSB, 0xd8), 238 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_PWM_GEAR_BAND, 0xaa), 239 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_HS_GEAR_BAND, 0x06), 240 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x03), 241 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x03), 242 + }; 243 + 244 + static const struct qmp_phy_init_tbl sc7280_ufsphy_hs_g4_rx[] = { 245 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_LVL, 0x24), 246 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_CNTRL, 0x0f), 247 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_DEGLITCH_CNTRL, 0x1e), 248 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_BAND, 0x18), 249 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FASTLOCK_FO_GAIN, 0x0a), 250 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x5a), 251 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CONTROLS, 0xf1), 252 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FASTLOCK_COUNT_LOW, 0x80), 253 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CTRL2, 0x81), 254 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0e), 255 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_GAIN, 0x04), 256 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_TERM_BW, 0x6f), 257 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL1, 0x04), 258 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2, 0x00), 259 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL3, 0x09), 260 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL4, 0x07), 261 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1, 0x17), 262 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_OFFSET_ADAPTOR_CNTRL2, 0x00), 263 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_MEASURE_TIME, 0x20), 264 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0x80), 265 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x01), 266 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0x3f), 267 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0xff), 268 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0xff), 269 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0x7f), 270 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x2c), 271 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0x6d), 272 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0x6d), 273 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xed), 274 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH3, 0x3b), 275 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0x3c), 276 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_LOW, 0xe0), 277 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH, 0xc8), 278 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH2, 0xc8), 279 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH3, 0x3b), 280 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH4, 0xb1), 281 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_DCC_CTRL1, 0x0c), 282 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_GM_CAL, 0x0f), 283 + }; 284 + 180 285 static const struct qmp_phy_init_tbl sm6115_ufsphy_serdes[] = { 181 286 QMP_PHY_INIT_CFG(QSERDES_COM_CMN_CONFIG, 0x0e), 182 287 QMP_PHY_INIT_CFG(QSERDES_COM_SYSCLK_EN_SEL, 0x14), ··· 991 886 .vreg_list = qmp_phy_vreg_l, 992 887 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 993 888 .regs = ufsphy_v5_regs_layout, 889 + }; 890 + 891 + static const struct qmp_phy_cfg sc7280_ufsphy_cfg = { 892 + .lanes = 2, 893 + 894 + .offsets = &qmp_ufs_offsets, 895 + 896 + .tbls = { 897 + .serdes = sm8150_ufsphy_serdes, 898 + .serdes_num = ARRAY_SIZE(sm8150_ufsphy_serdes), 899 + .tx = sc7280_ufsphy_tx, 900 + .tx_num = ARRAY_SIZE(sc7280_ufsphy_tx), 901 + .rx = sc7280_ufsphy_rx, 902 + .rx_num = ARRAY_SIZE(sc7280_ufsphy_rx), 903 + .pcs = sc7280_ufsphy_pcs, 904 + .pcs_num = ARRAY_SIZE(sc7280_ufsphy_pcs), 905 + }, 906 + .tbls_hs_b = { 907 + .serdes = sm8150_ufsphy_hs_b_serdes, 908 + .serdes_num = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes), 909 + }, 910 + .tbls_hs_g4 = { 911 + .tx = sm8250_ufsphy_hs_g4_tx, 912 + .tx_num = ARRAY_SIZE(sm8250_ufsphy_hs_g4_tx), 913 + .rx = sc7280_ufsphy_hs_g4_rx, 914 + .rx_num = ARRAY_SIZE(sc7280_ufsphy_hs_g4_rx), 915 + .pcs = sm8150_ufsphy_hs_g4_pcs, 916 + .pcs_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_pcs), 917 + }, 918 + .clk_list = sm8450_ufs_phy_clk_l, 919 + .num_clks = ARRAY_SIZE(sm8450_ufs_phy_clk_l), 920 + .vreg_list = qmp_phy_vreg_l, 921 + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 922 + .regs = ufsphy_v4_regs_layout, 994 923 }; 995 924 996 925 static const struct qmp_phy_cfg sc8280xp_ufsphy_cfg = { ··· 1787 1648 }, { 1788 1649 .compatible = "qcom,sa8775p-qmp-ufs-phy", 1789 1650 .data = &sa8775p_ufsphy_cfg, 1651 + }, { 1652 + .compatible = "qcom,sc7280-qmp-ufs-phy", 1653 + .data = &sc7280_ufsphy_cfg, 1790 1654 }, { 1791 1655 .compatible = "qcom,sc8180x-qmp-ufs-phy", 1792 1656 .data = &sm8150_ufsphy_cfg,
+106 -119
drivers/phy/qualcomm/phy-qcom-qmp-usb.c
··· 21 21 22 22 #include "phy-qcom-qmp.h" 23 23 #include "phy-qcom-qmp-pcs-misc-v3.h" 24 + #include "phy-qcom-qmp-pcs-misc-v4.h" 24 25 #include "phy-qcom-qmp-pcs-usb-v4.h" 25 26 #include "phy-qcom-qmp-pcs-usb-v5.h" 26 27 ··· 95 94 QPHY_PCS_AUTONOMOUS_MODE_CTRL, 96 95 QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR, 97 96 QPHY_PCS_POWER_DOWN_CONTROL, 97 + QPHY_PCS_MISC_CLAMP_ENABLE, 98 98 /* Keep last to ensure regs_layout arrays are properly initialized */ 99 99 QPHY_LAYOUT_SIZE 100 100 }; ··· 116 114 [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V3_PCS_AUTONOMOUS_MODE_CTRL, 117 115 [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V3_PCS_LFPS_RXTERM_IRQ_CLEAR, 118 116 [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V3_PCS_POWER_DOWN_CONTROL, 117 + [QPHY_PCS_MISC_CLAMP_ENABLE] = QPHY_V3_PCS_MISC_CLAMP_ENABLE, 118 + }; 119 + 120 + static const unsigned int qmp_v3_usb3phy_regs_layout_qcm2290[QPHY_LAYOUT_SIZE] = { 121 + [QPHY_SW_RESET] = QPHY_V3_PCS_SW_RESET, 122 + [QPHY_START_CTRL] = QPHY_V3_PCS_START_CONTROL, 123 + [QPHY_PCS_STATUS] = QPHY_V3_PCS_PCS_STATUS, 124 + [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V3_PCS_AUTONOMOUS_MODE_CTRL, 125 + [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V3_PCS_LFPS_RXTERM_IRQ_CLEAR, 126 + [QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V3_PCS_POWER_DOWN_CONTROL, 119 127 }; 120 128 121 129 static const unsigned int qmp_v4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { ··· 137 125 /* In PCS_USB */ 138 126 [QPHY_PCS_AUTONOMOUS_MODE_CTRL] = QPHY_V4_PCS_USB3_AUTONOMOUS_MODE_CTRL, 139 127 [QPHY_PCS_LFPS_RXTERM_IRQ_CLEAR] = QPHY_V4_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR, 128 + [QPHY_PCS_MISC_CLAMP_ENABLE] = QPHY_V4_PCS_MISC_CLAMP_ENABLE, 140 129 }; 141 130 142 131 static const unsigned int qmp_v5_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = { ··· 1191 1178 const struct qmp_phy_init_tbl *pcs_usb_tbl; 1192 1179 int pcs_usb_tbl_num; 1193 1180 1194 - /* clock ids to be requested */ 1195 - const char * const *clk_list; 1196 - int num_clks; 1197 - /* resets to be requested */ 1198 - const char * const *reset_list; 1199 - int num_resets; 1200 1181 /* regulators to be requested */ 1201 1182 const char * const *vreg_list; 1202 1183 int num_vregs; ··· 1221 1214 1222 1215 struct clk *pipe_clk; 1223 1216 struct clk_bulk_data *clks; 1217 + int num_clks; 1218 + int num_resets; 1224 1219 struct reset_control_bulk_data *resets; 1225 1220 struct regulator_bulk_data *vregs; 1226 1221 ··· 1258 1249 } 1259 1250 1260 1251 /* list of clocks required by phy */ 1261 - static const char * const msm8996_phy_clk_l[] = { 1262 - "aux", "cfg_ahb", "ref", 1263 - }; 1264 - 1265 - static const char * const qmp_v3_phy_clk_l[] = { 1252 + static const char * const qmp_usb_phy_clk_l[] = { 1266 1253 "aux", "cfg_ahb", "ref", "com_aux", 1267 1254 }; 1268 1255 1269 - static const char * const qmp_v4_phy_clk_l[] = { 1270 - "aux", "ref", "com_aux", 1271 - }; 1272 - 1273 - static const char * const qmp_v4_ref_phy_clk_l[] = { 1274 - "aux", "ref_clk_src", "ref", "com_aux", 1275 - }; 1276 - 1277 - /* usb3 phy on sdx55 doesn't have com_aux clock */ 1278 - static const char * const qmp_v4_sdx55_usbphy_clk_l[] = { 1279 - "aux", "cfg_ahb", "ref" 1280 - }; 1281 - 1282 - static const char * const qcm2290_usb3phy_clk_l[] = { 1283 - "cfg_ahb", "ref", "com_aux", 1284 - }; 1285 - 1286 1256 /* list of resets */ 1287 - static const char * const msm8996_usb3phy_reset_l[] = { 1257 + static const char * const usb3phy_legacy_reset_l[] = { 1288 1258 "phy", "common", 1289 1259 }; 1290 1260 1291 - static const char * const qcm2290_usb3phy_reset_l[] = { 1261 + static const char * const usb3phy_reset_l[] = { 1292 1262 "phy_phy", "phy", 1293 1263 }; 1294 1264 ··· 1286 1298 1287 1299 static const struct qmp_usb_offsets qmp_usb_offsets_v3 = { 1288 1300 .serdes = 0, 1301 + .pcs = 0x600, 1302 + .tx = 0x200, 1303 + .rx = 0x400, 1304 + }; 1305 + 1306 + static const struct qmp_usb_offsets qmp_usb_offsets_v3_qcm2290 = { 1307 + .serdes = 0x0, 1289 1308 .pcs = 0xc00, 1290 1309 .pcs_misc = 0xa00, 1291 1310 .tx = 0x200, 1292 1311 .rx = 0x400, 1293 1312 .tx2 = 0x600, 1294 1313 .rx2 = 0x800, 1314 + }; 1315 + 1316 + static const struct qmp_usb_offsets qmp_usb_offsets_v4 = { 1317 + .serdes = 0, 1318 + .pcs = 0x0800, 1319 + .pcs_usb = 0x0e00, 1320 + .tx = 0x0200, 1321 + .rx = 0x0400, 1295 1322 }; 1296 1323 1297 1324 static const struct qmp_usb_offsets qmp_usb_offsets_v5 = { ··· 1320 1317 static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { 1321 1318 .lanes = 1, 1322 1319 1320 + .offsets = &qmp_usb_offsets_v3, 1321 + 1323 1322 .serdes_tbl = ipq8074_usb3_serdes_tbl, 1324 1323 .serdes_tbl_num = ARRAY_SIZE(ipq8074_usb3_serdes_tbl), 1325 1324 .tx_tbl = msm8996_usb3_tx_tbl, ··· 1330 1325 .rx_tbl_num = ARRAY_SIZE(ipq8074_usb3_rx_tbl), 1331 1326 .pcs_tbl = ipq8074_usb3_pcs_tbl, 1332 1327 .pcs_tbl_num = ARRAY_SIZE(ipq8074_usb3_pcs_tbl), 1333 - .clk_list = msm8996_phy_clk_l, 1334 - .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), 1335 - .reset_list = msm8996_usb3phy_reset_l, 1336 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1337 1328 .vreg_list = qmp_phy_vreg_l, 1338 1329 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1339 1330 .regs = qmp_v3_usb3phy_regs_layout, ··· 1348 1347 .rx_tbl_num = ARRAY_SIZE(ipq9574_usb3_rx_tbl), 1349 1348 .pcs_tbl = ipq9574_usb3_pcs_tbl, 1350 1349 .pcs_tbl_num = ARRAY_SIZE(ipq9574_usb3_pcs_tbl), 1351 - .clk_list = msm8996_phy_clk_l, 1352 - .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), 1353 - .reset_list = qcm2290_usb3phy_reset_l, 1354 - .num_resets = ARRAY_SIZE(qcm2290_usb3phy_reset_l), 1355 1350 .vreg_list = qmp_phy_vreg_l, 1356 1351 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1357 1352 .regs = qmp_v3_usb3phy_regs_layout, ··· 1355 1358 1356 1359 static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { 1357 1360 .lanes = 1, 1361 + 1362 + .offsets = &qmp_usb_offsets_v3, 1358 1363 1359 1364 .serdes_tbl = msm8996_usb3_serdes_tbl, 1360 1365 .serdes_tbl_num = ARRAY_SIZE(msm8996_usb3_serdes_tbl), ··· 1366 1367 .rx_tbl_num = ARRAY_SIZE(msm8996_usb3_rx_tbl), 1367 1368 .pcs_tbl = msm8996_usb3_pcs_tbl, 1368 1369 .pcs_tbl_num = ARRAY_SIZE(msm8996_usb3_pcs_tbl), 1369 - .clk_list = msm8996_phy_clk_l, 1370 - .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), 1371 - .reset_list = msm8996_usb3phy_reset_l, 1372 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1373 1370 .vreg_list = qmp_phy_vreg_l, 1374 1371 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1375 1372 .regs = qmp_v2_usb3phy_regs_layout, ··· 1386 1391 .pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl), 1387 1392 .pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl, 1388 1393 .pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl), 1389 - .clk_list = qmp_v4_phy_clk_l, 1390 - .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), 1391 - .reset_list = qcm2290_usb3phy_reset_l, 1392 - .num_resets = ARRAY_SIZE(qcm2290_usb3phy_reset_l), 1393 1394 .vreg_list = qmp_phy_vreg_l, 1394 1395 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1395 1396 .regs = qmp_v5_usb3phy_regs_layout, ··· 1406 1415 .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl), 1407 1416 .pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl, 1408 1417 .pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl), 1409 - .clk_list = qmp_v4_phy_clk_l, 1410 - .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), 1411 - .reset_list = qcm2290_usb3phy_reset_l, 1412 - .num_resets = ARRAY_SIZE(qcm2290_usb3phy_reset_l), 1413 1418 .vreg_list = qmp_phy_vreg_l, 1414 1419 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1415 1420 .regs = qmp_v5_usb3phy_regs_layout, ··· 1413 1426 1414 1427 static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { 1415 1428 .lanes = 1, 1429 + 1430 + .offsets = &qmp_usb_offsets_v3, 1416 1431 1417 1432 .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl, 1418 1433 .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_uniphy_serdes_tbl), ··· 1424 1435 .rx_tbl_num = ARRAY_SIZE(qmp_v3_usb3_uniphy_rx_tbl), 1425 1436 .pcs_tbl = qmp_v3_usb3_uniphy_pcs_tbl, 1426 1437 .pcs_tbl_num = ARRAY_SIZE(qmp_v3_usb3_uniphy_pcs_tbl), 1427 - .clk_list = qmp_v3_phy_clk_l, 1428 - .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), 1429 - .reset_list = msm8996_usb3phy_reset_l, 1430 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1431 1438 .vreg_list = qmp_phy_vreg_l, 1432 1439 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1433 1440 .regs = qmp_v3_usb3phy_regs_layout, ··· 1434 1449 static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { 1435 1450 .lanes = 2, 1436 1451 1452 + .offsets = &qmp_usb_offsets_v3_qcm2290, 1453 + 1437 1454 .serdes_tbl = msm8998_usb3_serdes_tbl, 1438 1455 .serdes_tbl_num = ARRAY_SIZE(msm8998_usb3_serdes_tbl), 1439 1456 .tx_tbl = msm8998_usb3_tx_tbl, ··· 1444 1457 .rx_tbl_num = ARRAY_SIZE(msm8998_usb3_rx_tbl), 1445 1458 .pcs_tbl = msm8998_usb3_pcs_tbl, 1446 1459 .pcs_tbl_num = ARRAY_SIZE(msm8998_usb3_pcs_tbl), 1447 - .clk_list = msm8996_phy_clk_l, 1448 - .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), 1449 - .reset_list = msm8996_usb3phy_reset_l, 1450 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1451 1460 .vreg_list = qmp_phy_vreg_l, 1452 1461 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1453 1462 .regs = qmp_v3_usb3phy_regs_layout, ··· 1451 1468 1452 1469 static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { 1453 1470 .lanes = 1, 1471 + 1472 + .offsets = &qmp_usb_offsets_v4, 1454 1473 1455 1474 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1456 1475 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), ··· 1464 1479 .pcs_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_pcs_tbl), 1465 1480 .pcs_usb_tbl = sm8150_usb3_uniphy_pcs_usb_tbl, 1466 1481 .pcs_usb_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_pcs_usb_tbl), 1467 - .clk_list = qmp_v4_ref_phy_clk_l, 1468 - .num_clks = ARRAY_SIZE(qmp_v4_ref_phy_clk_l), 1469 - .reset_list = msm8996_usb3phy_reset_l, 1470 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1471 1482 .vreg_list = qmp_phy_vreg_l, 1472 1483 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1473 1484 .regs = qmp_v4_usb3phy_regs_layout, ··· 1475 1494 static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { 1476 1495 .lanes = 1, 1477 1496 1497 + .offsets = &qmp_usb_offsets_v4, 1498 + 1478 1499 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1479 1500 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1480 1501 .tx_tbl = sm8250_usb3_uniphy_tx_tbl, ··· 1487 1504 .pcs_tbl_num = ARRAY_SIZE(sm8250_usb3_uniphy_pcs_tbl), 1488 1505 .pcs_usb_tbl = sm8250_usb3_uniphy_pcs_usb_tbl, 1489 1506 .pcs_usb_tbl_num = ARRAY_SIZE(sm8250_usb3_uniphy_pcs_usb_tbl), 1490 - .clk_list = qmp_v4_ref_phy_clk_l, 1491 - .num_clks = ARRAY_SIZE(qmp_v4_ref_phy_clk_l), 1492 - .reset_list = msm8996_usb3phy_reset_l, 1493 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1494 1507 .vreg_list = qmp_phy_vreg_l, 1495 1508 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1496 1509 .regs = qmp_v4_usb3phy_regs_layout, ··· 1498 1519 static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { 1499 1520 .lanes = 1, 1500 1521 1522 + .offsets = &qmp_usb_offsets_v4, 1523 + 1501 1524 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1502 1525 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1503 1526 .tx_tbl = sdx55_usb3_uniphy_tx_tbl, ··· 1510 1529 .pcs_tbl_num = ARRAY_SIZE(sm8250_usb3_uniphy_pcs_tbl), 1511 1530 .pcs_usb_tbl = sm8250_usb3_uniphy_pcs_usb_tbl, 1512 1531 .pcs_usb_tbl_num = ARRAY_SIZE(sm8250_usb3_uniphy_pcs_usb_tbl), 1513 - .clk_list = qmp_v4_sdx55_usbphy_clk_l, 1514 - .num_clks = ARRAY_SIZE(qmp_v4_sdx55_usbphy_clk_l), 1515 - .reset_list = msm8996_usb3phy_reset_l, 1516 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1517 1532 .vreg_list = qmp_phy_vreg_l, 1518 1533 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1519 1534 .regs = qmp_v4_usb3phy_regs_layout, ··· 1521 1544 static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { 1522 1545 .lanes = 1, 1523 1546 1547 + .offsets = &qmp_usb_offsets_v5, 1548 + 1524 1549 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1525 1550 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1526 1551 .tx_tbl = sdx65_usb3_uniphy_tx_tbl, ··· 1533 1554 .pcs_tbl_num = ARRAY_SIZE(sm8350_usb3_uniphy_pcs_tbl), 1534 1555 .pcs_usb_tbl = sm8350_usb3_uniphy_pcs_usb_tbl, 1535 1556 .pcs_usb_tbl_num = ARRAY_SIZE(sm8350_usb3_uniphy_pcs_usb_tbl), 1536 - .clk_list = qmp_v4_sdx55_usbphy_clk_l, 1537 - .num_clks = ARRAY_SIZE(qmp_v4_sdx55_usbphy_clk_l), 1538 - .reset_list = msm8996_usb3phy_reset_l, 1539 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1540 1557 .vreg_list = qmp_phy_vreg_l, 1541 1558 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1542 1559 .regs = qmp_v5_usb3phy_regs_layout, ··· 1544 1569 static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { 1545 1570 .lanes = 1, 1546 1571 1572 + .offsets = &qmp_usb_offsets_v5, 1573 + 1547 1574 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1548 1575 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1549 1576 .tx_tbl = sm8350_usb3_uniphy_tx_tbl, ··· 1556 1579 .pcs_tbl_num = ARRAY_SIZE(sm8350_usb3_uniphy_pcs_tbl), 1557 1580 .pcs_usb_tbl = sm8350_usb3_uniphy_pcs_usb_tbl, 1558 1581 .pcs_usb_tbl_num = ARRAY_SIZE(sm8350_usb3_uniphy_pcs_usb_tbl), 1559 - .clk_list = qmp_v4_ref_phy_clk_l, 1560 - .num_clks = ARRAY_SIZE(qmp_v4_ref_phy_clk_l), 1561 - .reset_list = msm8996_usb3phy_reset_l, 1562 - .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), 1563 1582 .vreg_list = qmp_phy_vreg_l, 1564 1583 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1565 1584 .regs = qmp_v5_usb3phy_regs_layout, ··· 1567 1594 static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { 1568 1595 .lanes = 2, 1569 1596 1570 - .offsets = &qmp_usb_offsets_v3, 1597 + .offsets = &qmp_usb_offsets_v3_qcm2290, 1571 1598 1572 1599 .serdes_tbl = qcm2290_usb3_serdes_tbl, 1573 1600 .serdes_tbl_num = ARRAY_SIZE(qcm2290_usb3_serdes_tbl), ··· 1577 1604 .rx_tbl_num = ARRAY_SIZE(qcm2290_usb3_rx_tbl), 1578 1605 .pcs_tbl = qcm2290_usb3_pcs_tbl, 1579 1606 .pcs_tbl_num = ARRAY_SIZE(qcm2290_usb3_pcs_tbl), 1580 - .clk_list = qcm2290_usb3phy_clk_l, 1581 - .num_clks = ARRAY_SIZE(qcm2290_usb3phy_clk_l), 1582 - .reset_list = qcm2290_usb3phy_reset_l, 1583 - .num_resets = ARRAY_SIZE(qcm2290_usb3phy_reset_l), 1584 1607 .vreg_list = qmp_phy_vreg_l, 1585 1608 .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 1586 - .regs = qmp_v3_usb3phy_regs_layout, 1609 + .regs = qmp_v3_usb3phy_regs_layout_qcm2290, 1587 1610 }; 1588 1611 1589 1612 static void qmp_usb_configure_lane(void __iomem *base, ··· 1633 1664 return ret; 1634 1665 } 1635 1666 1636 - ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); 1667 + ret = reset_control_bulk_assert(qmp->num_resets, qmp->resets); 1637 1668 if (ret) { 1638 1669 dev_err(qmp->dev, "reset assert failed\n"); 1639 1670 goto err_disable_regulators; 1640 1671 } 1641 1672 1642 - ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); 1673 + ret = reset_control_bulk_deassert(qmp->num_resets, qmp->resets); 1643 1674 if (ret) { 1644 1675 dev_err(qmp->dev, "reset deassert failed\n"); 1645 1676 goto err_disable_regulators; 1646 1677 } 1647 1678 1648 - ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); 1679 + ret = clk_bulk_prepare_enable(qmp->num_clks, qmp->clks); 1649 1680 if (ret) 1650 1681 goto err_assert_reset; 1651 1682 ··· 1654 1685 return 0; 1655 1686 1656 1687 err_assert_reset: 1657 - reset_control_bulk_assert(cfg->num_resets, qmp->resets); 1688 + reset_control_bulk_assert(qmp->num_resets, qmp->resets); 1658 1689 err_disable_regulators: 1659 1690 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 1660 1691 ··· 1666 1697 struct qmp_usb *qmp = phy_get_drvdata(phy); 1667 1698 const struct qmp_phy_cfg *cfg = qmp->cfg; 1668 1699 1669 - reset_control_bulk_assert(cfg->num_resets, qmp->resets); 1700 + reset_control_bulk_assert(qmp->num_resets, qmp->resets); 1670 1701 1671 - clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); 1702 + clk_bulk_disable_unprepare(qmp->num_clks, qmp->clks); 1672 1703 1673 1704 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 1674 1705 ··· 1821 1852 qphy_setbits(pcs_usb, cfg->regs[QPHY_PCS_AUTONOMOUS_MODE_CTRL], intr_mask); 1822 1853 1823 1854 /* Enable i/o clamp_n for autonomous mode */ 1824 - if (pcs_misc) 1825 - qphy_clrbits(pcs_misc, QPHY_V3_PCS_MISC_CLAMP_ENABLE, CLAMP_EN); 1855 + if (pcs_misc && cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE]) 1856 + qphy_clrbits(pcs_misc, cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE], CLAMP_EN); 1826 1857 } 1827 1858 1828 1859 static void qmp_usb_disable_autonomous_mode(struct qmp_usb *qmp) ··· 1832 1863 void __iomem *pcs_misc = qmp->pcs_misc; 1833 1864 1834 1865 /* Disable i/o clamp_n on resume for normal mode */ 1835 - if (pcs_misc) 1836 - qphy_setbits(pcs_misc, QPHY_V3_PCS_MISC_CLAMP_ENABLE, CLAMP_EN); 1866 + if (pcs_misc && cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE]) 1867 + qphy_setbits(pcs_misc, cfg->regs[QPHY_PCS_MISC_CLAMP_ENABLE], CLAMP_EN); 1837 1868 1838 1869 qphy_clrbits(pcs_usb, cfg->regs[QPHY_PCS_AUTONOMOUS_MODE_CTRL], 1839 1870 ARCVR_DTCT_EN | ARCVR_DTCT_EVENT_SEL | ALFPS_DTCT_EN); ··· 1846 1877 static int __maybe_unused qmp_usb_runtime_suspend(struct device *dev) 1847 1878 { 1848 1879 struct qmp_usb *qmp = dev_get_drvdata(dev); 1849 - const struct qmp_phy_cfg *cfg = qmp->cfg; 1850 1880 1851 1881 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode); 1852 1882 ··· 1857 1889 qmp_usb_enable_autonomous_mode(qmp); 1858 1890 1859 1891 clk_disable_unprepare(qmp->pipe_clk); 1860 - clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); 1892 + clk_bulk_disable_unprepare(qmp->num_clks, qmp->clks); 1861 1893 1862 1894 return 0; 1863 1895 } ··· 1865 1897 static int __maybe_unused qmp_usb_runtime_resume(struct device *dev) 1866 1898 { 1867 1899 struct qmp_usb *qmp = dev_get_drvdata(dev); 1868 - const struct qmp_phy_cfg *cfg = qmp->cfg; 1869 1900 int ret = 0; 1870 1901 1871 1902 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode); ··· 1874 1907 return 0; 1875 1908 } 1876 1909 1877 - ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); 1910 + ret = clk_bulk_prepare_enable(qmp->num_clks, qmp->clks); 1878 1911 if (ret) 1879 1912 return ret; 1880 1913 1881 1914 ret = clk_prepare_enable(qmp->pipe_clk); 1882 1915 if (ret) { 1883 1916 dev_err(dev, "pipe_clk enable failed, err=%d\n", ret); 1884 - clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); 1917 + clk_bulk_disable_unprepare(qmp->num_clks, qmp->clks); 1885 1918 return ret; 1886 1919 } 1887 1920 ··· 1912 1945 return devm_regulator_bulk_get(dev, num, qmp->vregs); 1913 1946 } 1914 1947 1915 - static int qmp_usb_reset_init(struct qmp_usb *qmp) 1948 + static int qmp_usb_reset_init(struct qmp_usb *qmp, 1949 + const char *const *reset_list, 1950 + int num_resets) 1916 1951 { 1917 - const struct qmp_phy_cfg *cfg = qmp->cfg; 1918 1952 struct device *dev = qmp->dev; 1919 1953 int i; 1920 1954 int ret; 1921 1955 1922 - qmp->resets = devm_kcalloc(dev, cfg->num_resets, 1956 + qmp->resets = devm_kcalloc(dev, num_resets, 1923 1957 sizeof(*qmp->resets), GFP_KERNEL); 1924 1958 if (!qmp->resets) 1925 1959 return -ENOMEM; 1926 1960 1927 - for (i = 0; i < cfg->num_resets; i++) 1928 - qmp->resets[i].id = cfg->reset_list[i]; 1961 + for (i = 0; i < num_resets; i++) 1962 + qmp->resets[i].id = reset_list[i]; 1929 1963 1930 - ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets); 1964 + qmp->num_resets = num_resets; 1965 + 1966 + ret = devm_reset_control_bulk_get_exclusive(dev, num_resets, qmp->resets); 1931 1967 if (ret) 1932 1968 return dev_err_probe(dev, ret, "failed to get resets\n"); 1933 1969 ··· 1939 1969 1940 1970 static int qmp_usb_clk_init(struct qmp_usb *qmp) 1941 1971 { 1942 - const struct qmp_phy_cfg *cfg = qmp->cfg; 1943 1972 struct device *dev = qmp->dev; 1944 - int num = cfg->num_clks; 1973 + int num = ARRAY_SIZE(qmp_usb_phy_clk_l); 1945 1974 int i; 1946 1975 1947 1976 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); ··· 1948 1979 return -ENOMEM; 1949 1980 1950 1981 for (i = 0; i < num; i++) 1951 - qmp->clks[i].id = cfg->clk_list[i]; 1982 + qmp->clks[i].id = qmp_usb_phy_clk_l[i]; 1952 1983 1953 - return devm_clk_bulk_get(dev, num, qmp->clks); 1984 + qmp->num_clks = num; 1985 + 1986 + return devm_clk_bulk_get_optional(dev, num, qmp->clks); 1954 1987 } 1955 1988 1956 1989 static void phy_clk_release_provider(void *res) ··· 2032 2061 const struct qmp_phy_cfg *cfg = qmp->cfg; 2033 2062 struct device *dev = qmp->dev; 2034 2063 bool exclusive = true; 2064 + int ret; 2035 2065 2036 2066 qmp->serdes = devm_platform_ioremap_resource(pdev, 0); 2037 2067 if (IS_ERR(qmp->serdes)) ··· 2093 2121 "failed to get pipe clock\n"); 2094 2122 } 2095 2123 2124 + ret = devm_clk_bulk_get_all(qmp->dev, &qmp->clks); 2125 + if (ret < 0) 2126 + return ret; 2127 + 2128 + qmp->num_clks = ret; 2129 + 2130 + ret = qmp_usb_reset_init(qmp, usb3phy_legacy_reset_l, 2131 + ARRAY_SIZE(usb3phy_legacy_reset_l)); 2132 + if (ret) 2133 + return ret; 2134 + 2096 2135 return 0; 2097 2136 } 2098 2137 ··· 2114 2131 const struct qmp_usb_offsets *offs = cfg->offsets; 2115 2132 struct device *dev = qmp->dev; 2116 2133 void __iomem *base; 2134 + int ret; 2117 2135 2118 2136 if (!offs) 2119 2137 return -EINVAL; ··· 2125 2141 2126 2142 qmp->serdes = base + offs->serdes; 2127 2143 qmp->pcs = base + offs->pcs; 2128 - qmp->pcs_misc = base + offs->pcs_misc; 2129 - qmp->pcs_usb = base + offs->pcs_usb; 2144 + if (offs->pcs_usb) 2145 + qmp->pcs_usb = base + offs->pcs_usb; 2146 + if (offs->pcs_misc) 2147 + qmp->pcs_misc = base + offs->pcs_misc; 2130 2148 qmp->tx = base + offs->tx; 2131 2149 qmp->rx = base + offs->rx; 2132 2150 ··· 2137 2151 qmp->rx2 = base + offs->rx2; 2138 2152 } 2139 2153 2154 + ret = qmp_usb_clk_init(qmp); 2155 + if (ret) 2156 + return ret; 2157 + 2140 2158 qmp->pipe_clk = devm_clk_get(dev, "pipe"); 2141 2159 if (IS_ERR(qmp->pipe_clk)) { 2142 2160 return dev_err_probe(dev, PTR_ERR(qmp->pipe_clk), 2143 2161 "failed to get pipe clock\n"); 2144 2162 } 2163 + 2164 + ret = qmp_usb_reset_init(qmp, usb3phy_reset_l, 2165 + ARRAY_SIZE(usb3phy_reset_l)); 2166 + if (ret) 2167 + return ret; 2145 2168 2146 2169 return 0; 2147 2170 } ··· 2172 2177 qmp->cfg = of_device_get_match_data(dev); 2173 2178 if (!qmp->cfg) 2174 2179 return -EINVAL; 2175 - 2176 - ret = qmp_usb_clk_init(qmp); 2177 - if (ret) 2178 - return ret; 2179 - 2180 - ret = qmp_usb_reset_init(qmp); 2181 - if (ret) 2182 - return ret; 2183 2180 2184 2181 ret = qmp_usb_vreg_init(qmp); 2185 2182 if (ret)
-8
drivers/phy/qualcomm/phy-qcom-qmp.h
··· 126 126 #define QSERDES_V4_DP_PHY_AUX_INTERRUPT_STATUS 0x0d8 127 127 #define QSERDES_V4_DP_PHY_STATUS 0x0dc 128 128 129 - /* Only for QMP V4 PHY - PCS_MISC registers */ 130 - #define QPHY_V4_PCS_MISC_TYPEC_CTRL 0x00 131 - #define QPHY_V4_PCS_MISC_TYPEC_PWRDN_CTRL 0x04 132 - #define QPHY_V4_PCS_MISC_PCS_MISC_CONFIG1 0x08 133 - #define QPHY_V4_PCS_MISC_CLAMP_ENABLE 0x0c 134 - #define QPHY_V4_PCS_MISC_TYPEC_STATUS 0x10 135 - #define QPHY_V4_PCS_MISC_PLACEHOLDER_STATUS 0x14 136 - 137 129 #define QSERDES_V5_DP_PHY_STATUS 0x0dc 138 130 139 131 /* Only for QMP V6 PHY - DP PHY registers */
+1 -1
drivers/phy/realtek/phy-rtk-usb2.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/of_address.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/uaccess.h> 14 14 #include <linux/debugfs.h> 15 15 #include <linux/nvmem-consumer.h>
+1 -1
drivers/phy/realtek/phy-rtk-usb3.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/of_address.h> 12 + #include <linux/platform_device.h> 13 13 #include <linux/uaccess.h> 14 14 #include <linux/debugfs.h> 15 15 #include <linux/nvmem-consumer.h>
+14 -2
drivers/phy/renesas/r8a779f0-ether-serdes.c
··· 214 214 if (dd->initialized) 215 215 return 0; 216 216 217 + reset_control_reset(dd->reset); 218 + 219 + usleep_range(1000, 2000); 220 + 217 221 ret = r8a779f0_eth_serdes_common_init_ram(dd); 218 222 if (ret) 219 223 return ret; ··· 259 255 channel->dd->initialized = true; 260 256 261 257 return ret; 258 + } 259 + 260 + static int r8a779f0_eth_serdes_exit(struct phy *p) 261 + { 262 + struct r8a779f0_eth_serdes_channel *channel = phy_get_drvdata(p); 263 + 264 + channel->dd->initialized = false; 265 + 266 + return 0; 262 267 } 263 268 264 269 static int r8a779f0_eth_serdes_hw_init_late(struct r8a779f0_eth_serdes_channel ··· 327 314 328 315 static const struct phy_ops r8a779f0_eth_serdes_ops = { 329 316 .init = r8a779f0_eth_serdes_init, 317 + .exit = r8a779f0_eth_serdes_exit, 330 318 .power_on = r8a779f0_eth_serdes_power_on, 331 319 .set_mode = r8a779f0_eth_serdes_set_mode, 332 320 .set_speed = r8a779f0_eth_serdes_set_speed, ··· 369 355 dd->reset = devm_reset_control_get(&pdev->dev, NULL); 370 356 if (IS_ERR(dd->reset)) 371 357 return PTR_ERR(dd->reset); 372 - 373 - reset_control_reset(dd->reset); 374 358 375 359 for (i = 0; i < R8A779F0_ETH_SERDES_NUM; i++) { 376 360 struct r8a779f0_eth_serdes_channel *channel = &dd->channel[i];
-2
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/mutex.h> 19 19 #include <linux/of.h> 20 - #include <linux/of_address.h> 21 20 #include <linux/of_irq.h> 22 - #include <linux/of_platform.h> 23 21 #include <linux/phy/phy.h> 24 22 #include <linux/platform_device.h> 25 23 #include <linux/power_supply.h>
+4 -7
drivers/phy/rockchip/phy-rockchip-pcie.c
··· 12 12 #include <linux/mfd/syscon.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 - #include <linux/of_address.h> 16 - #include <linux/of_platform.h> 17 15 #include <linux/phy/phy.h> 18 16 #include <linux/platform_device.h> 17 + #include <linux/property.h> 19 18 #include <linux/regmap.h> 20 19 #include <linux/reset.h> 21 20 ··· 62 63 }; 63 64 64 65 struct rockchip_pcie_phy { 65 - struct rockchip_pcie_data *phy_data; 66 + const struct rockchip_pcie_data *phy_data; 66 67 struct regmap *reg_base; 67 68 struct phy_pcie_instance { 68 69 struct phy *phy; ··· 349 350 struct rockchip_pcie_phy *rk_phy; 350 351 struct phy_provider *phy_provider; 351 352 struct regmap *grf; 352 - const struct of_device_id *of_id; 353 353 int i; 354 354 u32 phy_num; 355 355 ··· 362 364 if (!rk_phy) 363 365 return -ENOMEM; 364 366 365 - of_id = of_match_device(rockchip_pcie_phy_dt_ids, &pdev->dev); 366 - if (!of_id) 367 + rk_phy->phy_data = device_get_match_data(&pdev->dev); 368 + if (!rk_phy->phy_data) 367 369 return -EINVAL; 368 370 369 - rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data; 370 371 rk_phy->reg_base = grf; 371 372 372 373 mutex_init(&rk_phy->pcie_mutex);
+3 -7
drivers/phy/rockchip/phy-rockchip-usb.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/mutex.h> 15 15 #include <linux/of.h> 16 - #include <linux/of_address.h> 17 - #include <linux/of_platform.h> 18 16 #include <linux/phy/phy.h> 19 17 #include <linux/platform_device.h> 18 + #include <linux/property.h> 20 19 #include <linux/regulator/consumer.h> 21 20 #include <linux/reset.h> 22 21 #include <linux/regmap.h> ··· 457 458 struct device *dev = &pdev->dev; 458 459 struct rockchip_usb_phy_base *phy_base; 459 460 struct phy_provider *phy_provider; 460 - const struct of_device_id *match; 461 461 struct device_node *child; 462 462 int err; 463 463 ··· 464 466 if (!phy_base) 465 467 return -ENOMEM; 466 468 467 - match = of_match_device(dev->driver->of_match_table, dev); 468 - if (!match || !match->data) { 469 + phy_base->pdata = device_get_match_data(dev); 470 + if (!phy_base->pdata) { 469 471 dev_err(dev, "missing phy data\n"); 470 472 return -EINVAL; 471 473 } 472 - 473 - phy_base->pdata = match->data; 474 474 475 475 phy_base->dev = dev; 476 476 phy_base->reg_base = ERR_PTR(-ENODEV);
+1 -10
drivers/phy/ti/phy-dm816x-usb.c
··· 13 13 #include <linux/pm_runtime.h> 14 14 #include <linux/delay.h> 15 15 #include <linux/phy/phy.h> 16 - #include <linux/of_platform.h> 17 16 18 17 #include <linux/mfd/syscon.h> 19 18 ··· 160 161 dm816x_usb_phy_runtime_resume, 161 162 NULL); 162 163 163 - #ifdef CONFIG_OF 164 164 static const struct of_device_id dm816x_usb_phy_id_table[] = { 165 165 { 166 166 .compatible = "ti,dm8168-usb-phy", ··· 167 169 {}, 168 170 }; 169 171 MODULE_DEVICE_TABLE(of, dm816x_usb_phy_id_table); 170 - #endif 171 172 172 173 static int dm816x_usb_phy_probe(struct platform_device *pdev) 173 174 { ··· 175 178 struct phy *generic_phy; 176 179 struct phy_provider *phy_provider; 177 180 struct usb_otg *otg; 178 - const struct of_device_id *of_id; 179 181 int error; 180 - 181 - of_id = of_match_device(of_match_ptr(dm816x_usb_phy_id_table), 182 - &pdev->dev); 183 - if (!of_id) 184 - return -EINVAL; 185 182 186 183 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); 187 184 if (!phy) ··· 263 272 .driver = { 264 273 .name = "dm816x-usb-phy", 265 274 .pm = &dm816x_usb_phy_pm_ops, 266 - .of_match_table = of_match_ptr(dm816x_usb_phy_id_table), 275 + .of_match_table = dm816x_usb_phy_id_table, 267 276 }, 268 277 }; 269 278
+2 -7
drivers/phy/ti/phy-omap-control.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/platform_device.h> 11 + #include <linux/property.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 14 #include <linux/err.h> 15 15 #include <linux/io.h> 16 16 #include <linux/clk.h> ··· 268 268 269 269 static int omap_control_phy_probe(struct platform_device *pdev) 270 270 { 271 - const struct of_device_id *of_id; 272 271 struct omap_control_phy *control_phy; 273 - 274 - of_id = of_match_device(omap_control_phy_id_table, &pdev->dev); 275 - if (!of_id) 276 - return -EINVAL; 277 272 278 273 control_phy = devm_kzalloc(&pdev->dev, sizeof(*control_phy), 279 274 GFP_KERNEL); ··· 276 281 return -ENOMEM; 277 282 278 283 control_phy->dev = &pdev->dev; 279 - control_phy->type = *(enum omap_control_phy_type *)of_id->data; 284 + control_phy->type = *(enum omap_control_phy_type *)device_get_match_data(&pdev->dev); 280 285 281 286 if (control_phy->type == OMAP_CTRL_TYPE_OTGHS) { 282 287 control_phy->otghs_control =
+4 -7
drivers/phy/ti/phy-omap-usb2.c
··· 19 19 #include <linux/phy/phy.h> 20 20 #include <linux/platform_device.h> 21 21 #include <linux/pm_runtime.h> 22 + #include <linux/property.h> 22 23 #include <linux/regmap.h> 23 24 #include <linux/slab.h> 24 25 #include <linux/sys_soc.h> ··· 372 371 struct device_node *node = pdev->dev.of_node; 373 372 struct device_node *control_node; 374 373 struct platform_device *control_pdev; 375 - const struct of_device_id *of_id; 376 - struct usb_phy_data *phy_data; 374 + const struct usb_phy_data *phy_data; 377 375 378 - of_id = of_match_device(omap_usb2_id_table, &pdev->dev); 379 - 380 - if (!of_id) 376 + phy_data = device_get_match_data(&pdev->dev); 377 + if (!phy_data) 381 378 return -EINVAL; 382 - 383 - phy_data = (struct usb_phy_data *)of_id->data; 384 379 385 380 phy = devm_kzalloc(&pdev->dev, sizeof(*phy), GFP_KERNEL); 386 381 if (!phy)
+4 -10
drivers/phy/ti/phy-ti-pipe3.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/platform_device.h> 11 + #include <linux/property.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/phy/phy.h> 13 14 #include <linux/of.h> ··· 779 778 struct phy_provider *phy_provider; 780 779 struct device *dev = &pdev->dev; 781 780 int ret; 782 - const struct of_device_id *match; 783 - struct pipe3_data *data; 781 + const struct pipe3_data *data; 784 782 785 783 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); 786 784 if (!phy) 787 785 return -ENOMEM; 788 786 789 - match = of_match_device(ti_pipe3_id_table, dev); 790 - if (!match) 787 + data = device_get_match_data(dev); 788 + if (!data) 791 789 return -EINVAL; 792 - 793 - data = (struct pipe3_data *)match->data; 794 - if (!data) { 795 - dev_err(dev, "no driver data\n"); 796 - return -EINVAL; 797 - } 798 790 799 791 phy->dev = dev; 800 792 phy->mode = data->mode;