USB OTG PHY driver for NXP LPC18xx family
v2 cover USB OTG PHY driver for NXP LPC18xx family
This patch set adds support for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. Driver takes care of enabling the PHY and setting the clock rate which is need for USB0 support on this platform.
This version address the comments from Kishon Vijay Abraham I.
Changes in v2:
- use PTR_ERR_OR_ZERO in phy driver
- rename binding doc
- update doc commit message
Base support for this platform can now be found in arm-soc next.
Joachim Eastwood (2):
phy: add lpc18xx usb otg phy driver
phy: dt bindings: add NXP LPC18xx/43xx USB OTG PHY bindings
.../bindings/phy/phy-lpc18xx-usb-otg.txt | 19 +++ drivers/phy/Kconfig | 11 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 +++++++++++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-lpc18xx-usb-otg.txt create mode 100644 drivers/phy/phy-lpc18xx-usb-otg.c
Signature · 1 line
1.8.0
PATCH v2 1/2 phy: add lpc18xx usb otg phy driver
Add PHY driver for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. This driver takes care of enabling the PHY in CREG (syscon) and setting the required clock frequency.
--- drivers/phy/Kconfig | 11 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 drivers/phy/phy-lpc18xx-usb-otg.c
drivers/phy/Kconfig +11 -0
@@ -52,6 +52,17 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) + select GENERIC_PHY + select MFD_SYSCON + help + Enable this to support NXP LPC18xx/43xx internal USB OTG PHY. + + This driver is need for USB0 support on LPC18xx/43xx and takes + care of enabling and clock setup. + config PHY_MVEBU_SATA def_bool y depends on ARCH_DOVE || MACH_DOVE || MACH_KIRKWOOD
drivers/phy/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o +obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o obj-$(CONFIG_PHY_MIPHY28LP) += phy-miphy28lp.o obj-$(CONFIG_PHY_MIPHY365X) += phy-miphy365x.o
drivers/phy/phy-lpc18xx-usb-otg.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
1.8.0
PATCH v2 1/2 phy: add lpc18xx usb otg phy driver
Hi,
Quoted 18 lines · Joachim Eastwood
Add PHY driver for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. This driver takes care of enabling the PHY in CREG (syscon) and setting the required clock frequency.
Signed-off-by Joachim Eastwood <[email protected]>--- drivers/phy/Kconfig | 11 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+)create mode 100644
drivers/phy/phy-lpc18xx-usb-otg.cdrivers/phy/Kconfig +0
-0
drivers/phy/Kconfig config PHY_EXYNOS_MIPI_VIDEO · line 59
Quoted 8 lines
drivers/phy/Kconfig +5
-0@@ -52,6 +52,17 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) + select GENERIC_PHY + select MFD_SYSCON
using select on visible symbols should be avoided. see [1]
Thanks
Kishon
PATCH v2 1/2 phy: add lpc18xx usb otg phy driver
Quoted 35 lines · Kishon Vijay Abraham I
Hi,
Quoted 20 lines · Joachim Eastwood
Add PHY driver for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. This driver takes care of enabling the PHY in CREG (syscon) and setting the required clock frequency.
Signed-off-by Joachim Eastwood <[email protected]>--- drivers/phy/Kconfig | 11 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+)create mode 100644
drivers/phy/phy-lpc18xx-usb-otg.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_EXYNOS_MIPI_VIDEO · line 59
Quoted 8 lines
drivers/phy/Kconfig +5
-0@@ -52,6 +52,17 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) + select GENERIC_PHY + select MFD_SYSCONusing select on visible symbols should be avoided. see [1]
Quoted 2 lines
For these two symbols using select is the right thing to do.
Look at the users in kernel:
$ git grep -E 'depend (MFD_SYSCON|GENERIC_PHY)' | wc -l 0 $ git grep -E 'select MFD_SYSCON' | wc -l 42
regards,
Joachim Eastwood
PATCH v2 1/2 phy: add lpc18xx usb otg phy driver
Quoted 39 lines · Joachim Eastwood
Quoted 35 lines · Kishon Vijay Abraham I
Hi,
Quoted 20 lines · Joachim Eastwood
Add PHY driver for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. This driver takes care of enabling the PHY in CREG (syscon) and setting the required clock frequency.
Signed-off-by Joachim Eastwood <[email protected]>--- drivers/phy/Kconfig | 11 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+)create mode 100644
drivers/phy/phy-lpc18xx-usb-otg.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_EXYNOS_MIPI_VIDEO · line 59
Quoted 8 lines
drivers/phy/Kconfig +5
-0@@ -52,6 +52,17 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) + select GENERIC_PHY + select MFD_SYSCONusing select on visible symbols should be avoided. see [1]
Quoted 7 lines
For these two symbols using select is the right thing to do.
Look at the users in kernel:
$ git grep -E 'depend (MFD_SYSCON|GENERIC_PHY)' | wc -l 0 $ git grep -E 'select MFD_SYSCON' | wc -l 42
Sorry, screwed up the regex for depends.
For depens we have:
$ git grep -E 'depends on (MFD_SYSCON|GENERIC_PHY)' | wc -l 10
regards,
Joachim Eastwood
PATCH v2 1/2 phy: add lpc18xx usb otg phy driver
Hi,
Quoted 48 lines · Joachim Eastwood
Quoted 39 lines · Joachim Eastwood
Quoted 35 lines · Kishon Vijay Abraham I
Hi,
Quoted 20 lines · Joachim Eastwood
Add PHY driver for the internal USB OTG PHY found on NXP LPC18xx and LPC43xx devices. This driver takes care of enabling the PHY in CREG (syscon) and setting the required clock frequency.
Signed-off-by Joachim Eastwood <[email protected]>--- drivers/phy/Kconfig | 11 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-lpc18xx-usb-otg.c | 143 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+)create mode 100644
drivers/phy/phy-lpc18xx-usb-otg.cdrivers/phy/Kconfig +0
-0drivers/phy/Kconfig config PHY_EXYNOS_MIPI_VIDEO · line 59
Quoted 8 lines
drivers/phy/Kconfig +5
-0@@ -52,6 +52,17 @@ config PHY_EXYNOS_MIPI_VIDEO Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P and EXYNOS SoCs. +config PHY_LPC18XX_USB_OTG + tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver" + depends on OF && (ARCH_LPC18XX || COMPILE_TEST) + select GENERIC_PHY + select MFD_SYSCONusing select on visible symbols should be avoided. see [1]
Quoted 7 lines
For these two symbols using select is the right thing to do.
Look at the users in kernel:
$ git grep -E 'depend (MFD_SYSCON|GENERIC_PHY)' | wc -l 0 $ git grep -E 'select MFD_SYSCON' | wc -l 42
Quoted 5 lines
Sorry, screwed up the regex for depends.
For depens we have:
$ git grep -E 'depends on (MFD_SYSCON|GENERIC_PHY)' | wc -l 10
select for GENERIC_PHY is okay but I'd prefer to have depends on for MFD_SYSCON.
Thanks
Kishon
PATCH v2 2/2 phy: dt bindings: add NXP LPC18xx/43xx USB OTG PHY bindings
In reply to Joachim EastwoodAdd binding documentation for NXP LPC18xx/43xx USB OTG PHY. This PHY can found on NXP LPC18xx and LPC43xx devices with USB support.
--- .../devicetree/bindings/phy/phy-lpc18xx-usb-otg.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-lpc18xx-usb-otg.txt
Documentation/devicetree/bindings/phy/phy-lpc18xx-usb-otg.txt new file +19 -0
@@ -0,0 +1,19 @@ +NXP LPC18xx/43xx internal USB OTG PHY binding +--------------------------------------------- + +This file contains documentation for the internal USB OTG PHY found +in NXP LPC18xx and LPC43xx SoCs. + +Required properties: +- compatible : must be "nxp,lpc1850-usb-otg-phy" +- clocks : must be exactly one entry +See: Documentation/devicetree/bindings/clock/clock-bindings.txt +- #phy-cells : must be 0 for this phy +See: Documentation/devicetree/bindings/phy/phy-bindings.txt + +Example: +usb0_otg_phy: usb0-otg-phy { + compatible = "nxp,lpc1850-usb-otg-phy"; + clocks = <&ccu1 CLK_USB0>; + #phy-cells = <0>; +};
Signature · 1 line
1.8.0