Re: [PATCH v3 0/2] staging: dwc2: add microframe scheduler

2014-08-06 Thread Nick Hudson

On 08/05/14 20:15, Paul Zimmerman wrote:

From: Nick Hudson [mailto:sk...@netbsd.org]
Sent: Tuesday, August 05, 2014 1:57 AM

On 07/22/14 22:22, Nick Hudson wrote:

On 07/22/14 18:46, Paul Zimmerman wrote:

The nak_frame handling would have added some benefit, but wouldn't
handle all
cases.

I'm seeing problems with devices NAKing to the point of confusing
dwc2 completely,
so I'd like to investigate a NAK holdoff scheme that's acceptable
for dwc2.  I
suspect the best thing to do here is to add a nak_count field to
dwc2_qh (or maybe
dwc2_qtd) and increment in dwc2_hc_nak_intr.  If the count exceeds a
threshold
then it would call

 dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_NAK);

and go around again.

I assume the NAK count would need resetting everywhere
qtd->error_count is reset.

How does this sound?

Sounds good to me. BTW, can you give me a pointer to one of the devices
that gives excessive NAKs? I would like to buy one for the lab here to
test with.


I'm seeing problems with a d-link dwcl-g122 wifi dongle that someone
sent me.

The attached patch helps with my d-link dwl-g122 - it's adapted from the
raspberry pi dwc_otg driver.

I'm not sure the NYET/NAK/ACK/other case and would happily remove it.

I assume the scheduler is doing something that is confusing the core
with this particular device. The error recovery is still valid I think.

Hi Nick,

If this is done in the Raspberry Pi kernel, then it's probably fine,
since those guys know more about the DWC2 core than anyone, I think.

One thing: For Linux, we are required to have a Signed-off-by line on
all patches. May I add your Signed-off-by to this patch?


Sure. :)



Also, in future, please include the patch inline instead of as an
attachment. That's the standard practice on the Linux lists, it
causes less problems with funky mailers and such. Thanks.



Noted.

Nick
--
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: 3.14.12 and USB option_instat_callback with 3G DONGLE

2014-08-06 Thread ressy66

On 2014-08-05 23:56, Johan Hovold wrote:

On Tue, Aug 05, 2014 at 02:30:31PM +1000, ress...@ausics.net wrote:

On 2014-08-05 00:10, Johan Hovold wrote:



> I'll queue this up for v3.17-rc.
>

Awesome, any chance of it finding its way into 3.14.x since it's a LT
release?


Yes, it's marked for stable and should show up there within a few weeks
(a little longer than usual due to the merge window).

Thanks,
Johan


awesome, thanks

--
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 0/3] usbip: move usbip out of staging

2014-08-06 Thread Max Vozeler
Hi everyone,

On Tue, Mar 18, 2014 at 01:33:24PM -0700, Greg KH wrote:
> On Tue, Mar 18, 2014 at 10:11:20PM +0200, Valentina Manea wrote:
> > After migrating userspace code to libudev, converting usbip-host
> > to a device driver and various bug fixes and enhancements, USB/IP
> > is fully functional and can be moved out of staging.
> > 
> > This patch series moves it as following:
> > * userspace code to tools/usb/usbip
> > * kernel code to drivers/usb/usbip
> > 
> > Besides this, a warning generated in the kernel code is solved.
> 
> Like Joe said, use -M please.
> 
> Also, I'm not going to be able to do this until after 3.15-rc1 is out,
> due to changes to this code base in multiple trees.
> 
> So can you resend when -rc1 is out?

What happened to this series, should it be resent?

Do people agree that usbip is ready to migrate out of staging in
general?

The README lists these TODO items:

- more discussion about the protocol
- testing
- review of the userspace interface
- document the protocol

The protocol has been documented and discussed in some depth. Not
everybody seems to love it yet I don't think any significant flaws
have been shown in the protocol.

There can always be more testing. :)

That leaves the userspace interface. Is it good enough to be made
official?

If so it should probably be added to Documentation/ABI.

Thanks,

Max
--
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] devio: fix issue with log flooding

2014-08-06 Thread Sérgio Basto
Hi,

we need a kernel with patch on [1] to usb works on guests machine of
VirtualBox  without spam dmesg.

I tested patch [1] devio: fix issue with log flooding of message and it
works, I wonder if this patch will be applied to kernel or not ? and if
can go to stables or not ? 

The problem of this warning is that trigger many times at least one time
every 2 seconds to 37 times per second .  


[1] http://www.spinics.net/lists/linux-usb/msg111380.html 

Thanks, 

-- 
Sérgio M. B.

--
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] devio: fix issue with log flooding

2014-08-06 Thread Greg KH
On Wed, Aug 06, 2014 at 02:42:31PM +0100, Sérgio Basto wrote:
> Hi,
> 
> we need a kernel with patch on [1] to usb works on guests machine of
> VirtualBox  without spam dmesg.

Then build such a kernel, what is preventing that?

> I tested patch [1] devio: fix issue with log flooding of message and it
> works, I wonder if this patch will be applied to kernel or not ? and if
> can go to stables or not ? 

You were pointed to the instructions of how to have a patch applied to
the stable tree, why not read that to see how to do it properly?

thanks,

greg k-h
--
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 0/3] usbip: move usbip out of staging

2014-08-06 Thread Greg KH
On Wed, Aug 06, 2014 at 02:22:10PM +0200, Max Vozeler wrote:
> Hi everyone,
> 
> On Tue, Mar 18, 2014 at 01:33:24PM -0700, Greg KH wrote:
> > On Tue, Mar 18, 2014 at 10:11:20PM +0200, Valentina Manea wrote:
> > > After migrating userspace code to libudev, converting usbip-host
> > > to a device driver and various bug fixes and enhancements, USB/IP
> > > is fully functional and can be moved out of staging.
> > > 
> > > This patch series moves it as following:
> > > * userspace code to tools/usb/usbip
> > > * kernel code to drivers/usb/usbip
> > > 
> > > Besides this, a warning generated in the kernel code is solved.
> > 
> > Like Joe said, use -M please.
> > 
> > Also, I'm not going to be able to do this until after 3.15-rc1 is out,
> > due to changes to this code base in multiple trees.
> > 
> > So can you resend when -rc1 is out?
> 
> What happened to this series, should it be resent?

Well, nothing is going to happen unless it is, so if you want to see it
merged, I suggest redoing it and resending it :)

thanks,

greg k-h
--
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] devio: fix issue with log flooding

2014-08-06 Thread Sérgio Basto
On Qua, 2014-08-06 at 07:43 -0700, Greg KH wrote: 
> On Wed, Aug 06, 2014 at 02:42:31PM +0100, Sérgio Basto wrote:
> > Hi,
> > 
> > we need a kernel with patch on [1] to usb works on guests machine of
> > VirtualBox  without spam dmesg.
> 
> Then build such a kernel, what is preventing that?

I did , http://copr.fedoraproject.org/coprs/sergiomb/kernel_vbox/ and
test it . 

> > I tested patch [1] devio: fix issue with log flooding of message and it
> > works, I wonder if this patch will be applied to kernel or not ? and if
> > can go to stables or not ? 
> 
> You were pointed to the instructions of how to have a patch applied to
> the stable tree, why not read that to see how to do it properly?

- It or an equivalent fix must already exist in Linus' tree (upstream).

So, I though, this list can be a way to patch enter in upstream, if
already not ,I don't know (is my first question), the submit could be
done by linux-usb team and the patch was already submit in
http://www.spinics.net/lists/linux-usb/msg111380.html


Thanks,
-- 
Sérgio M. B.

--
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] devio: fix issue with log flooding

2014-08-06 Thread Greg KH
On Wed, Aug 06, 2014 at 04:12:20PM +0100, Sérgio Basto wrote:
> On Qua, 2014-08-06 at 07:43 -0700, Greg KH wrote: 
> > On Wed, Aug 06, 2014 at 02:42:31PM +0100, Sérgio Basto wrote:
> > > Hi,
> > > 
> > > we need a kernel with patch on [1] to usb works on guests machine of
> > > VirtualBox  without spam dmesg.
> > 
> > Then build such a kernel, what is preventing that?
> 
> I did , http://copr.fedoraproject.org/coprs/sergiomb/kernel_vbox/ and
> test it . 
> 
> > > I tested patch [1] devio: fix issue with log flooding of message and it
> > > works, I wonder if this patch will be applied to kernel or not ? and if
> > > can go to stables or not ? 
> > 
> > You were pointed to the instructions of how to have a patch applied to
> > the stable tree, why not read that to see how to do it properly?
> 
> - It or an equivalent fix must already exist in Linus' tree (upstream).
> 
> So, I though, this list can be a way to patch enter in upstream, if
> already not ,I don't know (is my first question), the submit could be
> done by linux-usb team and the patch was already submit in
> http://www.spinics.net/lists/linux-usb/msg111380.html

The patch is already in Linus's tree, you can see it there.  It's also
already marked for the stable tree inclusion, so after Linus releases a
-rc kernel with it in it, the stable kernel developers will be able to
pick it up and put it in their kernels.

So there's really nothing to do here at the moment, the process will
happen automatically.

thanks,

greg k-h
--
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: Register VIA Telecom CDS7 chipset with Option USB serial driver

2014-08-06 Thread Brennan Ashton
This VIA Telecom baseband processor is used is used by by u-blox in both the
FW2770 and FW2760 products and may be used in others as well.

This patch has been tested on both of these modem versions.

Signed-off-by: Brennan Ashton 
---
 drivers/usb/serial/option.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index a968894..b398ab7 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -494,6 +494,10 @@ static void option_instat_callback(struct urb *urb);
 #define INOVIA_VENDOR_ID   0x20a6
 #define INOVIA_SEW858  0x1105
 
+/* VIA Telecom */
+#define VIATELECOM_VENDOR_ID   0x15eb
+#define VIATELECOM_PRODUCT_CDS70x0001
+
 /* some devices interfaces need special handling due to a number of reasons */
 enum option_blacklist_reason {
OPTION_BLACKLIST_NONE = 0,
@@ -1724,6 +1728,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* 
D-Link DWM-152/C1 */
{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* 
D-Link DWM-156/C1 */
{ USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) },
+   { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) },
{ } /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, option_ids);
-- 
1.9.3

--
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] devio: fix issue with log flooding

2014-08-06 Thread Sérgio Basto
On Qua, 2014-08-06 at 08:25 -0700, Greg KH wrote: 
> On Wed, Aug 06, 2014 at 04:12:20PM +0100, Sérgio Basto wrote:
> > On Qua, 2014-08-06 at 07:43 -0700, Greg KH wrote: 
> > > On Wed, Aug 06, 2014 at 02:42:31PM +0100, Sérgio Basto wrote:
> > > > Hi,
> > > > 
> > > > we need a kernel with patch on [1] to usb works on guests machine of
> > > > VirtualBox  without spam dmesg.
> > > 
> > > Then build such a kernel, what is preventing that?
> > 
> > I did , http://copr.fedoraproject.org/coprs/sergiomb/kernel_vbox/ and
> > test it . 
> > 
> > > > I tested patch [1] devio: fix issue with log flooding of message and it
> > > > works, I wonder if this patch will be applied to kernel or not ? and if
> > > > can go to stables or not ? 
> > > 
> > > You were pointed to the instructions of how to have a patch applied to
> > > the stable tree, why not read that to see how to do it properly?
> > 
> > - It or an equivalent fix must already exist in Linus' tree (upstream).
> > 
> > So, I though, this list can be a way to patch enter in upstream, if
> > already not ,I don't know (is my first question), the submit could be
> > done by linux-usb team and the patch was already submit in
> > http://www.spinics.net/lists/linux-usb/msg111380.html
> 
> The patch is already in Linus's tree, you can see it there.  It's also
> already marked for the stable tree inclusion, so after Linus releases a
> -rc kernel with it in it, the stable kernel developers will be able to
> pick it up and put it in their kernels.
> 
> So there's really nothing to do here at the moment, the process will
> happen automatically.


Cool , many thanks for the info ! 

Thanks, 
-- 
Sérgio M. B.

--
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 v3 6/6] MAINTAINERS: Add ehci-st.c and ohci-st.c to ARCH/STI architecture

2014-08-06 Thread Peter Griffin
Signed-off-by: Peter Griffin 
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 359a64e..847572d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1325,7 +1325,8 @@ F:drivers/pinctrl/pinctrl-st.c
 F: drivers/media/rc/st_rc.c
 F: drivers/i2c/busses/i2c-st.c
 F: drivers/tty/serial/st-asc.c
