Skip to contentSkip to conversation

ARM: vt8500: Update vt8500-ehci driver to support device tree.

PATCH New Tony Prisk 3 participants 7 messages Jul 19, 2012

Subsystems (3)
lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

PATCH 1/2 ARM: vt8500: Update vt8500-ehci driver to support device tree.

---
 drivers/usb/host/ehci-vt8500.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-vt8500.c +9 -0
index c1eda73..4ba8f0c 100644
@@ -16,6 +16,7 @@
  *
  */
 
+#include <linux/of.h>
 #include <linux/platform_device.h>
 
 static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
@@ -162,6 +163,12 @@ static int vt8500_ehci_drv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id vt8500_ehci_ids[] = {
+	{ .compatible = "via,vt8500-ehci", },
+	{ .compatible = "wm,prizm-ehci", },
+	{}
+};
+
 static struct platform_driver vt8500_ehci_driver = {
 	.probe		= vt8500_ehci_drv_probe,
 	.remove		= vt8500_ehci_drv_remove,
@@ -169,7 +176,9 @@ static struct platform_driver vt8500_ehci_driver = {
 	.driver = {
 		.name	= "vt8500-ehci",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(vt8500_ehci_ids),
 	}
 };
 
 MODULE_ALIAS("platform:vt8500-ehci");
+MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/2 ARM: vt8500: Add support for UHCI companion controller

Add support for the UHCI companion controller in arch-vt8500. This patch is based almost entirely off uhci-grlib.c with additions for device tree support.

---
 drivers/usb/host/Kconfig       |    4 +-
 drivers/usb/host/uhci-hcd.c    |    5 +
 drivers/usb/host/uhci-vt8500.c |  158 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 165 insertions(+), 2 deletions(-)
 create mode 100644 drivers/usb/host/uhci-vt8500.c
drivers/usb/host/Kconfig +2 -2
index 83e58df..1c4de8f 100644
@@ -450,7 +450,7 @@ config USB_OHCI_LITTLE_ENDIAN
 
 config USB_UHCI_HCD
 	tristate "UHCI HCD (most Intel and VIA) support"
-	depends on USB && (PCI || SPARC_LEON)
+	depends on USB && (PCI || SPARC_LEON || ARCH_VT8500)
 	---help---
 	  The Universal Host Controller Interface is a standard by Intel for
 	  accessing the USB hardware in the PC (which is also called the USB
@@ -468,7 +468,7 @@ config USB_UHCI_HCD
 config USB_UHCI_SUPPORT_NON_PCI_HC
 	bool
 	depends on USB_UHCI_HCD
-	default y if SPARC_LEON
+	default y if (SPARC_LEON || ARCH_VT8500)
 
 config USB_UHCI_BIG_ENDIAN_MMIO
 	bool
drivers/usb/host/uhci-hcd.c +5 -0
index e4db350..28f885d 100644
@@ -846,6 +846,11 @@ static const char hcd_name[] = "uhci_hcd";
 #define PLATFORM_DRIVER		uhci_grlib_driver
 #endif
 
+#ifdef CONFIG_ARCH_VT8500
+#include "uhci-vt8500.c"
+#define PLATFORM_DRIVER		uhci_vt8500_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER)
 #error "missing bus glue for uhci-hcd"
 #endif
drivers/usb/host/uhci-vt8500.c new file +158 -0

158 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 2/2 ARM: vt8500: Add support for UHCI companion controller

Quoted 5 lines · Tony Prisk

Add support for the UHCI companion controller in arch-vt8500. This patch is based almost entirely off uhci-grlib.c with additions for device tree support.

It looks like this file is basically completely generic, so could you just call it uhci-of instead so we can use it for all uhci implementations that have no special requirements?

Arnd

#3 lore raw

PATCH 1/2 ARM: vt8500: Update vt8500-ehci driver to support device tree.

In reply to Tony Prisk
Quoted 5 lines · Tony Prisk
---
 drivers/usb/host/ehci-vt8500.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

The addition is straightforward and looks correct, but I would suggest you also add the new "compatible" values to Documentation/devicetree/bindings/usb-ehci.txt

Arnd

#4 lore raw

PATCH 1/2 ARM: vt8500: Update vt8500-ehci driver to support device tree.

In reply to Tony Prisk

2012/7/19 Tony Prisk <[email protected]>:

Quoted 4 lines
---
 drivers/usb/host/ehci-vt8500.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Have you tried to use ehci-platform on VIA/WMT devices? If it works (which I would expect), I believe it's better to include OF support into ehci-platform and drop ehci-vt8500 completely after existing boards are converted to Device Tree. When writing ehci-vt8500, I mostly only copied stuff from the PCI version and made it initialize from the platform bus (nothing specific to vt8500).

Thanks,
Alexey

author
#5 lore raw

PATCH 1/2 ARM: vt8500: Update vt8500-ehci driver to support device tree.

From: Alexey Charkov [alchark at gmail.com]
Sent: 20 July 2012 02:45
To: vt8500-wm8505-linux-kernel at googlegroups.com
Cc: Arnd Bergmann; linux-arm-kernel at lists.infradead.org; devicetree-discuss at lists.ozlabs.org; Tony Prisk
Subject: Re: [PATCH 1/2] ARM: vt8500: Update vt8500-ehci driver to support device tree.

2012/7/19 Tony Prisk <[email protected]>:

Quoted 4 lines
---
 drivers/usb/host/ehci-vt8500.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Have you tried to use ehci-platform on VIA/WMT devices? If it works (which I would expect), I believe it's better to include OF support into ehci-platform and drop ehci-vt8500 completely after existing boards are converted to Device Tree. When writing ehci-vt8500, I mostly only copied stuff from the PCI version and made it initialize from the platform bus (nothing specific to vt8500).

Thanks,
Alexey

-----
Alexey,

The biggest problem I have at the moment is that its very hard to test anything as I only have a WM8650 which isn't supported in mainline.

I think I have a local copy of 'our' repo on my laptop - If I do, I'll try changing the platform_device to use ehci_platform and see if it works.

Arnd,

There isn't any reason why it couldn't be uhci_of. I was simply trying to preserve our existing platform support without having to introduce more patches for the board files. The existing uhci-grlib is probably a better candidate though as I noticed its been updated to support OF since I wrote this driver, and this driver is based off that one.

Regards

Tony P

author
#6 lore raw

PATCH 1/2 ARM: vt8500: Update vt8500-ehci driver to support device tree.

In reply to Alexey Charkov

From: Alexey Charkov [alchark at gmail.com]
Sent: 20 July 2012 02:45
To: vt8500-wm8505-linux-kernel at googlegroups.com
Cc: Arnd Bergmann; linux-arm-kernel at lists.infradead.org; devicetree-discuss at lists.ozlabs.org; Tony Prisk
Subject: Re: [PATCH 1/2] ARM: vt8500: Update vt8500-ehci driver to support device tree.

2012/7/19 Tony Prisk <[email protected]>:

Quoted 4 lines
---
 drivers/usb/host/ehci-vt8500.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Have you tried to use ehci-platform on VIA/WMT devices? If it works (which I would expect), I believe it's better to include OF support into ehci-platform and drop ehci-vt8500 completely after existing boards are converted to Device Tree. When writing ehci-vt8500, I mostly only copied stuff from the PCI version and made it initialize from the platform bus (nothing specific to vt8500).

Thanks,
Alexey

-----

The ehci-platform device requires platform_data be passed at probe. While its generic enought , it puts requirements on the device-tree to setup the private data, which would be messy to get approved I suspect.

Regards

Tony P