Re: FUSB200 xhci issue

2013-08-10 Thread Oleksij Rempel

Am 09.08.2013 21:32, schrieb Alan Stern:

On Fri, 9 Aug 2013, Oleksij Rempel wrote:


Is there any way to prevent the device from losing its firmware during
a USB reset or suspend?


For suspend - yes. It is possible to ignore suspend command or put the
SoC in low power mode - but is it probably not so easy to bring it back.
I would need to read more code and create some doc as side effect untill
i understand how it works.
I'm not sure how about reset command. I would need more testing and some
ones help. If i see it correctly, usb reset should affect only usb core
and usb pll.

How can i trigger usb reset?


http://marc.info/?l=linux-usbm=121459435621262w=2

Give the program the pathname for the USB device node.  For example:

usbreset /dev/bus/usb/001/004


Great! thx!

usb reset do not affect behaviour of firmware. At least after i remove 
all attempts to reboot FW from driver.
If adapter will got reset signal, FW will be notified about it. Then FW 
will remove reset flag and will just continue to work. After usb reset, 
lsusb show correct, update information - EP3 and EP4 was updated from 
INT to BULK.


I assume, no i need to add to the driver some kind of firmware check. 
What is the proper way to do it?


--
Regards,
Oleksij
--
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/2] net/usb: catc: allocate URB setup_packet as separate buffer

2013-08-10 Thread Jussi Kivilinna
On 09.08.2013 23:42, David Miller wrote:
 From: Jussi Kivilinna jussi.kivili...@iki.fi
 Date: Wed, 07 Aug 2013 16:26:29 +0300
 
 URB setup packet must not be allocated as part of larger structure
 because DMA coherence issues.

 Patch changes catc to allocate ctrl_dr member as separate buffer.

 Patch is only compile tested.

 Cc: sta...@vger.kernel.org
 Signed-off-by: Jussi Kivilinna jussi.kivili...@iki.fi
 
 I absolutely do not agree with your adding the stable CC: tag for
 a patch which has only been compile tested.

Agreed, this was not brightest of ideas. I won't do it again.

-Jussi

 
 This applies to all of your other patches you submitted in this
 cluster too.
 

--
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


[PATCH V2] USB: EHCI: make ehci-w90X900 a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the W90X900(W90P910) on-chip host controller driver from
ehci-hcd host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
however, note that other changes are still needed before W90X900(W90P910)
can be booted with a multi-platform kernel

and an ehci driver that only works on one of them.

With the infrastructure added by Alan Stern in patch 3e0232039
USB: EHCI: prepare to make ehci-hcd a library module, we can
avoid this problem by turning a bus glue into a separate
module, as we do here for the w90X900 bus glue.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Arnd Bergmann a...@arndb.de
Acked-by: Wan ZongShun mcuos@gmail.com
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org
Cc: linux-ker...@vger.kernel.org

V2:
-Arranged  #include's in alphabetical order.
-Replaced w90p910 by w90x900 because it is supports
 all series of w90x900.

 drivers/usb/host/Kconfig|2 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-hcd.c |5 ---
 drivers/usb/host/ehci-w90x900.c |   85 ---
 4 files changed, 37 insertions(+), 56 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index ba52912..7bc598b 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -244,7 +244,7 @@ config USB_EHCI_MV
  SoCs, see USB_EHCI_HCD_ORION for those.
 
 config USB_W90X900_EHCI
-   bool W90X900(W90P910) EHCI support
+   tristate W90X900(W90P910) EHCI support
depends on ARCH_W90X900
---help---
Enables support for the W90X900 USB controller
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 7664db8..28adb3f 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += ehci-tegra.o
 obj-$(CONFIG_USB_EHCI_MV)   += ehci-mv.o
+obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o
 
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 5717dcd..4a5644e 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1249,11 +1249,6 @@ MODULE_LICENSE (GPL);
 #define XILINX_OF_PLATFORM_DRIVER  ehci_hcd_xilinx_of_driver
 #endif
 
-#ifdef CONFIG_USB_W90X900_EHCI
-#include ehci-w90x900.c
-#definePLATFORM_DRIVER ehci_hcd_w90x900_driver
-#endif
-
 #ifdef CONFIG_USB_OCTEON_EHCI
 #include ehci-octeon.c
 #define PLATFORM_DRIVERehci_octeon_driver
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 59e0e24..4d6631d 100644
--- a/drivers/usb/host/ehci-w90x900.c
+++ b/drivers/usb/host/ehci-w90x900.c
@@ -11,13 +11,28 @@
  *
  */
 
+#include linux/dma-mapping.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/of.h
 #include linux/platform_device.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ehci.h
 
 /* enable phy0 and phy1 for w90p910 */
 #defineENPHY   (0x018)
 #define PHY0_CTR   (0xA4)
 #define PHY1_CTR   (0xA8)
 
+#define DRIVER_DESC EHCI w90x900 driver
+
+static const char hcd_name[] = ehci-w90x900 ;
+
+static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
+
 static int usb_w90x900_probe(const struct hc_driver *driver,
  struct platform_device *pdev)
 {
@@ -99,54 +114,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= 

[PATCH V4 3/6] USB: OHCI: make ohci-omap3 a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the  TI OHCI OMAP3 host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.11.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Anand Gadiyar gadi...@ti.com
Cc: Felipe Balbi ba...@ti.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -ohci_setup() removed because it is called in .reset member
  of the ohci_hc_driver structure.
 -The improper multi-line commenting style written in proper way.
  ('*' characters aligned in vertically).

V3:
 -RemoteWakeupConnected setting has been removed.

V4:
 -V3 modification revert back, only ohci-regs setting write()
  function has been removed because ohci-regs doesn't get set until
  usb_add_hcd.
---
 drivers/usb/host/Kconfig  |2 +-
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ohci-hcd.c   |   18 ---
 drivers/usb/host/ohci-omap3.c |  118 +
 4 files changed, 40 insertions(+), 99 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 99b7e7e..3eab432 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -383,7 +383,7 @@ config USB_OHCI_HCD_OMAP1
  Enables support for the OHCI controller on OMAP1/2 chips.
 
 config USB_OHCI_HCD_OMAP3
-   bool OHCI support for OMAP3 and later chips
+   tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
default y
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index a0220c1..a0064a6 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_USB_OHCI_HCD_PCI)+= ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
+obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 1abc1e7..cad51d2 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1182,11 +1182,6 @@ MODULE_LICENSE (GPL);
 #define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_OMAP3
-#include ohci-omap3.c
-#define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
-#endif
-
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #include ohci-pxa27x.c
 #define PLATFORM_DRIVERohci_hcd_pxa27x_driver
@@ -1284,12 +1279,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_platform;
 #endif
 
