* [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-11 4:22 ` Viresh Kumar
2013-02-11 11:19 ` Mark Rutland
2013-02-10 18:58 ` [PATCH 2/8] USB: EHCI: make ehci-atmel " manjunath.goudar at linaro.org
` (6 subsequent siblings)
7 siblings, 2 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the Spear host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Viresh Kumar <viresh.linux@gmail.com>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Cc: linux-usb at vger.kernel.org
Cc: spear-devel at list.st.com
---
drivers/usb/host/Kconfig | 8 +++
drivers/usb/host/Makefile | 2 +-
drivers/usb/host/ehci-hcd.c | 8 +--
drivers/usb/host/ehci-spear.c | 131 +++++++++++++++++++++--------------------
4 files changed, 78 insertions(+), 71 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 3a21c5d..15e8032 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
Enables support for the on-chip EHCI controller on
OMAP3 and later chips.
+config USB_EHCI_HCD_SPEAR
+ tristate "Support for ST SPEAr on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && PLAT_SPEAR
+ default y
+ ---help---
+ Enables support for the on-chip EHCI controller on
+ ST SPEAr chips.
+
config USB_EHCI_MSM
bool "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 001fbff..c8fcde9 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -27,7 +27,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o
obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
-
+obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index b416a3f..be7247b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1274,7 +1274,7 @@ MODULE_LICENSE ("GPL");
#ifdef CONFIG_PLAT_ORION
#include "ehci-orion.c"
-#define PLATFORM_DRIVER ehci_orion_driver
+#define PLATFORM_DRIVER ehci_orion_driver
#endif
#ifdef CONFIG_USB_W90X900_EHCI
@@ -1297,11 +1297,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER vt8500_ehci_driver
#endif
-#ifdef CONFIG_PLAT_SPEAR
-#include "ehci-spear.c"
-#define PLATFORM_DRIVER spear_ehci_hcd_driver
-#endif
-
#ifdef CONFIG_USB_EHCI_MSM
#include "ehci-msm.c"
#define PLATFORM_DRIVER ehci_msm_driver
@@ -1347,6 +1342,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
!IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
!defined(PLATFORM_DRIVER) && \
+ !IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
index 466c1bb..0d9ed11 100644
--- a/drivers/usb/host/ehci-spear.c
+++ b/drivers/usb/host/ehci-spear.c
@@ -1,5 +1,5 @@
/*
-* Driver for EHCI HCD on SPEAR SOC
+* Driver for EHCI HCD on SPEAr SOC
*
* Copyright (C) 2010 ST Micro Electronics,
* Deepak Sikri <deepak.sikri@st.com>
@@ -12,29 +12,41 @@
*/
#include <linux/clk.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
#include <linux/jiffies.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
-struct spear_ehci {
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI SPEAr driver"
+
+static const char hcd_name[] = "ehci-SPEAr";
+
+struct SPEAr_ehci {
struct ehci_hcd ehci;
struct clk *clk;
};
-#define to_spear_ehci(hcd) (struct spear_ehci *)hcd_to_ehci(hcd)
+#define to_SPEAr_ehci(hcd) (struct SPEAr_ehci *)hcd_to_ehci(hcd)
-static void spear_start_ehci(struct spear_ehci *ehci)
+static void SPEAr_start_ehci(struct SPEAr_ehci *ehci)
{
clk_prepare_enable(ehci->clk);
}
-static void spear_stop_ehci(struct spear_ehci *ehci)
+static void SPEAr_stop_ehci(struct SPEAr_ehci *ehci)
{
clk_disable_unprepare(ehci->clk);
}
-static int ehci_spear_setup(struct usb_hcd *hcd)
+static int ehci_SPEAr_setup(struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
@@ -43,43 +55,10 @@ static int ehci_spear_setup(struct usb_hcd *hcd)
return ehci_setup(hcd);
}
-
-static const struct hc_driver ehci_spear_hc_driver = {
- .description = hcd_name,
- .product_desc = "SPEAr EHCI",
- .hcd_priv_size = sizeof(struct spear_ehci),
-
- /* generic hardware linkage */
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- /* basic lifecycle operations */
- .reset = ehci_spear_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /* managing i/o requests and associated device resources */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- /* scheduling support */
- .get_frame_number = ehci_get_frame,
-
- /* root hub support */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
+static struct hc_driver __read_mostly ehci_SPEAr_hc_driver;
#ifdef CONFIG_PM
-static int ehci_spear_drv_suspend(struct device *dev)
+static int ehci_SPEAr_drv_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
bool do_wakeup = device_may_wakeup(dev);
@@ -87,7 +66,7 @@ static int ehci_spear_drv_suspend(struct device *dev)
return ehci_suspend(hcd, do_wakeup);
}
-static int ehci_spear_drv_resume(struct device *dev)
+static int ehci_SPEAr_drv_resume(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -96,18 +75,18 @@ static int ehci_spear_drv_resume(struct device *dev)
}
#endif /* CONFIG_PM */
-static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend,
- ehci_spear_drv_resume);
+static SIMPLE_DEV_PM_OPS(ehci_SPEAr_pm_ops, ehci_SPEAr_drv_suspend,
+ ehci_SPEAr_drv_resume);
-static u64 spear_ehci_dma_mask = DMA_BIT_MASK(32);
+static u64 SPEAr_ehci_dma_mask = DMA_BIT_MASK(32);
-static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
+static int SPEAr_ehci_hcd_drv_probe(struct platform_device *pdev)
{
struct usb_hcd *hcd ;
- struct spear_ehci *ehci;
+ struct SPEAr_ehci *ehci;
struct resource *res;
struct clk *usbh_clk;
- const struct hc_driver *driver = &ehci_spear_hc_driver;
+ const struct hc_driver *driver = &ehci_SPEAr_hc_driver;
int irq, retval;
if (usb_disabled())
@@ -125,7 +104,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
- pdev->dev.dma_mask = &spear_ehci_dma_mask;
+ pdev->dev.dma_mask = &SPEAr_ehci_dma_mask;
usbh_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(usbh_clk)) {
@@ -161,10 +140,10 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
goto err_put_hcd;
}
- ehci = (struct spear_ehci *)hcd_to_ehci(hcd);
+ ehci = (struct SPEAr_ehci *)hcd_to_ehci(hcd);
ehci->clk = usbh_clk;
- spear_start_ehci(ehci);
+ SPEAr_start_ehci(ehci);
retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval)
goto err_stop_ehci;
@@ -172,7 +151,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
return retval;
err_stop_ehci:
- spear_stop_ehci(ehci);
+ SPEAr_stop_ehci(ehci);
err_put_hcd:
usb_put_hcd(hcd);
fail:
@@ -181,10 +160,10 @@ fail:
return retval ;
}
-static int spear_ehci_hcd_drv_remove(struct platform_device *pdev)
+static int SPEAr_ehci_hcd_drv_remove(struct platform_device *pdev)
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
- struct spear_ehci *ehci_p = to_spear_ehci(hcd);
+ struct SPEAr_ehci *ehci_p = to_SPEAr_ehci(hcd);
if (!hcd)
return 0;
@@ -193,27 +172,51 @@ static int spear_ehci_hcd_drv_remove(struct platform_device *pdev)
usb_remove_hcd(hcd);
if (ehci_p->clk)
- spear_stop_ehci(ehci_p);
+ SPEAr_stop_ehci(ehci_p);
usb_put_hcd(hcd);
return 0;
}
-static struct of_device_id spear_ehci_id_table[] = {
- { .compatible = "st,spear600-ehci", },
+static struct of_device_id SPEAr_ehci_id_table[] = {
+ { .compatible = "st,SPEAr600-ehci", },
{ },
};
-static struct platform_driver spear_ehci_hcd_driver = {
- .probe = spear_ehci_hcd_drv_probe,
- .remove = spear_ehci_hcd_drv_remove,
+static struct platform_driver SPEAr_ehci_hcd_driver = {
+ .probe = SPEAr_ehci_hcd_drv_probe,
+ .remove = SPEAr_ehci_hcd_drv_remove,
.shutdown = usb_hcd_platform_shutdown,
.driver = {
- .name = "spear-ehci",
+ .name = hcd_name,
.bus = &platform_bus_type,
- .pm = &ehci_spear_pm_ops,
- .of_match_table = of_match_ptr(spear_ehci_id_table),
+ .pm = &ehci_SPEAr_pm_ops,
+ .of_match_table = of_match_ptr(SPEAr_ehci_id_table),
}
};
-MODULE_ALIAS("platform:spear-ehci");
+
+static const struct ehci_driver_overrides SPEAr_overrides __initdata = {
+ .reset = ehci_SPEAr_setup,
+};
+
+static int __init ehci_SPEAr_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+
+ ehci_init_driver(&ehci_SPEAr_hc_driver, &SPEAr_overrides);
+ return platform_driver_register(&SPEAr_ehci_hcd_driver);
+}
+module_init(ehci_SPEAr_init);
+
+static void __exit ehci_SPEAr_cleanup(void)
+{
+ platform_driver_unregister(&SPEAr_ehci_hcd_driver);
+}
+module_exit(ehci_SPEAr_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver
2013-02-10 18:58 ` [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver manjunath.goudar at linaro.org
@ 2013-02-11 4:22 ` Viresh Kumar
2013-02-11 11:19 ` Mark Rutland
1 sibling, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2013-02-11 4:22 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 11, 2013 at 12:28 AM, <manjunath.goudar@linaro.org> wrote:
> From: Manjunath Goudar <manjunath.goudar@linaro.org>
>
> Separate the Spear host controller driver from ehci-hcd host code
SPEAr
> into its own driver module.
>
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
> Cc: Greg KH <greg@kroah.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Viresh Kumar <viresh.linux@gmail.com>
> Cc: Shiraz Hashim <shiraz.hashim@st.com>
> Cc: linux-usb at vger.kernel.org
> Cc: spear-devel at list.st.com
> ---
> drivers/usb/host/Kconfig | 8 +++
> drivers/usb/host/Makefile | 2 +-
> drivers/usb/host/ehci-hcd.c | 8 +--
> drivers/usb/host/ehci-spear.c | 131 +++++++++++++++++++++--------------------
> 4 files changed, 78 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 3a21c5d..15e8032 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
> Enables support for the on-chip EHCI controller on
> OMAP3 and later chips.
>
> +config USB_EHCI_HCD_SPEAR
> + tristate "Support for ST SPEAr on-chip EHCI USB controller"
> + depends on USB_EHCI_HCD && PLAT_SPEAR
> + default y
> + ---help---
> + Enables support for the on-chip EHCI controller on
> + ST SPEAr chips.
> +
> config USB_EHCI_MSM
> bool "Support for MSM on-chip EHCI USB controller"
> depends on USB_EHCI_HCD && ARCH_MSM
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index 001fbff..c8fcde9 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -27,7 +27,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
> obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
> obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o
> obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
> -
> +obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
> obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
> obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
> obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index b416a3f..be7247b 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -1274,7 +1274,7 @@ MODULE_LICENSE ("GPL");
>
> #ifdef CONFIG_PLAT_ORION
> #include "ehci-orion.c"
> -#define PLATFORM_DRIVER ehci_orion_driver
> +#define PLATFORM_DRIVER ehci_orion_driver
> #endif
Looks to be unrelated change.
>
> #ifdef CONFIG_USB_W90X900_EHCI
> @@ -1297,11 +1297,6 @@ MODULE_LICENSE ("GPL");
> #define PLATFORM_DRIVER vt8500_ehci_driver
> #endif
>
> -#ifdef CONFIG_PLAT_SPEAR
> -#include "ehci-spear.c"
> -#define PLATFORM_DRIVER spear_ehci_hcd_driver
> -#endif
> -
> #ifdef CONFIG_USB_EHCI_MSM
> #include "ehci-msm.c"
> #define PLATFORM_DRIVER ehci_msm_driver
> @@ -1347,6 +1342,7 @@ MODULE_LICENSE ("GPL");
> !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
> !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
> !defined(PLATFORM_DRIVER) && \
> + !IS_ENABLED(CONFIG_PLAT_SPEAR) && \
> !defined(PS3_SYSTEM_BUS_DRIVER) && \
> !defined(OF_PLATFORM_DRIVER) && \
> !defined(XILINX_OF_PLATFORM_DRIVER)
> diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
> index 466c1bb..0d9ed11 100644
> --- a/drivers/usb/host/ehci-spear.c
> +++ b/drivers/usb/host/ehci-spear.c
> @@ -1,5 +1,5 @@
> /*
> -* Driver for EHCI HCD on SPEAR SOC
> +* Driver for EHCI HCD on SPEAr SOC
> *
> * Copyright (C) 2010 ST Micro Electronics,
> * Deepak Sikri <deepak.sikri@st.com>
> @@ -12,29 +12,41 @@
> */
>
> #include <linux/clk.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/io.h>
> #include <linux/jiffies.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> #include <linux/pm.h>
> +#include <linux/usb.h>
> +#include <linux/usb/hcd.h>
>
> -struct spear_ehci {
> +#include "ehci.h"
> +
> +#define DRIVER_DESC "EHCI SPEAr driver"
> +
> +static const char hcd_name[] = "ehci-SPEAr";
> +
> +struct SPEAr_ehci {
That's what i wrote in my comment on first patch:
"Please write spear as SPEAr everywhere, leaving
functions/variables/config options."
And so i haven't expected SPEAr into structure/function names :)
> struct ehci_hcd ehci;
> struct clk *clk;
> };
>
> -#define to_spear_ehci(hcd) (struct spear_ehci *)hcd_to_ehci(hcd)
> +#define to_SPEAr_ehci(hcd) (struct SPEAr_ehci *)hcd_to_ehci(hcd)
ditto
>
> -static void spear_start_ehci(struct spear_ehci *ehci)
> +static void SPEAr_start_ehci(struct SPEAr_ehci *ehci)
ditto
> {
> clk_prepare_enable(ehci->clk);
> }
>
> -static void spear_stop_ehci(struct spear_ehci *ehci)
> +static void SPEAr_stop_ehci(struct SPEAr_ehci *ehci)
ditto
> {
> clk_disable_unprepare(ehci->clk);
> }
>
> -static int ehci_spear_setup(struct usb_hcd *hcd)
> +static int ehci_SPEAr_setup(struct usb_hcd *hcd)
ditto
> {
> struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>
> @@ -43,43 +55,10 @@ static int ehci_spear_setup(struct usb_hcd *hcd)
>
> return ehci_setup(hcd);
> }
> -
> -static const struct hc_driver ehci_spear_hc_driver = {
> - .description = hcd_name,
> - .product_desc = "SPEAr EHCI",
> - .hcd_priv_size = sizeof(struct spear_ehci),
> -
> - /* generic hardware linkage */
> - .irq = ehci_irq,
> - .flags = HCD_MEMORY | HCD_USB2,
> -
> - /* basic lifecycle operations */
> - .reset = ehci_spear_setup,
> - .start = ehci_run,
> - .stop = ehci_stop,
> - .shutdown = ehci_shutdown,
> -
> - /* managing i/o requests and associated device resources */
> - .urb_enqueue = ehci_urb_enqueue,
> - .urb_dequeue = ehci_urb_dequeue,
> - .endpoint_disable = ehci_endpoint_disable,
> - .endpoint_reset = ehci_endpoint_reset,
> -
> - /* scheduling support */
> - .get_frame_number = ehci_get_frame,
> -
> - /* root hub support */
> - .hub_status_data = ehci_hub_status_data,
> - .hub_control = ehci_hub_control,
> - .bus_suspend = ehci_bus_suspend,
> - .bus_resume = ehci_bus_resume,
> - .relinquish_port = ehci_relinquish_port,
> - .port_handed_over = ehci_port_handed_over,
> - .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
> -};
> +static struct hc_driver __read_mostly ehci_SPEAr_hc_driver;
ditto
>
> #ifdef CONFIG_PM
> -static int ehci_spear_drv_suspend(struct device *dev)
> +static int ehci_SPEAr_drv_suspend(struct device *dev)
ditto
> {
> struct usb_hcd *hcd = dev_get_drvdata(dev);
> bool do_wakeup = device_may_wakeup(dev);
> @@ -87,7 +66,7 @@ static int ehci_spear_drv_suspend(struct device *dev)
> return ehci_suspend(hcd, do_wakeup);
> }
>
> -static int ehci_spear_drv_resume(struct device *dev)
> +static int ehci_SPEAr_drv_resume(struct device *dev)
ditto
> {
> struct usb_hcd *hcd = dev_get_drvdata(dev);
>
> @@ -96,18 +75,18 @@ static int ehci_spear_drv_resume(struct device *dev)
> }
> #endif /* CONFIG_PM */
>
> -static SIMPLE_DEV_PM_OPS(ehci_spear_pm_ops, ehci_spear_drv_suspend,
> - ehci_spear_drv_resume);
> +static SIMPLE_DEV_PM_OPS(ehci_SPEAr_pm_ops, ehci_SPEAr_drv_suspend,
> + ehci_SPEAr_drv_resume);
ditto
>
> -static u64 spear_ehci_dma_mask = DMA_BIT_MASK(32);
> +static u64 SPEAr_ehci_dma_mask = DMA_BIT_MASK(32);
ditto
>
> -static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
> +static int SPEAr_ehci_hcd_drv_probe(struct platform_device *pdev)
ditto
> {
> struct usb_hcd *hcd ;
> - struct spear_ehci *ehci;
> + struct SPEAr_ehci *ehci;
ditto
> struct resource *res;
> struct clk *usbh_clk;
> - const struct hc_driver *driver = &ehci_spear_hc_driver;
> + const struct hc_driver *driver = &ehci_SPEAr_hc_driver;
ditto
> int irq, retval;
>
> if (usb_disabled())
> @@ -125,7 +104,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
> * Once we have dma capability bindings this can go away.
> */
> if (!pdev->dev.dma_mask)
> - pdev->dev.dma_mask = &spear_ehci_dma_mask;
> + pdev->dev.dma_mask = &SPEAr_ehci_dma_mask;
ditto
>
> usbh_clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(usbh_clk)) {
> @@ -161,10 +140,10 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
> goto err_put_hcd;
> }
>
> - ehci = (struct spear_ehci *)hcd_to_ehci(hcd);
> + ehci = (struct SPEAr_ehci *)hcd_to_ehci(hcd);
ditto
> ehci->clk = usbh_clk;
>
> - spear_start_ehci(ehci);
> + SPEAr_start_ehci(ehci);
ditto
> retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
> if (retval)
> goto err_stop_ehci;
> @@ -172,7 +151,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
> return retval;
>
> err_stop_ehci:
> - spear_stop_ehci(ehci);
> + SPEAr_stop_ehci(ehci);
ditto
> err_put_hcd:
> usb_put_hcd(hcd);
> fail:
> @@ -181,10 +160,10 @@ fail:
> return retval ;
> }
>
> -static int spear_ehci_hcd_drv_remove(struct platform_device *pdev)
> +static int SPEAr_ehci_hcd_drv_remove(struct platform_device *pdev)
ditto
> {
> struct usb_hcd *hcd = platform_get_drvdata(pdev);
> - struct spear_ehci *ehci_p = to_spear_ehci(hcd);
> + struct SPEAr_ehci *ehci_p = to_SPEAr_ehci(hcd);
ditto
>
> if (!hcd)
> return 0;
> @@ -193,27 +172,51 @@ static int spear_ehci_hcd_drv_remove(struct platform_device *pdev)
> usb_remove_hcd(hcd);
>
> if (ehci_p->clk)
> - spear_stop_ehci(ehci_p);
> + SPEAr_stop_ehci(ehci_p);
ditto
> usb_put_hcd(hcd);
>
> return 0;
> }
>
> -static struct of_device_id spear_ehci_id_table[] = {
> - { .compatible = "st,spear600-ehci", },
> +static struct of_device_id SPEAr_ehci_id_table[] = {
ditto
> + { .compatible = "st,SPEAr600-ehci", },
ditto
> { },
> };
>
> -static struct platform_driver spear_ehci_hcd_driver = {
> - .probe = spear_ehci_hcd_drv_probe,
> - .remove = spear_ehci_hcd_drv_remove,
> +static struct platform_driver SPEAr_ehci_hcd_driver = {
> + .probe = SPEAr_ehci_hcd_drv_probe,
> + .remove = SPEAr_ehci_hcd_drv_remove,
ditto
> .shutdown = usb_hcd_platform_shutdown,
> .driver = {
> - .name = "spear-ehci",
> + .name = hcd_name,
> .bus = &platform_bus_type,
> - .pm = &ehci_spear_pm_ops,
> - .of_match_table = of_match_ptr(spear_ehci_id_table),
> + .pm = &ehci_SPEAr_pm_ops,
> + .of_match_table = of_match_ptr(SPEAr_ehci_id_table),
ditto
> }
> };
>
> -MODULE_ALIAS("platform:spear-ehci");
> +
> +static const struct ehci_driver_overrides SPEAr_overrides __initdata = {
> + .reset = ehci_SPEAr_setup,
ditto
> +};
> +
> +static int __init ehci_SPEAr_init(void)
> +{
> + if (usb_disabled())
> + return -ENODEV;
> +
> + pr_info("%s: " DRIVER_DESC "\n", hcd_name);
> +
> + ehci_init_driver(&ehci_SPEAr_hc_driver, &SPEAr_overrides);
> + return platform_driver_register(&SPEAr_ehci_hcd_driver);
> +}
> +module_init(ehci_SPEAr_init);
> +
> +static void __exit ehci_SPEAr_cleanup(void)
> +{
> + platform_driver_unregister(&SPEAr_ehci_hcd_driver);
> +}
> +module_exit(ehci_SPEAr_cleanup);
Everywhere else too :(
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver
2013-02-10 18:58 ` [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver manjunath.goudar at linaro.org
2013-02-11 4:22 ` Viresh Kumar
@ 2013-02-11 11:19 ` Mark Rutland
1 sibling, 0 replies; 12+ messages in thread
From: Mark Rutland @ 2013-02-11 11:19 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
[...]
> -static struct of_device_id spear_ehci_id_table[] = {
> - { .compatible = "st,spear600-ehci", },
> +static struct of_device_id SPEAr_ehci_id_table[] = {
> + { .compatible = "st,SPEAr600-ehci", },
> { },
> };
This will break anyone using the documented binding, and anyone with an
existing dt will suddenly find their usb support broken.
Please don't change this.
Thanks,
Mark.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/8] USB: EHCI: make ehci-atmel a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
2013-02-10 18:58 ` [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 3/8] USB: EHCI: make ehci-s5p " manjunath.goudar at linaro.org
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the Atmel host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: linux-usb at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 8 +++++
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-atmel.c | 77 ++++++++++++++++++++++-------------------
drivers/usb/host/ehci-hcd.c | 10 ++----
drivers/usb/host/ehci.h | 2 +-
5 files changed, 54 insertions(+), 44 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 15e8032..1ef37d7 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -170,6 +170,14 @@ config USB_EHCI_HCD_SPEAR
Enables support for the on-chip EHCI controller on
ST SPEAr chips.
+config USB_EHCI_HCD_AT91
+ tristate "Support for Atmel on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && ARCH_AT91
+ default y
+ ---help---
+ Enables support for the on-chip EHCI controller on
+ Atmel chips.
+
config USB_EHCI_MSM
bool "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index c8fcde9..b301243 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o
obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
+obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 27639487..e6a50f0 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -15,6 +15,19 @@
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_platform.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include <linux/dma-mapping.h>
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI atmel driver"
+
+static const char hcd_name[] = "ehci-atmel";
+static struct hc_driver __read_mostly ehci_atmel_hc_driver;
/* interface and function clocks */
static struct clk *iclk, *fclk;
@@ -60,41 +73,6 @@ static int ehci_atmel_setup(struct usb_hcd *hcd)
return ehci_setup(hcd);
}
-static const struct hc_driver ehci_atmel_hc_driver = {
- .description = hcd_name,
- .product_desc = "Atmel EHCI UHP HS",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- /* generic hardware linkage */
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- /* basic lifecycle operations */
- .reset = ehci_atmel_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /* managing i/o requests and associated device resources */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- /* scheduling support */
- .get_frame_number = ehci_get_frame,
-
- /* root hub support */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
-
static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32);
static int ehci_atmel_drv_probe(struct platform_device *pdev)
@@ -210,7 +188,34 @@ static struct platform_driver ehci_atmel_driver = {
.remove = ehci_atmel_drv_remove,
.shutdown = usb_hcd_platform_shutdown,
.driver = {
- .name = "atmel-ehci",
+ .name = hcd_name,
.of_match_table = of_match_ptr(atmel_ehci_dt_ids),
},
};
+
+static const struct ehci_driver_overrides atmel_overrides __initdata = {
+ .reset = ehci_atmel_setup,
+};
+
+static int __init ehci_atmel_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ ehci_init_driver(&ehci_atmel_hc_driver, &atmel_overrides);
+ return platform_driver_register(&ehci_atmel_driver);
+}
+module_init(ehci_atmel_init);
+
+static void __exit ehci_atmel_cleanup(void)
+{
+ platform_driver_unregister(&ehci_atmel_driver);
+}
+module_exit(ehci_atmel_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+
+MODULE_ALIAS("platform:ehci-atmel");
+MODULE_AUTHOR("Nicolas Ferre");
+MODULE_LICENSE("GPL");
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index be7247b..08e9fdf 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -352,7 +352,7 @@ static void ehci_silence_controller(struct ehci_hcd *ehci)
* This forcibly disables dma and IRQs, helping kexec and other cases
* where the next system software may expect clean state.
*/
-static void ehci_shutdown(struct usb_hcd *hcd)
+void ehci_shutdown(struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
@@ -366,7 +366,7 @@ static void ehci_shutdown(struct usb_hcd *hcd)
hrtimer_cancel(&ehci->hrtimer);
}
-
+EXPORT_SYMBOL_GPL(ehci_shutdown);
/*-------------------------------------------------------------------------*/
/*
@@ -1282,11 +1282,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_hcd_w90x900_driver
#endif
-#ifdef CONFIG_ARCH_AT91
-#include "ehci-atmel.c"
-#define PLATFORM_DRIVER ehci_atmel_driver
-#endif
-
#ifdef CONFIG_USB_OCTEON_EHCI
#include "ehci-octeon.c"
#define PLATFORM_DRIVER ehci_octeon_driver
@@ -1343,6 +1338,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
!defined(PLATFORM_DRIVER) && \
!IS_ENABLED(CONFIG_PLAT_SPEAR) && \
+ !IS_ENABLED(CONFIG_ARCH_AT91) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 36c3a82..593d3bb 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -798,7 +798,7 @@ struct ehci_driver_overrides {
extern void ehci_init_driver(struct hc_driver *drv,
const struct ehci_driver_overrides *over);
extern int ehci_setup(struct usb_hcd *hcd);
-
+extern void ehci_shutdown(struct usb_hcd *hcd);
#ifdef CONFIG_PM
extern int ehci_suspend(struct usb_hcd *hcd, bool do_wakeup);
extern int ehci_resume(struct usb_hcd *hcd, bool hibernated);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 3/8] USB: EHCI: make ehci-s5p a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
2013-02-10 18:58 ` [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 2/8] USB: EHCI: make ehci-atmel " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-11 17:40 ` Stephen Warren
2013-02-10 18:58 ` [PATCH 4/8] USB: EHCI: make ehci-mv " manjunath.goudar at linaro.org
` (4 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the s5p host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: linux-usb at vger.kernel.org
---
drivers/usb/host/Kconfig | 2 +-
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 6 +---
drivers/usb/host/ehci-s5p.c | 69 ++++++++++++++++++++++++-------------------
4 files changed, 41 insertions(+), 37 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 1ef37d7..8ffbafa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -215,7 +215,7 @@ config USB_EHCI_SH
If you use the PCI EHCI controller, this option is not necessary.
config USB_EHCI_S5P
- boolean "S5P EHCI support"
+ tristate "S5P EHCI support"
depends on USB_EHCI_HCD && PLAT_S5P
help
Enable support for the S5P SOC's on-chip EHCI controller.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index b301243..77e0331 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
+obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 08e9fdf..22c50fb 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1307,11 +1307,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_hcd_msp_driver
#endif
-#ifdef CONFIG_USB_EHCI_TEGRA
-#include "ehci-tegra.c"
-#define PLATFORM_DRIVER tegra_ehci_driver
-#endif
-
#ifdef CONFIG_USB_EHCI_S5P
#include "ehci-s5p.c"
#define PLATFORM_DRIVER s5p_ehci_driver
@@ -1339,6 +1334,7 @@ MODULE_LICENSE ("GPL");
!defined(PLATFORM_DRIVER) && \
!IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!IS_ENABLED(CONFIG_ARCH_AT91) && \
+ !IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 20ebf6a..6ddf526 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -20,6 +20,17 @@
#include <linux/usb/phy.h>
#include <linux/usb/samsung_usb_phy.h>
#include <plat/usb-phy.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include <linux/usb/otg.h>
+#include <linux/dma-mapping.h>
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI s5p driver"
#define EHCI_INSNREG00(base) (base + 0x90)
#define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25)
@@ -30,6 +41,10 @@
(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
+static const char hcd_name[] = "ehci-s5p";
+static struct hc_driver __read_mostly s5p_ehci_hc_driver;
+
+
struct s5p_ehci_hcd {
struct device *dev;
struct usb_hcd *hcd;
@@ -39,36 +54,6 @@ struct s5p_ehci_hcd {
struct s5p_ehci_platdata *pdata;
};
-static const struct hc_driver s5p_ehci_hc_driver = {
- .description = hcd_name,
- .product_desc = "S5P EHCI Host Controller",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- .reset = ehci_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- .get_frame_number = ehci_get_frame,
-
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
-
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci)
{
@@ -322,5 +307,27 @@ static struct platform_driver s5p_ehci_driver = {
.of_match_table = of_match_ptr(exynos_ehci_match),
}
};
+static const struct ehci_driver_overrides s5p_overrides __initdata = {
+ .reset = ehci_setup,
+};
+
+static int __init ehci_s5p_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ ehci_init_driver(&s5p_ehci_hc_driver, &s5p_overrides);
+ return platform_driver_register(&s5p_ehci_driver);
+}
+module_init(ehci_s5p_init);
+
+static void __exit ehci_s5p_cleanup(void)
+{
+ platform_driver_unregister(&s5p_ehci_driver);
+}
+module_exit(ehci_s5p_cleanup);
-MODULE_ALIAS("platform:s5p-ehci");
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_ALIAS("platform:ehci-s5p");
+MODULE_LICENSE("GPL");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/8] USB: EHCI: make ehci-mv a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
` (2 preceding siblings ...)
2013-02-10 18:58 ` [PATCH 3/8] USB: EHCI: make ehci-s5p " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 5/8] USB: EHCI: make ehci-vt8500 " manjunath.goudar at linaro.org
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the mv(marvell) host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: linux-usb at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 2 +-
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 6 +---
drivers/usb/host/ehci-mv.c | 80 ++++++++++++++++++++-----------------------
4 files changed, 40 insertions(+), 49 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 8ffbafa..2aa4ece 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -221,7 +221,7 @@ config USB_EHCI_S5P
Enable support for the S5P SOC's on-chip EHCI controller.
config USB_EHCI_MV
- bool "EHCI support for Marvell on-chip controller"
+ tristate "EHCI support for Marvell on-chip controller"
depends on USB_EHCI_HCD && (ARCH_PXA || ARCH_MMP)
select USB_EHCI_ROOT_HUB_TT
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 77e0331..d593017 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o
obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
+obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 22c50fb..d133f6d 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1317,11 +1317,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_grlib_driver
#endif
-#ifdef CONFIG_USB_EHCI_MV
-#include "ehci-mv.c"
-#define PLATFORM_DRIVER ehci_mv_driver
-#endif
-
#ifdef CONFIG_MIPS_SEAD3
#include "ehci-sead3.c"
#define PLATFORM_DRIVER ehci_hcd_sead3_driver
@@ -1335,6 +1330,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_PLAT_SPEAR) && \
!IS_ENABLED(CONFIG_ARCH_AT91) && \
!IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
+ !IS_ENABLED(CONFIG_USB_EHCI_MV) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 3065809..67de419 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -17,7 +17,18 @@
#include <linux/usb/otg.h>
#include <linux/platform_data/mv_usb.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include <linux/dma-mapping.h>
+
+#include "ehci.h"
+
+#define DRIVER_DESC "EHCI mv driver"
+
#define CAPLENGTH_MASK (0xff)
+static const char hcd_name[] = "ehci-mv";
+static struct hc_driver __read_mostly mv_ehci_hc_driver;
struct ehci_hcd_mv {
struct usb_hcd *hcd;
@@ -95,48 +106,6 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
return retval;
}
-static const struct hc_driver mv_ehci_hc_driver = {
- .description = hcd_name,
- .product_desc = "Marvell EHCI",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- /*
- * basic lifecycle operations
- */
- .reset = mv_ehci_reset,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
-};
-
static int mv_ehci_probe(struct platform_device *pdev)
{
struct mv_usb_platform_data *pdata = pdev->dev.platform_data;
@@ -350,8 +319,33 @@ static struct platform_driver ehci_mv_driver = {
.remove = mv_ehci_remove,
.shutdown = mv_ehci_shutdown,
.driver = {
- .name = "mv-ehci",
+ .name = hcd_name,
.bus = &platform_bus_type,
},
.id_table = ehci_id_table,
};
+static const struct ehci_driver_overrides mv_overrides __initdata = {
+ .reset = mv_ehci_reset,
+};
+
+static int __init ehci_mv_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ ehci_init_driver(&mv_ehci_hc_driver, &mv_overrides);
+ return platform_driver_register(&ehci_mv_driver);
+}
+module_init(ehci_mv_init);
+
+static void __exit ehci_mv_cleanup(void)
+{
+ platform_driver_unregister(&ehci_mv_driver);
+}
+module_exit(ehci_mv_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_ALIAS("platform:ehci-mv");
+MODULE_AUTHOR("Marvell");
+MODULE_LICENSE("GPL");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 5/8] USB: EHCI: make ehci-vt8500 a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
` (3 preceding siblings ...)
2013-02-10 18:58 ` [PATCH 4/8] USB: EHCI: make ehci-mv " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 6/8] USB: EHCI: make ehci-msm " manjunath.goudar at linaro.org
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the vt8500 host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Tony Prisk <linux@prisktech.co.nz>
Cc: Alexey Charkov <alchark@gmail.com>
Cc: linux-usb at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 8 +++++
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 5 ---
drivers/usb/host/ehci-vt8500.c | 73 ++++++++++++++++++----------------------
4 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2aa4ece..4e15b87 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
Enables support for the on-chip EHCI controller on
OMAP3 and later chips.
+config USB_EHCI_HCD_VT8500
+ tristate "Support for VT8500 on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && ARCH_VT8500
+ default y
+ ---help---
+ Enables support for the on-chip EHCI controller on
+ VT8500 chips.
+
config USB_EHCI_HCD_SPEAR
tristate "Support for ST SPEAr on-chip EHCI USB controller"
depends on USB_EHCI_HCD && PLAT_SPEAR
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index d593017..1fe0579 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o
+obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index d133f6d..3dacac0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1287,11 +1287,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_octeon_driver
#endif
-#ifdef CONFIG_ARCH_VT8500
-#include "ehci-vt8500.c"
-#define PLATFORM_DRIVER vt8500_ehci_driver
-#endif
-
#ifdef CONFIG_USB_EHCI_MSM
#include "ehci-msm.c"
#define PLATFORM_DRIVER ehci_msm_driver
diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c
index 11695d5..98d65bd 100644
--- a/drivers/usb/host/ehci-vt8500.c
+++ b/drivers/usb/host/ehci-vt8500.c
@@ -16,52 +16,25 @@
*
*/
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include <linux/dma-mapping.h>
#include <linux/of.h>
#include <linux/platform_device.h>
-static const struct hc_driver vt8500_ehci_hc_driver = {
- .description = hcd_name,
- .product_desc = "VT8500 EHCI",
- .hcd_priv_size = sizeof(struct ehci_hcd),
+#include "ehci.h"
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- /*
- * basic lifecycle operations
- */
- .reset = ehci_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
+#define DRIVER_DESC "vt8500 On-Chip EHCI Host driver"
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
+static const char hcd_name[] = "ehci-vt8500";
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
+static struct hc_driver __read_mostly vt8500_ehci_hc_driver;
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
+static const struct ehci_driver_overrides ehci_vt8500_overrides __initdata = {
+ .reset = ehci_setup,
};
static u64 vt8500_ehci_dma_mask = DMA_BIT_MASK(32);
@@ -140,11 +113,31 @@ static struct platform_driver vt8500_ehci_driver = {
.remove = vt8500_ehci_drv_remove,
.shutdown = usb_hcd_platform_shutdown,
.driver = {
- .name = "vt8500-ehci",
+ .name = hcd_name,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(vt8500_ehci_ids),
}
};
+static int __init ehci_vt8500_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ ehci_init_driver(&vt8500_ehci_hc_driver, &ehci_vt8500_overrides);
+ return platform_driver_register(&vt8500_ehci_driver);
+}
+module_init(ehci_vt8500_init);
+
+static void __exit ehci_vt8500_cleanup(void)
+{
+ platform_driver_unregister(&vt8500_ehci_driver);
+}
+module_exit(ehci_vt8500_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_AUTHOR("Alexey Charkov");
+MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:vt8500-ehci");
MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/8] USB: EHCI: make ehci-msm a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
` (4 preceding siblings ...)
2013-02-10 18:58 ` [PATCH 5/8] USB: EHCI: make ehci-vt8500 " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-11 17:37 ` Stephen Warren
2013-02-10 18:58 ` [PATCH 7/8] USB: EHCI: make ehci-w90X900 " manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 8/8] USB: EHCI: make ehci-orion " manjunath.goudar at linaro.org
7 siblings, 1 reply; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the Qualcomm On-Chip host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brown <davidb@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Brian Swetland <swetland@google.com>
Cc: linux-usb at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 4 +-
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 7 +---
drivers/usb/host/ehci-msm.c | 85 +++++++++++++++++++------------------------
4 files changed, 42 insertions(+), 55 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 4e15b87..751290d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -187,7 +187,7 @@ config USB_EHCI_HCD_AT91
Atmel chips.
config USB_EHCI_MSM
- bool "Support for MSM on-chip EHCI USB controller"
+ tristate "Support for MSM on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_MSM
select USB_EHCI_ROOT_HUB_TT
select USB_MSM_OTG
@@ -203,7 +203,7 @@ config USB_EHCI_TEGRA
boolean "NVIDIA Tegra HCD support"
depends on USB_EHCI_HCD && ARCH_TEGRA
select USB_EHCI_ROOT_HUB_TT
- help
+ --- help---
This driver enables support for the internal USB Host Controllers
found in NVIDIA Tegra SoCs. The controllers are EHCI compliant.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 1fe0579..75d98b9 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o
obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
+obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 3dacac0..db5f0ce 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1287,11 +1287,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_octeon_driver
#endif
-#ifdef CONFIG_USB_EHCI_MSM
-#include "ehci-msm.c"
-#define PLATFORM_DRIVER ehci_msm_driver
-#endif
-
#ifdef CONFIG_TILE_USB
#include "ehci-tilegx.c"
#define PLATFORM_DRIVER ehci_hcd_tilegx_driver
@@ -1326,6 +1321,8 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_ARCH_AT91) && \
!IS_ENABLED(CONFIG_USB_EHCI_S5P) && \
!IS_ENABLED(CONFIG_USB_EHCI_MV) && \
+ !IS_ENABLED(CONFIG_ARCH_VT8500) && \
+ !IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 88a49c8..a9a0357 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -26,12 +26,22 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/pm_runtime.h>
-
#include <linux/usb/otg.h>
#include <linux/usb/msm_hsusb_hw.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+
+#include "ehci.h"
#define MSM_USB_BASE (hcd->regs)
+#define DRIVER_DESC "Qualcomm On-Chip EHCI Host Controller"
+
+static const char hcd_name[] = "msm_hsusb_host";
+static struct hc_driver __read_mostly msm_hc_driver;
static struct usb_phy *phy;
static int ehci_msm_reset(struct usb_hcd *hcd)
@@ -56,52 +66,6 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
return 0;
}
-static struct hc_driver msm_hc_driver = {
- .description = hcd_name,
- .product_desc = "Qualcomm On-Chip EHCI Host Controller",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_USB2 | HCD_MEMORY,
-
- .reset = ehci_msm_reset,
- .start = ehci_run,
-
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- /*
- * PM support
- */
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
-};
-
static int ehci_msm_probe(struct platform_device *pdev)
{
struct usb_hcd *hcd;
@@ -222,7 +186,32 @@ static struct platform_driver ehci_msm_driver = {
.probe = ehci_msm_probe,
.remove = ehci_msm_remove,
.driver = {
- .name = "msm_hsusb_host",
+ .name = hcd_name,
.pm = &ehci_msm_dev_pm_ops,
},
};
+
+static const struct ehci_driver_overrides msm_overrides __initdata = {
+ .reset = ehci_msm_reset,
+};
+
+static int __init ehci_msm_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ ehci_init_driver(&msm_hc_driver, &msm_overrides);
+ return platform_driver_register(&ehci_msm_driver);
+}
+module_init(ehci_msm_init);
+
+static void __exit ehci_msm_cleanup(void)
+{
+ platform_driver_unregister(&ehci_msm_driver);
+}
+module_exit(ehci_msm_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_ALIAS("platform:msm-ehci");
+MODULE_LICENSE("GPL");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/8] USB: EHCI: make ehci-msm a separate driver
2013-02-10 18:58 ` [PATCH 6/8] USB: EHCI: make ehci-msm " manjunath.goudar at linaro.org
@ 2013-02-11 17:37 ` Stephen Warren
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Warren @ 2013-02-11 17:37 UTC (permalink / raw)
To: linux-arm-kernel
On 02/10/2013 11:58 AM, manjunath.goudar at linaro.org wrote:
> Separate the Qualcomm On-Chip host controller driver from ehci-hcd host code
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> @@ -203,7 +203,7 @@ config USB_EHCI_TEGRA
> boolean "NVIDIA Tegra HCD support"
> depends on USB_EHCI_HCD && ARCH_TEGRA
> select USB_EHCI_ROOT_HUB_TT
> - help
> + --- help---
> This driver enables support for the internal USB Host Controllers
> found in NVIDIA Tegra SoCs. The controllers are EHCI compliant.
I still don't think that's correct.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/8] USB: EHCI: make ehci-w90X900 a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
` (5 preceding siblings ...)
2013-02-10 18:58 ` [PATCH 6/8] USB: EHCI: make ehci-msm " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
2013-02-10 18:58 ` [PATCH 8/8] USB: EHCI: make ehci-orion " manjunath.goudar at linaro.org
7 siblings, 0 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the Nuvoton On-Chip host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: linux-usb at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 2 +-
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 16 +++----
drivers/usb/host/ehci-w90x900.c | 90 +++++++++++++++++----------------------
4 files changed, 48 insertions(+), 61 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 751290d..d1d1b09 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -238,7 +238,7 @@ config USB_EHCI_MV
only be EHCI host. OTG is controller that can switch to host mode.
config USB_W90X900_EHCI
- bool "W90X900(W90P910) EHCI support"
+ tristate "W90X900(W90P910) EHCI support"
depends on USB_EHCI_HCD && ARCH_W90X900
---help---
Enables support for the W90X900 USB controller
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 75d98b9..e169ba1 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o
obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
+obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index db5f0ce..5fab5fa 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1272,16 +1272,6 @@ MODULE_LICENSE ("GPL");
#define XILINX_OF_PLATFORM_DRIVER ehci_hcd_xilinx_of_driver
#endif
-#ifdef CONFIG_PLAT_ORION
-#include "ehci-orion.c"
-#define PLATFORM_DRIVER ehci_orion_driver
-#endif
-
-#ifdef CONFIG_USB_W90X900_EHCI
-#include "ehci-w90x900.c"
-#define PLATFORM_DRIVER ehci_hcd_w90x900_driver
-#endif
-
#ifdef CONFIG_USB_OCTEON_EHCI
#include "ehci-octeon.c"
#define PLATFORM_DRIVER ehci_octeon_driver
@@ -1292,6 +1282,11 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_hcd_tilegx_driver
#endif
+#ifdef CONFIG_PLAT_ORION
+#include "ehci-orion.c"
+#define PLATFORM_DRIVER ehci_orion_driver
+#endif
+
#ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
#include "ehci-pmcmsp.c"
#define PLATFORM_DRIVER ehci_hcd_msp_driver
@@ -1323,6 +1318,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_USB_EHCI_MV) && \
!IS_ENABLED(CONFIG_ARCH_VT8500) && \
!IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
+ !IS_ENABLED(CONFIG_USB_W90X900_EHCI) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 59e0e24..0b677ec 100644
--- a/drivers/usb/host/ehci-w90x900.c
+++ b/drivers/usb/host/ehci-w90x900.c
@@ -13,11 +13,31 @@
#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include "ehci.h"
+
/* enable phy0 and phy1 for w90p910 */
#define ENPHY (0x01<<8)
#define PHY0_CTR (0xA4)
#define PHY1_CTR (0xA8)
+#define DRIVER_DESC "Nuvoton w90x900 On-Chip EHCI Host driver"
+
+static const char hcd_name[] = "ehci-w90x900";
+
+static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
+
+static const struct ehci_driver_overrides ehci_w90X900_overrides __initdata = {
+ .reset = ehci_setup,
+};
+
static int usb_w90x900_probe(const struct hc_driver *driver,
struct platform_device *pdev)
{
@@ -99,54 +119,6 @@ void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev)
usb_put_hcd(hcd);
}
-static const struct hc_driver ehci_w90x900_hc_driver = {
- .description = hcd_name,
- .product_desc = "Nuvoton w90x900 EHCI Host Controller",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_USB2|HCD_MEMORY,
-
- /*
- * basic lifecycle operations
- */
- .reset = ehci_setup,
- .start = ehci_run,
-
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
-#ifdef CONFIG_PM
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
-#endif
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
-
static int ehci_w90x900_probe(struct platform_device *pdev)
{
if (usb_disabled())
@@ -168,12 +140,30 @@ static struct platform_driver ehci_hcd_w90x900_driver = {
.probe = ehci_w90x900_probe,
.remove = ehci_w90x900_remove,
.driver = {
- .name = "w90x900-ehci",
+ .name = hcd_name,
.owner = THIS_MODULE,
},
};
+static int __init ehci_w90X900_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+
+ ehci_init_driver(&ehci_w90x900_hc_driver, &ehci_w90X900_overrides);
+ return platform_driver_register(&ehci_hcd_w90x900_driver);
+}
+module_init(ehci_w90X900_init);
+
+static void __exit ehci_w90X900_cleanup(void)
+{
+ platform_driver_unregister(&ehci_hcd_w90x900_driver);
+}
+module_exit(ehci_w90X900_cleanup);
+
MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_DESCRIPTION("w90p910 usb ehci driver!");
+MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:w90p910-ehci");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 8/8] USB: EHCI: make ehci-orion a separate driver
[not found] <1360522697-22902-1-git-send-email-y>
` (6 preceding siblings ...)
2013-02-10 18:58 ` [PATCH 7/8] USB: EHCI: make ehci-w90X900 " manjunath.goudar at linaro.org
@ 2013-02-10 18:58 ` manjunath.goudar at linaro.org
7 siblings, 0 replies; 12+ messages in thread
From: manjunath.goudar at linaro.org @ 2013-02-10 18:58 UTC (permalink / raw)
To: linux-arm-kernel
From: Manjunath Goudar <manjunath.goudar@linaro.org>
Separate the Marvell Orion host controller driver from ehci-hcd host code
into its own driver module.
Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
---
drivers/usb/host/Kconfig | 8 ++++
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-hcd.c | 6 +--
drivers/usb/host/ehci-orion.c | 91 +++++++++++++++++++----------------------
4 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index d1d1b09..18bfbfa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -162,6 +162,14 @@ config USB_EHCI_HCD_OMAP
Enables support for the on-chip EHCI controller on
OMAP3 and later chips.
+config USB_EHCI_HCD_ORION
+ tristate "Support for Marvell Orion on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && PLAT_ORION
+ default y
+ ---help---
+ Enables support for the on-chip EHCI controller on
+ Morvell Orion chips.
+
config USB_EHCI_HCD_VT8500
tristate "Support for VT8500 on-chip EHCI USB controller"
depends on USB_EHCI_HCD && ARCH_VT8500
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index e169ba1..fe20e98 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_USB_EHCI_MV) += ehci-mv.o
obj-$(CONFIG_USB_EHCI_HCD_VT8500)+= ehci-vt8500.o
obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o
+obj-$(CONFIG_USB_EHCI_HCD_ORION)+= ehci-orion.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5fab5fa..4c2a795 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1282,11 +1282,6 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_hcd_tilegx_driver
#endif
-#ifdef CONFIG_PLAT_ORION
-#include "ehci-orion.c"
-#define PLATFORM_DRIVER ehci_orion_driver
-#endif
-
#ifdef CONFIG_USB_EHCI_HCD_PMC_MSP
#include "ehci-pmcmsp.c"
#define PLATFORM_DRIVER ehci_hcd_msp_driver
@@ -1319,6 +1314,7 @@ MODULE_LICENSE ("GPL");
!IS_ENABLED(CONFIG_ARCH_VT8500) && \
!IS_ENABLED(CONFIG_USB_EHCI_MSM) && \
!IS_ENABLED(CONFIG_USB_W90X900_EHCI) && \
+ !IS_ENABLED(CONFIG_PLAT_ORION) && \
!defined(PS3_SYSTEM_BUS_DRIVER) && \
!defined(OF_PLATFORM_DRIVER) && \
!defined(XILINX_OF_PLATFORM_DRIVER)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 914a3ec..06f143b 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -17,6 +17,13 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
+#include <linux/usb.h>
+#include <linux/usb/hcd.h>
+#include <linux/io.h>
+#include <linux/dma-mapping.h>
+
+#include "ehci.h"
+
#define rdl(off) __raw_readl(hcd->regs + (off))
#define wrl(off, val) __raw_writel((val), hcd->regs + (off))
@@ -34,6 +41,17 @@
#define USB_PHY_IVREF_CTRL 0x440
#define USB_PHY_TST_GRP_CTRL 0x450
+#define DRIVER_DESC "EHCI orion driver"
+
+static const char hcd_name[] = "ehci-orion";
+
+static struct hc_driver __read_mostly ehci_orion_hc_driver;
+
+static const struct ehci_driver_overrides orion_overrides __initdata = {
+ .reset = ehci_setup,
+};
+
+
/*
* Implement Orion USB controller specification guidelines
*/
@@ -104,51 +122,6 @@ static void orion_usb_phy_v1_setup(struct usb_hcd *hcd)
wrl(USB_MODE, 0x13);
}
-static const struct hc_driver ehci_orion_hc_driver = {
- .description = hcd_name,
- .product_desc = "Marvell Orion EHCI",
- .hcd_priv_size = sizeof(struct ehci_hcd),
-
- /*
- * generic hardware linkage
- */
- .irq = ehci_irq,
- .flags = HCD_MEMORY | HCD_USB2,
-
- /*
- * basic lifecycle operations
- */
- .reset = ehci_setup,
- .start = ehci_run,
- .stop = ehci_stop,
- .shutdown = ehci_shutdown,
-
- /*
- * managing i/o requests and associated device resources
- */
- .urb_enqueue = ehci_urb_enqueue,
- .urb_dequeue = ehci_urb_dequeue,
- .endpoint_disable = ehci_endpoint_disable,
- .endpoint_reset = ehci_endpoint_reset,
-
- /*
- * scheduling support
- */
- .get_frame_number = ehci_get_frame,
-
- /*
- * root hub support
- */
- .hub_status_data = ehci_hub_status_data,
- .hub_control = ehci_hub_control,
- .bus_suspend = ehci_bus_suspend,
- .bus_resume = ehci_bus_resume,
- .relinquish_port = ehci_relinquish_port,
- .port_handed_over = ehci_port_handed_over,
-
- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
-};
-
static void
ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
const struct mbus_dram_target_info *dram)
@@ -323,8 +296,6 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
return 0;
}
-MODULE_ALIAS("platform:orion-ehci");
-
static const struct of_device_id ehci_orion_dt_ids[] = {
{ .compatible = "marvell,orion-ehci", },
{},
@@ -336,8 +307,32 @@ static struct platform_driver ehci_orion_driver = {
.remove = __exit_p(ehci_orion_drv_remove),
.shutdown = usb_hcd_platform_shutdown,
.driver = {
- .name = "orion-ehci",
+ .name = hcd_name,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(ehci_orion_dt_ids),
},
};
+
+static int __init ehci_orion_init(void)
+{
+ if (usb_disabled())
+ return -ENODEV;
+
+ pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+
+ ehci_init_driver(&ehci_orion_hc_driver, &orion_overrides);
+ return platform_driver_register(&ehci_orion_driver);
+}
+module_init(ehci_orion_init);
+
+static void __exit ehci_orion_cleanup(void)
+{
+ platform_driver_unregister(&ehci_orion_driver);
+}
+module_exit(ehci_orion_cleanup);
+
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_ALIAS("platform:ehci-orion");
+MODULE_AUTHOR("Tzachi Perelstein");
+MODULE_LICENSE("GPL");
+
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread