Split Generic PHY consumer and provider API
Subsystems (80)
Vladimir Oltean
maintainerv4 cover Split Generic PHY consumer and provider API
The biggest problem requiring this split is the fact that consumer drivers poke around in struct phy, accessing fields which shouldn't be visible to them. Follow the example of mux, gpio, iio, spi offload, pwrsec, pinctrl and regulator, which each expose separate headers for consumers and providers.
Some off-list discussions were had with Vinod Koul regarding the 3 PHY providers outside the drivers/phy/ subsystem. It was agreed that it is desirable to relocate them to drivers/phy/, rather than to publish phy-provider.h to include/linux/phy/ for liberal use. Only phy.h and (new) phy-props.h - consumer-facing headers - stay there.
The hope is that developers get a hint when they need to include the wrong header to get their job done.
If that fails, patch 24/24 adds a regex in the MAINTAINERS entry that ensures linux-phy is copied on all Generic PHY patches, for an extra set of eyes.
The series is formatted on linux-phy/next for build testing, but is intended to be applied on top of commit
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=4ff5801f45b494ad8251a16ec06c9f303ed3b9a0
which is v7.0-rc1 + 1 patch, and then merged into linux-phy/next. The idea being that it's better to resolve the merge conflict early. There are 4 expected conflicts, details in the conflicting patches (21/24 and 22/24).
Requested merge strategy, I hope this works for everyone:
- Subsystem maintainers ACK their affected portions
- Entire series goes through linux-phy
- linux-phy provides stable tag
- (optionally) Said tag is merged back into affected subsystem 'next' branches. Those who prefer can handle merge conflicts when they send their PR.
Detailed change log in patches, summary below.
v3->v4:
- fix build breakage in drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c and include/linux/phy/tegra/xusb.h added by patch 22/24v2->v3:
- remove unused variable in PCI after device link removal
- update MAINTAINERS regex pattern to escape forward slashes
- add more people to CC list
- provide conflict resolutionv1->v2:
- split "phy: include PHY provider header" into smaller chunks to work around mailing list moderation due to patch size
- improve MAINTAINERS regex pattern
- make all PHY attribute helpers NULL-tolerant. Not just the new phy_get_bus_width(), but also retroactively, the existing ones.
- fixed the temporary include path from <linux/phy/phy.h> to "phy-provider.h", removed anyway by the end of the series
- logical bug fixes in the PCI controller <-> PHY device link removal and Exynos UFS PHY API rework
In case anyone wants to test the series, here it is on top of linux-phy/next:
https://github.com/vladimiroltean/linux/tree/phy-split-consumer-provider-v4
I've also test-applied it on v7.0-rc1 and provided conflict resolution with net-next and with linux-phy/next:
https://github.com/vladimiroltean/linux/commits/phy-split-consumer-provider-v4-merge/
v3 at:
https://lore.kernel.org/linux-phy/[email protected]/
v2 at:
https://lore.kernel.org/linux-phy/[email protected]/
v1 at:
https://lore.kernel.org/linux-phy/[email protected]/
Vladimir Oltean (24):
ata: add <linux/pm_runtime.h> where missing
PCI: Add missing headers transitively included by <linux/phy/phy.h>
usb: add missing headers transitively included by <linux/phy/phy.h>
drm: add <linux/pm_runtime.h> where missing
phy: add <linux/pm_runtime.h> where missing
phy: spacemit: include missing <linux/phy/phy.h>
net: lan969x: include missing <linux/of.h>
PCI: Remove device links to PHY
ufs: exynos: stop poking into struct phy guts drm/rockchip: dw_hdmi: avoid direct dereference of phy->dev.of_node drm/msm/dp: remove debugging prints with internal struct phy state
phy: move provider API out of public <linux/phy/phy.h>
phy: make phy_get_mode(), phy_(get|set)_bus_width() NULL tolerant
phy: introduce phy_get_max_link_rate() helper for consumers drm/rockchip: dsi: include PHY provider header
drm: bridge: cdns-mhdp8546: use consumer API for getting PHY bus width
media: sunxi: a83-mips-csi2: include PHY provider header
net: renesas: rswitch: include PHY provider header
pinctrl: tegra-xusb: include PHY provider header
power: supply: cpcap-charger: include missing <linux/property.h>
phy: include PHY provider header (1/2)
phy: include PHY provider header (2/2)
phy: remove temporary provider compatibility from consumer header
MAINTAINERS: add regexes for linux-phy
MAINTAINERS | 11 + drivers/ata/ahci.c | 1 + drivers/ata/ahci_brcm.c | 1 + drivers/ata/ahci_ceva.c | 1 + drivers/ata/ahci_qoriq.c | 1 + drivers/ata/libahci.c | 1 + .../drm/bridge/analogix/analogix_dp_core.c | 1 + .../drm/bridge/cadence/cdns-mhdp8546-core.c | 7 +- drivers/gpu/drm/bridge/nwl-dsi.c | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +- drivers/gpu/drm/msm/dp/dp_aux.c | 1 + drivers/gpu/drm/msm/dp/dp_ctrl.c | 18 - drivers/gpu/drm/rockchip/cdn-dp-core.c | 1 + .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 25 +- .../sun8i-a83t-mipi-csi2/sun8i_a83t_dphy.c | 2 +- drivers/net/can/at91_can.c | 3 +- drivers/net/can/flexcan/flexcan-core.c | 3 +- drivers/net/can/m_can/m_can_platform.c | 3 +- drivers/net/can/rcar/rcar_canfd.c | 3 +- .../microchip/sparx5/lan969x/lan969x_rgmii.c | 1 + drivers/net/ethernet/renesas/rswitch_main.c | 1 + .../controller/cadence/pcie-cadence-plat.c | 4 - drivers/pci/controller/cadence/pcie-cadence.c | 16 +- drivers/pci/controller/cadence/pcie-cadence.h | 2 - drivers/pci/controller/dwc/pci-dra7xx.c | 16 - drivers/pci/controller/dwc/pci-keystone.c | 32 +- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 1 + drivers/pci/controller/dwc/pcie-histb.c | 1 + drivers/pci/controller/dwc/pcie-qcom-ep.c | 1 + drivers/pci/controller/dwc/pcie-spacemit-k1.c | 2 + drivers/pci/controller/dwc/pcie-tegra194.c | 1 + drivers/pci/controller/pci-tegra.c | 1 + drivers/pci/controller/pcie-rockchip-host.c | 1 + drivers/pci/controller/plda/pcie-starfive.c | 1 + drivers/phy/allwinner/phy-sun4i-usb.c | 3 +- drivers/phy/allwinner/phy-sun50i-usb3.c | 3 +- drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 +- drivers/phy/allwinner/phy-sun9i-usb.c | 3 +- drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c | 2 + .../amlogic/phy-meson-axg-mipi-pcie-analog.c | 3 +- drivers/phy/amlogic/phy-meson-axg-pcie.c | 2 + .../amlogic/phy-meson-g12a-mipi-dphy-analog.c | 3 +- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 + .../phy/amlogic/phy-meson-g12a-usb3-pcie.c | 3 +- drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 +- drivers/phy/amlogic/phy-meson8-hdmi-tx.c | 3 +- drivers/phy/amlogic/phy-meson8b-usb2.c | 3 +- drivers/phy/apple/atc.c | 3 +- drivers/phy/broadcom/phy-bcm-cygnus-pcie.c | 3 +- drivers/phy/broadcom/phy-bcm-kona-usb2.c | 4 +- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 3 +- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 3 +- drivers/phy/broadcom/phy-bcm-ns2-pcie.c | 3 +- drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c | 3 +- drivers/phy/broadcom/phy-bcm-sr-pcie.c | 3 +- drivers/phy/broadcom/phy-bcm-sr-usb.c | 3 +- drivers/phy/broadcom/phy-bcm63xx-usbh.c | 3 +- drivers/phy/broadcom/phy-brcm-sata.c | 3 +- drivers/phy/broadcom/phy-brcm-usb.c | 2 +- drivers/phy/cadence/cdns-dphy-rx.c | 3 +- drivers/phy/cadence/cdns-dphy.c | 4 +- drivers/phy/cadence/phy-cadence-salvo.c | 3 +- drivers/phy/cadence/phy-cadence-sierra.c | 3 +- drivers/phy/cadence/phy-cadence-torrent.c | 3 +- drivers/phy/canaan/phy-k230-usb.c | 3 +- drivers/phy/eswin/phy-eic7700-sata.c | 3 +- .../phy/freescale/phy-fsl-imx8-mipi-dphy.c | 3 +- drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 4 +- drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 3 +- drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 6 +- .../phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 3 +- drivers/phy/freescale/phy-fsl-lynx-28g.c | 3 +- drivers/phy/hisilicon/phy-hi3660-usb3.c | 3 +- drivers/phy/hisilicon/phy-hi3670-pcie.c | 3 +- drivers/phy/hisilicon/phy-hi3670-usb3.c | 3 +- drivers/phy/hisilicon/phy-hi6220-usb.c | 3 +- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 4 +- drivers/phy/hisilicon/phy-histb-combphy.c | 3 +- drivers/phy/hisilicon/phy-hix5hd2-sata.c | 3 +- drivers/phy/ingenic/phy-ingenic-usb.c | 3 +- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 +- drivers/phy/intel/phy-intel-keembay-usb.c | 3 +- drivers/phy/intel/phy-intel-lgm-combo.c | 4 +- drivers/phy/intel/phy-intel-lgm-emmc.c | 3 +- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 3 +- drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c | 4 +- drivers/phy/marvell/phy-armada375-usb2.c | 3 +- drivers/phy/marvell/phy-armada38x-comphy.c | 3 +- drivers/phy/marvell/phy-berlin-sata.c | 3 +- drivers/phy/marvell/phy-berlin-usb.c | 3 +- drivers/phy/marvell/phy-mmp3-hsic.c | 3 +- drivers/phy/marvell/phy-mmp3-usb.c | 3 +- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 3 +- drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 3 +- drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 3 +- drivers/phy/marvell/phy-mvebu-cp110-utmi.c | 3 +- drivers/phy/marvell/phy-mvebu-sata.c | 3 +- drivers/phy/marvell/phy-pxa-28nm-hsic.c | 3 +- drivers/phy/marvell/phy-pxa-28nm-usb2.c | 3 +- drivers/phy/marvell/phy-pxa-usb.c | 3 +- drivers/phy/mediatek/phy-mtk-dp.c | 3 +- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 1 - drivers/phy/mediatek/phy-mtk-hdmi.h | 3 +- drivers/phy/mediatek/phy-mtk-mipi-csi-0-5.c | 2 +- drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 3 +- drivers/phy/mediatek/phy-mtk-pcie.c | 2 +- drivers/phy/mediatek/phy-mtk-tphy.c | 2 +- drivers/phy/mediatek/phy-mtk-ufs.c | 2 +- drivers/phy/mediatek/phy-mtk-xfi-tphy.c | 2 +- drivers/phy/mediatek/phy-mtk-xsphy.c | 2 +- drivers/phy/microchip/lan966x_serdes.c | 4 +- drivers/phy/microchip/sparx5_serdes.c | 2 +- drivers/phy/motorola/phy-cpcap-usb.c | 3 +- drivers/phy/motorola/phy-mapphone-mdm6600.c | 5 +- drivers/phy/mscc/phy-ocelot-serdes.c | 3 +- drivers/phy/nuvoton/phy-ma35d1-usb2.c | 3 +- drivers/phy/phy-airoha-pcie.c | 2 +- drivers/phy/phy-can-transceiver.c | 3 +- drivers/phy/phy-core-mipi-dphy.c | 4 +- drivers/phy/phy-core.c | 52 ++ drivers/phy/phy-google-usb.c | 4 +- drivers/phy/phy-lpc18xx-usb-otg.c | 3 +- drivers/phy/phy-nxp-ptn3222.c | 3 +- drivers/phy/phy-pistachio-usb.c | 4 +- drivers/phy/phy-provider.h | 256 +++++++++ drivers/phy/phy-snps-eusb2.c | 2 + drivers/phy/phy-xgene.c | 3 +- drivers/phy/qualcomm/phy-ath79-usb.c | 3 +- drivers/phy/qualcomm/phy-qcom-apq8064-sata.c | 3 +- drivers/phy/qualcomm/phy-qcom-edp.c | 3 +- .../phy/qualcomm/phy-qcom-eusb2-repeater.c | 3 +- drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 3 +- drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 3 +- drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 3 +- drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 + drivers/phy/qualcomm/phy-qcom-m31.c | 3 +- drivers/phy/qualcomm/phy-qcom-pcie2.c | 3 +- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 +- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 3 +- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 +- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 3 +- .../phy/qualcomm/phy-qcom-qmp-usb-legacy.c | 4 +- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 4 +- drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 4 +- drivers/phy/qualcomm/phy-qcom-qusb2.c | 5 +- drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 3 +- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 4 +- .../phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c | 3 +- drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c | 3 +- drivers/phy/qualcomm/phy-qcom-usb-hs.c | 3 +- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 3 +- drivers/phy/qualcomm/phy-qcom-usb-ss.c | 3 +- drivers/phy/ralink/phy-mt7621-pci.c | 3 +- drivers/phy/ralink/phy-ralink-usb.c | 3 +- drivers/phy/realtek/phy-rtk-usb2.c | 3 +- drivers/phy/realtek/phy-rtk-usb3.c | 3 +- drivers/phy/renesas/phy-rcar-gen2.c | 3 +- drivers/phy/renesas/phy-rcar-gen3-pcie.c | 4 +- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 3 +- drivers/phy/renesas/phy-rcar-gen3-usb3.c | 3 +- drivers/phy/renesas/phy-rzg3e-usb3.c | 3 +- drivers/phy/renesas/r8a779f0-ether-serdes.c | 4 +- drivers/phy/rockchip/phy-rockchip-dp.c | 3 +- drivers/phy/rockchip/phy-rockchip-dphy-rx0.c | 3 +- drivers/phy/rockchip/phy-rockchip-emmc.c | 3 +- .../phy/rockchip/phy-rockchip-inno-csidphy.c | 3 +- .../phy/rockchip/phy-rockchip-inno-dsidphy.c | 4 +- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 2 + drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 3 +- .../rockchip/phy-rockchip-naneng-combphy.c | 3 +- drivers/phy/rockchip/phy-rockchip-pcie.c | 2 +- .../phy/rockchip/phy-rockchip-samsung-dcphy.c | 3 +- .../phy/rockchip/phy-rockchip-samsung-hdptx.c | 2 + .../phy/rockchip/phy-rockchip-snps-pcie3.c | 3 +- drivers/phy/rockchip/phy-rockchip-typec.c | 5 +- drivers/phy/rockchip/phy-rockchip-usb.c | 3 +- drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 + drivers/phy/samsung/phy-exynos-dp-video.c | 3 +- drivers/phy/samsung/phy-exynos-mipi-video.c | 3 +- drivers/phy/samsung/phy-exynos-pcie.c | 3 +- drivers/phy/samsung/phy-exynos4210-usb2.c | 3 +- drivers/phy/samsung/phy-exynos4x12-usb2.c | 3 +- drivers/phy/samsung/phy-exynos5-usbdrd.c | 2 + drivers/phy/samsung/phy-exynos5250-sata.c | 3 +- drivers/phy/samsung/phy-exynos5250-usb2.c | 3 +- drivers/phy/samsung/phy-s5pv210-usb2.c | 3 +- drivers/phy/samsung/phy-samsung-ufs.c | 2 +- drivers/phy/samsung/phy-samsung-ufs.h | 3 +- drivers/phy/samsung/phy-samsung-usb2.c | 2 + drivers/phy/samsung/phy-samsung-usb2.h | 3 +- drivers/phy/socionext/phy-uniphier-ahci.c | 3 +- drivers/phy/socionext/phy-uniphier-pcie.c | 3 +- drivers/phy/socionext/phy-uniphier-usb2.c | 3 +- drivers/phy/socionext/phy-uniphier-usb3hs.c | 3 +- drivers/phy/socionext/phy-uniphier-usb3ss.c | 3 +- drivers/phy/sophgo/phy-cv1800-usb2.c | 3 +- drivers/phy/spacemit/phy-k1-pcie.c | 4 +- drivers/phy/spacemit/phy-k1-usb2.c | 2 + drivers/phy/st/phy-miphy28lp.c | 4 +- drivers/phy/st/phy-spear1310-miphy.c | 3 +- drivers/phy/st/phy-spear1340-miphy.c | 3 +- drivers/phy/st/phy-stih407-usb.c | 3 +- drivers/phy/st/phy-stm32-combophy.c | 3 +- drivers/phy/st/phy-stm32-usbphyc.c | 2 + drivers/phy/starfive/phy-jh7110-dphy-rx.c | 3 +- drivers/phy/starfive/phy-jh7110-dphy-tx.c | 3 +- drivers/phy/starfive/phy-jh7110-pcie.c | 3 +- drivers/phy/starfive/phy-jh7110-usb.c | 3 +- drivers/phy/sunplus/phy-sunplus-usb2.c | 3 +- drivers/phy/tegra/phy-tegra194-p2u.c | 3 +- drivers/phy/tegra/xusb-tegra124.c | 2 +- drivers/phy/tegra/xusb-tegra186.c | 2 +- drivers/phy/tegra/xusb-tegra210.c | 2 +- drivers/phy/tegra/xusb.c | 2 +- drivers/phy/ti/phy-am654-serdes.c | 3 +- drivers/phy/ti/phy-da8xx-usb.c | 3 +- drivers/phy/ti/phy-dm816x-usb.c | 3 +- drivers/phy/ti/phy-gmii-sel.c | 3 +- drivers/phy/ti/phy-omap-usb2.c | 3 +- drivers/phy/ti/phy-ti-pipe3.c | 3 +- drivers/phy/ti/phy-tusb1210.c | 1 + drivers/phy/ti/phy-twl4030-usb.c | 3 +- drivers/phy/xilinx/phy-zynqmp.c | 4 +- drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 2 +- drivers/power/supply/cpcap-charger.c | 1 + drivers/ufs/host/ufs-exynos.c | 24 +- drivers/ufs/host/ufs-exynos.h | 1 + drivers/usb/chipidea/ci_hdrc_imx.c | 1 + drivers/usb/core/hcd.c | 1 + drivers/usb/dwc3/dwc3-generic-plat.c | 1 + drivers/usb/dwc3/gadget.c | 1 + include/linux/phy/phy-props.h | 75 +++ include/linux/phy/phy-sun4i-usb.h | 2 +- include/linux/phy/phy.h | 497 ++++-------------- include/linux/phy/tegra/xusb.h | 1 + include/linux/phy/ulpi_phy.h | 2 +- 238 files changed, 942 insertions(+), 705 deletions(-) create mode 100644 drivers/phy/phy-provider.h create mode 100644 include/linux/phy/phy-props.h
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 1/24 ata: add <linux/pm_runtime.h> where missing
It appears that libahci.c, ahci.c as well as the ahci_brcm, ahci_ceva and ahci_qoriq drivers are using runtime PM operations without including <linux/pm_runtime.h>. This header is somehow being indirectly provided by <linux/phy/phy.h>, which would like to drop it (none of the functions it exports need it).
---
Cc: Damien Le Moal <[email protected]>
Cc: Niklas Cassel <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/ata/ahci.c | 1 + drivers/ata/ahci_brcm.c | 1 + drivers/ata/ahci_ceva.c | 1 + drivers/ata/ahci_qoriq.c | 1 + drivers/ata/libahci.c | 1 + 5 files changed, 5 insertions(+)
drivers/ata/ahci.c +1 -0
@@ -26,6 +26,7 @@#include <linux/device.h> #include <linux/dmi.h> #include <linux/gfp.h> +#include <linux/pm_runtime.h> #include <scsi/scsi_host.h> #include <scsi/scsi_cmnd.h> #include <linux/libata.h>
drivers/ata/ahci_brcm.c +1 -0
@@ -16,6 +16,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/string.h>
drivers/ata/ahci_ceva.c +1 -0
@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/reset.h> #include "ahci.h"
drivers/ata/ahci_qoriq.c +1 -0
@@ -14,6 +14,7 @@#include <linux/device.h> #include <linux/of.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/libata.h> #include "ahci.h"
drivers/ata/libahci.c +1 -0
@@ -30,6 +30,7 @@#include <scsi/scsi_cmnd.h> #include <linux/libata.h> #include <linux/pci.h> +#include <linux/pm_runtime.h> #include "ahci.h" #include "libata.h"
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 2/24 PCI: Add missing headers transitively included by <linux/phy/phy.h>
In reply to Vladimir OlteanThe tegra as well as a few dwc PCI controller drivers uses PM runtime operations without including the required <linux/pm_runtime.h> header.
Similarly, pcie-rockchip-host, pcie-starfive as well as a few dwc PCI controllers use the regulator consumer API without including <linux/regulator/consumer.h>.
It seems these function prototypes were indirectly provided by <linux/phy/phy.h>, mostly by mistake (none of the functions it exports need it).
Before the PHY header can drop the unnecessary includes, make sure the PCI controller drivers include what they use.
---
Cc: Lorenzo Pieralisi <[email protected]>
Cc: "Krzysztof Wilczyński" <[email protected]>
Cc: Manivannan Sadhasivam <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Yixun Lan <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Shawn Lin <[email protected]>
Cc: Kevin Xie <[email protected]>
v2->v4: nonev1->v2: collect tag, adjust commit title
--- drivers/pci/controller/dwc/pci-keystone.c | 1 + drivers/pci/controller/dwc/pcie-dw-rockchip.c | 1 + drivers/pci/controller/dwc/pcie-histb.c | 1 + drivers/pci/controller/dwc/pcie-qcom-ep.c | 1 + drivers/pci/controller/dwc/pcie-spacemit-k1.c | 2 ++ drivers/pci/controller/dwc/pcie-tegra194.c | 1 + drivers/pci/controller/pci-tegra.c | 1 + drivers/pci/controller/pcie-rockchip-host.c | 1 + drivers/pci/controller/plda/pcie-starfive.c | 1 + 9 files changed, 10 insertions(+)
drivers/pci/controller/dwc/pci-keystone.c +1 -0
@@ -24,6 +24,7 @@#include <linux/of_pci.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/resource.h> #include <linux/signal.h>
drivers/pci/controller/dwc/pcie-dw-rockchip.c +1 -0
@@ -21,6 +21,7 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include <linux/regulator/consumer.h> #include <linux/reset.h> #include "../../pci.h"
drivers/pci/controller/dwc/pcie-histb.c +1 -0
@@ -18,6 +18,7 @@#include <linux/pci.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <linux/resource.h> #include <linux/reset.h>
drivers/pci/controller/dwc/pcie-qcom-ep.c +1 -0
@@ -19,6 +19,7 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/module.h>
drivers/pci/controller/dwc/pcie-spacemit-k1.c +2 -0
@@ -15,7 +15,9 @@#include <linux/mod_devicetable.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> +#include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/types.h>
drivers/pci/controller/dwc/pcie-tegra194.c +1 -0
@@ -27,6 +27,7 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/random.h> +#include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/resource.h> #include <linux/types.h>
drivers/pci/controller/pci-tegra.c +1 -0
@@ -36,6 +36,7 @@#include <linux/phy/phy.h> #include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/sizes.h> #include <linux/slab.h>
drivers/pci/controller/pcie-rockchip-host.c +1 -0
@@ -24,6 +24,7 @@#include <linux/of_pci.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include "../pci.h" #include "pcie-rockchip.h"
drivers/pci/controller/plda/pcie-starfive.c +1 -0
@@ -21,6 +21,7 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> +#include <linux/regulator/consumer.h> #include <linux/reset.h> #include "../../pci.h"
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 3/24 usb: add missing headers transitively included by <linux/phy/phy.h>
In reply to Vladimir OlteanThe chipidea ci_hdrc_imx driver uses regulator consumer API like regulator_enable() but does not include <linux/regulator/consumer.h>.
The core USB HCD driver calls invalidate_kernel_vmap_range() and flush_kernel_vmap_range(), but does not include <linux/highmem.h>.
The DWC3 gadget driver calls:
- device_property_present()
- device_property_count_u8()
- device_property_read_u8_array()
but does not include <linux/property.h>
The dwc3-generic-plat driver uses of_device_get_match_data() but does not include <linux/of.h>.
In all these cases, the necessary includes were still provided somehow, directly or indirectly, through <linux/phy/phy.h>. The latter header wants to drop those includes, so fill in the required headers to avoid any breakage.
---
Cc: Peter Chen <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Frank Li <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Thinh Nguyen <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/usb/chipidea/ci_hdrc_imx.c | 1 + drivers/usb/core/hcd.c | 1 + drivers/usb/dwc3/dwc3-generic-plat.c | 1 + drivers/usb/dwc3/gadget.c | 1 + 4 files changed, 4 insertions(+)
drivers/usb/chipidea/ci_hdrc_imx.c +1 -0
@@ -17,6 +17,7 @@#include <linux/clk.h> #include <linux/pinctrl/consumer.h> #include <linux/pm_qos.h> +#include <linux/regulator/consumer.h> #include "ci.h" #include "ci_hdrc_imx.h"
drivers/usb/core/hcd.c +1 -0
@@ -10,6 +10,7 @@*/ #include <linux/bcd.h> +#include <linux/highmem.h> #include <linux/module.h> #include <linux/version.h> #include <linux/kernel.h>
drivers/usb/dwc3/dwc3-generic-plat.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/clk.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/reset.h> #include <linux/regmap.h>
drivers/usb/dwc3/gadget.c +1 -0
@@ -10,6 +10,7 @@#include <linux/kernel.h> #include <linux/delay.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/platform_device.h>
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 4/24 drm: add <linux/pm_runtime.h> where missing
In reply to Vladimir OlteanMultiple DRM bridge drivers use runtime PM operations without including the proper header, instead relying on transitive inclusion by <linux/phy/phy.h>.
The PHY subsystem wants to get rid of headers it provides for no reason, so modify these drivers to include what they need directly.
---
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
v1->v4: none
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 1 + drivers/gpu/drm/bridge/nwl-dsi.c | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1 + drivers/gpu/drm/msm/dp/dp_aux.c | 1 + drivers/gpu/drm/rockchip/cdn-dp-core.c | 1 + 6 files changed, 6 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -0
@@ -18,6 +18,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <drm/bridge/analogix_dp.h> #include <drm/drm_atomic.h>
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1 -0
@@ -32,6 +32,7 @@#include <linux/phy/phy.h> #include <linux/phy/phy-dp.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/wait.h>
drivers/gpu/drm/bridge/nwl-dsi.c +1 -0
@@ -18,6 +18,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/sys_soc.h>
drivers/gpu/drm/bridge/samsung-dsim.c +1 -0
@@ -20,6 +20,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/units.h> #include <video/mipi_display.h>
drivers/gpu/drm/msm/dp/dp_aux.c +1 -0
@@ -6,6 +6,7 @@#include <linux/delay.h> #include <linux/iopoll.h> #include <linux/phy/phy.h> +#include <linux/pm_runtime.h> #include <drm/drm_print.h> #include "dp_reg.h"
drivers/gpu/drm/rockchip/cdn-dp-core.c +1 -0
@@ -10,6 +10,7 @@#include <linux/firmware.h> #include <linux/mfd/syscon.h> #include <linux/phy/phy.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h>
Signature · 1 line
2.43.0
Re: [PATCH v4 phy-next 04/24] drm: add <linux/pm_runtime.h> where missing
Quoted 119 lines · On Wed, Mar 18, 2026, 04:36 Vladimir Oltean <[email protected]> wrote:
Multiple DRM bridge drivers use runtime PM operations without including the proper header, instead relying on transitive inclusion by <
linux/phy/phy.h>.The PHY subsystem wants to get rid of headers it provides for no reason, so modify these drivers to include what they need directly.
Signed-off-by Vladimir Oltean <[email protected]>---
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
v1->v4: none--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 1 + drivers/gpu/drm/bridge/nwl-dsi.c | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 1 + drivers/gpu/drm/msm/dp/dp_aux.c | 1 + drivers/gpu/drm/rockchip/cdn-dp-core.c | 1 + 6 files changed, 6 insertions(+)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1
-0@@ -18,6 +18,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <drm/bridge/analogix_dp.h> #include <drm/drm_atomic.h> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1
-0@@ -32,6 +32,7 @@#include <linux/phy/phy.h> #include <linux/phy/phy-dp.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/wait.h> drivers/gpu/drm/bridge/nwl-dsi.c +1
-0@@ -18,6 +18,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/sys_soc.h> drivers/gpu/drm/bridge/samsung-dsim.c +1
-0@@ -20,6 +20,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/units.h> #include <video/mipi_display.h> drivers/gpu/drm/msm/dp/dp_aux.c +1
-0@@ -6,6 +6,7 @@#include <linux/delay.h> #include <linux/iopoll.h> #include <linux/phy/phy.h> +#include <linux/pm_runtime.h> #include <drm/drm_print.h> #include "dp_reg.h" drivers/gpu/drm/rockchip/cdn-dp-core.c +1
-1@@ -10,6 +10,7 @@#include <linux/firmware.h> #include <linux/mfd/syscon.h> #include <linux/phy/phy.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> --2.43.0
Vladimir Oltean
maintainerPATCH v4 5/24 phy: add <linux/pm_runtime.h> where missing
In reply to Vladimir OlteanIt appears that the phy-mapphone-mdm6600, phy-qcom-snps-femto-v2, phy-rcar-gen3-pcie, r8a779f0-ether-serdes and phy-rockchip-typec drivers call runtime PM operations without including the proper header.
This was provided by <linux/phy/phy.h> but no function exported by this header directly needs it. So we need to drop it from there, and fix up drivers that used to depend on that.
---
Cc: Peter Griffin <[email protected]>
Cc: "André Draszik" <[email protected]>
Cc: Tudor Ambarus <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Heiko Stuebner <[email protected]>
v2->v4: nonev1->v2: collect tags
--- drivers/phy/motorola/phy-mapphone-mdm6600.c | 1 + drivers/phy/phy-google-usb.c | 1 + drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1 + drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c | 1 + drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 1 + drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 1 + drivers/phy/qualcomm/phy-qcom-qusb2.c | 1 + drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 1 + drivers/phy/renesas/phy-rcar-gen3-pcie.c | 1 + drivers/phy/renesas/r8a779f0-ether-serdes.c | 1 + drivers/phy/rockchip/phy-rockchip-typec.c | 1 + drivers/phy/ti/phy-tusb1210.c | 1 + 12 files changed, 12 insertions(+)
drivers/phy/motorola/phy-mapphone-mdm6600.c +1 -0
@@ -17,6 +17,7 @@#include <linux/of_platform.h> #include <linux/phy/phy.h> #include <linux/pinctrl/consumer.h> +#include <linux/pm_runtime.h> #define PHY_MDM6600_PHY_DELAY_MS 4000/* PHY enable 2.2s to 3.5s */ #define PHY_MDM6600_ENABLED_DELAY_MS 8000/* 8s more total for MDM6600 */
drivers/phy/phy-google-usb.c +1 -0
@@ -16,6 +16,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/usb/typec_mux.h>
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1 -0
@@ -16,6 +16,7 @@#include <linux/of_graph.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h>
drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c +1 -0
@@ -16,6 +16,7 @@#include <linux/of_address.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h>
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +1 -0
@@ -15,6 +15,7 @@#include <linux/of_address.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h>
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c +1 -0
@@ -16,6 +16,7 @@#include <linux/of_address.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/reset.h>
drivers/phy/qualcomm/phy-qcom-qusb2.c +1 -0
@@ -14,6 +14,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/reset.h>
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +1 -0
@@ -12,6 +12,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/reset.h>
drivers/phy/renesas/phy-rcar-gen3-pcie.c +1 -0
@@ -11,6 +11,7 @@#include <linux/of.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/spinlock.h> #define PHY_CTRL 0x4000/* R8A77980 only */
drivers/phy/renesas/r8a779f0-ether-serdes.c +1 -0
@@ -12,6 +12,7 @@#include <linux/phy.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/reset.h> #define R8A779F0_ETH_SERDES_NUM 3
drivers/phy/rockchip/phy-rockchip-typec.c +1 -0
@@ -49,6 +49,7 @@#include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h>
drivers/phy/ti/phy-tusb1210.c +1 -0
@@ -13,6 +13,7 @@#include <linux/ulpi/regs.h> #include <linux/gpio/consumer.h> #include <linux/phy/ulpi_phy.h> +#include <linux/pm_runtime.h> #include <linux/power_supply.h> #include <linux/property.h> #include <linux/workqueue.h>
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 6/24 phy: spacemit: include missing <linux/phy/phy.h>
In reply to Vladimir OlteanThis driver relies on a transitive inclusion of the PHY API header through the USB headers.
---
Cc: Yixun Lan <[email protected]>
v1->v4: none
--- drivers/phy/spacemit/phy-k1-usb2.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/spacemit/phy-k1-usb2.c +1 -0
@@ -9,6 +9,7 @@#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/iopoll.h> +#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/usb/of.h>
Signature · 1 line
2.43.0
Re: [PATCH v4 phy-next 06/24] phy: spacemit: include missing <linux/phy/phy.h>
Hi Vladimir,
Quoted 4 lines · Vladimir Oltean
This driver relies on a transitive inclusion of the PHY API header through the USB headers.
Signed-off-by Vladimir Oltean <[email protected]>
Quoted 23 lines
---
Cc: Yixun Lan <[email protected]>
v1->v4: none--- drivers/phy/spacemit/phy-k1-usb2.c | 1 + 1 file changed, 1 insertion(+)drivers/phy/spacemit/phy-k1-usb2.c +1
-0@@ -9,6 +9,7 @@#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/iopoll.h> +#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/usb/of.h> Signature · 1 line
2.43.0
Signature · 1 line
Yixun Lan (dlan)
Vladimir Oltean
maintainerPATCH v4 7/24 net: lan969x: include missing <linux/of.h>
In reply to Vladimir OlteanThis file is calling of_property_read_u32() without including the proper header for it. It is provided by <linux/phy/phy.h>, which wants to get rid of it.
---
Cc: Daniel Machon <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Steen Hegelund <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_rgmii.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_rgmii.c +1 -0
@@ -4,6 +4,7 @@* Copyright (c) 2024 Microchip Technology Inc. and its subsidiaries. */ +#include <linux/of.h> #include "lan969x.h" /* Tx clock selectors */
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 8/24 PCI: Remove device links to PHY
In reply to Vladimir OlteanThis is practically a full revert of commit7a4db656a635 ("PCI: dra7xx: Create functional dependency between PCIe and PHY") and a partial revert of the device link pieces from commits dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers") 49229238ab47 ("PCI: keystone: Cleanup PHY handling")
The trouble with these commits is that they dereference fields inside struct phy from a consumer driver, which will become no longer possible.
Since commit 987351e1ea77 ("phy: core: Add consumer device link support") from 2019, the PHY core also adds a device link to order PHY provider and consumer suspend/resume operations. All reverted commits are from 2017-2018, and what they do should actually be redundant now.
---
Cc: Lorenzo Pieralisi <[email protected]>
Cc: "Krzysztof Wilczyński" <[email protected]>
Cc: Manivannan Sadhasivam <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Vignesh Raghavendra <[email protected]>
Cc: Siddharth Vadapalli <[email protected]>
v3->v4: nonev2->v3:
- remove dangling set but unused phy_count local variable in cdns_plat_pcie_probe()v1->v2:
- fully remove struct device link **link from struct cdns_pcie and from cdns_plat_pcie_probe() error path
- collect tag
- adjust commit title
--- .../controller/cadence/pcie-cadence-plat.c | 4 --- drivers/pci/controller/cadence/pcie-cadence.c | 16 +--------- drivers/pci/controller/cadence/pcie-cadence.h | 2 -- drivers/pci/controller/dwc/pci-dra7xx.c | 16 ---------- drivers/pci/controller/dwc/pci-keystone.c | 31 +++---------------- 5 files changed, 5 insertions(+), 64 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-plat.c +0 -4
@@ -41,7 +41,6 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)struct pci_host_bridge *bridge;struct cdns_pcie_ep *ep;struct cdns_pcie_rc *rc; -int phy_count;bool is_rc;int ret;
@@ -122,9 +121,6 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)pm_runtime_put_sync (dev);pm_runtime_disable (dev);cdns_pcie_disable_phy (cdns_plat_pcie->pcie); - phy_count = cdns_plat_pcie->pcie->phy_count; -while (phy_count--) -device_link_del (cdns_plat_pcie->pcie->link[phy_count]);return 0 ; }
drivers/pci/controller/cadence/pcie-cadence.c +1 -15
@@ -222,7 +222,6 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)struct device_node *np = dev->of_node;int phy_count;struct phy **phy; -struct device_link **link;int i;int ret;const char *name;
@@ -238,10 +237,6 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)if (!phy)return -ENOMEM ; - link =devm_kcalloc (dev, phy_count,sizeof (*link),GFP_KERNEL ); -if (!link) -return -ENOMEM ; -for (i =0 ; i < phy_count; i++) {of_property_read_string_index (np,"phy-names" , i, &name); phy[i] =devm_phy_get (dev, name);
@@ -249,17 +244,10 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) ret =PTR_ERR (phy[i]); goto err_phy; } - link[i] =device_link_add (dev, &phy[i]->dev,DL_FLAG_STATELESS ); -if (!link[i]) { -devm_phy_put (dev, phy[i]); - ret = -EINVAL ; - goto err_phy; - } } pcie->phy_count = phy_count; pcie->phy = phy; - pcie->link = link; ret =cdns_pcie_enable_phy (pcie);if (ret)
@@ -268,10 +256,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)return 0 ; err_phy: -while (--i >=0 ) { -device_link_del (link[i]); +while (--i >=0 )devm_phy_put (dev, phy[i]); - }return ret; }
drivers/pci/controller/cadence/pcie-cadence.h +0 -2
@@ -82,7 +82,6 @@ struct cdns_plat_pcie_of_data {* @is_rc: tell whether the PCIe controller mode is Root Complex or Endpoint. * @phy_count: number of supported PHY devices * @phy: list of pointers to specific PHY control blocks -* @link: list of pointers to corresponding device link representations * @ops: Platform-specific ops to control various inputs from Cadence PCIe * wrapper * @cdns_pcie_reg_offsets: Register bank offsets for different SoC
@@ -95,7 +94,6 @@ struct cdns_pcie {bool is_rc;int phy_count;struct phy **phy; -struct device_link **link;const struct cdns_pcie_ops *ops;const struct cdns_plat_pcie_of_data *cdns_pcie_reg_offsets; };
drivers/pci/controller/dwc/pci-dra7xx.c +0 -16
@@ -9,7 +9,6 @@#include <linux/clk.h> #include <linux/delay.h> -#include <linux/device.h> #include <linux/err.h> #include <linux/interrupt.h> #include <linux/irq.h>
@@ -683,7 +682,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)int i;int phy_count;struct phy **phy; -struct device_link **link;void __iomem *base;struct dw_pcie *pci;struct dra7xx_pcie *dra7xx;
@@ -731,10 +729,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - link =devm_kcalloc (dev, phy_count,sizeof (*link),GFP_KERNEL ); -if (!link) -return -ENOMEM ; - dra7xx->clk =devm_clk_get_optional (dev,NULL );if (IS_ERR (dra7xx->clk)) return dev_err_probe(dev, PTR_ERR(dra7xx->clk),
@@ -749,12 +743,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) phy[i] =devm_phy_get (dev, name);if (IS_ERR (phy[i]))return PTR_ERR (phy[i]); - - link[i] =device_link_add (dev, &phy[i]->dev,DL_FLAG_STATELESS ); -if (!link[i]) { - ret = -EINVAL ; - goto err_link; - } } dra7xx->base = base;
@@ -856,10 +844,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)pm_runtime_disable (dev);dra7xx_pcie_disable_phy (dra7xx); -err_link: -while (--i >=0 ) -device_link_del (link[i]); -return ret; }
drivers/pci/controller/dwc/pci-keystone.c +4 -27
@@ -130,7 +130,6 @@ struct keystone_pcie {int num_lanes;u32 num_viewport;struct phy **phy; -struct device_link **link;struct device_node *msi_intc_np;struct irq_domain *intx_irq_domain;struct device_node *np;
@@ -1118,7 +1117,6 @@ static int ks_pcie_probe(struct platform_device *pdev)enum dw_pcie_device_mode mode;struct dw_pcie *pci;struct keystone_pcie *ks_pcie; -struct device_link **link;struct gpio_desc *gpiod;struct resource *res;void __iomem *base;
@@ -1189,31 +1187,17 @@ static int ks_pcie_probe(struct platform_device *pdev)if (!phy)return -ENOMEM ; - link =devm_kcalloc (dev, num_lanes,sizeof (*link),GFP_KERNEL ); -if (!link) -return -ENOMEM ; -for (i =0 ; i < num_lanes; i++) {snprintf (name,sizeof (name),"pcie-phy%d" , i); phy[i] =devm_phy_optional_get (dev, name);if (IS_ERR (phy[i])) { ret =PTR_ERR (phy[i]); - goto err_link; - } - -if (!phy[i]) -continue ; - - link[i] =device_link_add (dev, &phy[i]->dev,DL_FLAG_STATELESS ); -if (!link[i]) { - ret = -EINVAL ; - goto err_link; + goto err; } } ks_pcie->np = np; ks_pcie->pci = pci; - ks_pcie->link = link; ks_pcie->num_lanes = num_lanes; ks_pcie->phy = phy;
@@ -1223,7 +1207,7 @@ static int ks_pcie_probe(struct platform_device *pdev) ret =PTR_ERR (gpiod);if (ret != -EPROBE_DEFER )dev_err (dev,"Failed to get reset GPIO\n" ); - goto err_link; + goto err; }/* Obtain references to the PHYs */
@@ -1238,7 +1222,7 @@ static int ks_pcie_probe(struct platform_device *pdev)if (ret) {dev_err (dev,"failed to enable phy\n" ); - goto err_link; + goto err; }platform_set_drvdata (pdev, ks_pcie);
@@ -1325,25 +1309,18 @@ static int ks_pcie_probe(struct platform_device *pdev)pm_runtime_disable (dev);ks_pcie_disable_phy (ks_pcie); -err_link: -while (--i >=0 && link[i]) -device_link_del (link[i]); - +err:return ret; }static void ks_pcie_remove (struct platform_device *pdev) {struct keystone_pcie *ks_pcie =platform_get_drvdata (pdev); -struct device_link **link = ks_pcie->link; -int num_lanes = ks_pcie->num_lanes;struct device *dev = &pdev->dev;pm_runtime_put (dev);pm_runtime_disable (dev);ks_pcie_disable_phy (ks_pcie); -while (num_lanes--) -device_link_del (link[num_lanes]); }static struct platform_driver ks_pcie_driver = {
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 9/24 ufs: exynos: stop poking into struct phy guts
In reply to Vladimir OlteanThe Exynos host controller driver is clearly a PHY consumer (gets the ufs->phy using devm_phy_get()), but pokes into the guts of struct phy to get the generic_phy->power_count.
The UFS core (specifically ufshcd_link_startup()) may call the variant operation exynos_ufs_pre_link() -> exynos_ufs_phy_init() multiple times if the link startup fails and needs to be retried.
However ufs-exynos shouldn't be doing what it's doing, i.e. looking at the generic_phy->power_count, because in the general sense of the API, a single Generic PHY may have multiple consumers. If ufs-exynos looks at generic_phy->power_count, there's no guarantee that *ufs-exynos* is the one who previously bumped that power count. So it may be powering down the PHY on behalf of another consumer.
The correct way in which this should be handled is ufs-exynos should *remember* whether it has initialized and powered up the PHY before, and power it down during link retries. Not rely on the power_count (which, btw, on the writer side is modified under &phy->mutex, but on the reader side is accessed unlocked). This is a discouraged pattern even if here it doesn't cause functional problems.
---
Cc: Alim Akhtar <[email protected]>
Cc: Peter Griffin <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Chanho Park <[email protected]>
v3->v4: nonev2->v3:
- add Cc Chanho Park, author of commit 3d73b200f989 ("scsi: ufs:
ufs-exynos: Change ufs phy control sequence")v1->v2:
- add better ufs->phy_powered_on handling in exynos_ufs_exit(), exynos_ufs_suspend() and exynos_ufs_resume() which ensures we won't enter a phy->power_count underrun condition
--- drivers/ufs/host/ufs-exynos.c | 24 ++++++++++++++++++++---- drivers/ufs/host/ufs-exynos.h | 1 + 2 files changed, 21 insertions(+), 4 deletions(-)
drivers/ufs/host/ufs-exynos.c +20 -4
@@ -963,9 +963,10 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)phy_set_bus_width (generic_phy, ufs->avail_ln_rx); -if (generic_phy->power_count) { +if (ufs->phy_powered_on) {phy_power_off (generic_phy);phy_exit (generic_phy); + ufs->phy_powered_on = false; } ret =phy_init (generic_phy);
@@ -979,6 +980,8 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs)if (ret) goto out_exit_phy; + ufs->phy_powered_on = true; +return 0 ; out_exit_phy:
@@ -1527,6 +1530,9 @@ static void exynos_ufs_exit(struct ufs_hba *hba) {struct exynos_ufs *ufs =ufshcd_get_variant (hba); +if (!ufs->phy_powered_on) +return ; +phy_power_off (ufs->phy);phy_exit (ufs->phy); }
@@ -1728,8 +1734,10 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,if (ufs->drv_data->suspend) ufs->drv_data->suspend (ufs); -if (!ufshcd_is_link_active (hba)) +if (!ufshcd_is_link_active (hba) && ufs->phy_powered_on) {phy_power_off (ufs->phy); + ufs->phy_powered_on = false; + }return 0 ; }
@@ -1737,9 +1745,17 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op,static int exynos_ufs_resume (struct ufs_hba *hba,enum ufs_pm_op pm_op) {struct exynos_ufs *ufs =ufshcd_get_variant (hba); +int err; -if (!ufshcd_is_link_active (hba)) -phy_power_on (ufs->phy); +if (!ufshcd_is_link_active (hba) && !ufs->phy_powered_on) { + err =phy_power_on (ufs->phy); +if (err) { +dev_err (hba->dev,"Failed to power on PHY: %pe\n" , +ERR_PTR (err)); + }else { + ufs->phy_powered_on = true; + } + }exynos_ufs_config_smu (ufs);exynos_ufs_fmp_resume (hba);
drivers/ufs/host/ufs-exynos.h +1 -0
@@ -227,6 +227,7 @@ struct exynos_ufs {int avail_ln_rx;int avail_ln_tx;int rx_sel_idx; +bool phy_powered_on;struct ufs_pa_layer_attr dev_req_params;struct ufs_phy_time_cfg t_cfg;ktime_t entry_hibern8_t;
Signature · 1 line
2.43.0
Martin K. Petersen
AppliedRe: [PATCH v4 phy-next 09/24] ufs: exynos: stop poking into struct phy guts
Vladimir,
Quoted 3 lines
The Exynos host controller driver is clearly a PHY consumer (gets the
ufs->phyusingdevm_phy_get()), but pokes into the guts of struct phy to get thegeneric_phy->power_count.
Looks OK to me but it would be good to get an ack from Samsung.
Applied to 7.1/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Vladimir Oltean
maintainerPATCH v4 10/24 drm/rockchip: dw_hdmi: avoid direct dereference of phy->dev.of_node
In reply to Vladimir OlteanThe dw_hdmi-rockchip driver validates pixel clock rates against the HDMI PHY's internal clock provider on certain SoCs like RK3328. This is currently achieved by dereferencing hdmi->phy->dev.of_node to obtain the provider node, which violates the Generic PHY API's encapsulation (the goal is for struct phy to be an opaque pointer with a hidden definition, to be interacted with only using API functions or NULL pointer checks, for the case where optional variants of phy_get() did not find a PHY).
Refactor dw_hdmi_rockchip_bind() to perform a manual phandle lookup on the "hdmi" PHY index within the controller's DT node. This provides a parallel path to the clock provider's OF node without relying on the internal structure of the struct phy handle.
---
Cc: Sandy Huang <[email protected]>
Cc: "Heiko Stübner" <[email protected]>
Cc: Andy Yan <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
v3->v4: add commit message clarification of what is understood by
"opaque pointer"v1->v3: none
--- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 25 ++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +15 -10
@@ -537,21 +537,22 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +struct device_node *np =dev_of_node (dev);struct dw_hdmi_plat_data *plat_data;const struct of_device_id *match;struct drm_device *drm = data;struct drm_encoder *encoder;struct rockchip_hdmi *hdmi; -int ret; +int ret, index; -if (!pdev->dev.of_node) +if (!np)return -ENODEV ; hdmi =devm_kzalloc (&pdev->dev,sizeof (*hdmi),GFP_KERNEL );if (!hdmi)return -ENOMEM ; - match =of_match_node (dw_hdmi_rockchip_dt_ids, pdev->dev.of_node); + match =of_match_node (dw_hdmi_rockchip_dt_ids, np); plat_data =devm_kmemdup (&pdev->dev, match->data,sizeof (*plat_data),GFP_KERNEL );if (!plat_data)
@@ -564,9 +565,9 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, plat_data->priv_data = hdmi; encoder = &hdmi->encoder.encoder; - encoder->possible_crtcs =drm_of_find_possible_crtcs (drm, dev->of_node); + encoder->possible_crtcs =drm_of_find_possible_crtcs (drm, np);rockchip_drm_encoder_set_crtc_endpoint_id (&hdmi->encoder, - dev->of_node,0 ,0 ); + np,0 ,0 );/* * If we failed to find the CRTC(s) which this encoder is
@@ -588,13 +589,17 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,return dev_err_probe (hdmi->dev, ret,"failed to get phy\n" ); } -if (hdmi->phy) { + index =of_property_match_string (np,"phy-names" ,"hdmi" ); +if (index >=0 ) {struct of_phandle_args clkspec; - clkspec.np = hdmi->phy->dev.of_node; - hdmi->hdmiphy_clk =of_clk_get_from_provider (&clkspec); -if (IS_ERR (hdmi->hdmiphy_clk)) - hdmi->hdmiphy_clk =NULL ; +if (!of_parse_phandle_with_args (np,"phys" ,"#phy-cells" , index, + &clkspec)) { + hdmi->hdmiphy_clk =of_clk_get_from_provider (&clkspec); +of_node_put (clkspec.np); +if (IS_ERR (hdmi->hdmiphy_clk)) + hdmi->hdmiphy_clk =NULL ; + } }if (hdmi->chip_data == &rk3568_chip_data) {
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 11/24 drm/msm/dp: remove debugging prints with internal struct phy state
In reply to Vladimir OlteanThese do not provide much value, and will become hard to maintain once the Generic PHY framework starts hiding the contents of struct phy from consumers.
---
Cc: Rob Clark <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Abhinav Kumar <[email protected]>
Cc: Jessica Zhang <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Marijn Suijten <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
v3->v4: nonev1->v3: collect tag
--- drivers/gpu/drm/msm/dp/dp_ctrl.c | 18 ------------------ 1 file changed, 18 deletions(-)
drivers/gpu/drm/msm/dp/dp_ctrl.c +0 -18
@@ -1928,9 +1928,6 @@ void msm_dp_ctrl_phy_init(struct msm_dp_ctrl *msm_dp_ctrl)msm_dp_ctrl_phy_reset (ctrl);phy_init (phy); - -drm_dbg_dp (ctrl->drm_dev,"phy=%p init=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); }void msm_dp_ctrl_phy_exit (struct msm_dp_ctrl *msm_dp_ctrl)
@@ -1943,8 +1940,6 @@ void msm_dp_ctrl_phy_exit(struct msm_dp_ctrl *msm_dp_ctrl)msm_dp_ctrl_phy_reset (ctrl);phy_exit (phy); -drm_dbg_dp (ctrl->drm_dev,"phy=%p init=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); }static int msm_dp_ctrl_reinitialize_mainlink (struct msm_dp_ctrl_private *ctrl)
@@ -1996,8 +1991,6 @@ static int msm_dp_ctrl_deinitialize_mainlink(struct msm_dp_ctrl_private *ctrl)phy_exit (phy);phy_init (phy); -drm_dbg_dp (ctrl->drm_dev,"phy=%p init=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count);return 0 ; }
@@ -2588,9 +2581,6 @@ void msm_dp_ctrl_off_link_stream(struct msm_dp_ctrl *msm_dp_ctrl)/* aux channel down, reinit phy */ phy_exit (phy);phy_init (phy); - -drm_dbg_dp (ctrl->drm_dev,"phy=%p init=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); }void msm_dp_ctrl_off_link (struct msm_dp_ctrl *msm_dp_ctrl)
@@ -2606,13 +2596,7 @@ void msm_dp_ctrl_off_link(struct msm_dp_ctrl *msm_dp_ctrl)dev_pm_opp_set_rate (ctrl->dev,0 );msm_dp_ctrl_link_clk_disable (&ctrl->msm_dp_ctrl); -DRM_DEBUG_DP ("Before, phy=%p init_count=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); -phy_power_off (phy); - -DRM_DEBUG_DP ("After, phy=%p init_count=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); }void msm_dp_ctrl_off (struct msm_dp_ctrl *msm_dp_ctrl)
@@ -2638,8 +2622,6 @@ void msm_dp_ctrl_off(struct msm_dp_ctrl *msm_dp_ctrl)msm_dp_ctrl_link_clk_disable (&ctrl->msm_dp_ctrl);phy_power_off (phy); -drm_dbg_dp (ctrl->drm_dev,"phy=%p init=%d power_on=%d\n" , - phy, phy->init_count, phy->power_count); }irqreturn_t msm_dp_ctrl_isr (struct msm_dp_ctrl *msm_dp_ctrl)
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 12/24 phy: move provider API out of public <linux/phy/phy.h>
In reply to Vladimir OlteanThe major goal is to hide the contents of struct phy from consumer drivers.
The idea with "phy-props.h" is that both consumers and providers make use of some data types. So both headers include "phy-props.h".
Some slight points of contention.
1. phy_set_bus_width(): Vinod explains that despite the current caller situation (9 providers, 1 consumer), it is a consumer API function.
The use case is that the controller (for example UFS) may have limitations and should set the expected lanes to be used and width on those lanes. A number of Generic PHYs can support multiple lanes and multiple width so this is way for controller telling I am using this configuration.
2. phy-provider.h should go to include/linux/phy/ or to drivers/phy/? We do have 3 PHY providers outside of drivers/phy/:
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_dphy.c drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
but the practice is not encouraged, and with time, these should be moved to the subsystem. This is not something that I can do now.
3. We can no longer tolerate static inline helpers. Allowing these would make it impossible to hide the struct phy definition from consumers. I've made phy_get_mode(), phy_get_bus_width(), phy_set_bus_width() exported symbols in drivers/phy/phy-core.c.
4. This is not a change without side effects. In the transition we are no longer providing <linux/pm_runtime.h> at all, and <linux/regulator/consumer.h> to PHY consumer drivers. However, the in-tree dependencies should all have been resolved. Also, the movement of phy-provider.h to drivers/phy/ is at least "interesting" for out of tree PHY provider drivers (this header is not deployed by make headers_install). However, it seems to be what Vinod is looking to see.
For temporary compatibility, keep including the provider header. This will be removed when abuses are all gotten rid of.
---v2->v4: nonev1->v2:
- collect tag
- fix path to phy-provider.h
- update commit message with the 4th point of contention
--- drivers/phy/phy-core.c | 34 +++ drivers/phy/phy-provider.h | 256 +++++++++++++++++ include/linux/phy/phy-props.h | 75 +++++ include/linux/phy/phy.h | 497 +++++++--------------------------- 4 files changed, 456 insertions(+), 406 deletions(-) create mode 100644 drivers/phy/phy-provider.h create mode 100644 include/linux/phy/phy-props.h
drivers/phy/phy-core.c +34 -0
@@ -20,6 +20,22 @@#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#define to_phy (a) (container_of((a), struct phy, dev)) + +/** +* struct phy_lookup - PHY association in list of phys managed by the phy driver +* @node: list node +* @dev_id: the device of the association +* @con_id: connection ID string on device +* @phy: the phy of the association +*/ +struct phy_lookup { +struct list_head node; +const char *dev_id; +const char *con_id; +struct phy *phy; +}; +static void phy_release (struct device *dev);static const struct class phy_class = { .name ="phy" ,
@@ -606,6 +622,24 @@ int phy_validate(struct phy *phy, enum phy_mode mode, int submode, }EXPORT_SYMBOL_GPL (phy_validate); +enum phy_mode phy_get_mode (struct phy *phy) +{ +return phy->attrs.mode; +} +EXPORT_SYMBOL_GPL (phy_get_mode); + +int phy_get_bus_width (struct phy *phy) +{ +return phy->attrs.bus_width; +} +EXPORT_SYMBOL_GPL (phy_get_bus_width); + +void phy_set_bus_width (struct phy *phy,int bus_width) +{ + phy->attrs.bus_width = bus_width; +} +EXPORT_SYMBOL_GPL (phy_set_bus_width); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy
drivers/phy/phy-provider.h new file +256 -0
256 lines not on this page · raw message
include/linux/phy/phy-props.h new file +75 -0
75 lines not on this page · raw message
include/linux/phy/phy.h +91 -406
579 lines not on this page · raw message
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 13/24 phy: make phy_get_mode(), phy_(get|set)_bus_width() NULL tolerant
In reply to Vladimir OlteanThe PHY API has an optional "get" which returns NULL, so it needs to accept that NULL coming back in.
Most PHY functions do this, only the formerly static inline attribute dereferences did not.
---v2->v4: nonev1->v2: patch is new
--- drivers/phy/phy-core.c | 9 ++++++++- include/linux/phy/phy.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/phy/phy-core.c +8 -1
@@ -624,19 +624,26 @@ EXPORT_SYMBOL_GPL(phy_validate);enum phy_mode phy_get_mode (struct phy *phy) { +if (!phy) +return PHY_MODE_INVALID ; +return phy->attrs.mode; }EXPORT_SYMBOL_GPL (phy_get_mode);int phy_get_bus_width (struct phy *phy) { +if (!phy) +return 0 ; +return phy->attrs.bus_width; }EXPORT_SYMBOL_GPL (phy_get_bus_width);void phy_set_bus_width (struct phy *phy,int bus_width) { - phy->attrs.bus_width = bus_width; +if (phy) + phy->attrs.bus_width = bus_width; }EXPORT_SYMBOL_GPL (phy_set_bus_width);
include/linux/phy/phy.h +2 -0
@@ -248,6 +248,8 @@ static inline int phy_notify_state(struct phy *phy, union phy_notify state)static inline int phy_get_bus_width (struct phy *phy) { +if (!phy) +return 0 ;return -ENOSYS ; }
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 14/24 phy: introduce phy_get_max_link_rate() helper for consumers
In reply to Vladimir OlteanConsumer drivers shouldn't dereference struct phy, not even to get to its attributes.
We have phy_get_bus_width() as a precedent for getting the bus_width attribute, so let's add phy_get_max_link_rate() and use it in DRM and CAN drivers.
In CAN drivers, the transceiver is acquired through devm_phy_optional_get() and NULL is given by the API as a non-error case, so the PHY API should also tolerate NULL coming back to it. This means we can further simplify the call sites that test for the NULL quality of the transceiver.
---
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Andy Yan <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: Vincent Mailhol <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Claudiu Beznea <[email protected]>
Cc: Markus Schneider-Pargmann <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Magnus Damm <[email protected]>
v3->v4: nonev2->v3: collect tagv1->v2: make phy_get_bus_width() NULL-tolerant to simplify CAN callers
--- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 4 ++-- drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2 +- drivers/net/can/at91_can.c | 3 +-- drivers/net/can/flexcan/flexcan-core.c | 3 +-- drivers/net/can/m_can/m_can_platform.c | 3 +-- drivers/net/can/rcar/rcar_canfd.c | 3 +-- drivers/phy/phy-core.c | 9 +++++++++ include/linux/phy/phy.h | 6 ++++++ 8 files changed, 22 insertions(+), 11 deletions(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +2 -2
@@ -1300,7 +1300,7 @@ static u32 cdns_mhdp_get_training_interval_us(struct cdns_mhdp_device *mhdp,static void cdns_mhdp_fill_host_caps (struct cdns_mhdp_device *mhdp) { -unsigned int link_rate; +u32 link_rate;/* Get source capabilities based on PHY attributes */
@@ -1308,7 +1308,7 @@ static void cdns_mhdp_fill_host_caps(struct cdns_mhdp_device *mhdp)if (!mhdp->host.lanes_cnt) mhdp->host.lanes_cnt =4 ; - link_rate = mhdp->phy->attrs.max_link_rate; + link_rate =phy_get_max_link_rate (mhdp->phy);if (!link_rate) link_rate =drm_dp_bw_code_to_link_rate (DP_LINK_BW_8_1 );else
drivers/gpu/drm/bridge/synopsys/dw-dp.c +1 -1
@@ -536,7 +536,7 @@ static int dw_dp_link_parse(struct dw_dp *dp, struct drm_connector *connector) link->revision = link->dpcd[DP_DPCD_REV ]; link->rate =min_t (u32,min (dp->plat_data.max_link_rate, - dp->phy->attrs.max_link_rate *100 ), +phy_get_max_link_rate (dp->phy) *100 ),drm_dp_max_link_rate (link->dpcd)); link->lanes =min_t (u8,phy_get_bus_width (dp->phy),drm_dp_max_lane_count (link->dpcd));
drivers/net/can/at91_can.c +1 -2
@@ -1125,8 +1125,7 @@ static int at91_can_probe(struct platform_device *pdev)can_rx_offload_add_timestamp (dev, &priv->offload); -if (transceiver) - priv->can.bitrate_max = transceiver->attrs.max_link_rate; + priv->can.bitrate_max =phy_get_max_link_rate (transceiver);if (at91_is_sam9263 (priv)) dev->sysfs_groups[0 ] = &at91_sysfs_attr_group;
drivers/net/can/flexcan/flexcan-core.c +1 -2
@@ -2210,8 +2210,7 @@ static int flexcan_probe(struct platform_device *pdev) priv->reg_xceiver = reg_xceiver; priv->transceiver = transceiver; -if (transceiver) - priv->can.bitrate_max = transceiver->attrs.max_link_rate; + priv->can.bitrate_max =phy_get_max_link_rate (transceiver);if (priv->devtype_data.quirks &FLEXCAN_QUIRK_NR_IRQ_3 ) { priv->irq_boff =platform_get_irq (pdev,1 );
drivers/net/can/m_can/m_can_platform.c +1 -2
@@ -131,8 +131,7 @@ static int m_can_plat_probe(struct platform_device *pdev) goto probe_fail; } -if (transceiver) - mcan_class->can.bitrate_max = transceiver->attrs.max_link_rate; + mcan_class->can.bitrate_max =phy_get_max_link_rate (transceiver); priv->base = addr; priv->mram_base = mram_addr;
drivers/net/can/rcar/rcar_canfd.c +1 -2
@@ -1884,8 +1884,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, priv->transceiver = transceiver; priv->channel = ch; priv->gpriv = gpriv; -if (transceiver) - priv->can.bitrate_max = transceiver->attrs.max_link_rate; + priv->can.bitrate_max =phy_get_max_link_rate (transceiver); priv->can.clock.freq = fcan_freq;dev_info (dev,"can_clk rate is %u\n" , priv->can.clock.freq);
drivers/phy/phy-core.c +9 -0
@@ -647,6 +647,15 @@ void phy_set_bus_width(struct phy *phy, int bus_width) }EXPORT_SYMBOL_GPL (phy_set_bus_width); +u32 phy_get_max_link_rate (struct phy *phy) +{ +if (!phy) +return 0 ; + +return phy->attrs.max_link_rate; +} +EXPORT_SYMBOL_GPL (phy_get_max_link_rate); +/** * _of_phy_get() - lookup and obtain a reference to a phy by phandle * @np: device_node for which to get the phy
include/linux/phy/phy.h +6 -0
@@ -57,6 +57,7 @@ int phy_notify_disconnect(struct phy *phy, int port);int phy_notify_state (struct phy *phy,union phy_notify state);int phy_get_bus_width (struct phy *phy);void phy_set_bus_width (struct phy *phy,int bus_width); +u32 phy_get_max_link_rate (struct phy *phy);#else static inline struct phy *phy_get (struct device *dev,const char *string) {
@@ -256,6 +257,11 @@ static inline int phy_get_bus_width(struct phy *phy)static inline void phy_set_bus_width (struct phy *phy,int bus_width) { } + +static inline u32 phy_get_max_link_rate (struct phy *phy) +{ +return 0 ; +}#endif /* IS_ENABLED(CONFIG_GENERIC_PHY) */ #endif /* __PHY_CONSUMER_H */
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 15/24 drm/rockchip: dsi: include PHY provider header
In reply to Vladimir OlteanThe Rockchip DSI controller is a PHY consumer driver, which is also a PHY provider (calls devm_phy_create()) that lives out of drivers/phy/.
According to Vinod, this is discouraged, although it would be difficult for me to address a proper movement here.
---
Cc: Sandy Huang <[email protected]>
Cc: "Heiko Stübner" <[email protected]>
Cc: Andy Yan <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
v3->v4: nonev2->v3: fix cc listv1->v2: none
--- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +1 -0
@@ -27,6 +27,7 @@#include <drm/drm_print.h> #include <drm/drm_simple_kms_helper.h> +#include "../../../phy/phy-provider.h" /* FIXME */ #include "rockchip_drm_drv.h" #define DSI_PHY_RSTZ 0xa0
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 16/24 drm: bridge: cdns-mhdp8546: use consumer API for getting PHY bus width
In reply to Vladimir OlteanThe Cadence MHDP8546 DP bridge driver gets the PHY bus_width attribute (holding number of lanes) directly, but doing this will no longer be possible after the definition of struct phy is hidden from consumers.
Use the phy_get_bus_width() API function designed specifically for consumers.
---
Cc: Andrzej Hajda <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
v1->v4: none
--- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1 -1
@@ -1304,7 +1304,7 @@ static void cdns_mhdp_fill_host_caps(struct cdns_mhdp_device *mhdp)/* Get source capabilities based on PHY attributes */ - mhdp->host.lanes_cnt = mhdp->phy->attrs.bus_width; + mhdp->host.lanes_cnt =phy_get_bus_width (mhdp->phy);if (!mhdp->host.lanes_cnt) mhdp->host.lanes_cnt =4 ;
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 17/24 media: sunxi: a83-mips-csi2: include PHY provider header
In reply to Vladimir OlteanThe introduction commit 576d196c522b ("media: sunxi: Add support for the A83T MIPI CSI-2 controller") says:
This implementation splits the protocol and D-PHY registers and uses the PHY framework internally. The D-PHY is not registered as a standalone PHY driver since it cannot be used with any other controller.
However, this does not matter, and is not the only instance of tight PHY provider <-> consumer pairing. According to Vinod Koul, having PHY provider drivers outside of drivers/phy/ is discouraged, although it would be difficult for me to address a proper movement here.
So just include the private provider API header from drivers/phy/ and leave a FIXME in place.
---
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Samuel Holland <[email protected]>
v3->v4: collect tagv1->v3: none
--- .../media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_dphy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_dphy.c +1 -1
@@ -4,9 +4,9 @@* Author: Paul Kocialkowski <[email protected]> */ -#include <linux/phy/phy.h> #include <linux/regmap.h> +#include "../../../../phy/phy-provider.h" /* FIXME */ #include "sun8i_a83t_dphy.h" #include "sun8i_a83t_mipi_csi2.h"
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 18/24 net: renesas: rswitch: include PHY provider header
In reply to Vladimir OlteanAs a PHY consumer driver, the Renesas rswitch dereferences internal fields of struct phy, something which shouldn't be done, as that is going to be made an opaque pointer.
It is quite clearly visible that the driver is tightly coupled with the drivers/phy/renesas/r8a779f0-ether-serdes.c, which puts heavy pressure on the Generic PHY subsystem.
This was discussed before here:
https://lore.kernel.org/linux-phy/20260211194541.cdmibrpfn6ej6e74@skbuf/
but to summarize, it is generally expected that when a Generic PHY function is called, it takes effect immediately. When this doesn't happen, the PHY provider driver must change its implementation rather than the consumer be made to work around it. PHY providers which rely on a hardcoded call sequence in the consumer are just lazy and wrong.
The most obvious example is commit 5cb630925b49 ("net: renesas: rswitch:
Add phy_power_{on,off}() calling"). Problem description:
- Ethernet PHYs may change phydev->interface. When this happens, the SerDes must learn of the new phydev->interface using phy_set_mode_ext().
- drivers/phy/renesas/r8a779f0-ether-serdes.c implements phy_set_mode_ext(), but this only caches the mode and submode into channel->phy_interface and applies this to hardware during phy_power_on().
The commit author decided to work around this at the consumer site, by power cycling the PHY for the configuration to take effect.
This had a worse implication from an API perspective in subsequent commit 053f13f67be6 ("rswitch: Fix imbalance phy_power_off() calling"). It was observed that phy_power_on() and phy_power_off() calls need to be balanced, and so, the consumer decided to start looking at the struct phy :: power_count (the technical reason why I'm making this change).
This is also wrong from an API perspective because
- a consumer should only care about its own vote on the PHY power state. If this is a multi-port submode like QSGMII, a single phy_power_off() call will not actually turn the PHY off (nor should it).
- the power_count is written under the &phy->mutex, but read unlocked here.
The rswitch and r8a779f0-ether-serdes drivers both need to be completely rethought in terms of Generic PHY API call sequence. There is no quick fix to apply. Just include the PHY provider API along with the consumer one, to keep working as before when struct phy will be made an opaque pointer to normal PHY consumers. But this is a bad offender (and it's not even a provider) so add a FIXME.
---
Cc: Yoshihiro Shimoda <[email protected]>
Cc: Michael Dege <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: "Russell King (Oracle)" <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/net/ethernet/renesas/rswitch_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/renesas/rswitch_main.c +1 -0
@@ -27,6 +27,7 @@#include <linux/spinlock.h> #include <linux/sys_soc.h> +#include "../../../phy/phy-provider.h" /* FIXME */ #include "rswitch.h" #include "rswitch_l2.h"
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 19/24 pinctrl: tegra-xusb: include PHY provider header
In reply to Vladimir OlteanThe tegra-xusb pinctrl driver is also a PHY provider (calls devm_phy_create() for PCIe and SATA). However, according to Vinod Koul, having PHY provider drivers outside of drivers/phy/ is discouraged, although it would be difficult for me to address a proper movement here.
Include the private provider API header from drivers/phy/, but leave a FIXME in place. It will have to be moved, eventually.
---
Cc: Linus Walleij <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/pinctrl/tegra/pinctrl-tegra-xusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/tegra/pinctrl-tegra-xusb.c +1 -1
@@ -7,7 +7,6 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> #include <linux/seq_file.h>
@@ -19,6 +18,7 @@#include <dt-bindings/pinctrl/pinctrl-tegra-xusb.h> +#include "../../phy/phy-provider.h" /* FIXME */ #include "../core.h" #include "../pinctrl-utils.h"
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 20/24 power: supply: cpcap-charger: include missing <linux/property.h>
In reply to Vladimir OlteanThis file uses dev_fwnode() without including the proper header for it, relying on transitive header inclusion from:
drivers/power/supply/cpcap-charger.c
- include/linux/phy/omap_usb.h
- include/linux/usb/phy_companion.h
- include/linux/usb/otg.h
- include/linux/phy/phy.h
- drivers/phy/phy-provider.h
- include/linux/of.h
- include/linux/property.h
With the future removal of drivers/phy/phy-provider.h from include/linux/phy/phy.h, this transitive inclusion would break.
---
Cc: Sebastian Reichel <[email protected]>
v2->v4: nonev1->v2: collect tag
--- drivers/power/supply/cpcap-charger.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/supply/cpcap-charger.c +1 -0
@@ -21,6 +21,7 @@#include <linux/mod_devicetable.h> #include <linux/platform_device.h> #include <linux/power_supply.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/gpio/consumer.h>
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 21/24 phy: include PHY provider header (1/2)
In reply to Vladimir OlteanThe majority of PHY drivers are PHY providers (obviously).
Some are providers *and* consumers (phy-meson-axg-mipi-dphy, phy-meson-axg-pcie). These are the Amlogic AXG SoCs, which split the physical layer into two chained PHYs: the digital layer and the analog layer. The DSI or PCIe controller interacts only with the digital PHY, presumably for simplicity.
The rest of PHY drivers which include <linux/phy/phy.h> do so because they call phy_set_bus_width(), a consumer function.
---
Conflicts in drivers/phy/canaan/phy-k230-usb.c with commit 8787fa1da603 ("phy: usb: Add driver for Canaan K230 USB 2.0 PHY"). Conflicts in drivers/phy/eswin/phy-eic7700-sata.c with commit 67ee9ccaa34a ("phy: eswin: Create eswin directory and add EIC7700 SATA PHY driver")
Both drivers are newly added in linux-phy/next and not present in v7.0-rc1. The recommendation is to drop the changes in this patch and readd them when merging into linux-phy/next.
v2->v3: add conflict resolution detailsv1->v2: split in two parts to pass through linux-phy mailing list moderation
--- drivers/phy/allwinner/phy-sun4i-usb.c | 3 ++- drivers/phy/allwinner/phy-sun50i-usb3.c | 3 ++- drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 ++-- drivers/phy/allwinner/phy-sun9i-usb.c | 3 ++- drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c | 2 ++ drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 3 ++- drivers/phy/amlogic/phy-meson-axg-pcie.c | 2 ++ drivers/phy/amlogic/phy-meson-g12a-mipi-dphy-analog.c | 3 ++- drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 ++ drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c | 3 ++- drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 ++- drivers/phy/amlogic/phy-meson8-hdmi-tx.c | 3 ++- drivers/phy/amlogic/phy-meson8b-usb2.c | 3 ++- drivers/phy/apple/atc.c | 3 ++- drivers/phy/broadcom/phy-bcm-cygnus-pcie.c | 3 ++- drivers/phy/broadcom/phy-bcm-kona-usb2.c | 4 +++- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 3 ++- drivers/phy/broadcom/phy-bcm-ns-usb3.c | 3 ++- drivers/phy/broadcom/phy-bcm-ns2-pcie.c | 3 ++- drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c | 3 ++- drivers/phy/broadcom/phy-bcm-sr-pcie.c | 3 ++- drivers/phy/broadcom/phy-bcm-sr-usb.c | 3 ++- drivers/phy/broadcom/phy-bcm63xx-usbh.c | 3 ++- drivers/phy/broadcom/phy-brcm-sata.c | 3 ++- drivers/phy/broadcom/phy-brcm-usb.c | 2 +- drivers/phy/cadence/cdns-dphy-rx.c | 3 ++- drivers/phy/cadence/cdns-dphy.c | 4 ++-- drivers/phy/cadence/phy-cadence-salvo.c | 3 ++- drivers/phy/cadence/phy-cadence-sierra.c | 3 ++- drivers/phy/cadence/phy-cadence-torrent.c | 3 ++- drivers/phy/canaan/phy-k230-usb.c | 3 ++- drivers/phy/eswin/phy-eic7700-sata.c | 3 ++- drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c | 3 ++- drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 4 ++-- drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 3 ++- drivers/phy/freescale/phy-fsl-imx8qm-hsio.c | 6 +++--- drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 3 ++- drivers/phy/freescale/phy-fsl-lynx-28g.c | 3 ++- drivers/phy/hisilicon/phy-hi3660-usb3.c | 3 ++- drivers/phy/hisilicon/phy-hi3670-pcie.c | 3 ++- drivers/phy/hisilicon/phy-hi3670-usb3.c | 3 ++- drivers/phy/hisilicon/phy-hi6220-usb.c | 3 ++- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 4 +++- drivers/phy/hisilicon/phy-histb-combphy.c | 3 ++- drivers/phy/hisilicon/phy-hix5hd2-sata.c | 3 ++- drivers/phy/ingenic/phy-ingenic-usb.c | 3 ++- drivers/phy/intel/phy-intel-keembay-emmc.c | 3 ++- drivers/phy/intel/phy-intel-keembay-usb.c | 3 ++- drivers/phy/intel/phy-intel-lgm-combo.c | 4 ++-- drivers/phy/intel/phy-intel-lgm-emmc.c | 3 ++- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 3 ++- drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c | 4 ++-- drivers/phy/marvell/phy-armada375-usb2.c | 3 ++- drivers/phy/marvell/phy-armada38x-comphy.c | 3 ++- drivers/phy/marvell/phy-berlin-sata.c | 3 ++- drivers/phy/marvell/phy-berlin-usb.c | 3 ++- drivers/phy/marvell/phy-mmp3-hsic.c | 3 ++- drivers/phy/marvell/phy-mmp3-usb.c | 3 ++- drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 3 ++- drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 3 ++- drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 3 ++- drivers/phy/marvell/phy-mvebu-cp110-utmi.c | 3 ++- drivers/phy/marvell/phy-mvebu-sata.c | 3 ++- drivers/phy/marvell/phy-pxa-28nm-hsic.c | 3 ++- drivers/phy/marvell/phy-pxa-28nm-usb2.c | 3 ++- drivers/phy/marvell/phy-pxa-usb.c | 3 ++- drivers/phy/mediatek/phy-mtk-dp.c | 3 ++- drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 1 - drivers/phy/mediatek/phy-mtk-hdmi.h | 3 ++- drivers/phy/mediatek/phy-mtk-mipi-csi-0-5.c | 2 +- drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 3 ++- drivers/phy/mediatek/phy-mtk-pcie.c | 2 +- drivers/phy/mediatek/phy-mtk-tphy.c | 2 +- drivers/phy/mediatek/phy-mtk-ufs.c | 2 +- drivers/phy/mediatek/phy-mtk-xfi-tphy.c | 2 +- drivers/phy/mediatek/phy-mtk-xsphy.c | 2 +- drivers/phy/microchip/lan966x_serdes.c | 4 ++-- drivers/phy/microchip/sparx5_serdes.c | 2 +- drivers/phy/motorola/phy-cpcap-usb.c | 3 ++- drivers/phy/motorola/phy-mapphone-mdm6600.c | 4 +++- drivers/phy/mscc/phy-ocelot-serdes.c | 3 ++- drivers/phy/nuvoton/phy-ma35d1-usb2.c | 3 ++- drivers/phy/phy-airoha-pcie.c | 2 +- drivers/phy/phy-can-transceiver.c | 3 ++- drivers/phy/phy-core-mipi-dphy.c | 4 ++-- drivers/phy/phy-core.c | 2 ++ drivers/phy/phy-google-usb.c | 3 ++- drivers/phy/phy-lpc18xx-usb-otg.c | 3 ++- drivers/phy/phy-nxp-ptn3222.c | 3 ++- drivers/phy/phy-pistachio-usb.c | 4 ++-- drivers/phy/phy-snps-eusb2.c | 2 ++ drivers/phy/phy-xgene.c | 3 ++- 92 files changed, 177 insertions(+), 97 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +2 -1
@@ -23,7 +23,6 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-sun4i-usb.h> #include <linux/platform_device.h> #include <linux/power_supply.h>
@@ -33,6 +32,8 @@#include <linux/usb/of.h> #include <linux/workqueue.h> +#include "../phy-provider.h" +#define REG_ISCR 0x00#define REG_PHYCTL_A10 0x04#define REG_PHYBIST 0x08
drivers/phy/allwinner/phy-sun50i-usb3.c +2 -1
@@ -18,10 +18,11 @@#include <linux/io.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +/* Interface Status and Control Registers */ #define SUNXI_ISCR 0x00#define SUNXI_PIPE_CLOCK_CONTROL 0x14
drivers/phy/allwinner/phy-sun6i-mipi-dphy.c +2 -2
@@ -10,12 +10,12 @@#include <linux/clk.h> #include <linux/module.h> #include <linux/of_address.h> +#include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <linux/phy/phy.h> -#include <linux/phy/phy-mipi-dphy.h> +#include "../phy-provider.h" #define SUN6I_DPHY_GCTL_REG 0x00#define SUN6I_DPHY_GCTL_LANE_NUM (n) ((((n) - 1) & 3) << 4)
drivers/phy/allwinner/phy-sun9i-usb.c +2 -1
@@ -15,11 +15,12 @@#include <linux/err.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/usb/of.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define SUNXI_AHB_INCR16_BURST_EN BIT(11)#define SUNXI_AHB_INCR8_BURST_EN BIT(10)#define SUNXI_AHB_INCR4_BURST_EN BIT(9)
drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c +2 -0
@@ -20,6 +20,8 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +/* [31] soft reset for the phy. * 1: reset. 0: dessert the reset. * [30] clock lane soft reset.
drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c +2 -1
@@ -7,7 +7,6 @@#include <linux/bitfield.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> #include <linux/delay.h> #include <linux/mfd/syscon.h>
@@ -15,6 +14,8 @@#include <linux/platform_device.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define HHI_MIPI_CNTL0 0x00#define HHI_MIPI_CNTL0_COMMON_BLOCK GENMASK(31, 28)#define HHI_MIPI_CNTL0_ENABLE BIT(29)
drivers/phy/amlogic/phy-meson-axg-pcie.c +2 -0
@@ -13,6 +13,8 @@#include <linux/bitfield.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define MESON_PCIE_REG0 0x00#define MESON_PCIE_COMMON_CLK BIT(4)#define MESON_PCIE_PORT_SEL GENMASK(3, 2)
drivers/phy/amlogic/phy-meson-g12a-mipi-dphy-analog.c +2 -1
@@ -9,7 +9,6 @@#include <linux/bitfield.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> #include <linux/delay.h> #include <linux/mfd/syscon.h>
@@ -17,6 +16,8 @@#include <linux/platform_device.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define HHI_MIPI_CNTL0 0x00#define HHI_MIPI_CNTL0_DIF_REF_CTL1 GENMASK(31, 16)#define HHI_MIPI_CNTL0_DIF_REF_CTL0 GENMASK(15, 0)
drivers/phy/amlogic/phy-meson-g12a-usb2.c +2 -0
@@ -20,6 +20,8 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define PHY_CTRL_R0 0x0#define PHY_CTRL_R1 0x4#define PHY_CTRL_R2 0x8
drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c +2 -1
@@ -12,12 +12,13 @@#include <linux/clk.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/platform_device.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define PHY_R0 0x00#define PHY_R0_PCIE_POWER_STATE GENMASK(4, 0)#define PHY_R0_PCIE_USB3_SWITCH GENMASK(6, 5)
drivers/phy/amlogic/phy-meson-gxl-usb2.c +2 -1
@@ -12,9 +12,10 @@#include <linux/module.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +/* bits [31:27] are read-only */ #define U2P_R0 0x0#define U2P_R0_BYPASS_SEL BIT(0)
drivers/phy/amlogic/phy-meson8-hdmi-tx.c +2 -1
@@ -11,11 +11,12 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* * Unfortunately there is no detailed documentation available for the * HHI_HDMI_PHY_CNTL0 register. CTL0 and CTL1 is all we know about.
drivers/phy/amlogic/phy-meson8b-usb2.c +2 -1
@@ -14,10 +14,11 @@#include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/usb/of.h> +#include "../phy-provider.h" +#define REG_CONFIG 0x00#define REG_CONFIG_CLK_EN BIT(0)#define REG_CONFIG_CLK_SEL_MASK GENMASK(3, 1)
drivers/phy/apple/atc.c +2 -1
@@ -32,7 +32,6 @@#include <linux/mutex.h> #include <linux/of.h> #include <linux/of_device.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset-controller.h> #include <linux/soc/apple/tunable.h>
@@ -44,6 +43,8 @@#include <linux/usb/typec_mux.h> #include <linux/usb/typec_tbt.h> +#include "../phy-provider.h" +#define AUSPLL_FSM_CTRL 0x1014#define AUSPLL_APB_CMD_OVERRIDE 0x2000
drivers/phy/broadcom/phy-bcm-cygnus-pcie.c +2 -1
@@ -5,9 +5,10 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define PCIE_CFG_OFFSET 0x00#define PCIE1_PHY_IDDQ_SHIFT 10#define PCIE0_PHY_IDDQ_SHIFT 2
drivers/phy/broadcom/phy-bcm-kona-usb2.c +3 -1
@@ -12,9 +12,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> +#include <linux/phy/phy.h> /* for phy_set_bus_width() */ #include <linux/platform_device.h> +#include "../phy-provider.h" +#define OTGCTL (0)#define OTGCTL_OTGSTAT2 BIT(31)#define OTGCTL_OTGSTAT1 BIT(30)
drivers/phy/broadcom/phy-bcm-ns-usb2.c +2 -1
@@ -13,11 +13,12 @@#include <linux/module.h> #include <linux/of_address.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/slab.h> +#include "../phy-provider.h" +struct bcm_ns_usb2 {struct device *dev;struct clk *ref_clk;
drivers/phy/broadcom/phy-bcm-ns-usb3.c +2 -1
@@ -19,10 +19,11 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/property.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define BCM_NS_USB3_PHY_BASE_ADDR_REG 0x1f#define BCM_NS_USB3_PHY_PLL30_BLOCK 0x8000#define BCM_NS_USB3_PHY_TX_PMD_BLOCK 0x8040
drivers/phy/broadcom/phy-bcm-ns2-pcie.c +2 -1
@@ -6,7 +6,8 @@#include <linux/of_mdio.h> #include <linux/mdio.h> #include <linux/phy.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" #define BLK_ADDR_REG_OFFSET 0x1f#define PLL_AFE1_100MHZ_BLK 0x2100
drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c +2 -1
@@ -14,12 +14,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include "../phy-provider.h" +#define ICFG_DRD_AFE 0x0#define ICFG_MISC_STAT 0x18#define ICFG_DRD_P0CTL 0x1C
drivers/phy/broadcom/phy-bcm-sr-pcie.c +2 -1
@@ -9,10 +9,11 @@#include <linux/module.h> #include <linux/mfd/syscon.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* we have up to 8 PAXB based RC. The 9th one is always PAXC */ #define SR_NR_PCIE_PHYS 9#define SR_PAXC_PHY_IDX (SR_NR_PCIE_PHYS - 1)
drivers/phy/broadcom/phy-bcm-sr-usb.c +2 -1
@@ -8,9 +8,10 @@#include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +enum bcm_usb_phy_version {BCM_SR_USB_COMBO_PHY ,BCM_SR_USB_HS_PHY ,
drivers/phy/broadcom/phy-bcm63xx-usbh.c +2 -1
@@ -18,10 +18,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +/* USBH control register offsets */ enum usbh_regs {USBH_BRT_CONTROL1 =0 ,
drivers/phy/broadcom/phy-brcm-sata.c +2 -1
@@ -13,9 +13,10 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define SATA_PCB_BANK_OFFSET 0x23c#define SATA_PCB_REG_OFFSET (ofs) ((ofs) * 4)
drivers/phy/broadcom/phy-brcm-usb.c +1 -1
@@ -11,7 +11,6 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/soc/brcmstb/brcmstb.h>
@@ -19,6 +18,7 @@#include <linux/mfd/syscon.h> #include <linux/suspend.h> +#include "../phy-provider.h" #include "phy-brcm-usb-init.h" static DEFINE_MUTEX (sysfs_lock);
drivers/phy/cadence/cdns-dphy-rx.c +2 -1
@@ -9,12 +9,13 @@#include <linux/iopoll.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/sys_soc.h> +#include "../phy-provider.h" +#define DPHY_PMA_CMN (reg) (reg)#define DPHY_PCS (reg) (0xb00 + (reg))#define DPHY_ISO (reg) (0xc00 + (reg))
drivers/phy/cadence/cdns-dphy.c +2 -2
@@ -10,11 +10,11 @@#include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/reset.h> -#include <linux/phy/phy.h> -#include <linux/phy/phy-mipi-dphy.h> +#include "../phy-provider.h" #define REG_WAKEUP_TIME_NS 800#define DPHY_PLL_RATE_HZ 108000000
drivers/phy/cadence/phy-cadence-salvo.c +2 -1
@@ -10,12 +10,13 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/of.h> #include <linux/of_platform.h> +#include "../phy-provider.h" +#define USB3_PHY_OFFSET 0x0#define USB2_PHY_OFFSET 0x38000/* USB3 PHY register definition */
drivers/phy/cadence/phy-cadence-sierra.c +2 -1
@@ -12,7 +12,6 @@#include <linux/err.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h>
@@ -23,6 +22,8 @@#include <dt-bindings/phy/phy.h> #include <dt-bindings/phy/phy-cadence.h> +#include "../phy-provider.h" +#define NUM_SSC_MODE 3#define NUM_PHY_TYPE 5
drivers/phy/cadence/phy-cadence-torrent.c +2 -1
@@ -17,11 +17,12 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define REF_CLK_19_2MHZ 19200000#define REF_CLK_25MHZ 25000000#define REF_CLK_100MHZ 100000000
drivers/phy/canaan/phy-k230-usb.c +2 -1
@@ -8,9 +8,10 @@#include <linux/bitfield.h> #include <linux/io.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define MAX_PHYS 2/* Register offsets within the HiSysConfig system controller */
drivers/phy/eswin/phy-eic7700-sata.c +2 -1
@@ -14,11 +14,12 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define SATA_AXI_LP_CTRL 0x08#define SATA_MPLL_CTRL 0x20#define SATA_P0_PHY_STAT 0x24
drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c +2 -1
@@ -16,11 +16,12 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <dt-bindings/firmware/imx/rsrc.h> +#include "../phy-provider.h" +/* Control and Status Registers(CSR) */ #define PHY_CTRL 0x00#define CCM_MASK GENMASK(7, 5)
drivers/phy/freescale/phy-fsl-imx8m-pcie.c +2 -2
@@ -3,6 +3,7 @@* Copyright 2021 NXP */ +#include <dt-bindings/phy/phy-imx8-pcie.h> #include <linux/bitfield.h> #include <linux/clk.h> #include <linux/delay.h>
@@ -12,12 +13,11 @@#include <linux/mfd/syscon/imx7-iomuxc-gpr.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <dt-bindings/phy/phy-imx8-pcie.h> +#include "../phy-provider.h" #define IMX8MM_PCIE_PHY_CMN_REG061 0x184#define ANA_PLL_CLK_OUT_TO_EXT_IO_EN BIT(0)
drivers/phy/freescale/phy-fsl-imx8mq-usb.c +2 -1
@@ -7,11 +7,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/usb/typec_mux.h> +#include "../phy-provider.h" +#define PHY_CTRL0 0x0#define PHY_CTRL0_REF_SSP_EN BIT(2)#define PHY_CTRL0_FSEL_MASK GENMASK(10, 5)
drivers/phy/freescale/phy-fsl-imx8qm-hsio.c +3 -3
@@ -3,6 +3,8 @@* Copyright 2024 NXP */ +#include <dt-bindings/phy/phy.h> +#include <dt-bindings/phy/phy-imx8-pcie.h> #include <linux/bitfield.h> #include <linux/clk.h> #include <linux/delay.h>
@@ -11,13 +13,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/pci_regs.h> -#include <linux/phy/phy.h> #include <linux/phy/pcie.h> #include <linux/platform_device.h> #include <linux/regmap.h> -#include <dt-bindings/phy/phy.h> -#include <dt-bindings/phy/phy-imx8-pcie.h> +#include "../phy-provider.h" #define MAX_NUM_LANE 3#define LANE_NUM_CLKS 5
drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c +2 -1
@@ -9,12 +9,13 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/units.h> +#include "../phy-provider.h" +#define REG_SET 0x4#define REG_CLR 0x8
drivers/phy/freescale/phy-fsl-lynx-28g.c +2 -1
@@ -5,10 +5,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/workqueue.h> +#include "../phy-provider.h" +#define LYNX_28G_NUM_LANE 8#define LYNX_28G_NUM_PLL 2
drivers/phy/hisilicon/phy-hi3660-usb3.c +2 -1
@@ -12,10 +12,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PERI_CRG_CLK_EN4 0x40#define PERI_CRG_CLK_DIS4 0x44#define GT_CLK_USB3OTG_REF BIT(0)
drivers/phy/hisilicon/phy-hi3670-pcie.c +2 -1
@@ -26,11 +26,12 @@#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/types.h> +#include "../phy-provider.h" +#define AXI_CLK_FREQ 207500000#define REF_CLK_FREQ 100000000
drivers/phy/hisilicon/phy-hi3670-usb3.c +2 -1
@@ -14,10 +14,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define SCTRL_SCDEEPSLEEPED (0x0)#define USB_CLK_SELECTED BIT(20)
drivers/phy/hisilicon/phy-hi6220-usb.c +2 -1
@@ -8,9 +8,10 @@#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define SC_PERIPH_CTRL4 0x00c#define CTRL4_PICO_SIDDQ BIT(6)
drivers/phy/hisilicon/phy-hisi-inno-usb2.c +3 -1
@@ -10,10 +10,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> +#include <linux/phy/phy.h> /* for phy_set_bus_width() */ #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define INNO_PHY_PORT_NUM 2#define REF_CLK_STABLE_TIME 100/* unit:us */ #define UTMI_CLK_STABLE_TIME 200/* unit:us */
drivers/phy/hisilicon/phy-histb-combphy.c +2 -1
@@ -14,12 +14,13 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define COMBPHY_MODE_PCIE 0#define COMBPHY_MODE_USB3 1#define COMBPHY_MODE_SATA 2
drivers/phy/hisilicon/phy-hix5hd2-sata.c +2 -1
@@ -9,10 +9,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define SATA_PHY0_CTLL 0xa0#define MPLL_MULTIPLIER_SHIFT 1#define MPLL_MULTIPLIER_MASK 0xfe
drivers/phy/ingenic/phy-ingenic-usb.c +2 -1
@@ -12,10 +12,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> +#include "../phy-provider.h" +/* OTGPHY register offsets */ #define REG_USBPCR_OFFSET 0x00#define REG_USBRDT_OFFSET 0x04
drivers/phy/intel/phy-intel-keembay-emmc.c +2 -1
@@ -11,10 +11,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* eMMC/SD/SDIO core/phy configuration registers */ #define PHY_CFG_0 0x24#define SEL_DLY_TXCLK_MASK BIT(29)
drivers/phy/intel/phy-intel-keembay-usb.c +2 -1
@@ -10,10 +10,11 @@#include <linux/delay.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* USS (USB Subsystem) clock control registers */ #define USS_CPR_CLK_EN 0x00#define USS_CPR_CLK_SET 0x04
drivers/phy/intel/phy-intel-lgm-combo.c +2 -2
@@ -5,6 +5,7 @@* Copyright (C) 2019-2020 Intel Corporation. */ +#include <dt-bindings/phy/phy.h> #include <linux/bitfield.h> #include <linux/clk.h> #include <linux/iopoll.h>
@@ -12,12 +13,11 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" #define PCIE_PHY_GEN_CTRL 0x00#define PCIE_PHY_CLK_PAD BIT(17)
drivers/phy/intel/phy-intel-lgm-emmc.c +2 -1
@@ -11,10 +11,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* eMMC phy register definitions */ #define EMMC_PHYCTRL0_REG 0xa8#define DR_TY_MASK GENMASK(30, 28)
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c +2 -1
@@ -12,12 +12,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +/* Transmitter HS Pre-Emphasis Enable */ #define RCU_CFG1_TX_PEE BIT(0)/* Disconnect Threshold */
drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c +2 -2
@@ -11,6 +11,7 @@* TODO: PHY modes other than 36MHz (without "SSC") */ +#include <dt-bindings/phy/phy-lantiq-vrx200-pcie.h> #include <linux/bitfield.h> #include <linux/bits.h> #include <linux/clk.h>
@@ -18,13 +19,12 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <dt-bindings/phy/phy-lantiq-vrx200-pcie.h> +#include "../phy-provider.h" #define PCIE_PHY_PLL_CTRL1 0x44
drivers/phy/marvell/phy-armada375-usb2.c +2 -1
@@ -16,9 +16,10 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define USB2_PHY_CONFIG_DISABLE BIT(0)struct armada375_cluster_phy {
drivers/phy/marvell/phy-armada38x-comphy.c +2 -1
@@ -9,10 +9,11 @@#include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define MAX_A38X_COMPHY 6#define MAX_A38X_PORTS 3
drivers/phy/marvell/phy-berlin-sata.c +2 -1
@@ -10,10 +10,11 @@#include <linux/clk.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/io.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define HOST_VSA_ADDR 0x0#define HOST_VSA_DATA 0x4#define PORT_SCR_CTL 0x2c
drivers/phy/marvell/phy-berlin-usb.c +2 -1
@@ -9,11 +9,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define USB_PHY_PLL 0x04#define USB_PHY_PLL_CONTROL 0x08#define USB_PHY_TX_CTRL0 0x10
drivers/phy/marvell/phy-mmp3-hsic.c +2 -1
@@ -7,9 +7,10 @@#include <linux/io.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define HSIC_CTRL 0x08#define HSIC_ENABLE BIT(7)#define PLL_BYPASS BIT(4)
drivers/phy/marvell/phy-mmp3-usb.c +2 -1
@@ -8,10 +8,11 @@#include <linux/io.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/soc/mmp/cputype.h> +#include "../phy-provider.h" +#define USB2_PLL_REG0 0x4#define USB2_PLL_REG1 0x8#define USB2_TX_REG0 0x10
drivers/phy/marvell/phy-mvebu-a3700-comphy.c +2 -1
@@ -21,10 +21,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/spinlock.h> +#include "../phy-provider.h" +#define PLL_SET_DELAY_US 600#define COMPHY_PLL_SLEEP 1000#define COMPHY_PLL_TIMEOUT 150000
drivers/phy/marvell/phy-mvebu-a3700-utmi.c +2 -1
@@ -14,10 +14,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* Armada 3700 UTMI PHY registers */ #define USB2_PHY_PLL_CTRL_REG0 0x0#define PLL_REF_DIV_OFF 0
drivers/phy/marvell/phy-mvebu-cp110-comphy.c +2 -1
@@ -13,10 +13,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* Relative to priv->base */ #define MVEBU_COMPHY_SERDES_CFG0 (n) (0x0 + (n) * 0x1000)#define MVEBU_COMPHY_SERDES_CFG0_PU_PLL BIT(1)
drivers/phy/marvell/phy-mvebu-cp110-utmi.c +2 -1
@@ -13,12 +13,13 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/usb/of.h> #include <linux/usb/otg.h> +#include "../phy-provider.h" +#define UTMI_PHY_PORTS 2/* CP110 UTMI register macro definetions */
drivers/phy/marvell/phy-mvebu-sata.c +2 -1
@@ -8,11 +8,12 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/clk.h> -#include <linux/phy/phy.h> #include <linux/io.h> #include <linux/mod_devicetable.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +struct priv {struct clk *clk;void __iomem *base;
drivers/phy/marvell/phy-pxa-28nm-hsic.c +2 -1
@@ -17,7 +17,8 @@#include <linux/clk.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" #define PHY_28NM_HSIC_CTRL 0x08#define PHY_28NM_HSIC_IMPCAL_CAL 0x18
drivers/phy/marvell/phy-pxa-28nm-usb2.c +2 -1
@@ -17,7 +17,8 @@#include <linux/clk.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" /* USB PXA1928 PHY mapping */ #define PHY_28NM_PLL_REG0 0x0
drivers/phy/marvell/phy-pxa-usb.c +2 -1
@@ -10,9 +10,10 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +/* phy regs */ #define UTMI_REVISION 0x0#define UTMI_CTRL 0x4
drivers/phy/mediatek/phy-mtk-dp.c +2 -1
@@ -10,10 +10,11 @@#include <linux/io.h> #include <linux/mfd/syscon.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PHY_OFFSET 0x1000#define MTK_DP_PHY_DIG_PLL_CTL_1 (PHY_OFFSET + 0x14)
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +0 -1
@@ -7,7 +7,6 @@#include <linux/io.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> #include <linux/regulator/of_regulator.h>
drivers/phy/mediatek/phy-mtk-hdmi.h +2 -1
@@ -11,12 +11,13 @@#include <linux/delay.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> #include <linux/regulator/machine.h> #include <linux/types.h> +#include "../phy-provider.h" +struct mtk_hdmi_phy ;struct mtk_hdmi_phy_conf {
drivers/phy/mediatek/phy-mtk-mipi-csi-0-5.c +1 -1
@@ -12,10 +12,10 @@#include <linux/io.h> #include <linux/module.h> #include <linux/mutex.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" #include "phy-mtk-mipi-csi-0-5-rx-reg.h"
drivers/phy/mediatek/phy-mtk-mipi-dsi.h +2 -1
@@ -13,9 +13,10 @@#include <linux/module.h> #include <linux/nvmem-consumer.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/slab.h> +#include "../phy-provider.h" +struct mtk_mipitx_data {const u32 mppll_preserve;const struct clk_ops *mipi_tx_clk_ops;
drivers/phy/mediatek/phy-mtk-pcie.c +1 -1
@@ -8,10 +8,10 @@#include <linux/module.h> #include <linux/nvmem-consumer.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" #define PEXTP_ANA_GLB_00_REG 0x9000
drivers/phy/mediatek/phy-mtk-tphy.c +1 -1
@@ -15,10 +15,10 @@#include <linux/nvmem-consumer.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" /* version V1 sub-banks offset base address */
drivers/phy/mediatek/phy-mtk-ufs.c +1 -1
@@ -9,9 +9,9 @@#include <linux/io.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" /* mphy register and offsets */
drivers/phy/mediatek/phy-mtk-xfi-tphy.c +1 -1
@@ -17,8 +17,8 @@#include <linux/clk.h> #include <linux/reset.h> #include <linux/phy.h> -#include <linux/phy/phy.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" #define MTK_XFI_TPHY_NUM_CLOCKS 2
drivers/phy/mediatek/phy-mtk-xsphy.c +1 -1
@@ -14,10 +14,10 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" #include "phy-mtk-io.h" /* u2 phy banks */
drivers/phy/microchip/lan966x_serdes.c +2 -2
@@ -1,15 +1,15 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <dt-bindings/phy/phy-lan966x-serdes.h> #include <linux/err.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> -#include <dt-bindings/phy/phy-lan966x-serdes.h> #include "lan966x_serdes_regs.h" +#include "../phy-provider.h" #define PLL_CONF_MASK GENMASK(4, 3)#define PLL_CONF_25MHZ 0
drivers/phy/microchip/sparx5_serdes.c +1 -1
@@ -17,8 +17,8 @@#include <linux/io.h> #include <linux/clk.h> #include <linux/phy.h> -#include <linux/phy/phy.h> +#include "../phy-provider.h" #include "sparx5_serdes.h" #define SPX5_SERDES_10G_START 13
drivers/phy/motorola/phy-cpcap-usb.c +2 -1
@@ -24,10 +24,11 @@#include <linux/gpio/consumer.h> #include <linux/mfd/motorola-cpcap.h> #include <linux/phy/omap_usb.h> -#include <linux/phy/phy.h> #include <linux/regulator/consumer.h> #include <linux/usb/musb.h> +#include "../phy-provider.h" +/* CPCAP_REG_USBC1 register bits */ #define CPCAP_BIT_IDPULSE BIT(15)#define CPCAP_BIT_ID100KPU BIT(14)
drivers/phy/motorola/phy-mapphone-mdm6600.c +3 -1
@@ -15,10 +15,12 @@#include <linux/gpio/consumer.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> +#include <linux/phy/phy.h> /* for phy_pm_runtime_*() */ #include <linux/pinctrl/consumer.h> #include <linux/pm_runtime.h> +#include "../phy-provider.h" +#define PHY_MDM6600_PHY_DELAY_MS 4000/* PHY enable 2.2s to 3.5s */ #define PHY_MDM6600_ENABLED_DELAY_MS 8000/* 8s more total for MDM6600 */ #define PHY_MDM6600_WAKE_KICK_MS 600/* time on after GPIO toggle */
drivers/phy/mscc/phy-ocelot-serdes.c +2 -1
@@ -12,12 +12,13 @@#include <linux/of.h> #include <linux/of_platform.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <soc/mscc/ocelot_hsio.h> #include <dt-bindings/phy/phy-ocelot-serdes.h> +#include "../phy-provider.h" +struct serdes_ctrl {struct regmap *regs;struct device *dev;
drivers/phy/nuvoton/phy-ma35d1-usb2.c +2 -1
@@ -10,10 +10,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* USB PHY Miscellaneous Control Register */ #define MA35_SYS_REG_USBPMISCR 0x60#define PHY0POR BIT(0)/* PHY Power-On Reset Control Bit */
drivers/phy/phy-airoha-pcie.c +1 -1
@@ -9,11 +9,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/slab.h> #include "phy-airoha-pcie-regs.h" +#include "phy-provider.h" #define LEQ_LEN_CTRL_MAX_VAL 7#define FREQ_LOCK_MAX_ATTEMPT 10
drivers/phy/phy-can-transceiver.c +2 -1
@@ -6,13 +6,14 @@* */ #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/module.h> #include <linux/gpio.h> #include <linux/gpio/consumer.h> #include <linux/mux/consumer.h> +#include "phy-provider.h" +struct can_transceiver_data {u32 flags;#define CAN_TRANSCEIVER_STB_PRESENT BIT(0)
drivers/phy/phy-core-mipi-dphy.c +2 -2
@@ -4,13 +4,13 @@* Copyright (C) 2018 Cadence Design Systems Inc. */ +#include <linux/phy/phy-mipi-dphy.h> #include <linux/errno.h> #include <linux/export.h> #include <linux/kernel.h> #include <linux/time64.h> -#include <linux/phy/phy.h> -#include <linux/phy/phy-mipi-dphy.h> +#include "phy-provider.h" /* * Minimum D-PHY timings based on MIPI D-PHY specification. Derived
drivers/phy/phy-core.c +2 -0
@@ -20,6 +20,8 @@#include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include "phy-provider.h" +#define to_phy (a) (container_of((a), struct phy, dev))/**
drivers/phy/phy-google-usb.c +2 -1
@@ -14,13 +14,14 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/usb/typec_mux.h> +#include "phy-provider.h" +#define USBCS_USB2PHY_CFG19_OFFSET 0x0#define USBCS_USB2PHY_CFG19_PHY_CFG_PLL_FB_DIV GENMASK(19, 8)
drivers/phy/phy-lpc18xx-usb-otg.c +2 -1
@@ -10,10 +10,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "phy-provider.h" +/* USB OTG PHY register offset and bit in CREG */ #define LPC18XX_CREG_CREG0 0x004#define LPC18XX_CREG_CREG0_USB0PHY BIT(5)
drivers/phy/phy-nxp-ptn3222.c +2 -1
@@ -7,10 +7,11 @@#include <linux/i2c.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> +#include "phy-provider.h" +#define NUM_SUPPLIES 2struct ptn3222 {
drivers/phy/phy-pistachio-usb.c +2 -2
@@ -5,6 +5,7 @@* Copyright (C) 2015 Google, Inc. */ +#include <dt-bindings/phy/phy-pistachio-usb.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/io.h>
@@ -12,11 +13,10 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> -#include <dt-bindings/phy/phy-pistachio-usb.h> +#include "phy-provider.h" #define USB_PHY_CONTROL1 0x04#define USB_PHY_CONTROL1_FSEL_SHIFT 2
drivers/phy/phy-snps-eusb2.c +2 -0
@@ -13,6 +13,8 @@#include <linux/regulator/consumer.h> #include <linux/reset.h> +#include "phy-provider.h" +#define EXYNOS_USB_PHY_HS_PHY_CTRL_RST (0x0)#define USB_PHY_RST_MASK GENMASK(1, 0)#define UTMI_PORT_RST_MASK GENMASK(5, 4)
drivers/phy/phy-xgene.c +2 -1
@@ -43,9 +43,10 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/delay.h> -#include <linux/phy/phy.h> #include <linux/clk.h> +#include "phy-provider.h" +/* Max 2 lanes per a PHY unit */ #define MAX_LANE 2
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 22/24 phy: include PHY provider header (2/2)
In reply to Vladimir OlteanThe majority of PHY drivers are PHY providers (obviously).
Some are chained PHY provider+consumer (phy-qcom-m31-eusb2.c, phy-exynos5-usbdrd.c).
Others include <linux/phy/phy.h> because they call consumer functions such as phy_pm_runtime_get() - phy-mapphone-mdm6600.c. See commit 2ad2af081622 ("phy: mapphone-mdm6600: Improve phy related runtime PM calls") for the story behind that. My understanding is it's a pragmatic shortcut, but it doesn't bother much.
---
Conflicts in drivers/phy/spacemit/phy-k1-pcie.c with commit 75fb1a33f9ac ("phy: move spacemit pcie driver to its subfolder"). The recommendation is to patch drivers/phy/phy-spacemit-k1-pcie.c with the change found here, in order for the branch to build cleanly on top of v7.0-rc1. Then remember to patch back drivers/phy/spacemit/phy-k1-pcie.c during the merge to linux-phy/next. VERY IMPORTANT: on v7.0-rc1, the header path is "phy-provider.h", whereas in phy-next it is "../phy-provider.h", due to the spacemit folder move.
Conflicts trivially in drivers/phy/qualcomm/phy-qcom-sgmii-eth.c with commit 4ff5801f45b4 ("phy: qcom-sgmii-eth: add .set_mode() and .validate() methods").
The recommended resolution is to keep their newly introduced adjacent line ("+#include <linux/phy.h>" - network PHY) while removing our "#include <linux/phy/phy.h>" - generic PHY.
This was previously brought up here:
https://lore.kernel.org/netdev/[email protected]/
v3->v4:
- fix phy-provider.h path from drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c
- make sure include/linux/phy/tegra/xusb.h is not reliant upon an external "struct phy" definitionv2->v3: nonev1->v2: split in two parts to pass through linux-phy mailing list moderation. The split is at letter 'q' (Qualcomm)
--- drivers/phy/qualcomm/phy-ath79-usb.c | 3 ++- drivers/phy/qualcomm/phy-qcom-apq8064-sata.c | 3 ++- drivers/phy/qualcomm/phy-qcom-edp.c | 3 ++- drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c | 3 ++- drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 3 ++- drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 3 ++- drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c | 3 ++- drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 ++ drivers/phy/qualcomm/phy-qcom-m31.c | 3 ++- drivers/phy/qualcomm/phy-qcom-pcie2.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 3 ++- drivers/phy/qualcomm/phy-qcom-qusb2.c | 4 ++-- drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 3 ++- drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 3 ++- drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c | 3 ++- drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c | 3 ++- drivers/phy/qualcomm/phy-qcom-usb-hs.c | 3 ++- drivers/phy/qualcomm/phy-qcom-usb-hsic.c | 3 ++- drivers/phy/qualcomm/phy-qcom-usb-ss.c | 3 ++- drivers/phy/ralink/phy-mt7621-pci.c | 3 ++- drivers/phy/ralink/phy-ralink-usb.c | 3 ++- drivers/phy/realtek/phy-rtk-usb2.c | 3 ++- drivers/phy/realtek/phy-rtk-usb3.c | 3 ++- drivers/phy/renesas/phy-rcar-gen2.c | 3 ++- drivers/phy/renesas/phy-rcar-gen3-pcie.c | 3 ++- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 3 ++- drivers/phy/renesas/phy-rcar-gen3-usb3.c | 3 ++- drivers/phy/renesas/phy-rzg3e-usb3.c | 3 ++- drivers/phy/renesas/r8a779f0-ether-serdes.c | 3 ++- drivers/phy/rockchip/phy-rockchip-dp.c | 3 ++- drivers/phy/rockchip/phy-rockchip-dphy-rx0.c | 3 ++- drivers/phy/rockchip/phy-rockchip-emmc.c | 3 ++- drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 3 ++- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 4 ++-- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 2 ++ drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 3 ++- drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 3 ++- drivers/phy/rockchip/phy-rockchip-pcie.c | 2 +- drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 3 ++- drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 2 ++ drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 3 ++- drivers/phy/rockchip/phy-rockchip-typec.c | 4 ++-- drivers/phy/rockchip/phy-rockchip-usb.c | 3 ++- drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 ++ drivers/phy/samsung/phy-exynos-dp-video.c | 3 ++- drivers/phy/samsung/phy-exynos-mipi-video.c | 3 ++- drivers/phy/samsung/phy-exynos-pcie.c | 3 ++- drivers/phy/samsung/phy-exynos4210-usb2.c | 3 ++- drivers/phy/samsung/phy-exynos4x12-usb2.c | 3 ++- drivers/phy/samsung/phy-exynos5-usbdrd.c | 2 ++ drivers/phy/samsung/phy-exynos5250-sata.c | 3 ++- drivers/phy/samsung/phy-exynos5250-usb2.c | 3 ++- drivers/phy/samsung/phy-s5pv210-usb2.c | 3 ++- drivers/phy/samsung/phy-samsung-ufs.c | 2 +- drivers/phy/samsung/phy-samsung-ufs.h | 3 ++- drivers/phy/samsung/phy-samsung-usb2.c | 2 ++ drivers/phy/samsung/phy-samsung-usb2.h | 3 ++- drivers/phy/socionext/phy-uniphier-ahci.c | 3 ++- drivers/phy/socionext/phy-uniphier-pcie.c | 3 ++- drivers/phy/socionext/phy-uniphier-usb2.c | 3 ++- drivers/phy/socionext/phy-uniphier-usb3hs.c | 3 ++- drivers/phy/socionext/phy-uniphier-usb3ss.c | 3 ++- drivers/phy/sophgo/phy-cv1800-usb2.c | 3 ++- drivers/phy/spacemit/phy-k1-pcie.c | 4 ++-- drivers/phy/spacemit/phy-k1-usb2.c | 3 ++- drivers/phy/st/phy-miphy28lp.c | 4 ++-- drivers/phy/st/phy-spear1310-miphy.c | 3 ++- drivers/phy/st/phy-spear1340-miphy.c | 3 ++- drivers/phy/st/phy-stih407-usb.c | 3 ++- drivers/phy/st/phy-stm32-combophy.c | 3 ++- drivers/phy/st/phy-stm32-usbphyc.c | 2 ++ drivers/phy/starfive/phy-jh7110-dphy-rx.c | 3 ++- drivers/phy/starfive/phy-jh7110-dphy-tx.c | 3 ++- drivers/phy/starfive/phy-jh7110-pcie.c | 3 ++- drivers/phy/starfive/phy-jh7110-usb.c | 3 ++- drivers/phy/sunplus/phy-sunplus-usb2.c | 3 ++- drivers/phy/tegra/phy-tegra194-p2u.c | 3 ++- drivers/phy/tegra/xusb-tegra124.c | 2 +- drivers/phy/tegra/xusb-tegra186.c | 2 +- drivers/phy/tegra/xusb-tegra210.c | 2 +- drivers/phy/tegra/xusb.c | 2 +- drivers/phy/ti/phy-am654-serdes.c | 3 ++- drivers/phy/ti/phy-da8xx-usb.c | 3 ++- drivers/phy/ti/phy-dm816x-usb.c | 3 ++- drivers/phy/ti/phy-gmii-sel.c | 3 ++- drivers/phy/ti/phy-omap-usb2.c | 3 ++- drivers/phy/ti/phy-ti-pipe3.c | 3 ++- drivers/phy/ti/phy-twl4030-usb.c | 3 ++- drivers/phy/xilinx/phy-zynqmp.c | 4 ++-- include/linux/phy/phy-sun4i-usb.h | 2 +- include/linux/phy/tegra/xusb.h | 1 + include/linux/phy/ulpi_phy.h | 2 +- 98 files changed, 187 insertions(+), 96 deletions(-)
drivers/phy/qualcomm/phy-ath79-usb.c +2 -1
@@ -8,9 +8,10 @@#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/reset.h> +#include "../phy-provider.h" +struct ath79_usb_phy {struct reset_control *reset;/* The suspend override logic is inverted, hence the no prefix
drivers/phy/qualcomm/phy-qcom-apq8064-sata.c +2 -1
@@ -13,7 +13,8 @@#include <linux/clk.h> #include <linux/slab.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" /* PHY registers */ #define UNIPHY_PLL_REFCLK_CFG 0x000
drivers/phy/qualcomm/phy-qcom-edp.c +2 -1
@@ -13,7 +13,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-dp.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h>
@@ -22,6 +21,8 @@#include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-dp-phy.h" #include "phy-qcom-qmp-qserdes-com-v4.h" #include "phy-qcom-qmp-qserdes-com-v6.h"
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c +2 -1
@@ -8,7 +8,8 @@#include <linux/regulator/consumer.h> #include <linux/regmap.h> #include <linux/of.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" /* eUSB2 status registers */ #define EUSB2_RPTR_STATUS 0x08
drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c +2 -1
@@ -14,10 +14,11 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +struct ipq4019_usb_phy {struct device *dev;struct phy *phy;
drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c +2 -1
@@ -13,7 +13,8 @@#include <linux/clk.h> #include <linux/slab.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" struct qcom_ipq806x_sata_phy {void __iomem *mmio;
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c +2 -1
@@ -5,13 +5,14 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/delay.h> #include <linux/regmap.h> #include <linux/mfd/syscon.h> #include <linux/bitfield.h> +#include "../phy-provider.h" +/* USB QSCRATCH Hardware registers */ #define QSCRATCH_GENERAL_CFG (0x08)#define HSUSB_PHY_CTRL_REG (0x10)
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c +2 -0
@@ -18,6 +18,8 @@#include <linux/regulator/consumer.h> +#include "../phy-provider.h" +#define USB_PHY_UTMI_CTRL0 (0x3c)#define SLEEPM BIT(0)
drivers/phy/qualcomm/phy-qcom-m31.c +2 -1
@@ -10,11 +10,12 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define USB2PHY_PORT_UTMI_CTRL1 0x40#define USB2PHY_PORT_UTMI_CTRL2 0x44
drivers/phy/qualcomm/phy-qcom-pcie2.c +2 -1
@@ -8,11 +8,12 @@#include <linux/clk.h> #include <linux/iopoll.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#include <dt-bindings/phy/phy.h> #define PCIE20_PARF_PHY_STTS 0x3c
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2 -1
@@ -14,7 +14,6 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_graph.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h>
@@ -28,6 +27,8 @@#include <dt-bindings/phy/phy-qcom-qmp.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +2 -1
@@ -13,12 +13,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +2 -1
@@ -15,7 +15,6 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/phy/pcie.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h>
@@ -24,6 +23,8 @@#include <dt-bindings/phy/phy-qcom-qmp.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +2 -1
@@ -13,7 +13,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h>
@@ -21,6 +20,8 @@#include <ufs/unipro.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c +2 -1
@@ -14,13 +14,14 @@#include <linux/of.h> #include <linux/of_device.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp.h" #include "phy-qcom-qmp-pcs-misc-v3.h" #include "phy-qcom-qmp-pcs-usb-v4.h"
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +2 -1
@@ -13,13 +13,14 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c +2 -1
@@ -14,7 +14,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h>
@@ -25,6 +24,8 @@#include <linux/usb/typec_mux.h> #include <dt-bindings/phy/phy-qcom-qmp.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-common.h" #include "phy-qcom-qmp.h"
drivers/phy/qualcomm/phy-qcom-qusb2.c +2 -2
@@ -3,6 +3,7 @@* Copyright (c) 2017, 2019, The Linux Foundation. All rights reserved. */ +#include <dt-bindings/phy/phy-qcom-qusb2.h> #include <linux/clk.h> #include <linux/delay.h> #include <linux/err.h>
@@ -12,7 +13,6 @@#include <linux/module.h> #include <linux/nvmem-consumer.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h>
@@ -20,7 +20,7 @@#include <linux/reset.h> #include <linux/slab.h> -#include <dt-bindings/phy/phy-qcom-qusb2.h> +#include "../phy-provider.h" #define QUSB2PHY_PLL 0x0#define QUSB2PHY_PLL_TEST 0x04
drivers/phy/qualcomm/phy-qcom-sgmii-eth.c +2 -1
@@ -7,10 +7,11 @@#include <linux/ethtool.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#include "phy-qcom-qmp-pcs-sgmii.h" #include "phy-qcom-qmp-qserdes-com-v5.h" #include "phy-qcom-qmp-qserdes-txrx-v5.h"
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +2 -1
@@ -10,7 +10,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h>
@@ -18,6 +17,8 @@#include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define USB2_PHY_USB_PHY_UTMI_CTRL0 (0x3c)#define SLEEPM BIT(0)#define OPMODE_MASK GENMASK(4, 3)
drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c +2 -1
@@ -12,12 +12,13 @@#include <linux/module.h> #include <linux/of_device.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/units.h> +#include "../phy-provider.h" +#define RST_ASSERT_DELAY_MIN_US 100#define RST_ASSERT_DELAY_MAX_US 150#define PIPE_CLK_DELAY_MIN_US 5000
drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c +2 -1
@@ -11,12 +11,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_graph.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +/* PHY register and bit definitions */ #define PHY_CTRL_COMMON0 0x078#define SIDDQ BIT(2)
drivers/phy/qualcomm/phy-qcom-usb-hs.c +2 -1
@@ -8,11 +8,12 @@#include <linux/clk.h> #include <linux/regulator/consumer.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/reset.h> #include <linux/extcon.h> #include <linux/notifier.h> +#include "../phy-provider.h" +#define ULPI_PWR_CLK_MNG_REG 0x88# define ULPI_PWR_OTG_COMP_DISABLE BIT(0)
drivers/phy/qualcomm/phy-qcom-usb-hsic.c +2 -1
@@ -5,12 +5,13 @@#include <linux/module.h> #include <linux/ulpi/driver.h> #include <linux/ulpi/regs.h> -#include <linux/phy/phy.h> #include <linux/pinctrl/consumer.h> #include <linux/pinctrl/pinctrl-state.h> #include <linux/delay.h> #include <linux/clk.h> +#include "../phy-provider.h" +#define ULPI_HSIC_CFG 0x30#define ULPI_HSIC_IO_CAL 0x33
drivers/phy/qualcomm/phy-qcom-usb-ss.c +2 -1
@@ -11,12 +11,13 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define PHY_CTRL0 0x6C#define PHY_CTRL1 0x70#define PHY_CTRL2 0x74
drivers/phy/ralink/phy-mt7621-pci.c +2 -1
@@ -10,11 +10,12 @@#include <linux/bitops.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/sys_soc.h> +#include "../phy-provider.h" +#define RG_PE1_PIPE_REG 0x02c#define RG_PE1_PIPE_RST BIT(12)#define RG_PE1_PIPE_CMD_FRC BIT(4)
drivers/phy/ralink/phy-ralink-usb.c +2 -1
@@ -14,11 +14,12 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define RT_SYSC_REG_SYSCFG1 0x014#define RT_SYSC_REG_CLKCFG1 0x030#define RT_SYSC_REG_USB_PHY_CFG 0x05c
drivers/phy/realtek/phy-rtk-usb2.c +2 -1
@@ -16,9 +16,10 @@#include <linux/regmap.h> #include <linux/sys_soc.h> #include <linux/mfd/syscon.h> -#include <linux/phy/phy.h> #include <linux/usb.h> +#include "../phy-provider.h" +/* GUSB2PHYACCn register */ #define PHY_NEW_REG_REQ BIT(25)#define PHY_VSTS_BUSY BIT(23)
drivers/phy/realtek/phy-rtk-usb3.c +2 -1
@@ -16,9 +16,10 @@#include <linux/regmap.h> #include <linux/sys_soc.h> #include <linux/mfd/syscon.h> -#include <linux/phy/phy.h> #include <linux/usb.h> +#include "../phy-provider.h" +#define USB_MDIO_CTRL_PHY_BUSY BIT(7)#define USB_MDIO_CTRL_PHY_WRITE BIT(0)#define USB_MDIO_CTRL_PHY_ADDR_SHIFT 8
drivers/phy/renesas/phy-rcar-gen2.c +2 -1
@@ -12,11 +12,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/spinlock.h> #include <linux/atomic.h> +#include "../phy-provider.h" +#define USBHS_LPSTS 0x02#define USBHS_UGCTRL 0x80#define USBHS_UGCTRL2 0x84
drivers/phy/renesas/phy-rcar-gen3-pcie.c +2 -1
@@ -9,11 +9,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/spinlock.h> +#include "../phy-provider.h" +#define PHY_CTRL 0x4000/* R8A77980 only */ /* PHY control register (PHY_CTRL) */
drivers/phy/renesas/phy-rcar-gen3-usb2.c +2 -1
@@ -19,7 +19,6 @@#include <linux/mutex.h> #include <linux/mux/consumer.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h>
@@ -29,6 +28,8 @@#include <linux/usb/of.h> #include <linux/workqueue.h> +#include "../phy-provider.h" +/******* USB2.0 Host registers (original offset is +0x200) *******/ #define USB2_INT_ENABLE 0x000#define USB2_AHB_BUS_CTR 0x008
drivers/phy/renesas/phy-rcar-gen3-usb3.c +2 -1
@@ -10,10 +10,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include "../phy-provider.h" +#define USB30_CLKSET0 0x034#define USB30_CLKSET1 0x036#define USB30_SSC_SET 0x038
drivers/phy/renesas/phy-rzg3e-usb3.c +2 -1
@@ -11,11 +11,12 @@#include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define USB3_TEST_RESET 0x0000#define USB3_TEST_UTMICTRL2 0x0b04#define USB3_TEST_PRMCTRL5_R 0x0c10
drivers/phy/renesas/r8a779f0-ether-serdes.c +2 -1
@@ -10,11 +10,12 @@#include <linux/kernel.h> #include <linux/of.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define R8A779F0_ETH_SERDES_NUM 3#define R8A779F0_ETH_SERDES_OFFSET 0x0400#define R8A779F0_ETH_SERDES_BANK_SELECT 0x03fc
drivers/phy/rockchip/phy-rockchip-dp.c +2 -1
@@ -10,10 +10,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define GRF_SOC_CON12 0x0274#define GRF_EDP_REF_CLK_SEL_INTER_HIWORD_MASK BIT(20)
drivers/phy/rockchip/phy-rockchip-dphy-rx0.c +2 -1
@@ -21,11 +21,12 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define RK3399_GRF_SOC_CON9 0x6224#define RK3399_GRF_SOC_CON21 0x6254#define RK3399_GRF_SOC_CON22 0x6258
drivers/phy/rockchip/phy-rockchip-emmc.c +2 -1
@@ -13,10 +13,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* * The higher 16-bit of this register is used for write protection * only if BIT(x + 16) set to 1 the BIT(x) can be written.
drivers/phy/rockchip/phy-rockchip-inno-csidphy.c +2 -1
@@ -13,13 +13,14 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +/* GRF */ #define RK1808_GRF_PD_VI_CON_OFFSET 0x0430
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +2 -2
@@ -15,13 +15,13 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> #include <linux/time64.h> -#include <linux/phy/phy.h> -#include <linux/phy/phy-mipi-dphy.h> +#include "../phy-provider.h" #define UPDATE (x, h, l) (((x) << (l)) & GENMASK((h), (l)))
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +2 -0
@@ -20,6 +20,8 @@#include <linux/phy/phy.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define UPDATE (x, h, l) (((x) << (l)) & GENMASK((h), (l)))/* REG: 0x00 */
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +2 -1
@@ -18,7 +18,6 @@#include <linux/mutex.h> #include <linux/of.h> #include <linux/of_irq.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/power_supply.h> #include <linux/regmap.h>
@@ -27,6 +26,8 @@#include <linux/usb/of.h> #include <linux/usb/otg.h> +#include "../phy-provider.h" +#define BIT_WRITEABLE_SHIFT 16#define SCHEDULE_DELAY (60 * HZ)#define OTG_SCHEDULE_DELAY (2 * HZ)
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c +2 -1
@@ -9,12 +9,13 @@#include <linux/clk.h> #include <linux/mfd/syscon.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/units.h> +#include "../phy-provider.h" +#define BIT_WRITEABLE_SHIFT 16#define REF_CLOCK_24MHz (24 * HZ_PER_MHZ)#define REF_CLOCK_25MHz (25 * HZ_PER_MHZ)
drivers/phy/rockchip/phy-rockchip-pcie.c +1 -1
@@ -13,12 +13,12 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" #define PHY_MAX_LANE_NUM 4#define PHY_CFG_DATA_MASK GENMASK(10, 7)
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c +2 -1
@@ -15,12 +15,13 @@#include <linux/module.h> #include <linux/mod_devicetable.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define BIAS_CON0 0x0000#define I_RES_CNTL_MASK GENMASK(6, 4)#define I_RES_CNTL (x) FIELD_PREP(I_RES_CNTL_MASK, x)
drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c +2 -0
@@ -21,6 +21,8 @@#include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define GRF_HDPTX_CON0 0x00#define LC_REF_CLK_SEL BIT(11)#define HDPTX_I_PLL_EN BIT(7)
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +2 -1
@@ -14,11 +14,12 @@#include <linux/module.h> #include <linux/of.h> #include <linux/phy/pcie.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> +#include "../phy-provider.h" +/* Register for RK3568 */ #define GRF_PCIE30PHY_CON1 0x4#define GRF_PCIE30PHY_CON6 0x18
drivers/phy/rockchip/phy-rockchip-typec.c +2 -2
@@ -43,6 +43,7 @@#include <linux/io.h> #include <linux/iopoll.h> #include <linux/kernel.h> +#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h>
@@ -53,8 +54,7 @@#include <linux/regmap.h> #include <linux/reset.h> -#include <linux/mfd/syscon.h> -#include <linux/phy/phy.h> +#include "../phy-provider.h" #define CMN_SSM_BANDGAP (0x21 << 2)#define CMN_SSM_BIAS (0x22 << 2)
drivers/phy/rockchip/phy-rockchip-usb.c +2 -1
@@ -14,7 +14,6 @@#include <linux/module.h> #include <linux/mutex.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/regulator/consumer.h>
@@ -23,6 +22,8 @@#include <linux/mfd/syscon.h> #include <linux/delay.h> +#include "../phy-provider.h" +static int enable_usb_uart;#define UOC_CON0 0x00
drivers/phy/rockchip/phy-rockchip-usbdp.c +2 -0
@@ -25,6 +25,8 @@#include <linux/usb/typec_dp.h> #include <linux/usb/typec_mux.h> +#include "../phy-provider.h" +/* USBDP PHY Register Definitions */ #define UDPHY_PCS 0x4000#define UDPHY_PMA 0x8000
drivers/phy/samsung/phy-exynos-dp-video.c +2 -1
@@ -12,11 +12,12 @@#include <linux/module.h> #include <linux/mfd/syscon.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/soc/samsung/exynos-regs-pmu.h> +#include "../phy-provider.h" +struct exynos_dp_video_phy_drvdata {u32 phy_ctrl_offset; };
drivers/phy/samsung/phy-exynos-mipi-video.c +2 -1
@@ -11,13 +11,14 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/spinlock.h> #include <linux/soc/samsung/exynos-regs-pmu.h> #include <linux/mfd/syscon.h> +#include "../phy-provider.h" +enum exynos_mipi_phy_id {EXYNOS_MIPI_PHY_ID_NONE =-1 ,EXYNOS_MIPI_PHY_ID_CSIS0 ,
drivers/phy/samsung/phy-exynos-pcie.c +2 -1
@@ -12,9 +12,10 @@#include <linux/mfd/syscon.h> #include <linux/of_platform.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PCIE_PHY_OFFSET (x) ((x) * 0x4)/* Sysreg FSYS register offsets and bits for Exynos5433 */
drivers/phy/samsung/phy-exynos4210-usb2.c +2 -1
@@ -8,8 +8,9 @@#include <linux/delay.h> #include <linux/io.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> + +#include "../phy-provider.h" #include "phy-samsung-usb2.h" /* Exynos USB PHY registers */
drivers/phy/samsung/phy-exynos4x12-usb2.c +2 -1
@@ -8,8 +8,9 @@#include <linux/delay.h> #include <linux/io.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> + +#include "../phy-provider.h" #include "phy-samsung-usb2.h" /* Exynos USB PHY registers */
drivers/phy/samsung/phy-exynos5-usbdrd.c +2 -0
@@ -26,6 +26,8 @@#include <linux/usb/typec.h> #include <linux/usb/typec_mux.h> +#include "../phy-provider.h" +/* Exynos USB PHY registers */ #define EXYNOS5_FSEL_9MHZ6 0x0#define EXYNOS5_FSEL_10MHZ 0x1
drivers/phy/samsung/phy-exynos5250-sata.c +2 -1
@@ -15,12 +15,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/spinlock.h> #include <linux/mfd/syscon.h> +#include "../phy-provider.h" +#define SATAPHY_CONTROL_OFFSET 0x0724#define EXYNOS5_SATAPHY_PMU_ENABLE BIT(0)#define EXYNOS5_SATA_RESET 0x4
drivers/phy/samsung/phy-exynos5250-usb2.c +2 -1
@@ -8,8 +8,9 @@#include <linux/delay.h> #include <linux/io.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> + +#include "../phy-provider.h" #include "phy-samsung-usb2.h" /* Exynos USB PHY registers */
drivers/phy/samsung/phy-s5pv210-usb2.c +2 -1
@@ -8,7 +8,8 @@#include <linux/delay.h> #include <linux/io.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" #include "phy-samsung-usb2.h" /* Exynos USB PHY registers */
drivers/phy/samsung/phy-samsung-ufs.c +1 -1
@@ -15,10 +15,10 @@#include <linux/iopoll.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" #include "phy-samsung-ufs.h" #define for_each_phy_lane (phy, i) \
drivers/phy/samsung/phy-samsung-ufs.h +2 -1
@@ -10,9 +10,10 @@#ifndef _PHY_SAMSUNG_UFS_#define _PHY_SAMSUNG_UFS_ -#include <linux/phy/phy.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PHY_COMN_BLK 1#define PHY_TRSV_BLK 2#define END_UFS_PHY_CFG { 0 }
drivers/phy/samsung/phy-samsung-usb2.c +2 -0
@@ -13,6 +13,8 @@#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/spinlock.h> + +#include "../phy-provider.h" #include "phy-samsung-usb2.h" static int samsung_usb2_phy_power_on (struct phy *phy)
drivers/phy/samsung/phy-samsung-usb2.h +2 -1
@@ -10,12 +10,13 @@#define _PHY_EXYNOS_USB2_H#include <linux/clk.h> -#include <linux/phy/phy.h> #include <linux/device.h> #include <linux/regmap.h> #include <linux/spinlock.h> #include <linux/regulator/consumer.h> +#include "../phy-provider.h" +#define KHZ 1000#define MHZ (KHZ * KHZ)
drivers/phy/socionext/phy-uniphier-ahci.c +2 -1
@@ -12,10 +12,11 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +struct uniphier_ahciphy_priv {struct device *dev;void __iomem *base;
drivers/phy/socionext/phy-uniphier-pcie.c +2 -1
@@ -12,12 +12,13 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/resource.h> +#include "../phy-provider.h" +/* PHY */ #define PCL_PHY_CLKCTRL 0x0000#define PORT_SEL_MASK GENMASK(11, 9)
drivers/phy/socionext/phy-uniphier-usb2.c +2 -1
@@ -10,11 +10,12 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> +#include "../phy-provider.h" +#define SG_USBPHY1CTRL 0x500#define SG_USBPHY1CTRL2 0x504#define SG_USBPHY2CTRL 0x508
drivers/phy/socionext/phy-uniphier-usb3hs.c +2 -1
@@ -17,12 +17,13 @@#include <linux/nvmem-consumer.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> #include <linux/slab.h> +#include "../phy-provider.h" +#define HSPHY_CFG0 0x0#define HSPHY_CFG0_HS_I_MASK GENMASK(31, 28)#define HSPHY_CFG0_HSDISC_MASK GENMASK(27, 26)
drivers/phy/socionext/phy-uniphier-usb3ss.c +2 -1
@@ -16,11 +16,12 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define SSPHY_TESTI 0x0#define TESTI_DAT_MASK GENMASK(13, 6)#define TESTI_ADR_MASK GENMASK(5, 1)
drivers/phy/sophgo/phy-cv1800-usb2.c +2 -1
@@ -12,10 +12,11 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> #include <linux/spinlock.h> +#include "../phy-provider.h" +#define REG_USB_PHY_CTRL 0x048#define PHY_VBUS_POWER_EN BIT(0)
drivers/phy/spacemit/phy-k1-pcie.c +2 -2
@@ -5,6 +5,7 @@* Copyright (C) 2025 by RISCstar Solutions Corporation. All rights reserved. */ +#include <dt-bindings/phy/phy.h> #include <linux/bitfield.h> #include <linux/clk.h> #include <linux/clk-provider.h>
@@ -12,12 +13,11 @@#include <linux/kernel.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" /* * Three PCIe ports are supported in the SpacemiT K1 SoC, and this driver
drivers/phy/spacemit/phy-k1-usb2.c +2 -1
@@ -9,11 +9,12 @@#include <linux/bitfield.h> #include <linux/clk.h> #include <linux/iopoll.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/usb/of.h> +#include "../phy-provider.h" +#define PHY_RST_MODE_CTRL 0x04#define PHY_PLL_RDY BIT(0)#define PHY_CLK_CDR_EN BIT(1)
drivers/phy/st/phy-miphy28lp.c +2 -2
@@ -7,6 +7,7 @@* Author: Alexandre Torgue <[email protected]> */ +#include <dt-bindings/phy/phy.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/iopoll.h>
@@ -16,13 +17,12 @@#include <linux/of_platform.h> #include <linux/of_address.h> #include <linux/clk.h> -#include <linux/phy/phy.h> #include <linux/delay.h> #include <linux/mfd/syscon.h> #include <linux/regmap.h> #include <linux/reset.h> -#include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" /* MiPHY registers */ #define MIPHY_CONF_RESET 0x00
drivers/phy/st/phy-spear1310-miphy.c +2 -1
@@ -14,10 +14,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* SPEAr1310 Registers */ #define SPEAR1310_PCIE_SATA_CFG 0x3A4#define SPEAR1310_PCIE_SATA2_SEL_PCIE (0 << 31)
drivers/phy/st/phy-spear1340-miphy.c +2 -1
@@ -14,10 +14,11 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* SPEAr1340 Registers */ /* Power Management Registers */ #define SPEAR1340_PCM_CFG 0x100
drivers/phy/st/phy-stih407-usb.c +2 -1
@@ -16,7 +16,8 @@#include <linux/regmap.h> #include <linux/reset.h> #include <linux/mfd/syscon.h> -#include <linux/phy/phy.h> + +#include "../phy-provider.h" #define PHYPARAM_REG 0#define PHYCTRL_REG 1
drivers/phy/st/phy-stm32-combophy.c +2 -1
@@ -10,12 +10,13 @@#include <linux/clk.h> #include <linux/mfd/syscon.h> #include <linux/platform_device.h> -#include <linux/phy/phy.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> #include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" +#define SYSCFG_COMBOPHY_CR1 0x4c00#define SYSCFG_COMBOPHY_CR2 0x4c04#define SYSCFG_COMBOPHY_CR4 0x4c0c
drivers/phy/st/phy-stm32-usbphyc.c +2 -0
@@ -18,6 +18,8 @@#include <linux/reset.h> #include <linux/units.h> +#include "../phy-provider.h" +#define STM32_USBPHYC_PLL 0x0#define STM32_USBPHYC_MISC 0x8#define STM32_USBPHYC_MONITOR (X ) (0x108 + ((X) * 0x100))
drivers/phy/starfive/phy-jh7110-dphy-rx.c +2 -1
@@ -13,11 +13,12 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define STF_DPHY_APBCFGSAIF_SYSCFG (x) (x)#define STF_DPHY_ENABLE_CLK BIT(6)
drivers/phy/starfive/phy-jh7110-dphy-tx.c +2 -1
@@ -15,12 +15,13 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> -#include <linux/phy/phy.h> #include <linux/phy/phy-mipi-dphy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define STF_DPHY_APBIFSAIF_SYSCFG (x) (x)#define STF_DPHY_AON_POWER_READY_N_ACTIVE 0
drivers/phy/starfive/phy-jh7110-pcie.c +2 -1
@@ -12,10 +12,11 @@#include <linux/io.h> #include <linux/module.h> #include <linux/mfd/syscon.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PCIE_KVCO_LEVEL_OFF 0x28#define PCIE_USB3_PHY_PLL_CTL_OFF 0x7c#define PCIE_KVCO_TUNE_SIGNAL_OFF 0x80
drivers/phy/starfive/phy-jh7110-usb.c +2 -1
@@ -12,11 +12,12 @@#include <linux/io.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/usb/of.h> +#include "../phy-provider.h" +#define USB_125M_CLK_RATE 125000000#define USB_CLK_MODE_OFF 0x0#define USB_CLK_MODE_RX_NORMAL_PWR BIT(1)
drivers/phy/sunplus/phy-sunplus-usb2.c +2 -1
@@ -17,10 +17,11 @@#include <linux/module.h> #include <linux/nvmem-consumer.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/reset.h> +#include "../phy-provider.h" +#define HIGH_MASK_BITS GENMASK(31, 16)#define LOW_MASK_BITS GENMASK(15, 0)#define OTP_DISC_LEVEL_DEFAULT 0xd
drivers/phy/tegra/phy-tegra194-p2u.c +2 -1
@@ -11,9 +11,10 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> +#include "../phy-provider.h" +#define P2U_CONTROL_CMN 0x74#define P2U_CONTROL_CMN_ENABLE_L2_EXIT_RATE_CHANGE BIT(13)#define P2U_CONTROL_CMN_SKP_SIZE_PROTECTION_EN BIT(20)
drivers/phy/tegra/xusb-tegra124.c +1 -1
@@ -8,7 +8,6 @@#include <linux/mailbox_client.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/reset.h>
@@ -16,6 +15,7 @@#include <soc/tegra/fuse.h> +#include "../phy-provider.h" #include "xusb.h" #define FUSE_SKU_CALIB_HS_CURR_LEVEL_PADX_SHIFT (x) ((x) ? 15 : 0)
drivers/phy/tegra/xusb-tegra186.c +1 -1
@@ -7,7 +7,6 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/regulator/consumer.h> #include <linux/platform_device.h> #include <linux/clk.h>
@@ -15,6 +14,7 @@#include <soc/tegra/fuse.h> +#include "../phy-provider.h" #include "xusb.h" /* FUSE USB_CALIB registers */
drivers/phy/tegra/xusb-tegra210.c +1 -1
@@ -12,7 +12,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h>
@@ -21,6 +20,7 @@#include <soc/tegra/fuse.h> +#include "../phy-provider.h" #include "xusb.h" #define FUSE_SKU_CALIB_HS_CURR_LEVEL_PADX_SHIFT (x) \
drivers/phy/tegra/xusb.c +1 -1
@@ -9,7 +9,6 @@#include <linux/module.h> #include <linux/of.h> #include <linux/of_platform.h> -#include <linux/phy/phy.h> #include <linux/phy/tegra/xusb.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h>
@@ -19,6 +18,7 @@#include <soc/tegra/fuse.h> +#include "../phy-provider.h" #include "xusb.h" static struct phy *tegra_xusb_pad_of_xlate(struct device *dev,
drivers/phy/ti/phy-am654-serdes.c +2 -1
@@ -15,11 +15,12 @@#include <linux/mfd/syscon.h> #include <linux/mux/consumer.h> #include <linux/of_address.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define CMU_R004 0x4#define CMU_R060 0x60#define CMU_R07C 0x7c
drivers/phy/ti/phy-da8xx-usb.c +2 -1
@@ -11,12 +11,13 @@#include <linux/mfd/da8xx-cfgchip.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/phy/phy.h> #include <linux/platform_data/phy-da8xx-usb.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PHY_INIT_BITS (CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN)struct da8xx_usb_phy {
drivers/phy/ti/phy-dm816x-usb.c +2 -1
@@ -12,10 +12,11 @@#include <linux/err.h> #include <linux/pm_runtime.h> #include <linux/delay.h> -#include <linux/phy/phy.h> #include <linux/mfd/syscon.h> +#include "../phy-provider.h" +/* * TRM has two sets of USB_CTRL registers.. The correct register bits * are in TRM section 24.9.8.2 USB_CTRL Register. The TRM documents the
drivers/phy/ti/phy-gmii-sel.c +2 -1
@@ -14,9 +14,10 @@#include <linux/of_address.h> #include <linux/of_net.h> #include <linux/phy.h> -#include <linux/phy/phy.h> #include <linux/regmap.h> +#include "../phy-provider.h" +/* AM33xx SoC specific definitions for the CONTROL port */ #define AM33XX_GMII_SEL_MODE_MII 0#define AM33XX_GMII_SEL_MODE_RMII 1
drivers/phy/ti/phy-omap-usb2.c +2 -1
@@ -16,7 +16,6 @@#include <linux/of_platform.h> #include <linux/phy/omap_control_phy.h> #include <linux/phy/omap_usb.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/property.h>
@@ -25,6 +24,8 @@#include <linux/sys_soc.h> #include <linux/usb/phy_companion.h> +#include "../phy-provider.h" +#define USB2PHY_ANA_CONFIG1 0x4c#define USB2PHY_DISCON_BYP_LATCH BIT(31)
drivers/phy/ti/phy-ti-pipe3.c +2 -1
@@ -10,7 +10,6 @@#include <linux/platform_device.h> #include <linux/property.h> #include <linux/slab.h> -#include <linux/phy/phy.h> #include <linux/of.h> #include <linux/clk.h> #include <linux/err.h>
@@ -22,6 +21,8 @@#include <linux/mfd/syscon.h> #include <linux/regmap.h> +#include "../phy-provider.h" +#define PLL_STATUS 0x00000004#define PLL_GO 0x00000008#define PLL_CONFIGURATION1 0x0000000C
drivers/phy/ti/phy-twl4030-usb.c +2 -1
@@ -20,7 +20,6 @@#include <linux/io.h> #include <linux/delay.h> #include <linux/usb/otg.h> -#include <linux/phy/phy.h> #include <linux/pm_runtime.h> #include <linux/usb/musb.h> #include <linux/usb/ulpi.h>
@@ -29,6 +28,8 @@#include <linux/err.h> #include <linux/slab.h> +#include "../phy-provider.h" +/* Register defines */ #define MCPC_CTRL 0x30
drivers/phy/xilinx/phy-zynqmp.c +2 -2
@@ -12,6 +12,7 @@* PCIe should also work but that is experimental as of now. */ +#include <dt-bindings/phy/phy.h> #include <linux/clk.h> #include <linux/debugfs.h> #include <linux/delay.h>
@@ -19,12 +20,11 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/slab.h> -#include <dt-bindings/phy/phy.h> +#include "../phy-provider.h" /* * Lane Registers
include/linux/phy/phy-sun4i-usb.h +1 -1
@@ -6,7 +6,7 @@#ifndef PHY_SUN4I_USB_H_ #define PHY_SUN4I_USB_H_ -#include "phy.h" +struct phy ;/** * sun4i_usb_phy_set_squelch_detect() - Enable/disable squelch detect
include/linux/phy/tegra/xusb.h +1 -0
@@ -8,6 +8,7 @@struct tegra_xusb_padctl ;struct device ; +struct phy ;enum usb_device_speed ;struct tegra_xusb_padctl *tegra_xusb_padctl_get (struct device *dev);
include/linux/phy/ulpi_phy.h +1 -1
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: GPL-2.0 */ -#include <linux/phy/phy.h> +#include "../../drivers/phy/phy-provider.h" /** * Helper that registers PHY for a ULPI device and adds a lookup for binding it
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 23/24 phy: remove temporary provider compatibility from consumer header
In reply to Vladimir OlteanNow that all consumers have been updated to no longer dereference fields inside struct phy, we can hide its definition altogether from public view.
---v2->v4: nonev1->v2: collect tag
--- include/linux/phy/phy.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/phy/phy.h +0 -2
@@ -12,8 +12,6 @@#include <linux/phy/phy-props.h> -#include "../../../drivers/phy/phy-provider.h" -struct device ;struct device_node ;struct phy ;
Signature · 1 line
2.43.0
Vladimir Oltean
maintainerPATCH v4 24/24 MAINTAINERS: add regexes for linux-phy
In reply to Vladimir OlteanSome pragmatic shortcuts are being taken by PHY consumer driver authors, which put a burden on the framework. A lot of these can be caught during review.
Make sure the linux-phy list is copied on as many keywords that regexes can reasonably catch.
Some considerations that led to this solution and not a simpler one:
- Consumers may be located anywhere, and their file naming provides no indication whatsoever that they are PHY API consumers.
- The network PHY API has similarly sounding API: phy_start(), phy_connect(), etc. Similarly, matching on "phy" would hit phys_addr_t, "cryptography", etc.
- The header files themselves need attention to avoid matching on include/linux/phy.h (network PHY), include/linux/usb/phy.h, drivers/net/vendor/device/phy.h, etc.
- At least for a transitional period, I suppose developers will still try to add PHY providers outside the subsystem (which is discouraged).
So I used \b to try to match on actual word boundaries and I went for listing all markers of PHY API use as they may appear in patch contexts.
Bit rot is a valid concern. I will add a test to the build automation that newly introduced struct and function names in include/linux/phy.h, include/linux/phy-props.h and drivers/phy/phy-provider.h are matched by the MAINTAINERS entry K: patterns.
The keyword patterns were written with great help from Joe Perches <[email protected]>.
---
Cc: Joe Perches <[email protected]>
v3->v4: nonev2->v3:
- escape forward slash in linux/phy/phy.h in regex pattern:
https://lore.kernel.org/linux-phy/[email protected]/v1->v2:
- split into multiple regex patterns
- use matching-only (insted of capturing) regex patterns
- adjust commit message to reflect the Q&A from v1
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -10713,6 +10713,17 @@ F: Documentation/devicetree/bindings/phy/ F: drivers/phy/ F: include/dt-bindings/phy/ F: include/linux/phy/ +K: (?:linux\/phy\/phy\.h|phy-props\.h|phy-provider\.h) +K: \b(?:__)?(?:devm_)?(?:of_)?phy_(?:create|destroy|provider_(?:un)?register)\b +K: \bphy_(?:create|remove)_lookup\b +K: \bphy_(?:get|set)_drvdata\b +K: \b(?:devm_)?(?:of_)?phy_(?:optional_)?(?:get|put)(?:_by_index)?\b +K: \bphy_pm_runtime_(?:get|put)(?:_sync)?\b +K: \bphy_(?:init|exit|power_(?:on|off))\b +K: \bphy_(?:get|set)_(?:mode(?:_ext)?|media|speed|bus_width|max_link_rate)\b +K: \bphy_(?:reset|configure|validate|calibrate)\b +K: \bphy_notify_(?:connect|disconnect|state)\b +K: \bstruct\s+phy(?:_ops|_attrs|_lookup|_provider)?\b GENERIC PINCTRL I2C DEMULTIPLEXER DRIVER M: Wolfram Sang <[email protected]>
Signature · 1 line
2.43.0