-F: drivers/usb/host/st-hcd.c
+F: drivers/usb/host/ehci-st.c
+F: drivers/usb/host/ohci-st.c
 
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M: Lennert Buytenhek 
-- 
1.9.1

--
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 v3 5/6] usb: host: ohci-st: Add ohci-st devicetree bindings documentation

2014-08-06 Thread Peter Griffin
This patch documents the device tree bindings required for
the ohci on-chip controller found in ST consumer electronics SoC's.

Signed-off-by: Peter Griffin 
---
 Documentation/devicetree/bindings/usb/ohci-st.txt | 40 +++
 1 file changed, 40 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ohci-st.txt

diff --git a/Documentation/devicetree/bindings/usb/ohci-st.txt 
b/Documentation/devicetree/bindings/usb/ohci-st.txt
new file mode 100644
index 000..17181c5
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ohci-st.txt
@@ -0,0 +1,40 @@
+ST USB OHCI controller
+
+Required properties:
+
+ - compatible  : must be "st,st-ohci-300x"
+ - reg : physical base addresses of the controller and length 
of memory mapped
+ region
+ - interrupts  : one OHCI controller interrupt should be described here
+
+Optional properties:
+
+ - clocks  : phandle list of usb clocks
+ - clock-names : should be "ic" for interconnect clock and "clk48"
+See: Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+ - phys: phandle for the PHY device
+ - phy-names   : should be "usb"
+
+ - resets  : phandle to the powerdown and reset controller for the 
USB IP
+ - reset-names : should be "power" and "softreset".
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+Example:
+
+   ohci0: usb@0xfe1ffc00 {
+   compatible = "st,ohci-platform";
+   reg = <0xfe1ffc00 0x100>;
+   interrupts = ;
+   clocks = <&clk_s_a1_ls 0>,
+<&clockgen_b0 0>;
+   clock-names = "ic", "clk48";
+   phys = <&usb2_phy>;
+   phy-names = "usb";
+   status = "okay";
+
+   resets = <&powerdown STIH416_USB0_POWERDOWN>,
+<&softreset STIH416_USB0_SOFTRESET>;
+   reset-names = "power", "softreset";
+   };
-- 
1.9.1

--
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 v3 4/6] usb: host: ehci-st: Add ehci-st devicetree bindings documentation

2014-08-06 Thread Peter Griffin
This patch documents the device tree bindings required for the
ehci on-chip controller found in ST consumer electronics SoC's.

Signed-off-by: Peter Griffin 
---
 Documentation/devicetree/bindings/usb/ehci-st.txt | 41 +++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-st.txt

diff --git a/Documentation/devicetree/bindings/usb/ehci-st.txt 
b/Documentation/devicetree/bindings/usb/ehci-st.txt
new file mode 100644
index 000..abb862a
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ehci-st.txt
@@ -0,0 +1,41 @@
+ST USB EHCI controller
+
+Required properties:
+ - compatible  : must be "st,st-ehci-300x"
+ - reg : physical base addresses of the controller and length 
of memory mapped
+ region
+ - interrupts  : one EHCI interrupt should be described here
+ - pinctrl-names   : a pinctrl state named "default" must be defined
+ - pinctrl-0   : phandle referencing pin configuration of the USB 
controller
+See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
+
+Optional properties:
+ - clocks  : phandle list of usb clocks
+ - clock-names : should be "ic" for interconnect clock and "clk48"
+See: Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+ - phys: phandle for the PHY device
+ - phy-names   : should be "usb"
+ - resets  : phandle + reset specifier pairs to the powerdown and 
softreset lines
+ of the USB IP
+ - reset-names : should be "power" and "softreset"
+See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/reset.txt
+
+Example:
+
+   ehci1: usb@0xfe203e00 {
+   compatible = "st,ehci-platform";
+   reg = <0xfe203e00 0x100>;
+   interrupts = ;
+   pinctrl-names = "default";
+   pinctrl-0 = <&pinctrl_usb1>;
+   clocks = <&clk_s_a1_ls 0>;
+   phys = <&usb2_phy>;
+   phy-names = "usb";
+   status = "okay";
+
+   resets = <&powerdown STIH416_USB1_POWERDOWN>,
+<&softreset STIH416_USB1_SOFTRESET>;
+   reset-names = "power", "softreset";
+   };
-- 
1.9.1

--
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 v3 3/6] usb: host: ohci-st: Add OHCI driver support for ST STB devices

2014-08-06 Thread Peter Griffin
This patch adds the glue code required to ensure the on-chip OHCI
controller works on STi consumer electronics SoC's from STMicroelectronics.

It mainly manages the setting and enabling of the relevant clocks and manages
the reset / power signals to the IP block.

Signed-off-by: Peter Griffin 
---
 drivers/usb/host/Kconfig   |   7 ++
 drivers/usb/host/Makefile  |   1 +
 drivers/usb/host/ohci-st.c | 302 +
 3 files changed, 310 insertions(+)
 create mode 100644 drivers/usb/host/ohci-st.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 800969a..339aed9 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -529,6 +529,13 @@ config USB_OHCI_EXYNOS
help
 Enable support for the Samsung Exynos SOC's on-chip OHCI controller.
 
+config USB_OHCI_ST
+   tristate "OHCI support for ST SoC Series"
+   depends on ARCH_STI && OF
+   help
+Enable support for the on-chip OHCI controller found on
+STMicroelectronics consumer electronics SoC's.
+
 config USB_CNS3XXX_OHCI
bool "Cavium CNS3XXX OHCI Module (DEPRECATED)"
depends on ARCH_CNS3XXX
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 877f7e2..12f7afd 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -50,6 +50,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_ST)  += ohci-st.o usb-st-common.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
diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c
new file mode 100644
index 000..dfaa616
--- /dev/null
+++ b/drivers/usb/host/ohci-st.c
@@ -0,0 +1,302 @@
+/*
+ * ST OHCI driver
+ *
+ * Copyright (C) 2014 STMicroelectronics – All Rights Reserved
+ *
+ * Author: Peter Griffin 
+ *
+ * Derived from ohci-platform.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ohci.h"
+#include "usb-st-common.h"
+
+#define DRIVER_DESC "OHCI STMicroelectronics driver"
+
+#define hcd_to_ohci_priv(h) ((struct st_platform_priv *)hcd_to_ohci(h)->priv)
+
+static const char hcd_name[] = "ohci-st";
+
+static int st_ohci_platform_power_on(struct platform_device *dev)
+{
+   struct usb_hcd *hcd = platform_get_drvdata(dev);
+   struct st_platform_priv *priv = hcd_to_ohci_priv(hcd);
+
+   return st_usb_platform_power_on(priv);
+}
+
+static void st_ohci_platform_power_off(struct platform_device *dev)
+{
+   struct usb_hcd *hcd = platform_get_drvdata(dev);
+   struct st_platform_priv *priv = hcd_to_ohci_priv(hcd);
+
+   return st_usb_platform_power_off(priv);
+}
+
+static struct hc_driver __read_mostly ohci_platform_hc_driver;
+
+static const struct ohci_driver_overrides platform_overrides __initconst = {
+   .product_desc = "ST OHCI controller",
+   .extra_priv_size =  sizeof(struct st_platform_priv),
+};
+
+static struct usb_ohci_pdata ohci_platform_defaults = {
+   .power_on = st_ohci_platform_power_on,
+   .power_suspend =st_ohci_platform_power_off,
+   .power_off =st_ohci_platform_power_off,
+};
+
+static int st_ohci_platform_probe(struct platform_device *dev)
+{
+   struct usb_hcd *hcd;
+   struct resource *res_mem;
+   struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
+   struct st_platform_priv *priv;
+   struct ohci_hcd *ohci;
+   int err, irq, clk = 0;
+
+   if (usb_disabled())
+   return -ENODEV;
+
+   /*
+* Use reasonable defaults so platforms don't have to provide these
+* with DT probing on ARM.
+*/
+   if (!pdata)
+   pdata = &ohci_platform_defaults;
+
+   err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+   if (err)
+   return err;
+
+   irq = platform_get_irq(dev, 0);
+   if (irq < 0) {
+   dev_err(&dev->dev, "no irq provided");
+   return irq;
+   }
+
+   res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+   if (!res_mem) {
+   dev_err(&dev->dev, "no memory resource provided");
+   return -ENXIO;
+   }
+
+   hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
+   dev_name(&dev->dev));
+   if (!hcd)
+   return -ENOMEM;
+
+   platform_set_drvdata(dev, hcd);
+   dev->dev.platform_data = pdata;

[PATCH v3 2/6] usb: host: ehci-st: Add EHCI support for ST STB devices

2014-08-06 Thread Peter Griffin
This patch adds the glue code required to ensure the on-chip EHCI
controller works on STi consumer electronics SoC's from STMicroelectronics.

It mainly manages the setting and enabling of the relevant clocks and manages
the reset / power signals to the IP block.

Signed-off-by: Peter Griffin 
---
 drivers/usb/host/Kconfig   |   6 +
 drivers/usb/host/Makefile  |   1 +
 drivers/usb/host/ehci-st.c | 334 +
 3 files changed, 341 insertions(+)
 create mode 100644 drivers/usb/host/ehci-st.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index a5e7f71..800969a 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -235,6 +235,12 @@ config USB_W90X900_EHCI
---help---
Enables support for the W90X900 USB controller
 
+config USB_EHCI_ST
+   tristate "EHCI support for ST STB SoC Series"
+   depends on ARCH_STI && OF
+   help
+   Enable support for the ST SOC's on-chip EHCI controller.
+
 config USB_CNS3XXX_EHCI