-#ifdef OMAP3_PLATFORM_DRIVER
-   retval = platform_driver_register(OMAP3_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_omap3_platform;
-#endif
-
 #ifdef OF_PLATFORM_DRIVER
retval = platform_driver_register(OF_PLATFORM_DRIVER);
if (retval  0)
@@ -1393,10 +1382,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(OF_PLATFORM_DRIVER);
  error_of_platform:
 #endif
-#ifdef OMAP3_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
- error_omap3_platform:
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
  error_platform:
@@ -1448,9 +1433,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef OF_PLATFORM_DRIVER
platform_driver_unregister(OF_PLATFORM_DRIVER);
 #endif
-#ifdef OMAP3_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 8f71357..e14f4d9 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -29,90 +29,22 @@
  * - add kernel-doc
  */
 
+#include linux/dma-mapping.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/of.h
+#include linux/usb/otg.h
 #include linux/platform_device.h
 #include linux/pm_runtime.h
-#include linux/of.h
-#include linux/dma-mapping.h
-
-/*-*/
-
-static int ohci_omap3_init(struct usb_hcd *hcd)
-{
-   dev_dbg(hcd-self.controller, starting OHCI controller\n);
-
-   return ohci_init(hcd_to_ohci(hcd));
-}
-
-/*-*/
-
-static int ohci_omap3_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   /*
-* RemoteWakeupConnected has to be set explicitly before
-* calling ohci_run. The reset value of RWC is 0.
-*/
-   ohci-hc_control = 

[PATCH V4 2/6] USB: OHCI: make ohci-omap a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the  TI OHCI OMAP1/2 host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.11.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Felipe Balbi ba...@ti.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -omap_ohci_clock_power(0) called in usb_hcd_omap_remove().
 -Removed ohci_setup() call from usb_hcd_omap_probe().
 -host_enabled and host_initialized variables aren't used for anything
  thats what removed.

V3:
 -rewritten if (config-otg || config-rwc) block statements into
  two separate 'if blocks' to handle below scenarios
  1. config-otg set scenario.
  2. if any of these (config-otg, config-rwc) are set, this
 scenario should be handled only after ohci_setup()

V4:
 -usb_remove_hcd() function is required a valid clock that is what
  omap_ohci_clock_power(0) is called after hcd shutdown.
---
 drivers/usb/host/Kconfig |2 +-
 drivers/usb/host/Makefile|1 +
 drivers/usb/host/ohci-hcd.c  |   18 -
 drivers/usb/host/ohci-omap.c |  156 ++
 4 files changed, 55 insertions(+), 122 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 7b8f6bd..99b7e7e 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -376,7 +376,7 @@ config USB_OHCI_HCD
 if USB_OHCI_HCD
 
 config USB_OHCI_HCD_OMAP1
-   bool OHCI support for OMAP1/2 chips
+   tristate OHCI support for OMAP1/2 chips
depends on ARCH_OMAP1
default y
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 45e2ffb..a0220c1 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_OHCI_HCD)+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI) += ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
+obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 2980bb6..1abc1e7 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1182,11 +1182,6 @@ MODULE_LICENSE (GPL);
 #define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_OMAP1
-#include ohci-omap.c
-#define OMAP1_PLATFORM_DRIVER  ohci_hcd_omap_driver
-#endif
-
 #ifdef CONFIG_USB_OHCI_HCD_OMAP3
 #include ohci-omap3.c
 #define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
@@ -1289,12 +1284,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_platform;
 #endif
 
-#ifdef OMAP1_PLATFORM_DRIVER
-   retval = platform_driver_register(OMAP1_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_omap1_platform;
-#endif
-
 #ifdef OMAP3_PLATFORM_DRIVER
retval = platform_driver_register(OMAP3_PLATFORM_DRIVER);
if (retval  0)
@@ -1408,10 +1397,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
  error_omap3_platform:
 #endif
-#ifdef OMAP1_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP1_PLATFORM_DRIVER);
- error_omap1_platform:
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
  error_platform:
@@ -1466,9 +1451,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef OMAP3_PLATFORM_DRIVER
platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
 #endif
-#ifdef OMAP1_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP1_PLATFORM_DRIVER);
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 8747fa6..8149ef0 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -14,12 +14,21 @@
  * This file is licenced under the GPL.
  */
 
-#include linux/signal.h
-#include linux/jiffies.h
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/dma-mapping.h
 #include linux/err.h
 #include linux/gpio.h
+#include linux/io.h
+#include linux/jiffies.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/usb/otg.h
+#include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
 
 #include asm/io.h
 #include asm/mach-types.h
@@ -42,10 +51,7 @@
 #define OMAP1510_LB_MMU_RAM_H  0xfffec234
 #define OMAP1510_LB_MMU_RAM_L  0xfffec238
 
-
-#ifndef CONFIG_ARCH_OMAP
-#error This file is OMAP bus glue.  CONFIG_OMAP must be defined.
-#endif
+#define DRIVER_DESC OHCI OMAP driver
 
 #ifdef CONFIG_TPS65010
 #include linux/i2c/tps65010.h
@@ -68,8 +74,9 @@ extern int 

[PATCH V4 4/6] USB: OHCI: make ohci-spear a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the ST OHCI SPEAr host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.11.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Viresh Kumar viresh.li...@gmail.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -ohci_setup() removed because it is called in .reset member
  of the ohci_hc_driver structure.
 -debugging stuff isn't needed any more that's what removed.

V3:
 No change.
---
 drivers/usb/host/Kconfig  |8 +++
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ohci-hcd.c   |   18 --
 drivers/usb/host/ohci-spear.c |  140 +
 4 files changed, 65 insertions(+), 102 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 3eab432..a5a34a3 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -382,6 +382,14 @@ config USB_OHCI_HCD_OMAP1
---help---
  Enables support for the OHCI controller on OMAP1/2 chips.
 
+config USB_OHCI_HCD_SPEAR
+tristate Support for ST SPEAr on-chip OHCI USB controller
+depends on USB_OHCI_HCD  PLAT_SPEAR
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  ST SPEAr chips.
+
 config USB_OHCI_HCD_OMAP3
tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index a0064a6..8cc3f63 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -47,6 +47,7 @@ obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)   += ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
+obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index cad51d2..34ec156 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1212,11 +1212,6 @@ MODULE_LICENSE (GPL);
 #define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
 #endif
 
-#ifdef CONFIG_PLAT_SPEAR
-#include ohci-spear.c
-#define SPEAR_PLATFORM_DRIVER  spear_ohci_hcd_driver
-#endif
-
 #ifdef CONFIG_PPC_PS3
 #include ohci-ps3.c
 #define PS3_SYSTEM_BUS_DRIVER  ps3_ohci_driver
@@ -1333,19 +1328,9 @@ static int __init ohci_hcd_mod_init(void)
goto error_davinci;
 #endif
 
-#ifdef SPEAR_PLATFORM_DRIVER
-   retval = platform_driver_register(SPEAR_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_spear;
-#endif
-
return retval;
 
/* Error path */
-#ifdef SPEAR_PLATFORM_DRIVER
-   platform_driver_unregister(SPEAR_PLATFORM_DRIVER);
- error_spear:
-#endif
 #ifdef DAVINCI_PLATFORM_DRIVER
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
  error_davinci:
@@ -1403,9 +1388,6 @@ module_init(ohci_hcd_mod_init);
 
 static void __exit ohci_hcd_mod_exit(void)
 {
-#ifdef SPEAR_PLATFORM_DRIVER
-   platform_driver_unregister(SPEAR_PLATFORM_DRIVER);
-#endif
 #ifdef DAVINCI_PLATFORM_DRIVER
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index cc9dd9e..31ff3fc 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -11,92 +11,37 @@
 * warranty of any kind, whether express or implied.
 */
 
-#include linux/signal.h
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/dma-mapping.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of.h
+#include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
 
+#define DRIVER_DESC OHCI SPEAr driver
+
+static const char hcd_name[] = SPEAr-ohci;
 struct spear_ohci {
-   struct ohci_hcd ohci;
struct clk *clk;
 };
 
-#define to_spear_ohci(hcd) (struct spear_ohci *)hcd_to_ohci(hcd)
-
-static void spear_start_ohci(struct spear_ohci *ohci)
-{
-   clk_prepare_enable(ohci-clk);
-}
-
-static void spear_stop_ohci(struct spear_ohci *ohci)
-{
-   clk_disable_unprepare(ohci-clk);
-}
-
-static int ohci_spear_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   ret = ohci_init(ohci);
-   if (ret  0)
-   return ret;
-   ohci-regs = hcd-regs;
-
-   ret = ohci_run(ohci);
-   if (ret  0) {
-   dev_err(hcd-self.controller, can't start\n);
-   ohci_stop(hcd);
-   return ret;
-   }
-
-   create_debug_files(ohci);
-

[PATCH V4 5/6] USB: OHCI: make ohci-at91 a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the  TI OHCI Atmel host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.12.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -Set non-standard fields in ohci_at91_hc_driver manually, rather than
  relying on an expanded struct ohci_driver_overrides.
 -Save orig_ohci_hub_control and orig_ohci_hub_status_data rather than
  relying on ohci_hub_control and hub_status_data being exported.
 -ohci_setup() has been removed because it is called in .reset member
  of the ohci_hc_driver structure.

V3:
 -The ohci_restart() function is not required in  current scenario,
  only discarding connection state of integrated transceivers is sufficient,
  for this directly handling ohci-hc_control.

V4:
 - Removed extra space after tristate.
 - Removed extra space between function name  and '(' characters.
 - MODULE_ALIAS line moved to last statement of ohci-at91 file.
---
 drivers/usb/host/Kconfig |8 +++
 drivers/usb/host/Makefile|1 +
 drivers/usb/host/ohci-at91.c |  153 +++---
 drivers/usb/host/ohci-hcd.c  |   18 -
 4 files changed, 77 insertions(+), 103 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index a5a34a3..693560a 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -390,6 +390,14 @@ config USB_OHCI_HCD_SPEAR
   Enables support for the on-chip OHCI controller on
   ST SPEAr chips.
 
+config USB_OHCI_HCD_AT91
+tristate Support for Atmel on-chip OHCI USB controller
+depends on USB_OHCI_HCD  ARCH_AT91
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  Atmel chips.
+
 config USB_OHCI_HCD_OMAP3
tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 8cc3f63..a0ac663 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_USB_OHCI_EXYNOS) += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
+obj-$(CONFIG_USB_OHCI_HCD_AT91)+= ohci-at91.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 9677f68..08e28eb 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -13,27 +13,41 @@
  */
 
 #include linux/clk.h
-#include linux/platform_device.h
+#include linux/dma-mapping.h
 #include linux/of_platform.h
 #include linux/of_gpio.h
+#include linux/platform_device.h
 #include linux/platform_data/atmel.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/usb.h
+#include linux/usb/hcd.h
 
 #include mach/hardware.h
 #include asm/gpio.h
 
 #include mach/cpu.h
 
-#ifndef CONFIG_ARCH_AT91
-#error CONFIG_ARCH_AT91 must be defined.
-#endif
+
+#include ohci.h
 
 #define valid_port(index)  ((index) = 0  (index)  AT91_MAX_USBH_PORTS)
 #define at91_for_each_port(index)  \
for ((index) = 0; (index)  AT91_MAX_USBH_PORTS; (index)++)
 
 /* interface and function clocks; sometimes also an AHB clock */
+
+#define DRIVER_DESC OHCI Atmel driver
+
+static const char hcd_name[] = ohci-atmel;
+
+static struct hc_driver __read_mostly ohci_at91_hc_driver;
 static struct clk *iclk, *fclk, *hclk;
 static int clocked;
+static int (*orig_ohci_hub_control)(struct usb_hcd  *hcd, u16 typeReq,
+   u16 wValue, u16 wIndex, char *buf, u16 wLength);
+static int (*orig_ohci_hub_status_data)(struct usb_hcd *hcd, char *buf);
 
 extern int usb_disabled(void);
 
@@ -111,6 +125,8 @@ static void usb_hcd_at91_remove (struct usb_hcd *, struct 
platform_device *);
 static int usb_hcd_at91_probe(const struct hc_driver *driver,
struct platform_device *pdev)
 {
+   struct at91_usbh_data *board;
+   struct ohci_hcd *ohci;
int retval;
struct usb_hcd *hcd = NULL;
 
@@ -163,8 +179,10 @@ static int usb_hcd_at91_probe(const struct hc_driver 
*driver,
goto err5;
}
 
+   board = hcd-self.controller-platform_data;
+   ohci = hcd_to_ohci(hcd);
+   ohci-num_ports = board-ports;
at91_start_hc(pdev);
-   ohci_hcd_init(hcd_to_ohci(hcd));
 
retval = usb_add_hcd(hcd, pdev-resource[1].start, IRQF_SHARED);
if (retval == 0)
@@ -221,36 +239,6 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
 }
 
 

[PATCH V4 1/6] USB: OHCI: make ohci-exynos a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the  Samsung OHCI EXYNOS host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.11.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Acked-by: Jingoo Han jg1@samsung.com
Cc: Vivek Gautam gautam.vi...@samsung.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Kukjin Kim kgene@samsung.com
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -exynos_ohci_hcd structure assignment error fixed.
 -Removed multiple usb_create_hcd() from prob funtion.
 -platform_set_drvdata() called before exynos_ohci_phy_enable().
 -ohci_setup() removed because it is called in .reset member
  of the ohci_hc_driver structure

V3:
 -No major changes only exynos written in capital letters
  in OHCI exynos driver.

V4:
 -No changes.

---
 drivers/usb/host/Kconfig   |2 +-
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ohci-exynos.c |  167 +---
 drivers/usb/host/ohci-hcd.c|   18 -
 4 files changed, 71 insertions(+), 117 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 7bc598b..7b8f6bd 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -463,7 +463,7 @@ config USB_OHCI_SH
  If you use the PCI OHCI controller, this option is not necessary.
 
 config USB_OHCI_EXYNOS
-   boolean OHCI support for Samsung EXYNOS SoC Series
+   tristate OHCI support for Samsung EXYNOS SoC Series
depends on ARCH_EXYNOS
help
 Enable support for the Samsung Exynos SOC's on-chip OHCI controller.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 28adb3f..45e2ffb 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI) += ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
+obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index b0b542c..ae6068d 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -12,24 +12,39 @@
  */
 
 #include linux/clk.h
+#include linux/dma-mapping.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of.h
 #include linux/platform_device.h
 #include linux/platform_data/usb-ohci-exynos.h
 #include linux/usb/phy.h
 #include linux/usb/samsung_usb_phy.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/usb/otg.h
+
+#include ohci.h
+
+#define DRIVER_DESC OHCI EXYNOS driver
+
+static const char hcd_name[] = ohci-exynos;
+static struct hc_driver __read_mostly exynos_ohci_hc_driver;
+
+#define to_exynos_ohci(hcd) (struct exynos_ohci_hcd *)(hcd_to_ohci(hcd)-priv)
 
 struct exynos_ohci_hcd {
-   struct device *dev;
-   struct usb_hcd *hcd;
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
struct exynos4_ohci_platdata *pdata;
 };
 
-static void exynos_ohci_phy_enable(struct exynos_ohci_hcd *exynos_ohci)
+static void exynos_ohci_phy_enable(struct platform_device *pdev)
 {
-   struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
+   struct usb_hcd *hcd = platform_get_drvdata(pdev);
+   struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 
if (exynos_ohci-phy)
usb_phy_init(exynos_ohci-phy);
@@ -37,9 +52,10 @@ static void exynos_ohci_phy_enable(struct exynos_ohci_hcd 
*exynos_ohci)
exynos_ohci-pdata-phy_init(pdev, USB_PHY_TYPE_HOST);
 }
 
-static void exynos_ohci_phy_disable(struct exynos_ohci_hcd *exynos_ohci)
+static void exynos_ohci_phy_disable(struct platform_device *pdev)
 {
-   struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
+   struct usb_hcd *hcd = platform_get_drvdata(pdev);
+   struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
 
if (exynos_ohci-phy)
usb_phy_shutdown(exynos_ohci-phy);
@@ -47,63 +63,11 @@ static void exynos_ohci_phy_disable(struct exynos_ohci_hcd 
*exynos_ohci)
exynos_ohci-pdata-phy_exit(pdev, USB_PHY_TYPE_HOST);
 }
 
-static int ohci_exynos_reset(struct usb_hcd *hcd)
-{
-   return ohci_init(hcd_to_ohci(hcd));
-}
-
-static int ohci_exynos_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   ohci_dbg(ohci, ohci_exynos_start, ohci:%p, ohci);
-
-   ret = ohci_run(ohci);
-   if (ret  0) {
-   dev_err(hcd-self.controller, can't start %s\n,
-   hcd-self.bus_name);
-   ohci_stop(hcd);
-  

Re: [PATCH] net/usb: rtl8150: allocate URB transfer_buffer and setup_packet separately

2013-08-10 Thread Jussi Kivilinna
On 09.08.2013 21:50, Petko Manolov wrote:
 On Thu, 8 Aug 2013, Jussi Kivilinna wrote:
 
 On 08.08.2013 18:14, Petko Manolov wrote:
 On Wed, 7 Aug 2013, Jussi Kivilinna wrote:

 rtl8150 allocates URB transfer_buffer and setup_packet as part of same 
 structure 'struct async_req'. This can cause same cacheline to be 
 DMA-mapped twice with same URB. This can lead to memory corruption on 
 some systems.

 I can see performance impact due to the double mapping.  However, memory 
 corruption seems a bit too much for sane cache and DMA controllers.  Out 
 of interest - which is the architecture that will potentially corrupt the 
 memory.

 rtlwifi driver had similar structure to allocate both setup_packet and 
 transfer_buffer in single go (overlapping dma-mapping cachelines) and 
 this caused problems on ARM/sunxi. Problems means: memory corruptions at 
 random locations, device freezes and lock-ups.
 
 Broken controllers?..
 

At first I thought so too, but I discussed about this at linux-usb, and answer
was that driver which uses same (dma/-)cacheline for multiple buffers is buggy..
  http://marc.info/?l=linux-usbm=137130407121137w=2 (at end)
  http://marc.info/?l=linux-usbm=137137080902265w=2
  http://marc.info/?l=linux-usbm=137242422120782w=2

-Jussi
--
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


[PATCH V4 6/6] USB: OHCI: make ohci-s3c2410 a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the Samsung OHCI S3C host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM;
it would be nice to have in 3.12.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -Set non-standard fields in ohci_s3c2410_hc_driver manually, rather than
  relying on an expanded struct ohci_driver_overrides.
 -Save orig_ohci_hub_control and orig_ohci_hub_status_data rather than
  relying on ohci_hub_control and hub_status_data being exported.

V3:
 -Kconfig wrong parentheses discription fixed.
 -ohci_setup() has been removed because it is called in .reset member
  of the ohci_hc_driver structure.

V4:
 - Removed extra space before the '='.
 - Moved  /* forward definitions */ line before the declarations of functions.
---
 drivers/usb/host/Kconfig|8 +++
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ohci-hcd.c |   18 --
 drivers/usb/host/ohci-s3c2410.c |  128 +--
 4 files changed, 66 insertions(+), 89 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 693560a..795d14d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -390,6 +390,14 @@ config USB_OHCI_HCD_SPEAR
   Enables support for the on-chip OHCI controller on
   ST SPEAr chips.
 
+config USB_OHCI_HCD_S3C
+tristate Support for S3C on-chip OHCI USB controller
+depends on USB_OHCI_HCD  (ARCH_S3C24XX || ARCH_S3C64XX)
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  S3C chips.
+
 config USB_OHCI_HCD_AT91
 tristate Support for Atmel on-chip OHCI USB controller
 depends on USB_OHCI_HCD  ARCH_AT91
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index a0ac663..d3e9e66 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_USB_OHCI_HCD_OMAP1)  += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
 obj-$(CONFIG_USB_OHCI_HCD_AT91)+= ohci-at91.o
+obj-$(CONFIG_USB_OHCI_HCD_S3C) += ohci-s3c2410.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index b48c892..b69a49e 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1177,11 +1177,6 @@ MODULE_LICENSE (GPL);
 #define SA_DRIVER  ohci_hcd_sa_driver
 #endif
 
-#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S3C64XX)
-#include ohci-s3c2410.c
-#define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
-#endif
-
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #include ohci-pxa27x.c
 #define PLATFORM_DRIVERohci_hcd_pxa27x_driver
@@ -1293,12 +1288,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_tmio;
 #endif
 
-#ifdef S3C2410_PLATFORM_DRIVER
-   retval = platform_driver_register(S3C2410_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_s3c2410;
-#endif
-
 #ifdef EP93XX_PLATFORM_DRIVER
retval = platform_driver_register(EP93XX_PLATFORM_DRIVER);
if (retval  0)
@@ -1332,10 +1321,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
  error_ep93xx:
 #endif
-#ifdef S3C2410_PLATFORM_DRIVER
-   platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
- error_s3c2410:
-#endif
 #ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(TMIO_OHCI_DRIVER);
  error_tmio:
@@ -1382,9 +1367,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef EP93XX_PLATFORM_DRIVER
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
 #endif
-#ifdef S3C2410_PLATFORM_DRIVER
-   platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
-#endif
 #ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(TMIO_OHCI_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index e125770..48b5948 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -19,19 +19,36 @@
  * This file is licenced under the GPL.
 */
 
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/platform_device.h
 #include linux/platform_data/usb-ohci-s3c2410.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
+
 
 #define valid_port(idx) ((idx) == 1 || (idx) == 2)
 
 /* clock device associated with the hcd */
 
+
+#define DRIVER_DESC OHCI S3C driver
+
+static const char hcd_name[] = ohci-s3c;
+
 static struct 

[PATCH V3 1/2] USB: OHCI: make ohci-ep93xx a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the OHCI EP93XX host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -ohci_hcd_init() statements are removed,
  because by default it is called in ohci_setup().

V3:
 -Unused *ohci variable has been removed.
---
 drivers/usb/host/Kconfig   |8 
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ohci-ep93xx.c |   80 +---
 drivers/usb/host/ohci-hcd.c|   18 -
 4 files changed, 43 insertions(+), 64 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f7f7823..cdfaa04 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -414,6 +414,14 @@ config USB_OHCI_HCD_DA8XX
   Enables support for the on-chip OHCI controller on
   DA8xx/OMAP-L1x chips.
 
+config USB_OHCI_HCD_EP93XX
+   tristate Support for EP93XX on-chip OHCI USB controller
+   depends on USB_OHCI_HCD  ARCH_EP93XX
+   default y
+   ---help---
+ Enables support for the on-chip OHCI controller on
+ EP93XX chips.
+
 config USB_OHCI_HCD_AT91
 tristate Support for Atmel on-chip OHCI USB controller
 depends on USB_OHCI_HCD  ARCH_AT91
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index f8d59371..3fee3ea 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_USB_OHCI_HCD_AT91)   += ohci-at91.o
 obj-$(CONFIG_USB_OHCI_HCD_S3C) += ohci-s3c2410.o
 obj-$(CONFIG_USB_OHCI_HCD_LPC32XX) += ohci-nxp.o
 obj-$(CONFIG_USB_OHCI_HCD_DA8XX)   += ohci-da8xx.o
+obj-$(CONFIG_USB_OHCI_HCD_EP93XX)  += ohci-ep93xx.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index f0aaa48..7b0e3ae 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -25,8 +25,21 @@
 
 #include linux/clk.h
 #include linux/device.h
-#include linux/signal.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
+
+#define DRIVER_DESC OHCI EP93xx driver
+
+static const char hcd_name[] = ohci-ep93xx;
+
+static struct hc_driver __read_mostly ohci_ep93xx_hc_driver;
 
 static struct clk *usb_host_clock;
 
@@ -79,8 +92,6 @@ static int usb_hcd_ep93xx_probe(const struct hc_driver 
*driver,
 
ep93xx_start_hc(pdev-dev);
 
-   ohci_hcd_init(hcd_to_ohci(hcd));
-
retval = usb_add_hcd(hcd, pdev-resource[1].start, 0);
if (retval == 0)
return retval;
@@ -107,48 +118,6 @@ static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd,
usb_put_hcd(hcd);
 }
 
-static int ohci_ep93xx_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   if ((ret = ohci_init(ohci))  0)
-   return ret;
-
-   if ((ret = ohci_run(ohci))  0) {
-   dev_err(hcd-self.controller, can't start %s\n,
-   hcd-self.bus_name);
-   ohci_stop(hcd);
-   return ret;
-   }
-
-   return 0;
-}
-
-static struct hc_driver ohci_ep93xx_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = EP93xx OHCI,
-   .hcd_priv_size  = sizeof(struct ohci_hcd),
-   .irq= ohci_irq,
-   .flags  = HCD_USB11 | HCD_MEMORY,
-   .start  = ohci_ep93xx_start,
-   .stop   = ohci_stop,
-   .shutdown   = ohci_shutdown,
-   .urb_enqueue= ohci_urb_enqueue,
-   .urb_dequeue= ohci_urb_dequeue,
-   .endpoint_disable   = ohci_endpoint_disable,
-   .get_frame_number   = ohci_get_frame,
-   .hub_status_data= ohci_hub_status_data,
-   .hub_control= ohci_hub_control,
-#ifdef CONFIG_PM
-   .bus_suspend= ohci_bus_suspend,
-   .bus_resume = ohci_bus_resume,
-#endif
-   .start_port_reset   = ohci_start_port_reset,
-};
-
-extern int usb_disabled(void);
-
 static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev)
 {
int ret;
@@ -206,7 +175,6 @@ static int ohci_hcd_ep93xx_drv_resume(struct 
platform_device *pdev)
 }
 #endif
 
-
 static struct platform_driver ohci_hcd_ep93xx_driver = {
.probe  = ohci_hcd_ep93xx_drv_probe,
.remove = ohci_hcd_ep93xx_drv_remove,
@@ -221,4 +189,24 @@ static struct platform_driver 

[PATCH V3 2/2] USB: OHCI: make ohci-pxa27x a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the  OHCI pxa27x/pxa3xx host controller driver from
ohci-hcd host code so that it can be built as a separate driver
module. This work is part of enabling multi-platform kernels on
ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
 -Changed ohci_hcd and pxa27x_ohci struct variable names.
1 ohci_hcd struct variable name is ohci.
2 pxa27x_ohci struct variable name is pxa_ohci.

V3:
 -Rewrite the macro definition of to_pxa27x_ohci.
 -clk_put() function has been called before usb_put_hcd().
---
 drivers/usb/host/Kconfig   |8 ++
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ohci-hcd.c|5 -
 drivers/usb/host/ohci-pxa27x.c |  242 ++--
 4 files changed, 115 insertions(+), 141 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index cdfaa04..0d7ee36 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -422,6 +422,14 @@ config USB_OHCI_HCD_EP93XX
  Enables support for the on-chip OHCI controller on
  EP93XX chips.
 
+config USB_OHCI_HCD_PXA27X
+   tristate Support for PXA27X/PXA3XX on-chip OHCI USB controller
+   depends on USB_OHCI_HCD  (PXA27x || PXA3xx)
+   default y
+   ---help---
+ Enables support for the on-chip OHCI controller on
+ PXA27x/PXA3xx chips.
+
 config USB_OHCI_HCD_AT91
 tristate Support for Atmel on-chip OHCI USB controller
 depends on USB_OHCI_HCD  ARCH_AT91
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 3fee3ea..8b7fa89 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_USB_OHCI_HCD_S3C)+= ohci-s3c2410.o
 obj-$(CONFIG_USB_OHCI_HCD_LPC32XX) += ohci-nxp.o
 obj-$(CONFIG_USB_OHCI_HCD_DA8XX)   += ohci-da8xx.o
 obj-$(CONFIG_USB_OHCI_HCD_EP93XX)  += ohci-ep93xx.o
+obj-$(CONFIG_USB_OHCI_HCD_PXA27X)  += ohci-pxa27x.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 3f46cff..f601dde 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1184,11 +1184,6 @@ MODULE_LICENSE (GPL);
 #define SA_DRIVER  ohci_hcd_sa_driver
 #endif
 
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
-#include ohci-pxa27x.c
-#define PLATFORM_DRIVERohci_hcd_pxa27x_driver
-#endif
-
 #ifdef CONFIG_USB_OHCI_HCD_PPC_OF
 #include ohci-ppc-of.c
 #define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 5fb91f1..394f221 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -19,15 +19,26 @@
  * This file is licenced under the GPL.
  */
 
-#include linux/device.h
-#include linux/signal.h
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/device.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of_platform.h
 #include linux/of_gpio.h
-#include mach/hardware.h
 #include linux/platform_data/usb-ohci-pxa27x.h
 #include linux/platform_data/usb-pxa3xx-ulpi.h
+#include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/usb/otg.h
+
+#include mach/hardware.h
+
+#include ohci.h
+
+#define DRIVER_DESC OHCI PXA27x/PXA3x driver
 
 /*
  * UHC: USB Host Controller (OHCI-like) register definitions
@@ -101,16 +112,16 @@
 
 #define PXA_UHC_MAX_PORTNUM3
 
-struct pxa27x_ohci {
-   /* must be 1st member here for hcd_to_ohci() to work */
-   struct ohci_hcd ohci;
+static const char hcd_name[] = ohci-pxa27x;
+
+static struct hc_driver __read_mostly ohci_pxa27x_hc_driver;
 
-   struct device   *dev;
+struct pxa27x_ohci {
struct clk  *clk;
void __iomem*mmio_base;
 };
 
-#define to_pxa27x_ohci(hcd)(struct pxa27x_ohci *)hcd_to_ohci(hcd)
+#define to_pxa27x_ohci(hcd)(struct pxa27x_ohci *)(hcd_to_ohci(hcd)-priv)
 
 /*
   PMM_NPS_MODE -- PMM Non-power switching mode
@@ -122,10 +133,10 @@ struct pxa27x_ohci {
   PMM_PERPORT_MODE -- PMM per port switching mode
   Ports are powered individually.
  */
-static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *ohci, int mode)
+static int pxa27x_ohci_select_pmm(struct pxa27x_ohci *pxa_ohci, int mode)
 {
-   uint32_t uhcrhda = __raw_readl(ohci-mmio_base + UHCRHDA);
-   uint32_t uhcrhdb = __raw_readl(ohci-mmio_base + UHCRHDB);
+   uint32_t uhcrhda = __raw_readl(pxa_ohci-mmio_base + UHCRHDA);
+   uint32_t uhcrhdb = __raw_readl(pxa_ohci-mmio_base + UHCRHDB);
 
switch (mode) {
case PMM_NPS_MODE:
@@ -149,20 +160,18 @@ static int pxa27x_ohci_select_pmm(struct 

[PATCH V2] USB: OHCI: make ohci-nxp a separate driver

2013-08-10 Thread Manjunath Goudar
Separate the OHCI NXP host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Many place function name and struct name started with usb,
current scenario replaced usb with ohci for proper naming.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Signed-off-by: Deepak Saxena dsax...@linaro.org
Acked-by: Alan Stern st...@rowland.harvard.edu
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org

V2:
  - Directive check NXP_PLATFORM_DRIVER block has been removed.
---
 drivers/usb/host/Kconfig|8 +++
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ohci-hcd.c |   18 ---
 drivers/usb/host/ohci-nxp.c |  124 +--
 4 files changed, 58 insertions(+), 93 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 795d14d..0519769 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -398,6 +398,14 @@ config USB_OHCI_HCD_S3C
   Enables support for the on-chip OHCI controller on
   S3C chips.
 
+config USB_OHCI_HCD_LPC32XX
+   tristate Support for LPC on-chip OHCI USB controller
+   depends on USB_OHCI_HCD  ARCH_LPC32XX
+   default y
+   ---help---
+  Enables support for the on-chip OHCI controller on
+  NXP chips.
+
 config USB_OHCI_HCD_AT91
 tristate Support for Atmel on-chip OHCI USB controller
 depends on USB_OHCI_HCD  ARCH_AT91
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index d3e9e66..0835c39 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_USB_OHCI_HCD_OMAP3)  += ohci-omap3.o
 obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
 obj-$(CONFIG_USB_OHCI_HCD_AT91)+= ohci-at91.o
 obj-$(CONFIG_USB_OHCI_HCD_S3C) += ohci-s3c2410.o
+obj-$(CONFIG_USB_OHCI_HCD_LPC32XX) += ohci-nxp.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index f3dcaa2..39d14f0 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1194,11 +1194,6 @@ MODULE_LICENSE (GPL);
 #define EP93XX_PLATFORM_DRIVER ohci_hcd_ep93xx_driver
 #endif
 
-#ifdef CONFIG_ARCH_LPC32XX
-#include ohci-nxp.c
-#define NXP_PLATFORM_DRIVERusb_hcd_nxp_driver
-#endif
-
 #ifdef CONFIG_ARCH_DAVINCI_DA8XX
 #include ohci-da8xx.c
 #define DAVINCI_PLATFORM_DRIVERohci_hcd_da8xx_driver
@@ -1301,12 +1296,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_ep93xx;
 #endif
 
-#ifdef NXP_PLATFORM_DRIVER
-   retval = platform_driver_register(NXP_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_nxp;
-#endif
-
 #ifdef DAVINCI_PLATFORM_DRIVER
retval = platform_driver_register(DAVINCI_PLATFORM_DRIVER);
if (retval  0)
@@ -1320,10 +1309,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
  error_davinci:
 #endif
-#ifdef NXP_PLATFORM_DRIVER
-   platform_driver_unregister(NXP_PLATFORM_DRIVER);
- error_nxp:
-#endif
 #ifdef EP93XX_PLATFORM_DRIVER
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
  error_ep93xx:
@@ -1368,9 +1353,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef DAVINCI_PLATFORM_DRIVER
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
 #endif
-#ifdef NXP_PLATFORM_DRIVER
-   platform_driver_unregister(NXP_PLATFORM_DRIVER);
-#endif
 #ifdef EP93XX_PLATFORM_DRIVER
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index 7d7d507..8d6eecf 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -19,10 +19,19 @@
  * or implied.
  */
 #include linux/clk.h
-#include linux/platform_device.h
+#include linux/dma-mapping.h
+#include linux/io.h
 #include linux/i2c.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of.h
+#include linux/platform_device.h
 #include linux/usb/isp1301.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
+
 
 #include mach/hardware.h
 #include asm/mach-types.h
@@ -57,6 +66,11 @@
 #define start_int_umask(irq)
 #endif
 
+#define DRIVER_DESC OHCI NXP driver
+
+static const char hcd_name[] = ohci-nxp;
+static struct hc_driver __read_mostly ohci_nxp_hc_driver;
+
 static struct i2c_client *isp1301_i2c_client;
 
 extern int usb_disabled(void);
@@ -132,14 +146,14 @@ static inline void isp1301_vbus_off(void)
OTG1_VBUS_DRV);
 }
 
-static void nxp_start_hc(void)
+static void ohci_nxp_start_hc(void)
 {
unsigned long tmp = __raw_readl(USB_OTG_STAT_CONTROL) | HOST_EN;
__raw_writel(tmp, USB_OTG_STAT_CONTROL);
isp1301_vbus_on();
 }
 
-static void nxp_stop_hc(void)
+static void 

[PATCH] usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525

2013-08-10 Thread Maksim A. Boyko

Add the volume control quirk for avoiding the kernel warning
for the Logitech HD Webcam C525
as in the similar commit 36691e1be6ec551eef4a5225f126a281f8c051c2
for the Logitech HD Webcam C310.

Reported-by: Maksim Boyko maksim.a.bo...@gmail.com
Tested-by: Maksim Boyko maksim.a.bo...@gmail.com
Cc: sta...@vger.kernel.org # 3.10.5+
Signed-off-by: Maksim Boyko maksim.a.bo...@gmail.com
--
 sound/usb/mixer.c |1 +
 1 file changed, 1 insertion(+)

--- linux-3.10.5-orig/sound/usb/mixer.c 2013-08-04 12:51:49.0
+0400
+++ linux-3.10.5/sound/usb/mixer.c  2013-08-06 21:12:42.274197287
+0400
@@ -888,6 +888,7 @@ static void volume_control_quirks(struct
case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */
case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */
case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */
+   case USB_ID(0x046d, 0x0826): /* HD Webcam c525 */
case USB_ID(0x046d, 0x0991):
/* Most audio usb devices lie about volume resolution.
 * Most Logitech webcams have res = 384.


--
WBR, Maksim

P.S. Please, use this patch due to it should have correct tab symbols.


--
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: device failing to enumerate with XHCI

2013-08-10 Thread Oliver Neukum
On Fri, 2013-08-09 at 14:14 -0700, Sarah Sharp wrote:
 On Thu, Jul 04, 2013 at 03:35:13PM +0200, Oliver Neukum wrote:
  Hi,
  
  this is a Kinetic device for gesture recognition. It enumerates with EHCI.
  Under XHCI it fails miserably.
 
 Hi Oliver,
 
 Sorry for not looking at this log sooner.  It looks like the device
 somehow gets the xHCI command ring into a state where the dequeue
 pointer is out-of-sync with the event ring.  That means if you plug in a
 completely different device after trying to enumerate this device a
 couple times, I think the new device won't enumerate either.
 
 Can you give me a link to where I can purchase this device?  It's going

I can give you the link where I got it. I hope it will give you
an option to transfer to the US site.
http://www.amazon.de/Asus-Xtion-Live-Motion-Sensor/dp/B005UHB8EK/ref=sr_1_1?ie=UTF8qid=1376124802sr=8-1keywords=Asus+Motion

 to take me a while to figure out what's wrong with the command
 cancellation code, and it's probably easier to do this if I have the
 device.

I can understand that ;-)

Regards
Oliver


--
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 V4 6/6] USB: OHCI: make ohci-s3c2410 a separate driver

2013-08-10 Thread Tomasz Figa
Hi Manjunath,

On Saturday 10 of August 2013 13:07:36 Manjunath Goudar wrote:
 Separate the Samsung OHCI S3C host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM;
 it would be nice to have in 3.12.
 
 Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
 Signed-off-by: Deepak Saxena dsax...@linaro.org
 Acked-by: Alan Stern st...@rowland.harvard.edu
 Cc: Arnd Bergmann a...@arndb.de
 Cc: Greg KH g...@kroah.com
 Cc: linux-usb@vger.kernel.org
 
 V2:
  -Set non-standard fields in ohci_s3c2410_hc_driver manually, rather
 than relying on an expanded struct ohci_driver_overrides.
  -Save orig_ohci_hub_control and orig_ohci_hub_status_data rather than
   relying on ohci_hub_control and hub_status_data being exported.
 
 V3:
  -Kconfig wrong parentheses discription fixed.
  -ohci_setup() has been removed because it is called in .reset member
   of the ohci_hc_driver structure.
 
 V4:
  - Removed extra space before the '='.
  - Moved  /* forward definitions */ line before the declarations of
 functions. ---
  drivers/usb/host/Kconfig|8 +++
  drivers/usb/host/Makefile   |1 +
  drivers/usb/host/ohci-hcd.c |   18 --
  drivers/usb/host/ohci-s3c2410.c |  128
 +-- 4 files changed, 66
 insertions(+), 89 deletions(-)
 
 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
 index 693560a..795d14d 100644
 --- a/drivers/usb/host/Kconfig
 +++ b/drivers/usb/host/Kconfig
 @@ -390,6 +390,14 @@ config USB_OHCI_HCD_SPEAR
Enables support for the on-chip OHCI controller on
ST SPEAr chips.
 
 +config USB_OHCI_HCD_S3C
 +tristate Support for S3C on-chip OHCI USB controller

As far as I remember, you were supposed to keep the original name of this 
driver, as I suggested in previous iteration of this patch and you agreed. 
S3C is totally confusing when it's about Samsung SoC naming.

So here the config entry would be USB_OHCI_HCD_S3C2410 and I would call it 
OHCI support for Samsung S3C24xx/S3C64xx SoC series.

 +depends on USB_OHCI_HCD  (ARCH_S3C24XX || ARCH_S3C64XX)
 +default y
 +---help---
 +  Enables support for the on-chip OHCI controller on
 +  S3C chips.

S3C24xx/S3C64xx chips

 +
  config USB_OHCI_HCD_AT91
  tristate Support for Atmel on-chip OHCI USB controller
  depends on USB_OHCI_HCD  ARCH_AT91
 diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
 index a0ac663..d3e9e66 100644
 --- a/drivers/usb/host/Makefile
 +++ b/drivers/usb/host/Makefile
 @@ -49,6 +49,7 @@ obj-$(CONFIG_USB_OHCI_HCD_OMAP1)+= ohci-omap.o
  obj-$(CONFIG_USB_OHCI_HCD_OMAP3) += ohci-omap3.o
  obj-$(CONFIG_USB_OHCI_HCD_SPEAR) += ohci-spear.o
  obj-$(CONFIG_USB_OHCI_HCD_AT91)  += ohci-at91.o
 +obj-$(CONFIG_USB_OHCI_HCD_S3C)   += ohci-s3c2410.o

CONFIG_USB_OHCI_HCD_S3C2410

 
  obj-$(CONFIG_USB_UHCI_HCD)   += uhci-hcd.o
  obj-$(CONFIG_USB_FHCI_HCD)   += fhci.o
 diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
 index b48c892..b69a49e 100644
 --- a/drivers/usb/host/ohci-hcd.c
 +++ b/drivers/usb/host/ohci-hcd.c
 @@ -1177,11 +1177,6 @@ MODULE_LICENSE (GPL);
  #define SA_DRIVERohci_hcd_sa_driver
  #endif
 
 -#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S3C64XX)
 -#include ohci-s3c2410.c
 -#define S3C2410_PLATFORM_DRIVER  ohci_hcd_s3c2410_driver
 -#endif
 -
  #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
  #include ohci-pxa27x.c
  #define PLATFORM_DRIVER  ohci_hcd_pxa27x_driver
 @@ -1293,12 +1288,6 @@ static int __init ohci_hcd_mod_init(void)
   goto error_tmio;
  #endif
 
 -#ifdef S3C2410_PLATFORM_DRIVER
 - retval = platform_driver_register(S3C2410_PLATFORM_DRIVER);
 - if (retval  0)
 - goto error_s3c2410;
 -#endif
 -
  #ifdef EP93XX_PLATFORM_DRIVER
   retval = platform_driver_register(EP93XX_PLATFORM_DRIVER);
   if (retval  0)
 @@ -1332,10 +1321,6 @@ static int __init ohci_hcd_mod_init(void)
   platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
   error_ep93xx:
  #endif
 -#ifdef S3C2410_PLATFORM_DRIVER
 - platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
 - error_s3c2410:
 -#endif
  #ifdef TMIO_OHCI_DRIVER
   platform_driver_unregister(TMIO_OHCI_DRIVER);
   error_tmio:
 @@ -1382,9 +1367,6 @@ static void __exit ohci_hcd_mod_exit(void)
  #ifdef EP93XX_PLATFORM_DRIVER
   platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
  #endif
 -#ifdef S3C2410_PLATFORM_DRIVER
 - platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
 -#endif
  #ifdef TMIO_OHCI_DRIVER
   platform_driver_unregister(TMIO_OHCI_DRIVER);
  #endif
 diff --git a/drivers/usb/host/ohci-s3c2410.c
 b/drivers/usb/host/ohci-s3c2410.c index e125770..48b5948 100644
 --- a/drivers/usb/host/ohci-s3c2410.c
 +++ b/drivers/usb/host/ohci-s3c2410.c
 

Re: FUSB200 xhci issue

2013-08-10 Thread Alan Stern
On Sat, 10 Aug 2013, Oleksij Rempel wrote:

 usb reset do not affect behaviour of firmware. At least after i remove 
 all attempts to reboot FW from driver.
 If adapter will got reset signal, FW will be notified about it. Then FW 
 will remove reset flag and will just continue to work. After usb reset, 
 lsusb show correct, update information - EP3 and EP4 was updated from 
 INT to BULK.
 
 I assume, no i need to add to the driver some kind of firmware check. 
 What is the proper way to do it?

The simplest way is to put a new value for the device descriptor's 
bcdDevice value in the firmware.  Then all you have to do is check that 
value.

Alan Stern

--
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 v2] usb: Move definition of USB_EHCI_BIG_ENDIAN_MMIO et al. out side of the ifs.

2013-08-10 Thread Alan Stern
On Fri, 9 Aug 2013, David Daney wrote:

 From: David Daney david.da...@cavium.com
 
 When CONFIG_USB_SUPPORT is not selected we get things like:
 
 scripts/kconfig/mconf Kconfig
 warning: (MIPS_SEAD3  PMC_MSP  CPU_CAVIUM_OCTEON) selects 
 USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT  
 USB)
 
 It is much cleaner to make the various system Kconfigs select
 USB_EHCI_BIG_ENDIAN_MMIO rather than move the system config
 information into USB's Kconfig, but the warnings are annoying.
 
 Eliminate the warning by moving the definition of
 USB_EHCI_BIG_ENDIAN_MMIO outside of all the Kconfig if statements.
 While we are at it move USB_OHCI_BIG_ENDIAN_DESC,
 USB_OHCI_BIG_ENDIAN_MMIO, USB_OHCI_LITTLE_ENDIAN and
 USB_EHCI_BIG_ENDIAN_DESC too, as they could very well suffer similar
 problems for other systems.
 
 Get rid of the redundant default n in USB_OHCI_BIG_ENDIAN_DESC and
 USB_OHCI_BIG_ENDIAN_MMIO
 
 Signed-off-by: David Daney david.da...@cavium.com
 Cc: Alan Stern st...@rowland.harvard.edu
 ---
 
 Change from v1: Added USB_OHCI_BIG_ENDIAN_DESC,
 USB_OHCI_BIG_ENDIAN_MMIO, USB_OHCI_LITTLE_ENDIAN and
 USB_EHCI_BIG_ENDIAN_DESC to the set of symbols moved.

Acked-by: Alan Stern st...@rowland.harvard.edu


--
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 v2 0/4] Add phy support for AM335X platform using Generic PHy framework

2013-08-10 Thread Ezequiel Garcia
On Fri, Jul 19, 2013 at 06:04:33PM +0530, George Cherian wrote:
 This patch series adds phy support for AM335X platform.
 This patch series is based on Generic PHY framework [1].
 
 
 This series has
 - adds dual musb instances support for am335x platform 
 - adds phy-am-usb driver used in AM platforms
   - adds OTG callbacks
   - adds PHY wakeup enable/disable
 - adds dt  bindings for the phys
 - removes usb-phy and replaced with generic phy apis in glue layer
 
 All these changes are avilable at [2]
 
 [1] - http://marc.info/?l=linux-usbm=137224750928570w=2
 [2] - 
 git://git.ti.com/~georgecherian/ti-linux-kernel/georgec-connectivity-linux-feature-tree.git
 am335x-phy-driver-v2
 
 George Cherian (4):
   usb: phy: phy-omap-control: Add API to power and wakeup
   phy: phy-am-usb: Add PHY driver for am platform
   arm: dts: Add USB phy nodes for AM33XX

Is there any reason why there's no DT binding patch to this
series? (aka Documentation/devicetree/... + sent to devicetree list)

(sorry if this has been already explained somewhere...)

-- 
Ezequiel GarcĂ­a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
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


Bug 60699 - Stalled state of endpoint will not be cleared

2013-08-10 Thread Florian Wolter
Could someone review this Bug on Kernel Bug Tracker because this is a 
big Problem for me.

--
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] usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525

2013-08-10 Thread Sergei Shtylyov

Hello.

On 08/10/2013 12:20 PM, Maksim A. Boyko wrote:


Add the volume control quirk for avoiding the kernel warning
for the Logitech HD Webcam C525
as in the similar commit 36691e1be6ec551eef4a5225f126a281f8c051c2


   Please also specify that commit's summary line in parens.


for the Logitech HD Webcam C310.



Reported-by: Maksim Boyko maksim.a.bo...@gmail.com
Tested-by: Maksim Boyko maksim.a.bo...@gmail.com
Cc: sta...@vger.kernel.org # 3.10.5+
Signed-off-by: Maksim Boyko maksim.a.bo...@gmail.com
--
  sound/usb/mixer.c |1 +
  1 file changed, 1 insertion(+)

--- linux-3.10.5-orig/sound/usb/mixer.c2013-08-04 12:51:49.0
+0400
+++ linux-3.10.5/sound/usb/mixer.c2013-08-06 21:12:42.274197287
+0400
@@ -888,6 +888,7 @@ static void volume_control_quirks(struct
  case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */
  case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */
  case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */
+case USB_ID(0x046d, 0x0826): /* HD Webcam c525 */
  case USB_ID(0x046d, 0x0991):
  /* Most audio usb devices lie about volume resolution.
   * Most Logitech webcams have res = 384.


--
WBR, Maksim



P.S. Please, use this patch due to it should have correct tab symbols.


   Unfortunately, it seems to have a space added before each line starting 
with space.


WBR, Sergei


--
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: Commit 09fc7d22b0 (usb: musb: fix incorrect usage of resource pointer) questions

2013-08-10 Thread Sergei Shtylyov

Hello.

On 08/09/2013 05:15 PM, Felipe Balbi wrote:


I have basically two questions on this change:


   Thanks for the reply, I've managed to somehow miss it at first.


1) why it wasn't published before committing?



look deeper


   Don't know, I haven't found it either in the archives or in my mail 
folders. Perhaps it was named differently when posted?



2) why you omitted am35x.c from this commit?



mistake


   Are you going to fix it, or should I?
   I'm afraid there's one more issue with this commit. DaVinci platform 
device can have either 2 or 3 (on DM6467) resources, you only copy 2, so DMA 
on DM6467 seems somewhat broken. Will you address it or should I?


PS: I have lost access to all MUSB platforms, so can't test the patches.

WBR, Sergei

--
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