Skip to contentSkip to conversation

USB OTG PHY driver for NXP LPC18xx family

PATCH Superseded Joachim Eastwood 2 participants 7 messages May 21, 2015 – May 22, 2015

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index a53bd5b52df9..e11fb9e3c760 100644
@@ -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
index f12625178780..b7251f3b9ef7 100644
@@ -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
#2 lore raw

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.

---
  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 +0 -0
index a53bd5b52df9..e11fb9e3c760 100644

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]

[1] ->
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.txt#n111

Thanks
Kishon

#3 lore raw

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.

---
  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 +0 -0
index a53bd5b52df9..e11fb9e3c760 100644

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]

Quoted 2 lines

[1] ->
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.txt#n111

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

#4 lore raw

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.

---
  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 +0 -0
index a53bd5b52df9..e11fb9e3c760 100644

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]

Quoted 2 lines

[1] ->
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.txt#n111

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

#5 lore raw

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.

---
   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 +0 -0
index a53bd5b52df9..e11fb9e3c760 100644

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]

Quoted 2 lines

[1] ->
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.txt#n111

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

#6 lore raw

PATCH v2 2/2 phy: dt bindings: add NXP LPC18xx/43xx USB OTG PHY bindings

In reply to Joachim Eastwood

Add 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
new file mode 100644
index 000000000000..3da60ca04a42
@@ -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