bool "Cavium CNS3XXX EHCI Module (DEPRECATED)"
depends on ARCH_CNS3XXX
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index af0b81d..877f7e2 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -40,6 +40,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_W90X900_EHCI) += ehci-w90x900.o
+obj-$(CONFIG_USB_EHCI_ST)  += ehci-st.o usb-st-common.o
 
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
new file mode 100644
index 000..6f6f46d
--- /dev/null
+++ b/drivers/usb/host/ehci-st.c
@@ -0,0 +1,334 @@
+/*
+ * ST EHCI driver
+ *
+ * Copyright (C) 2014 STMicroelectronics – All Rights Reserved
+ *
+ * Author: Peter Griffin 
+ *
+ * Derived from ehci-platform.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+#include "usb-st-common.h"
+
+#define DRIVER_DESC "EHCI STMicroelectronics driver"
+
+#define hcd_to_ehci_priv(h) ((struct st_platform_priv *)hcd_to_ehci(h)->priv)
+
+static const char hcd_name[] = "ehci-st";
+
+#define EHCI_CAPS_SIZE 0x10
+#define AHB2STBUS_INSREG01 (EHCI_CAPS_SIZE + 0x84)
+
+int st_ehci_configure_bus(struct usb_hcd *hcd)
+{
+   /* Set EHCI packet buffer IN/OUT threshold to 128 bytes */
+   u32 threshold = 128 | (128 << 16);
+
+   writel(threshold, hcd->regs + AHB2STBUS_INSREG01);
+   return 0;
+}
+
+static int st_ehci_platform_reset(struct usb_hcd *hcd)
+{
+   struct platform_device *pdev = to_platform_device(hcd->self.controller);
+   struct usb_ehci_pdata *pdata = dev_get_platdata(&pdev->dev);
+   struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+   int retval;
+
+   if (pdata->pre_setup) {
+   retval = pdata->pre_setup(hcd);
+   if (retval < 0)
+   return retval;
+   }
+
+   ehci->caps = hcd->regs + pdata->caps_offset;
+   retval = ehci_setup(hcd);
+   if (retval)
+   return retval;
+
+   return 0;
+}
+
+static int st_ehci_platform_power_on(struct platform_device *dev)
+{
+   struct usb_hcd *hcd = platform_get_drvdata(dev);
+   struct st_platform_priv *priv = hcd_to_ehci_priv(hcd);
+
+   return st_usb_platform_power_on(priv);
+}
+
+static void st_ehci_platform_power_off(struct platform_device *dev)
+{
+   struct usb_hcd *hcd = platform_get_drvdata(dev);
+   struct st_platform_priv *priv = hcd_to_ehci_priv(hcd);
+
+   return st_usb_platform_power_off(priv);
+}
+
+static struct hc_driver __read_mostly ehci_platform_hc_driver;
+
+static const struct ehci_driver_overrides platform_overrides __initconst = {
+   .reset =st_ehci_platform_reset,
+   .extra_priv_size =  sizeof(struct st_platform_priv),
+};
+
+static struct usb_ehci_pdata ehci_platform_defaults = {
+   .power_on = st_ehci_platform_power_on,
+   .power_suspend =st_ehci_platform_power_off,
+   .power_off =st_ehci_platform_power_off,
+   .pre_setup =st_ehci_configure_bus,
+};
+
+static int st_ehci_platform_probe(struct platform_device *dev)
+{
+   struct usb_hcd *hcd;
+   struct resource *res_mem;
+   struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
+   struct st_platform_priv *priv;
+   struct ehci_hcd *ehci;
+   int err, irq, clk = 0;
+
+   if (usb_disabled())
+   return -ENODEV;
+
+   /*
+* Use reasonable defaults so platforms don'

[PATCH v3 0/6] Add EHCI and OHCI drivers for STi SoC's

2014-08-06 Thread Peter Griffin
This series adds support for the OHCI and EHCI on-chip controllers
found in STi consumer electronics SoC's from STMicroelectronics.

The series has been re-worked from v2 to split out the ehci and ohci parts
into their own drivers / devices like most other ARM platforms based on
feedback from Arnd Bergmann (see here 
http://www.spinics.net/lists/linux-usb/msg24.html. 

The ehci-platform & ohci-platform have been used as a basis for this in case we
wish to merge the drivers again in the future.

Changes since v2:
 - Based on Arnd Berghman feedback, split out into 2 devices / drivers
 - Base drivers oh ehci-platform.c & ohci-platform.c with required extensions
   to allow possible re-merge in the furture.

Changes since v1:
 - Correct s/OCHI/OHCI/ spelling
 - Improve kconfig help message
 - Various formating / spelling nits identified by Lee Jones
 - Make driver depend on OF & remove node checks in code
 - Use devm_ioremap_resource
 - Remove unnecessary header files

Peter Griffin (6):
  usb: host: usb-st-common: Add common code required by ohci-st and
ehci-st
  usb: host: ehci-st: Add EHCI support for ST STB devices
  usb: host: ohci-st: Add OHCI driver support for ST STB devices
  usb: host: ehci-st: Add ehci-st devicetree bindings documentation
  usb: host: ohci-st: Add ohci-st devicetree bindings documentation
  MAINTAINERS: Add ehci-st.c and ohci-st.c to ARCH/STI architecture

 Documentation/devicetree/bindings/usb/ehci-st.txt |  41 +++
 Documentation/devicetree/bindings/usb/ohci-st.txt |  40 +++
 MAINTAINERS   |   3 +-
 drivers/usb/host/Kconfig  |  13 +
 drivers/usb/host/Makefile |   2 +
 drivers/usb/host/ehci-st.c| 334 ++
 drivers/usb/host/ohci-st.c| 302 +++
 drivers/usb/host/usb-st-common.c  |  99 +++
 drivers/usb/host/usb-st-common.h  |  34 +++
 9 files changed, 867 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-st.txt
 create mode 100644 Documentation/devicetree/bindings/usb/ohci-st.txt
 create mode 100644 drivers/usb/host/ehci-st.c
 create mode 100644 drivers/usb/host/ohci-st.c
 create mode 100644 drivers/usb/host/usb-st-common.c
 create mode 100644 drivers/usb/host/usb-st-common.h

-- 
1.9.1

--
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 v3 1/6] usb: host: usb-st-common: Add common code required by ohci-st and ehci-st

2014-08-06 Thread Peter Griffin
This patch abstracts out some common code required by both the ehci-st
and ohci-st drivers.

Signed-off-by: Peter Griffin 
---
 drivers/usb/host/usb-st-common.c | 99 
 drivers/usb/host/usb-st-common.h | 34 ++
 2 files changed, 133 insertions(+)
 create mode 100644 drivers/usb/host/usb-st-common.c
 create mode 100644 drivers/usb/host/usb-st-common.h

diff --git a/drivers/usb/host/usb-st-common.c b/drivers/usb/host/usb-st-common.c
new file mode 100644
index 000..ddfdbf6
--- /dev/null
+++ b/drivers/usb/host/usb-st-common.c
@@ -0,0 +1,99 @@
+/*
+ * Common code shared between ehci-st.c and ohci-st.c
+ *
+ * Copyright (C) 2014 STMicroelectronics – All Rights Reserved
+ *
+ * Author: Peter Griffin 
+ *
+ * Derived from ohci-platform.c and ehci-platform.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+
+#include "usb-st-common.h"
+
+int st_usb_platform_power_on(struct st_platform_priv *priv)
+{
+   int clk, ret;
+
+   if (priv->pwr) {
+   ret = reset_control_deassert(priv->pwr);
+   if (ret)
+   return ret;
+   }
+
+   if (priv->rst) {
+   ret = reset_control_deassert(priv->rst);
+   if (ret)
+   goto err_assert_power;
+   }
+
+   /* some SoCs don't have a dedicated 48Mhz clock, but those that do
+  need the rate to be explicitly set */
+   if (priv->clk48) {
+   ret = clk_set_rate(priv->clk48, 4800);
+   if (ret)
+   goto err_assert_reset;
+   }
+
+   for (clk = 0; clk < USB_MAX_CLKS && priv->clks[clk]; clk++) {
+   ret = clk_prepare_enable(priv->clks[clk]);
+   if (ret)
+   goto err_disable_clks;
+   }
+
+   if (priv->phy) {
+   ret = phy_init(priv->phy);
+   if (ret)
+   goto err_disable_clks;
+
+   ret = phy_power_on(priv->phy);
+   if (ret)
+   goto err_exit_phy;
+   }
+
+   return 0;
+
+err_exit_phy:
+   phy_exit(priv->phy);
+err_disable_clks:
+   while (--clk >= 0)
+   clk_disable_unprepare(priv->clks[clk]);
+err_assert_reset:
+   if (priv->rst)
+   ret = reset_control_assert(priv->rst);
+err_assert_power:
+   if (priv->pwr)
+   ret = reset_control_assert(priv->pwr);
+
+   return ret;
+}
+EXPORT_SYMBOL(st_usb_platform_power_on);
+
+void st_usb_platform_power_off(struct st_platform_priv *priv)
+{
+   int clk;
+
+   if (priv->pwr)
+   reset_control_assert(priv->pwr);
+
+   if (priv->rst)
+   reset_control_assert(priv->rst);
+
+   if (priv->phy) {
+   phy_power_off(priv->phy);
+   phy_exit(priv->phy);
+   }
+
+   for (clk = USB_MAX_CLKS - 1; clk >= 0; clk--)
+   if (priv->clks[clk])
+   clk_disable_unprepare(priv->clks[clk]);
+
+}
+EXPORT_SYMBOL(st_usb_platform_power_off);
diff --git a/drivers/usb/host/usb-st-common.h b/drivers/usb/host/usb-st-common.h
new file mode 100644
index 000..5ee7fb0
--- /dev/null
+++ b/drivers/usb/host/usb-st-common.h
@@ -0,0 +1,34 @@
+/*
+ * ST ehci / ohci common header file
+ *
+ * Copyright (C) 2014 STMicroelectronics – All Rights Reserved
+ *
+ * Author: Peter Griffin 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef __USB_ST_COMMON_H
+#define __USB_ST_COMMON_H
+
+#include 
+#include 
+#include 
+
+#define USB_MAX_CLKS 3
+
+struct st_platform_priv {
+   struct clk *clks[USB_MAX_CLKS];
+   struct clk *clk48;
+   struct reset_control *rst;
+   struct reset_control *pwr;
+   struct phy *phy;
+};
+
+int st_usb_platform_power_on(struct st_platform_priv *priv);
+void st_usb_platform_power_off(struct st_platform_priv *priv);
+
+#endif /* __USB_ST_COMMON_H */
-- 
1.9.1

--
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: xhci_suspend is not stopping the root hub timer for the shared HCD

2014-08-06 Thread Al Cooper
V2 - Restart polling (which will restart the timer) for the shared
HCD in xhci_resume().

xhci_suspend() will stop the primary HCD's root hub timer, but leaves
the shared HCD's timer running. This change adds stopping of the
shared HCD timer.

Signed-off-by: Al Cooper 
---
 drivers/usb/host/xhci.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b6f2117..1557d4f 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -871,6 +871,8 @@ int xhci_suspend(struct xhci_hcd *xhci)
xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
del_timer_sync(&hcd->rh_timer);
+   clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);
+   del_timer_sync(&xhci->shared_hcd->rh_timer);
 
spin_lock_irq(&xhci->lock);
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
@@ -1075,6 +1077,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
usb_hcd_poll_rh_status(hcd);
+   set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);
+   usb_hcd_poll_rh_status(xhci->shared_hcd);
 
return retval;
 }
-- 
1.9.0.138.g2de3478

--
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: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-06 Thread Christoph Hellwig
On Wed, Aug 06, 2014 at 03:29:47PM +0200, Douglas Gilbert wrote:
> If not and since I'm told black lists and the like won't
> work, my advice for the record is to use FreeBSD or Windows
> for tools that need this capability.

I doubt either of them forces users to hack up flags for these cases.

At least for windows I suspect it just never sends the LUN encoded
in the CDB and treats USB devices special instead of our insistance
on pretending they are SCSI-2.

Maybe some of the USB people have on the wire traces or access to
device or windows documentation on this?

--
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: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-06 Thread Alan Stern
On Wed, 6 Aug 2014, Christoph Hellwig wrote:

> On Wed, Aug 06, 2014 at 03:29:47PM +0200, Douglas Gilbert wrote:
> > If not and since I'm told black lists and the like won't
> > work, my advice for the record is to use FreeBSD or Windows
> > for tools that need this capability.
> 
> I doubt either of them forces users to hack up flags for these cases.

Why was this change needed in the first place?  There's no explanation 
in the patch itself.

> At least for windows I suspect it just never sends the LUN encoded
> in the CDB and treats USB devices special instead of our insistance
> on pretending they are SCSI-2.

We no longer pretend that USB mass-storage devices have any particular 
SCSI level.  See commit 09b6b51b0b6c.

> Maybe some of the USB people have on the wire traces or access to
> device or windows documentation on this?

Most likely it varies with the version of Windows and the INQUIRY data
returned by the device.

I can obtain hardware traces for the kinds of devices and computers 
lying around here.  But what sort of combinations should I test?

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: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-06 Thread Alan Stern
Please don't remove names from the CC: list; use Reply-To-All.  I had 
to go back and add all the names back in.

On Wed, 6 Aug 2014, Tiziano Bacocco wrote:

> Test with alcor based USB flash drives, linux 3.16 will remove the 3 msb of
> the CDB byte when using SG raw

Sure, but isn't that what you want it to do?  Doesn't the flash drive 
use those bits to hold the LUN number?

Alan Stern


> Il 06/ago/2014 22:02 "Alan Stern"  ha scritto:
>
> > On Wed, 6 Aug 2014, Christoph Hellwig wrote:
> >
> > > On Wed, Aug 06, 2014 at 03:29:47PM +0200, Douglas Gilbert wrote:
> > > > If not and since I'm told black lists and the like won't
> > > > work, my advice for the record is to use FreeBSD or Windows
> > > > for tools that need this capability.
> > >
> > > I doubt either of them forces users to hack up flags for these cases.
> >
> > Why was this change needed in the first place?  There's no explanation
> > in the patch itself.

--
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 v3 1/6] usb: host: usb-st-common: Add common code required by ohci-st and ehci-st

2014-08-06 Thread Arnd Bergmann
On Wednesday 06 August 2014, Peter Griffin wrote:
> +int st_usb_platform_power_on(struct st_platform_priv *priv)
> +{
> + int clk, ret;
> +
> + if (priv->pwr) {
> + ret = reset_control_deassert(priv->pwr);
> + if (ret)
> + return ret;
> + }
> +
> + if (priv->rst) {
> + ret = 
> (priv->rst);
> + if (ret)
> + goto err_assert_power;
> + }

I wouldn't make these optional, just call the functions
unconditionally and fail the probe function if they are
not available.

I'm not sure if it's worth keeping these functions in a
common file. You are adding complexity this way and I don't
think you are even saving a significant number of code lines
compared to just having two copies of them.

> +EXPORT_SYMBOL(st_usb_platform_power_on);

If you want to keep them, it would be best to make

Arnd
--
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 v3 2/6] usb: host: ehci-st: Add EHCI support for ST STB devices

2014-08-06 Thread Arnd Bergmann
On Wednesday 06 August 2014, Peter Griffin wrote:

> +static int st_ehci_platform_reset(struct usb_hcd *hcd)
> +{
> + struct platform_device *pdev = to_platform_device(hcd->self.controller);
> + struct usb_ehci_pdata *pdata = dev_get_platdata(&pdev->dev);
> + struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> + int retval;
> +
> + if (pdata->pre_setup) {
> + retval = pdata->pre_setup(hcd);
> + if (retval < 0)
> + return retval;
> + }

What is the point in going through a platform data function pointer here?
Can't you just open-code st_ehci_configure_bus() here?

> +static int st_ehci_platform_probe(struct platform_device *dev)
> +{
> + struct usb_hcd *hcd;
> + struct resource *res_mem;
> + struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
> + struct st_platform_priv *priv;
> + struct ehci_hcd *ehci;
> + int err, irq, clk = 0;
> +
> + if (usb_disabled())
> + return -ENODEV;
> +
> + /*
> +  * Use reasonable defaults so platforms don't have to provide these
> +  * with DT probing on ARM.
> +  */
> + if (!pdata)
> + pdata = &ehci_platform_defaults;

How would you ever get here with pdata set?

> + err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
> + if (err)
> + return err;

Remove this here, and rely on the correct mask to be set from the DT scan.

Arnd
--
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 v3 0/6] Add EHCI and OHCI drivers for STi SoC's

2014-08-06 Thread Arnd Bergmann
On Wednesday 06 August 2014, Peter Griffin wrote:
> This series adds support for the OHCI and EHCI on-chip controllers
> found in STi consumer electronics SoC's from STMicroelectronics.
> 
> The series has been re-worked from v2 to split out the ehci and ohci parts
> into their own drivers / devices like most other ARM platforms based on
> feedback from Arnd Bergmann (see here 
> http://www.spinics.net/lists/linux-usb/msg24.html. 
> 
> The ehci-platform & ohci-platform have been used as a basis for this in case 
> we
> wish to merge the drivers again in the future.
> 
> Changes since v2:
>  - Based on Arnd Berghman feedback, split out into 2 devices / drivers
>  - Base drivers oh ehci-platform.c & ohci-platform.c with required extensions
>to allow possible re-merge in the furture.

Hi Peter,

This looks much better than the first version. I have some remaining comments 
for
how it could be simplified a bit more.

The way that you deal with the 48mhz clock seems like it should fit in well
with the generic driver, just like all the rest (once the usb-st-common
stuff is moved into the ohci/ehci drivers), so the alternative would be
to make it all generic now.

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


usb: gadget: f_uac1.c Incorrect descriptor

2014-08-06 Thread Ken Helberg
Hi,

Hope this is the right place to mention/post this; I'm new to this. As a
point of reference, I'm running uClinux on a bf609-ezkit that is based on
3.10, but from what I can tell this hasn't been changed/fixed since 3.10 yet
and applies in general.

As per section 4.3.2 of Universal Serial Bus Device Class Definition for
Audio Devices (audio10.pdf), and section B.3.3.2 by example, the
bInCollection field of the Class-Specific AudioControl (AC) Interface Header
Descriptor is the number of AudioStreaming (AS) and MIDIStreaming (MS)
interfaces for the given AC interface. Similarly, the baInterfaceNr
collection is only to list the AS and MS interfaces.

In f_uac1.c, the AC header descriptor states that it has 2 interfaces in its
collection, one of those being the AC interface itself. This, at least,
causes Windows 7 to not enumerate the device correctly. Changing the
relative lines to make is only have 1 interface listed fixes enumeration on
Windows 7. (I know I should provide a patch for this, but I'm still reading
up on the proper way to submit these).

Interface numbering should be dynamic. Currently, the value(s) in the
baInterfaceNr collection are not updated when retrieved in f_audio_bind(). I
have not tried this myself yet, but should be easy to implement/understand.

If this all makes sense, I'll post a patch here (anywhere else, too?).

Thanks,

Ken

--
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: usb: gadget: f_uac1.c Incorrect descriptor

2014-08-06 Thread Felipe Balbi
Hi,

On Wed, Aug 06, 2014 at 09:14:55PM +, Ken Helberg wrote:
> Hope this is the right place to mention/post this; I'm new to this. As a
> point of reference, I'm running uClinux on a bf609-ezkit that is based on
> 3.10, but from what I can tell this hasn't been changed/fixed since 3.10 yet
> and applies in general.
> 
> As per section 4.3.2 of Universal Serial Bus Device Class Definition for
> Audio Devices (audio10.pdf), and section B.3.3.2 by example, the
> bInCollection field of the Class-Specific AudioControl (AC) Interface Header
> Descriptor is the number of AudioStreaming (AS) and MIDIStreaming (MS)
> interfaces for the given AC interface. Similarly, the baInterfaceNr
> collection is only to list the AS and MS interfaces.
> 
> In f_uac1.c, the AC header descriptor states that it has 2 interfaces in its
> collection, one of those being the AC interface itself. This, at least,
> causes Windows 7 to not enumerate the device correctly. Changing the
> relative lines to make is only have 1 interface listed fixes enumeration on
> Windows 7. (I know I should provide a patch for this, but I'm still reading
> up on the proper way to submit these).
> 
> Interface numbering should be dynamic. Currently, the value(s) in the
> baInterfaceNr collection are not updated when retrieved in f_audio_bind(). I
> have not tried this myself yet, but should be easy to implement/understand.
> 
> If this all makes sense, I'll post a patch here (anywhere else, too?).

Sure, please send a patch and make sure to Cc the maintainer. You can
use scripts/get_maintainer.pl to help out. Also, make sure to split bug
fix from new code. I can see you'd write at least two patches:

1) Drop F_AUDIO_AC_INTERFACE from baInterfaceNr (this should have Cc:
 befor your Signed-off-by)

2) Switch to dynamic Interface number on f_uac1.c. This is new code
which would be merged for v3.18.

good luck.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v3 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Doug Anderson
Paul,

On Tue, Aug 5, 2014 at 1:08 PM, Paul Zimmerman
 wrote:
>> Maybe dwc2 is refer to the Kconfig in dwc3 for there is a choice from
>> one of "Host only mode", "Gadget only mode" and "Dual Role mode",
>> which means the role is decided by the Kconfig.
>>
>> In my opinion, there maybe more than one controller in a Soc, and for
>> different
>> usage, the mode select should not be done in Kconfig, it's better to do that
>> in dts file.
>> I agree with you that the CONFIG_USB_DWC2_HOST should defined for host
>> functionality, not for role definition.
>>
>> Paul: what do you think?
>
> I'm confused about how your dual-role mode implementation is supposed
> to work. Right now, the host and peripheral modes are compiled as
> separate drivers, and there is no dual-role mode in the Kconfig. So I
> don't see how your code can work. Have you tested it?

Ah, interesting.  I just assumed that since you could compile both in
that dual mode was there, but I clearly was confused.

I don't think Kever had tested dual_role mode.


> Dinh Nguyen is working on a patch series to add dual-role support, I
> think you have seen that, right? That adds the Kconfig options for all
> three modes. Maybe you should build on top of that?

I hadn't personally seen it, but now I have!  I guess this is the
newest .

I haven't done a thorough review, but I think Kever's patch v4
 is still relevant since
I don't see anything parsing the dr_mode in Dinh's patches.

-Doug
--
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 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Doug Anderson
Kever,

On Tue, Aug 5, 2014 at 6:01 PM, Kever Yang  wrote:
> According to the "dr_mode", the otg controller can work as
> device role and host role. Some boards always want to use host mode
> and some other boards want to use gadget mode. We use the dts setting
> to set dwc2's mode, rather than fixing it to whatever hardware says.
>
> Signed-off-by: Kever Yang 
> Acked-by: Paul Zimmerman 
> ---
>
> Changes in v4:
> - From Doug's suggestion:
>  -- remove dr_mode init from Kconfig code
>  -- change the commit meesage
>
> Changes in v3:
> - fix the odd spacing in dwc2_hsotg struct
> - From Jingoo's suggestion:
> change the commit message
> - add dr_mode init from Kconfig
>
> Changes in v2:
> - put spaces around '+' operator
> - expand the comment for dr_mode
> - handle dr_mode is USB_DR_MODE_OTG
>
>  drivers/usb/dwc2/core.c | 18 ++
>  drivers/usb/dwc2/core.h |  5 +
>  drivers/usb/dwc2/platform.c |  4 
>  3 files changed, 27 insertions(+)

I think this patch still makes sense even though we don't have a
combined driver yet.  Perhaps Paul or Dihn can confirm.

We could potentially do something based on KConfig (like you did in
patch set #3), but it wouldn't really make sense to do that until
after Dihn's work lands.


> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
> index 27d2c9b..738bec2 100644
> --- a/drivers/usb/dwc2/core.c
> +++ b/drivers/usb/dwc2/core.c
> @@ -118,6 +118,7 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>  {
> u32 greset;
> int count = 0;
> +   u32 gusbcfg;
>
> dev_vdbg(hsotg->dev, "%s()\n", __func__);
>
> @@ -148,6 +149,23 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
> }
> } while (greset & GRSTCTL_CSFTRST);
>
> +   if (hsotg->dr_mode == USB_DR_MODE_HOST) {
> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
> +   gusbcfg |= GUSBCFG_FORCEHOSTMODE;
> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
> +   } else if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) {
> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
> +   gusbcfg |= GUSBCFG_FORCEDEVMODE;
> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
> +   } else if (hsotg->dr_mode == USB_DR_MODE_OTG) {
> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
> +   writel(gusbcfg, hsotg->regs + GUSBCFG);

I think the third case here won't be too useful until the combined
driver, but it shouldn't hurt, right?


-Doug
--
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 1/1] net: fix USB network driver config option.

2014-08-06 Thread Francois Romieu
From: Francois Romieu 

It must be tristate to avoid broken dependencies with kernel built-in
usb network drivers when usb support is module only.

When net config option is set, least surprize default should match usb.

Wireless RNDIS USB driver used to select USB_USBNET. USB_USBNET now
depends on USB_NET_DRIVERS so the latter should be selected as well.

Signed-off-by: Francois Romieu 
---
 drivers/net/usb/Kconfig  | 4 ++--
 drivers/net/wireless/Kconfig | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

It applies against plain linus 85417aef44fc58b08773117ceb1bc6ca5684e973.

diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index 9f194a0..37eed4d 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -5,8 +5,8 @@ comment "Host-side USB support is needed for USB Network 
Adapter support"
depends on !USB && NET
 
 menuconfig USB_NET_DRIVERS
-   bool "USB Network Adapters"
-   default y
+   tristate "USB Network Adapters"
+   default USB if USB
depends on USB && NET
 
 if USB_NET_DRIVERS
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index b2137e8..16604bd 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -189,6 +189,7 @@ config USB_NET_RNDIS_WLAN
tristate "Wireless RNDIS USB support"
depends on USB
depends on CFG80211
+   select USB_NET_DRIVERS
select USB_USBNET
select USB_NET_CDCETHER
select USB_NET_RNDIS_HOST
-- 
1.9.3

--
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 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Dinh Nguyen
On Wed, Aug 6, 2014 at 5:24 PM, Doug Anderson  wrote:
> Kever,
>
> On Tue, Aug 5, 2014 at 6:01 PM, Kever Yang  wrote:
>> According to the "dr_mode", the otg controller can work as
>> device role and host role. Some boards always want to use host mode
>> and some other boards want to use gadget mode. We use the dts setting
>> to set dwc2's mode, rather than fixing it to whatever hardware says.
>>
>> Signed-off-by: Kever Yang 
>> Acked-by: Paul Zimmerman 
>> ---
>>
>> Changes in v4:
>> - From Doug's suggestion:
>>  -- remove dr_mode init from Kconfig code
>>  -- change the commit meesage
>>
>> Changes in v3:
>> - fix the odd spacing in dwc2_hsotg struct
>> - From Jingoo's suggestion:
>> change the commit message
>> - add dr_mode init from Kconfig
>>
>> Changes in v2:
>> - put spaces around '+' operator
>> - expand the comment for dr_mode
>> - handle dr_mode is USB_DR_MODE_OTG
>>
>>  drivers/usb/dwc2/core.c | 18 ++
>>  drivers/usb/dwc2/core.h |  5 +
>>  drivers/usb/dwc2/platform.c |  4 
>>  3 files changed, 27 insertions(+)
>
> I think this patch still makes sense even though we don't have a
> combined driver yet.  Perhaps Paul or Dihn can confirm.
>

