Re: [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver

2013-02-11 Thread Mark Rutland
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.

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver

2013-02-10 Thread Viresh Kumar
On Mon, Feb 11, 2013 at 12:28 AM,  manjunath.gou...@linaro.org wrote:
 From: Manjunath Goudar manjunath.gou...@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.gou...@linaro.org
 Signed-off-by: Deepak Saxena dsax...@linaro.org
 Cc: Greg KH g...@kroah.com
 Cc: Alan Stern st...@rowland.harvard.edu
 Cc: Viresh Kumar viresh.li...@gmail.com
 Cc: Shiraz Hashim shiraz.has...@st.com
 Cc: linux-usb@vger.kernel.org
 Cc: spear-de...@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
 -#definePLATFORM_DRIVER ehci_orion_driver
 +#definePLATFORM_DRIVER ehci_orion_driver
  #endif

Looks to be unrelated change.


  #ifdef CONFIG_USB_W90X900_EHCI
 @@ -1297,11 +1297,6 @@ MODULE_LICENSE (GPL);
  #definePLATFORM_DRIVER vt8500_ehci_driver
  #endif

 -#ifdef CONFIG_PLAT_SPEAR
 -#include ehci-spear.c
 -#define PLATFORM_DRIVERspear_ehci_hcd_driver
 -#endif
 -
  #ifdef CONFIG_USB_EHCI_MSM
  #include ehci-msm.c
  #define PLATFORM_DRIVERehci_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.si...@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