I think this looks fine to me. I will rebase my v3 on top of this patch.

Dinh

> We could potentially do something based on KConfig (like you did in
> patch set #3), but it wouldn't really make sense to do that until
> after Dihn's work lands.
>
>
>> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
>> index 27d2c9b..738bec2 100644
>> --- a/drivers/usb/dwc2/core.c
>> +++ b/drivers/usb/dwc2/core.c
>> @@ -118,6 +118,7 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>>  {
>> u32 greset;
>> int count = 0;
>> +   u32 gusbcfg;
>>
>> dev_vdbg(hsotg->dev, "%s()\n", __func__);
>>
>> @@ -148,6 +149,23 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>> }
>> } while (greset & GRSTCTL_CSFTRST);
>>
>> +   if (hsotg->dr_mode == USB_DR_MODE_HOST) {
>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
>> +   gusbcfg |= GUSBCFG_FORCEHOSTMODE;
>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>> +   } else if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) {
>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
>> +   gusbcfg |= GUSBCFG_FORCEDEVMODE;
>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>> +   } else if (hsotg->dr_mode == USB_DR_MODE_OTG) {
>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
>> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>
> I think the third case here won't be too useful until the combined
> driver, but it shouldn't hurt, right?
>
>
> -Doug
> --
> 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
--
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 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Paul Zimmerman
> From: diand...@google.com [mailto:diand...@google.com] On Behalf Of Doug 
> Anderson
> Sent: Wednesday, August 06, 2014 3:25 PM
> 
> On Tue, Aug 5, 2014 at 6:01 PM, Kever Yang  wrote:
> > According to the "dr_mode", the otg controller can work as
> > device role and host role. Some boards always want to use host mode
> > and some other boards want to use gadget mode. We use the dts setting
> > to set dwc2's mode, rather than fixing it to whatever hardware says.
> >
> > Signed-off-by: Kever Yang 
> > Acked-by: Paul Zimmerman 
> > ---
> >
> > Changes in v4:
> > - From Doug's suggestion:
> >  -- remove dr_mode init from Kconfig code
> >  -- change the commit meesage
> >
> > Changes in v3:
> > - fix the odd spacing in dwc2_hsotg struct
> > - From Jingoo's suggestion:
> > change the commit message
> > - add dr_mode init from Kconfig
> >
> > Changes in v2:
> > - put spaces around '+' operator
> > - expand the comment for dr_mode
> > - handle dr_mode is USB_DR_MODE_OTG
> >
> >  drivers/usb/dwc2/core.c | 18 ++
> >  drivers/usb/dwc2/core.h |  5 +
> >  drivers/usb/dwc2/platform.c |  4 
> >  3 files changed, 27 insertions(+)
> 
> I think this patch still makes sense even though we don't have a
> combined driver yet.  Perhaps Paul or Dihn can confirm.

Yes, it should be fine.

> We could potentially do something based on KConfig (like you did in
> patch set #3), but it wouldn't really make sense to do that until
> after Dihn's work lands.
> 
> 
> > diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
> > index 27d2c9b..738bec2 100644
> > --- a/drivers/usb/dwc2/core.c
> > +++ b/drivers/usb/dwc2/core.c
> > @@ -118,6 +118,7 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
> >  {
> > u32 greset;
> > int count = 0;
> > +   u32 gusbcfg;
> >
> > dev_vdbg(hsotg->dev, "%s()\n", __func__);
> >
> > @@ -148,6 +149,23 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
> > }
> > } while (greset & GRSTCTL_CSFTRST);
> >
> > +   if (hsotg->dr_mode == USB_DR_MODE_HOST) {
> > +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> > +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
> > +   gusbcfg |= GUSBCFG_FORCEHOSTMODE;
> > +   writel(gusbcfg, hsotg->regs + GUSBCFG);
> > +   } else if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) {
> > +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> > +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
> > +   gusbcfg |= GUSBCFG_FORCEDEVMODE;
> > +   writel(gusbcfg, hsotg->regs + GUSBCFG);
> > +   } else if (hsotg->dr_mode == USB_DR_MODE_OTG) {
> > +   gusbcfg = readl(hsotg->regs + GUSBCFG);
> > +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
> > +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
> > +   writel(gusbcfg, hsotg->regs + GUSBCFG);
> 
> I think the third case here won't be too useful until the combined
> driver, but it shouldn't hurt, right?

Right. For the existing drivers, it shouldn't change anything, since
nothing currently sets dr_mode. And with Kever's other patches, it
forces host mode on the Rockchip platform, which is all that is required
for now, if I understand correctly.

-- 
Paul



Re: [PATCH 1/1] net: fix USB network driver config option.

2014-08-06 Thread David Miller
From: Francois Romieu 
Date: Thu, 7 Aug 2014 00:36:40 +0200

> From: Francois Romieu 
> 
> It must be tristate to avoid broken dependencies with kernel built-in
> usb network drivers when usb support is module only.
> 
> When net config option is set, least surprize default should match usb.
> 
> Wireless RNDIS USB driver used to select USB_USBNET. USB_USBNET now
> depends on USB_NET_DRIVERS so the latter should be selected as well.
> 
> Signed-off-by: Francois Romieu 

Ok, applied, thanks.
--
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 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Dinh Nguyen

On 8/6/14, 5:57 PM, Paul Zimmerman wrote:
>> From: diand...@google.com [mailto:diand...@google.com] On Behalf Of Doug 
>> Anderson
>> Sent: Wednesday, August 06, 2014 3:25 PM
>>
>> On Tue, Aug 5, 2014 at 6:01 PM, Kever Yang  wrote:
>>> According to the "dr_mode", the otg controller can work as
>>> device role and host role. Some boards always want to use host mode
>>> and some other boards want to use gadget mode. We use the dts setting
>>> to set dwc2's mode, rather than fixing it to whatever hardware says.
>>>
>>> Signed-off-by: Kever Yang 
>>> Acked-by: Paul Zimmerman 
>>> ---
>>>
>>> Changes in v4:
>>> - From Doug's suggestion:
>>>  -- remove dr_mode init from Kconfig code
>>>  -- change the commit meesage
>>>
>>> Changes in v3:
>>> - fix the odd spacing in dwc2_hsotg struct
>>> - From Jingoo's suggestion:
>>> change the commit message
>>> - add dr_mode init from Kconfig
>>>
>>> Changes in v2:
>>> - put spaces around '+' operator
>>> - expand the comment for dr_mode
>>> - handle dr_mode is USB_DR_MODE_OTG
>>>
>>>  drivers/usb/dwc2/core.c | 18 ++
>>>  drivers/usb/dwc2/core.h |  5 +
>>>  drivers/usb/dwc2/platform.c |  4 
>>>  3 files changed, 27 insertions(+)
>> I think this patch still makes sense even though we don't have a
>> combined driver yet.  Perhaps Paul or Dihn can confirm.
> Yes, it should be fine.
>
>> We could potentially do something based on KConfig (like you did in
>> patch set #3), but it wouldn't really make sense to do that until
>> after Dihn's work lands.
>>
>>
>>> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
>>> index 27d2c9b..738bec2 100644
>>> --- a/drivers/usb/dwc2/core.c
>>> +++ b/drivers/usb/dwc2/core.c
>>> @@ -118,6 +118,7 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>>>  {
>>> u32 greset;
>>> int count = 0;
>>> +   u32 gusbcfg;
>>>
>>> dev_vdbg(hsotg->dev, "%s()\n", __func__);
>>>
>>> @@ -148,6 +149,23 @@ static int dwc2_core_reset(struct dwc2_hsotg *hsotg)
>>> }
>>> } while (greset & GRSTCTL_CSFTRST);
>>>
>>> +   if (hsotg->dr_mode == USB_DR_MODE_HOST) {
>>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>>> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
>>> +   gusbcfg |= GUSBCFG_FORCEHOSTMODE;
>>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>>> +   } else if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) {
>>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>>> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
>>> +   gusbcfg |= GUSBCFG_FORCEDEVMODE;
>>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>>> +   } else if (hsotg->dr_mode == USB_DR_MODE_OTG) {
>>> +   gusbcfg = readl(hsotg->regs + GUSBCFG);
>>> +   gusbcfg &= ~GUSBCFG_FORCEHOSTMODE;
>>> +   gusbcfg &= ~GUSBCFG_FORCEDEVMODE;
>>> +   writel(gusbcfg, hsotg->regs + GUSBCFG);
>> I think the third case here won't be too useful until the combined
>> driver, but it shouldn't hurt, right?
> Right. For the existing drivers, it shouldn't change anything, since
> nothing currently sets dr_mode. And with Kever's other patches, it
> forces host mode on the Rockchip platform, which is all that is required
> for now, if I understand correctly.
>
I managed to test this patch on the SOCFPGA platform. So

Tested-by: Dinh Nguyen 

Thanks,
DInh

--
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 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

2014-08-06 Thread Doug Anderson
Kever,

On Tue, Aug 5, 2014 at 6:01 PM, Kever Yang  wrote:
> According to the "dr_mode", the otg controller can work as
> device role and host role. Some boards always want to use host mode
> and some other boards want to use gadget mode. We use the dts setting
> to set dwc2's mode, rather than fixing it to whatever hardware says.
>
> Signed-off-by: Kever Yang 
> Acked-by: Paul Zimmerman 
> ---
>
> Changes in v4:
> - From Doug's suggestion:
>  -- remove dr_mode init from Kconfig code
>  -- change the commit meesage
>
> Changes in v3:
> - fix the odd spacing in dwc2_hsotg struct
> - From Jingoo's suggestion:
> change the commit message
> - add dr_mode init from Kconfig
>
> Changes in v2:
> - put spaces around '+' operator
> - expand the comment for dr_mode
> - handle dr_mode is USB_DR_MODE_OTG
>
>  drivers/usb/dwc2/core.c | 18 ++
>  drivers/usb/dwc2/core.h |  5 +
>  drivers/usb/dwc2/platform.c |  4 
>  3 files changed, 27 insertions(+)

I don't know the driver well enough to feel like I can add my
Reviewed-by tag, but since you've already got an Ack from Paul it
doesn't matter much.  ...FWIW I'm happy with the current state of the
code now.  :)

-Doug
--
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] USB: atmel_usba_udc: fix it to deal with final DMA channel

2014-08-06 Thread Bo Shen
As, the interrupt for DMA is counted from 1, so need to checked
the USBA_NR_DMAS, in old way, it only check (USBA_NR_DMAS - 1),
so fix it.

Reported-by: Max Liao 
Signed-off-by: Bo Shen 
---

 drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c 
b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 906e65f..c9fe67e 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -1661,7 +1661,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
if (dma_status) {
int i;
 
-   for (i = 1; i < USBA_NR_DMAS; i++)
+   for (i = 1; i <= USBA_NR_DMAS; i++)
if (dma_status & (1 << i))
usba_dma_irq(udc, &udc->usba_ep[i]);
}
-- 
1.8.5.2

--
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 3/3] usbip: remove struct usb_device_id table

2014-08-06 Thread Valentina Manea
This was used back when usbip-host was an interface device driver;
after the conversion to device driver, the table remained unused.
Remove it in order to stop receiving a warning about it.

Signed-off-by: Valentina Manea 
---
 drivers/usb/usbip/stub_dev.c | 27 ---
 1 file changed, 27 deletions(-)

diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
index 51d0c71..fac20e0 100644
--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -26,33 +26,6 @@
 #include "stub.h"
 
 /*
- * Define device IDs here if you want to explicitly limit exportable devices.
- * In most cases, wildcard matching will be okay because driver binding can be
- * changed dynamically by a userland program.
- */
-static struct usb_device_id stub_table[] = {
-#if 0
-   /* just an example */
-   { USB_DEVICE(0x05ac, 0x0301) },   /* Mac 1 button mouse */
-   { USB_DEVICE(0x0430, 0x0009) },   /* Plat Home Keyboard */
-   { USB_DEVICE(0x059b, 0x0001) },   /* Iomega USB Zip 100 */
-   { USB_DEVICE(0x04b3, 0x4427) },   /* IBM USB CD-ROM */
-   { USB_DEVICE(0x05a9, 0xa511) },   /* LifeView USB cam */
-   { USB_DEVICE(0x55aa, 0x0201) },   /* Imation card reader */
-   { USB_DEVICE(0x046d, 0x0870) },   /* Qcam Express(QV-30) */
-   { USB_DEVICE(0x04bb, 0x0101) },   /* IO-DATA HD 120GB */
-   { USB_DEVICE(0x04bb, 0x0904) },   /* IO-DATA USB-ET/TX */
-   { USB_DEVICE(0x04bb, 0x0201) },   /* IO-DATA USB-ET/TX */
-   { USB_DEVICE(0x08bb, 0x2702) },   /* ONKYO USB Speaker */
-   { USB_DEVICE(0x046d, 0x08b2) },   /* Logicool Qcam 4000 Pro */
-#endif
-   /* magic for wild card */
-   { .driver_info = 1 },
-   { 0, } /* Terminating entry */
-};
-MODULE_DEVICE_TABLE(usb, stub_table);
-
-/*
  * usbip_status shows the status of usbip-host as long as this driver is bound
  * to the target device.
  */
-- 
1.8.1.2

--
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 1/3] usbip: move usbip userspace code out of staging

2014-08-06 Thread Valentina Manea
At this point, USB/IP userspace code is fully functional
and can be moved out of staging.

Signed-off-by: Valentina Manea 
---
 {drivers/staging/usbip/userspace => tools/usb/usbip}/.gitignore   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/AUTHORS  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/COPYING  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/INSTALL  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/Makefile.am  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/README   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/autogen.sh   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/cleanup.sh   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/configure.ac | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/doc/usbip.8  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/doc/usbipd.8 | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/Makefile.am   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/list.h| 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/names.c   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/names.h   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/sysfs_utils.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/sysfs_utils.h | 0
 .../staging/usbip/userspace => tools/usb/usbip}/libsrc/usbip_common.c | 0
 .../staging/usbip/userspace => tools/usb/usbip}/libsrc/usbip_common.h | 0
 .../usbip/userspace => tools/usb/usbip}/libsrc/usbip_host_driver.c| 0
 .../usbip/userspace => tools/usb/usbip}/libsrc/usbip_host_driver.h| 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/vhci_driver.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/vhci_driver.h | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/Makefile.am  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip.c  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip.h  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_attach.c   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_bind.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_detach.c   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_list.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_network.c  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_network.h  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_port.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbip_unbind.c   | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/usbipd.c | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/utils.c  | 0
 {drivers/staging/usbip/userspace => tools/usb/usbip}/src/utils.h  | 0
 37 files changed, 0 insertions(+), 0 deletions(-)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/.gitignore (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/AUTHORS (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/COPYING (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/INSTALL (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/Makefile.am (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/README (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/autogen.sh (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/cleanup.sh (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/configure.ac (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/doc/usbip.8 (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/doc/usbipd.8 (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/Makefile.am 
(100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/list.h 
(100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/names.c 
(100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/libsrc/names.h 
(100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/sysfs_utils.c (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/sysfs_utils.h (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/usbip_common.c (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/usbip_common.h (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/usbip_host_driver.c (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/usbip_host_driver.h (100%)
 rename {drivers/staging/usbip/userspace => 
tools/usb/usbip}/libsrc/vhci_driver.c (100%)
 rename {drivers/staging/usbip/userspace => 
tools/us

[PATCH 0/3] usbip: move usbip out of staging

2014-08-06 Thread Valentina Manea
After migrating userspace code to libudev, converting usbip-host
to a device driver and various bug fixes and enhancements, USB/IP
is fully functional and can be moved out of staging.

This patch series moves it as following:
* userspace code to tools/usb/usbip
* kernel code to drivers/usb/usbip

Besides this, a warning generated in the kernel code is solved.

Valentina Manea (3):
  usbip: move usbip userspace code out of staging
  usbip: move usbip kernel code out of staging
  usbip: remove struct usb_device_id table

 drivers/staging/Kconfig|  2 --
 drivers/staging/Makefile   |  1 -
 drivers/{staging => usb}/usbip/Kconfig |  0
 drivers/{staging => usb}/usbip/Makefile|  0
 drivers/{staging => usb}/usbip/README  |  0
 drivers/{staging => usb}/usbip/stub.h  |  0
 drivers/{staging => usb}/usbip/stub_dev.c  | 27 --
 drivers/{staging => usb}/usbip/stub_main.c |  0
 drivers/{staging => usb}/usbip/stub_rx.c   |  0
 drivers/{staging => usb}/usbip/stub_tx.c   |  0
 drivers/{staging => usb}/usbip/usbip_common.c  |  0
 drivers/{staging => usb}/usbip/usbip_common.h  |  2 +-
 drivers/{staging => usb}/usbip/usbip_event.c   |  0
 drivers/{staging => usb}/usbip/usbip_protocol.txt  |  0
 drivers/{staging => usb}/usbip/vhci.h  |  0
 drivers/{staging => usb}/usbip/vhci_hcd.c  |  0
 drivers/{staging => usb}/usbip/vhci_rx.c   |  0
 drivers/{staging => usb}/usbip/vhci_sysfs.c|  0
 drivers/{staging => usb}/usbip/vhci_tx.c   |  0
 .../usbip/uapi => include/uapi/linux}/usbip.h  |  0
 .../usbip/userspace => tools/usb/usbip}/.gitignore |  0
 .../usbip/userspace => tools/usb/usbip}/AUTHORS|  0
 .../usbip/userspace => tools/usb/usbip}/COPYING|  0
 .../usbip/userspace => tools/usb/usbip}/INSTALL|  0
 .../userspace => tools/usb/usbip}/Makefile.am  |  0
 .../usbip/userspace => tools/usb/usbip}/README |  0
 .../usbip/userspace => tools/usb/usbip}/autogen.sh |  0
 .../usbip/userspace => tools/usb/usbip}/cleanup.sh |  0
 .../userspace => tools/usb/usbip}/configure.ac |  0
 .../userspace => tools/usb/usbip}/doc/usbip.8  |  0
 .../userspace => tools/usb/usbip}/doc/usbipd.8 |  0
 .../usb/usbip}/libsrc/Makefile.am  |  0
 .../userspace => tools/usb/usbip}/libsrc/list.h|  0
 .../userspace => tools/usb/usbip}/libsrc/names.c   |  0
 .../userspace => tools/usb/usbip}/libsrc/names.h   |  0
 .../usb/usbip}/libsrc/sysfs_utils.c|  0
 .../usb/usbip}/libsrc/sysfs_utils.h|  0
 .../usb/usbip}/libsrc/usbip_common.c   |  0
 .../usb/usbip}/libsrc/usbip_common.h   |  0
 .../usb/usbip}/libsrc/usbip_host_driver.c  |  0
 .../usb/usbip}/libsrc/usbip_host_driver.h  |  0
 .../usb/usbip}/libsrc/vhci_driver.c|  0
 .../usb/usbip}/libsrc/vhci_driver.h|  0
 .../userspace => tools/usb/usbip}/src/Makefile.am  |  0
 .../userspace => tools/usb/usbip}/src/usbip.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip.h  |  0
 .../usb/usbip}/src/usbip_attach.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip_bind.c |  0
 .../usb/usbip}/src/usbip_detach.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip_list.c |  0
 .../usb/usbip}/src/usbip_network.c |  0
 .../usb/usbip}/src/usbip_network.h |  0
 .../userspace => tools/usb/usbip}/src/usbip_port.c |  0
 .../usb/usbip}/src/usbip_unbind.c  |  0
 .../userspace => tools/usb/usbip}/src/usbipd.c |  0
 .../userspace => tools/usb/usbip}/src/utils.c  |  0
 .../userspace => tools/usb/usbip}/src/utils.h  |  0
 57 files changed, 1 insertion(+), 31 deletions(-)
 rename drivers/{staging => usb}/usbip/Kconfig (100%)
 rename drivers/{staging => usb}/usbip/Makefile (100%)
 rename drivers/{staging => usb}/usbip/README (100%)
 rename drivers/{staging => usb}/usbip/stub.h (100%)
 rename drivers/{staging => usb}/usbip/stub_dev.c (90%)
 rename drivers/{staging => usb}/usbip/stub_main.c (100%)
 rename drivers/{staging => usb}/usbip/stub_rx.c (100%)
 rename drivers/{staging => usb}/usbip/stub_tx.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.h (99%)
 rename drivers/{staging => usb}/usbip/usbip_event.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_protocol.txt (100%)
 rename drivers/{staging => usb}/usbip/vhci.h (100%)
 rename drivers/{staging => usb}/usbip/vhci_hcd.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_rx.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_sysfs.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_tx.c (100%)
 rename {drivers/staging/usbip/uapi => include/uapi/linux}/usbip.h (100%)
 rename {drivers/staging/usbip/userspace => tools/usb/usbip}/.gitignore (100%)
 rename {drivers/stagi

[PATCH 2/3] usbip: move usbip kernel code out of staging

2014-08-06 Thread Valentina Manea
At this point, USB/IP kernel code is fully functional
and can be moved out of staging.

Signed-off-by: Valentina Manea 
---
 drivers/staging/Kconfig| 2 --
 drivers/staging/Makefile   | 1 -
 drivers/{staging => usb}/usbip/Kconfig | 0
 drivers/{staging => usb}/usbip/Makefile| 0
 drivers/{staging => usb}/usbip/README  | 0
 drivers/{staging => usb}/usbip/stub.h  | 0
 drivers/{staging => usb}/usbip/stub_dev.c  | 0
 drivers/{staging => usb}/usbip/stub_main.c | 0
 drivers/{staging => usb}/usbip/stub_rx.c   | 0
 drivers/{staging => usb}/usbip/stub_tx.c   | 0
 drivers/{staging => usb}/usbip/usbip_common.c  | 0
 drivers/{staging => usb}/usbip/usbip_common.h  | 2 +-
 drivers/{staging => usb}/usbip/usbip_event.c   | 0
 drivers/{staging => usb}/usbip/usbip_protocol.txt  | 0
 drivers/{staging => usb}/usbip/vhci.h  | 0
 drivers/{staging => usb}/usbip/vhci_hcd.c  | 0
 drivers/{staging => usb}/usbip/vhci_rx.c   | 0
 drivers/{staging => usb}/usbip/vhci_sysfs.c| 0
 drivers/{staging => usb}/usbip/vhci_tx.c   | 0
 {drivers/staging/usbip/uapi => include/uapi/linux}/usbip.h | 0
 20 files changed, 1 insertion(+), 4 deletions(-)
 rename drivers/{staging => usb}/usbip/Kconfig (100%)
 rename drivers/{staging => usb}/usbip/Makefile (100%)
 rename drivers/{staging => usb}/usbip/README (100%)
 rename drivers/{staging => usb}/usbip/stub.h (100%)
 rename drivers/{staging => usb}/usbip/stub_dev.c (100%)
 rename drivers/{staging => usb}/usbip/stub_main.c (100%)
 rename drivers/{staging => usb}/usbip/stub_rx.c (100%)
 rename drivers/{staging => usb}/usbip/stub_tx.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.h (99%)
 rename drivers/{staging => usb}/usbip/usbip_event.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_protocol.txt (100%)
 rename drivers/{staging => usb}/usbip/vhci.h (100%)
 rename drivers/{staging => usb}/usbip/vhci_hcd.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_rx.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_sysfs.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_tx.c (100%)
 rename {drivers/staging/usbip/uapi => include/uapi/linux}/usbip.h (100%)

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 2c486ea..35b494f 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -28,8 +28,6 @@ source "drivers/staging/et131x/Kconfig"
 
 source "drivers/staging/slicoss/Kconfig"
 
-source "drivers/staging/usbip/Kconfig"
-
 source "drivers/staging/wlan-ng/Kconfig"
 
 source "drivers/staging/comedi/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 1e1a3a1..e66a5db 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -6,7 +6,6 @@ obj-$(CONFIG_STAGING)   += staging.o
 obj-y  += media/
 obj-$(CONFIG_ET131X)   += et131x/
 obj-$(CONFIG_SLICOSS)  += slicoss/
-obj-$(CONFIG_USBIP_CORE)   += usbip/
 obj-$(CONFIG_PRISM2_USB)   += wlan-ng/
 obj-$(CONFIG_COMEDI)   += comedi/
 obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/
diff --git a/drivers/staging/usbip/Kconfig b/drivers/usb/usbip/Kconfig
similarity index 100%
rename from drivers/staging/usbip/Kconfig
rename to drivers/usb/usbip/Kconfig
diff --git a/drivers/staging/usbip/Makefile b/drivers/usb/usbip/Makefile
similarity index 100%
rename from drivers/staging/usbip/Makefile
rename to drivers/usb/usbip/Makefile
diff --git a/drivers/staging/usbip/README b/drivers/usb/usbip/README
similarity index 100%
rename from drivers/staging/usbip/README
rename to drivers/usb/usbip/README
diff --git a/drivers/staging/usbip/stub.h b/drivers/usb/usbip/stub.h
similarity index 100%
rename from drivers/staging/usbip/stub.h
rename to drivers/usb/usbip/stub.h
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
similarity index 100%
rename from drivers/staging/usbip/stub_dev.c
rename to drivers/usb/usbip/stub_dev.c
diff --git a/drivers/staging/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c
similarity index 100%
rename from drivers/staging/usbip/stub_main.c
rename to drivers/usb/usbip/stub_main.c
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c
similarity index 100%
rename from drivers/staging/usbip/stub_rx.c
rename to drivers/usb/usbip/stub_rx.c
diff --git a/drivers/staging/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c
similarity index 100%
rename from drivers/staging/usbip/stub_tx.c
rename to drivers/usb/usbip/stub_tx.c
diff --git a/drivers/staging/usbip/usbip_common.c 
b/drivers/usb/usbip/usbip_common.c
similarity index 100%
rename from drivers/staging/usbip/usbip_common.c
rename to drivers/usb/

[PATCH 0/3] usbip: move usbip out of staging

2014-08-06 Thread Valentina Manea
This is a resend of the patch series from March.

After migrating userspace code to libudev, converting usbip-host
to a device driver and various bug fixes and enhancements, USB/IP
is fully functional and can be moved out of staging.

This patch series moves it as following:
* userspace code to tools/usb/usbip
* kernel code to drivers/usb/usbip

Besides this, a warning generated in the kernel code is solved.

Valentina Manea (3):
  usbip: move usbip userspace code out of staging
  usbip: move usbip kernel code out of staging
  usbip: remove struct usb_device_id table

 drivers/staging/Kconfig|  2 --
 drivers/staging/Makefile   |  1 -
 drivers/{staging => usb}/usbip/Kconfig |  0
 drivers/{staging => usb}/usbip/Makefile|  0
 drivers/{staging => usb}/usbip/README  |  0
 drivers/{staging => usb}/usbip/stub.h  |  0
 drivers/{staging => usb}/usbip/stub_dev.c  | 27 --
 drivers/{staging => usb}/usbip/stub_main.c |  0
 drivers/{staging => usb}/usbip/stub_rx.c   |  0
 drivers/{staging => usb}/usbip/stub_tx.c   |  0
 drivers/{staging => usb}/usbip/usbip_common.c  |  0
 drivers/{staging => usb}/usbip/usbip_common.h  |  2 +-
 drivers/{staging => usb}/usbip/usbip_event.c   |  0
 drivers/{staging => usb}/usbip/usbip_protocol.txt  |  0
 drivers/{staging => usb}/usbip/vhci.h  |  0
 drivers/{staging => usb}/usbip/vhci_hcd.c  |  0
 drivers/{staging => usb}/usbip/vhci_rx.c   |  0
 drivers/{staging => usb}/usbip/vhci_sysfs.c|  0
 drivers/{staging => usb}/usbip/vhci_tx.c   |  0
 .../usbip/uapi => include/uapi/linux}/usbip.h  |  0
 .../usbip/userspace => tools/usb/usbip}/.gitignore |  0
 .../usbip/userspace => tools/usb/usbip}/AUTHORS|  0
 .../usbip/userspace => tools/usb/usbip}/COPYING|  0
 .../usbip/userspace => tools/usb/usbip}/INSTALL|  0
 .../userspace => tools/usb/usbip}/Makefile.am  |  0
 .../usbip/userspace => tools/usb/usbip}/README |  0
 .../usbip/userspace => tools/usb/usbip}/autogen.sh |  0
 .../usbip/userspace => tools/usb/usbip}/cleanup.sh |  0
 .../userspace => tools/usb/usbip}/configure.ac |  0
 .../userspace => tools/usb/usbip}/doc/usbip.8  |  0
 .../userspace => tools/usb/usbip}/doc/usbipd.8 |  0
 .../usb/usbip}/libsrc/Makefile.am  |  0
 .../userspace => tools/usb/usbip}/libsrc/list.h|  0
 .../userspace => tools/usb/usbip}/libsrc/names.c   |  0
 .../userspace => tools/usb/usbip}/libsrc/names.h   |  0
 .../usb/usbip}/libsrc/sysfs_utils.c|  0
 .../usb/usbip}/libsrc/sysfs_utils.h|  0
 .../usb/usbip}/libsrc/usbip_common.c   |  0
 .../usb/usbip}/libsrc/usbip_common.h   |  0
 .../usb/usbip}/libsrc/usbip_host_driver.c  |  0
 .../usb/usbip}/libsrc/usbip_host_driver.h  |  0
 .../usb/usbip}/libsrc/vhci_driver.c|  0
 .../usb/usbip}/libsrc/vhci_driver.h|  0
 .../userspace => tools/usb/usbip}/src/Makefile.am  |  0
 .../userspace => tools/usb/usbip}/src/usbip.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip.h  |  0
 .../usb/usbip}/src/usbip_attach.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip_bind.c |  0
 .../usb/usbip}/src/usbip_detach.c  |  0
 .../userspace => tools/usb/usbip}/src/usbip_list.c |  0
 .../usb/usbip}/src/usbip_network.c |  0
 .../usb/usbip}/src/usbip_network.h |  0
 .../userspace => tools/usb/usbip}/src/usbip_port.c |  0
 .../usb/usbip}/src/usbip_unbind.c  |  0
 .../userspace => tools/usb/usbip}/src/usbipd.c |  0
 .../userspace => tools/usb/usbip}/src/utils.c  |  0
 .../userspace => tools/usb/usbip}/src/utils.h  |  0
 57 files changed, 1 insertion(+), 31 deletions(-)
 rename drivers/{staging => usb}/usbip/Kconfig (100%)
 rename drivers/{staging => usb}/usbip/Makefile (100%)
 rename drivers/{staging => usb}/usbip/README (100%)
 rename drivers/{staging => usb}/usbip/stub.h (100%)
 rename drivers/{staging => usb}/usbip/stub_dev.c (90%)
 rename drivers/{staging => usb}/usbip/stub_main.c (100%)
 rename drivers/{staging => usb}/usbip/stub_rx.c (100%)
 rename drivers/{staging => usb}/usbip/stub_tx.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_common.h (99%)
 rename drivers/{staging => usb}/usbip/usbip_event.c (100%)
 rename drivers/{staging => usb}/usbip/usbip_protocol.txt (100%)
 rename drivers/{staging => usb}/usbip/vhci.h (100%)
 rename drivers/{staging => usb}/usbip/vhci_hcd.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_rx.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_sysfs.c (100%)
 rename drivers/{staging => usb}/usbip/vhci_tx.c (100%)
 rename {drivers/staging/usbip/uapi => include/uapi/linux}/usbip.h (100%)
 rename {drivers/staging/usbip/userspace => tools/u

[PATCH] rtl8150: Check if RSR is already defined

2014-08-06 Thread Nick Krause
I am getting the following warn

drivers/net/usb/rtl8150.c:30:0: warning: "RSR" redefined
arch/xtensa/include/asm/processor.h:189:0: note: this is the location of the 
previous definition

I wanted to remove RSR as it is not being used but it is not clear if being used
for documenting purpose. undefining should be enough.

Signed-off-by: Nick Krause 
---
 drivers/net/usb/rtl8150.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 6e87e57..7d9a6ba 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -21,6 +21,10 @@
 #define DRIVER_AUTHOR "Petko Manolov "
 #define DRIVER_DESC "rtl8150 based usb-ethernet driver"
 
+#ifdef RSR
+#undef RSR
+#endif
+
 #defineIDR 0x0120
 #defineMAR 0x0126
 #defineCR  0x012e
-- 
2.0.1

--
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 0/3] usbip: move usbip out of staging

2014-08-06 Thread Greg KH
On Thu, Aug 07, 2014 at 08:10:25AM +0300, Valentina Manea wrote:
> This is a resend of the patch series from March.
> 
> After migrating userspace code to libudev, converting usbip-host
> to a device driver and various bug fixes and enhancements, USB/IP
> is fully functional and can be moved out of staging.
> 
> This patch series moves it as following:
> * userspace code to tools/usb/usbip
> * kernel code to drivers/usb/usbip
> 
> Besides this, a warning generated in the kernel code is solved.

What kernel version is this against?

And can we get a maintainer for this code?  I don't want to see it sit
"ownerless" in the kernel tree.  Will you be willing to do this?

thanks,

greg k-h
--
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] rtl8150: Check if RSR is already defined

2014-08-06 Thread David Miller
From: Nick Krause 
Date: Thu,  7 Aug 2014 07:24:54 +0200

> I am getting the following warn
> 
> drivers/net/usb/rtl8150.c:30:0: warning: "RSR" redefined
> arch/xtensa/include/asm/processor.h:189:0: note: this is the location of the 
> previous definition
> 
> I wanted to remove RSR as it is not being used but it is not clear if being 
> used
> for documenting purpose. undefining should be enough.
> 
> Signed-off-by: Nick Krause 

This isn't the right way to fix this.

Rather, the thing to do is to give the macros in this driver an
appropriate prefix such as "RTL8150_" so that they don't collide
with things in the global namespace.
--
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] staging: usbip: vhci_sysfs.c: Fix a style issue

2014-08-06 Thread Lars R. Damerow
Replace a single-value sscanf() call with a call to kstrtou32(), as
recommended by checkpatch.pl.

Signed-off-by: Lars R. Damerow 
---
 drivers/staging/usbip/vhci_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/usbip/vhci_sysfs.c 
b/drivers/staging/usbip/vhci_sysfs.c
index 211f43f..1dfbfa0 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -114,7 +114,7 @@ static ssize_t store_detach(struct device *dev, struct 
device_attribute *attr,
int err;
__u32 rhport = 0;
 
-   if (sscanf(buf, "%u", &rhport) != 1)
+   if (kstrtou32(buf, 10, &rhport) != 1)
return -EINVAL;
 
/* check rhport */
-- 
1.9.3

--
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: [Bug 80711] [PATCH]SG_FLAG_LUN_INHIBIT is no longer implemented and there's not way to prevent the kernel from using the 2nd cdb byte for the LUN

2014-08-06 Thread Christoph Hellwig
On Wed, Aug 06, 2014 at 04:02:22PM -0400, Alan Stern wrote:
> > I doubt either of them forces users to hack up flags for these cases.
> 
> Why was this change needed in the first place?  There's no explanation 
> in the patch itself.

Which chance?  The one to not support SG_FLAG_LUN_INHIBIT?

> 
> > At least for windows I suspect it just never sends the LUN encoded
> > in the CDB and treats USB devices special instead of our insistance
> > on pretending they are SCSI-2.
> 
> We no longer pretend that USB mass-storage devices have any particular 
> SCSI level.  See commit 09b6b51b0b6c.

So the origina reported device must report SCSI-2 all by itself if he's
running a recent kernel, ok.

> > Maybe some of the USB people have on the wire traces or access to
> > device or windows documentation on this?
> 
> Most likely it varies with the version of Windows and the INQUIRY data
> returned by the device.
> 
> I can obtain hardware traces for the kinds of devices and computers 
> lying around here.  But what sort of combinations should I test?

I'd mostly be interested to see if it actualy encodes the LUN in the CDB
for any USB multi-LUN device.
--
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 0/6] usb: host: change TPL support behaviour

2014-08-06 Thread Peter Chen
According to On-The-Go and Embedded Host Supplement to the USB Revision
2.0 Specification, a Targeted Host (non-PC host, OTG or Embedded host)
is not required to support operation with all types of USB peripherals.
It is up to the manufacturer of each Targeted Host to declare which peripherals
the host will support and provide a list of those peripherals. This is called
the Targeted Host's "Targeted Peripheral List" (TPL). The TPL shall accurately
represent the device classes supported by the Targeted Host.

And the TPL support is a must for USB OTG & EH certification test, and TPL
support needs to apply for both OTG and EH, it should be decided by platform
setting.

This patchset changes TPL support behaviour like below:
- Apply possible TPL support for all kinds of host
- Effect TPL in code is decided by both configuration
(CONFIG_USB_OTG_WHITELIST) and platform flag, it can avoid
the enumeration failure by choosing TPL configuration wrongly.

Peter Chen (6):
  usb: hcd: add TPL support flag
  usb: core: TPL should apply for both OTG and EH
  usb: core: Kconfig: TPL should apply for both OTG and EH
  usb: common: add API to get if the platform supports TPL
  usb: chipidea: add TPL support for targeted hosts
  doc: dt-binding: ci-hdrc-imx: add TPL support

 .../devicetree/bindings/usb/ci-hdrc-imx.txt|2 ++
 drivers/usb/chipidea/core.c|4 
 drivers/usb/chipidea/host.c|1 +
 drivers/usb/common/usb-common.c|   15 +
 drivers/usb/core/Kconfig   |   12 +++
 drivers/usb/core/hub.c |   20 +++---
 drivers/usb/core/otg_whitelist.h   |   22 +---
 include/linux/usb/chipidea.h   |1 +
 include/linux/usb/hcd.h|1 +
 include/linux/usb/of.h |5 +
 10 files changed, 45 insertions(+), 38 deletions(-)

-- 
1.7.9.5

--
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 6/6] doc: dt-binding: ci-hdrc-imx: add TPL support

2014-08-06 Thread Peter Chen
TPL (Targeted Peripheral List) is needed for targets host
(OTG and Embedded Hosts) for usb certification and other
vendor specific requirements.

Signed-off-by: Peter Chen 
---
 .../devicetree/bindings/usb/ci-hdrc-imx.txt|2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt 
b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
index 1bae71e..38a5480 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt
@@ -19,6 +19,7 @@ Optional properties:
 - disable-over-current: disable over current detect
 - external-vbus-divider: enables off-chip resistor divider for Vbus
 - maximum-speed: limit the maximum connection speed to "full-speed".
+- tpl-support: TPL (Targeted Peripheral List) feature for targeted hosts
 
 Examples:
 usb@02184000 { /* USB OTG */
@@ -30,4 +31,5 @@ usb@02184000 { /* USB OTG */
disable-over-current;
external-vbus-divider;
maximum-speed = "full-speed";
+   tpl-support;
 };
-- 
1.7.9.5

--
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 4/6] usb: common: add API to get if the platform supports TPL

2014-08-06 Thread Peter Chen
The TPL (Targeted Peripheral List) is used for targeted hosts
(non-PC hosts), and it can be used at USB OTG & EH certification
and some specific products which need white list.

Signed-off-by: Peter Chen 
---
 drivers/usb/common/usb-common.c |   15 +++
 include/linux/usb/of.h  |5 +
 2 files changed, 20 insertions(+)

diff --git a/drivers/usb/common/usb-common.c b/drivers/usb/common/usb-common.c
index 6dfd30a..b530fd4 100644
--- a/drivers/usb/common/usb-common.c
+++ b/drivers/usb/common/usb-common.c
@@ -139,6 +139,21 @@ enum usb_device_speed of_usb_get_maximum_speed(struct 
device_node *np)
 }
 EXPORT_SYMBOL_GPL(of_usb_get_maximum_speed);
 
+/**
+ * of_usb_host_tpl_support - to get if Targeted Peripheral List is supported
+ * for given targeted hosts (non-PC hosts)
+ * @np: Pointer to the given device_node
+ *
+ * The function gets if the targeted hosts support TPL or not
+ */
+bool of_usb_host_tpl_support(struct device_node *np)
+{
+   if (of_find_property(np, "tpl-support", NULL))
+   return true;
+
+   return false;
+}
+EXPORT_SYMBOL_GPL(of_usb_host_tpl_support);
 #endif
 
 MODULE_LICENSE("GPL");
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index 8c38aa2..cfe0528 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -14,6 +14,7 @@
 #if IS_ENABLED(CONFIG_OF)
 enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
 enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np);
+bool of_usb_host_tpl_support(struct device_node *np);
 #else
 static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
 {
@@ -25,6 +26,10 @@ of_usb_get_maximum_speed(struct device_node *np)
 {
return USB_SPEED_UNKNOWN;
 }
+static inline bool of_usb_host_tpl_support(struct device_node *np)
+{
+   return false;
+}
 #endif
 
 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
-- 
1.7.9.5

--
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 1/6] usb: hcd: add TPL support flag

2014-08-06 Thread Peter Chen
The targeted hosts (non-PC hosts) need to have TPL (Targeted Peripheral List)
for USB OTG & EH certification and other vendor specific requirements.

The platform who needs TPL feature should set this flag at usb host
controller driver.

Signed-off-by: Peter Chen 
---
 include/linux/usb/hcd.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 485cd5e..a48c89e 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -144,6 +144,7 @@ struct usb_hcd {
unsignedhas_tt:1;   /* Integrated TT in root hub */
unsignedamd_resume_bug:1; /* AMD remote wakeup quirk */
unsignedcan_do_streams:1; /* HC supports streams */
+   unsignedtpl_support:1; /* OTG & EH TPL support */
 
unsigned intirq;/* irq allocated */
void __iomem*regs;  /* device memory/io */
-- 
1.7.9.5

--
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 2/6] usb: core: TPL should apply for both OTG and EH

2014-08-06 Thread Peter Chen
According to On-The-Go and Embedded Host Supplement to the USB Revision
2.0 Specification, the targeted hosts (non-PC hosts) include both
embedded hosts and otg, and each targeted host product defines the
set of supported peripherals on a TPL (Targeted Peripheral List). So,
TPL should apply for both OTG and embedded host, and the otg support is
not a must for embedded host.

The TPL support feature will only be effect when CONFIG_USB_OTG_WHITELIST
has been chosen and hcd->tpl_support flag is set, it can avoid the enumeration
fails problem for the user who chooses CONFIG_USB_OTG_WHITELIST wrongly.

Signed-off-by: Peter Chen 
---
 drivers/usb/core/hub.c   |   20 +++-
 drivers/usb/core/otg_whitelist.h |   22 ++
 2 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 8a4dcbc..5e0b8eb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2199,9 +2199,7 @@ static void announce_device(struct usb_device *udev)
 static inline void announce_device(struct usb_device *udev) { }
 #endif
 
-#ifdef CONFIG_USB_OTG
 #include "otg_whitelist.h"
-#endif
 
 /**
  * usb_enumerate_device_otg - FIXME (usbcore-internal)
@@ -2261,21 +2259,6 @@ static int usb_enumerate_device_otg(struct usb_device 
*udev)
}
}
}
-
-   if (!is_targeted(udev)) {
-
-   /* Maybe it can talk to us, though we can't talk to it.
-* (Includes HNP test device.)
-*/
-   if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {
-   err = usb_port_suspend(udev, PMSG_SUSPEND);
-   if (err < 0)
-   dev_dbg(&udev->dev, "HNP fail, %d\n", err);
-   }
-   err = -ENOTSUPP;
-   goto fail;
-   }
-fail:
 #endif
return err;
 }
@@ -2319,6 +2302,9 @@ static int usb_enumerate_device(struct usb_device *udev)
if (err < 0)
return err;
 
+   if (!is_targeted(udev))
+   return -ENOTSUPP;
+
usb_detect_interface_quirks(udev);
 
return 0;
diff --git a/drivers/usb/core/otg_whitelist.h b/drivers/usb/core/otg_whitelist.h
index e8cdce5..4d6a134 100644
--- a/drivers/usb/core/otg_whitelist.h
+++ b/drivers/usb/core/otg_whitelist.h
@@ -10,8 +10,8 @@
  */
 
 /*
- * This OTG Whitelist is the OTG "Targeted Peripheral List".  It should
- * mostly use of USB_DEVICE() or USB_DEVICE_VER() entries..
+ * This OTG and Embedded Host Whitelist is "Targeted Peripheral List".
+ * It should mostly use of USB_DEVICE() or USB_DEVICE_VER() entries..
  *
  * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING!
  */
@@ -49,9 +49,9 @@ static struct usb_device_id whitelist_table [] = {
 static int is_targeted(struct usb_device *dev)
 {
struct usb_device_id*id = whitelist_table;
+   struct usb_hcd  *hcd = bus_to_hcd(dev->bus);
 
-   /* possible in developer configs only! */
-   if (!dev->bus->otg_port)
+   if (!IS_ENABLED(CONFIG_USB_OTG_WHITELIST) || !hcd->tpl_support)
return 1;
 
/* HNP test device is _never_ targeted (see OTG spec 6.6.6) */
@@ -99,14 +99,12 @@ static int is_targeted(struct usb_device *dev)
/* add other match criteria here ... */
 
 
-   /* OTG MESSAGE: report errors here, customize to match your product */
-   dev_err(&dev->dev, "device v%04x p%04x is not supported\n",
-   le16_to_cpu(dev->descriptor.idVendor),
-   le16_to_cpu(dev->descriptor.idProduct));
-#ifdef CONFIG_USB_OTG_WHITELIST
+   /*
+* Required error message for OTG & EH compliance test,
+* customize it to match your product
+*/
+   dev_err(&dev->dev, "unsupported device\n");
+
return 0;
-#else
-   return 1;
-#endif
 }
 
-- 
1.7.9.5

--
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 3/6] usb: core: Kconfig: TPL should apply for both OTG and EH

2014-08-06 Thread Peter Chen
Update configuration for USB_OTG_WHITELIST, any targeted hosts
(non PC-hosts) can have TPL (Targered Peripheral List).

Signed-off-by: Peter Chen 
---
 drivers/usb/core/Kconfig |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 1060657..9cfda6a 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -56,22 +56,16 @@ config USB_OTG
  connector.
 
 config USB_OTG_WHITELIST
-   bool "Rely on OTG Targeted Peripherals List"
-   depends on USB_OTG || EXPERT
-   default y if USB_OTG
+   bool "Rely on OTG and EH Targeted Peripherals List"
+   depends on USB
help
  If you say Y here, the "otg_whitelist.h" file will be used as a
  product whitelist, so USB peripherals not listed there will be
  rejected during enumeration.  This behavior is required by the
- USB OTG specification for all devices not on your product's
+ USB OTG and EH specification for all devices not on your product's
  "Targeted Peripherals List".  "Embedded Hosts" are likewise
  allowed to support only a limited number of peripherals.
 
- Otherwise, peripherals not listed there will only generate a
- warning and enumeration will continue.  That's more like what
- normal Linux-USB hosts do (other than the warning), and is
- convenient for many stages of product development.
-
 config USB_OTG_BLACKLIST_HUB
bool "Disable external hubs"
depends on USB_OTG || EXPERT
-- 
1.7.9.5

--
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 5/6] usb: chipidea: add TPL support for targeted hosts

2014-08-06 Thread Peter Chen
For OTG and Embedded hosts, they may need TPL (Targeted Peripheral List)
for usb certification and other vender specific requirements, the
platform can tell chipidea core driver if it supports tpl through DT
or platform data.

Signed-off-by: Peter Chen 
---
 drivers/usb/chipidea/core.c  |4 
 drivers/usb/chipidea/host.c  |1 +
 include/linux/usb/chipidea.h |1 +
 3 files changed, 6 insertions(+)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 619d13e..41d45a1 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -473,6 +473,10 @@ static int ci_get_platdata(struct device *dev,
PTR_ERR(platdata->reg_vbus));
return PTR_ERR(platdata->reg_vbus);
}
+   /* Get TPL support */
+   if (!platdata->tpl_support)
+   platdata->tpl_support =
+   of_usb_host_tpl_support(dev->of_node);
}
 
if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL)
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index a93d950..0d6b24c 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -60,6 +60,7 @@ static int host_start(struct ci_hdrc *ci)
 
hcd->power_budget = ci->platdata->power_budget;
hcd->phy = ci->transceiver;
+   hcd->tpl_support = ci->platdata->tpl_support;
 
ehci = hcd_to_ehci(hcd);
ehci->caps = ci->hw_bank.cap;
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index bbe779f..e14c09a 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -31,6 +31,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT   1
void(*notify_event) (struct ci_hdrc *ci, unsigned event);
struct regulator*reg_vbus;
+   booltpl_support;
 };
 
 /* Default offset of capability registers */
-- 
1.7.9.5

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