Re: [PATCH 1/1] usb: chipidea: fix the build error with randconfig

2013-07-10 Thread Alexander Shishkin
Peter Chen writes: > Using below configs, the compile will have error: > ERROR: "ehci_init_driver" undefined! > > .config: > CONFIG_USB_CHIPIDEA=m > CONFIG_USB_CHIPIDEA_HOST=y > CONFIG_USB_CHIPIDEA_DEBUG=y > > The reason is chipidea host uses symbol from ehci, but ehci > is not compiled. Let the

Re: [PATCH] chipidea: bits: Cast PORTSC_PTS and DEVLC_PTS macros

2013-07-10 Thread Alexander Shishkin
Fabio Estevam writes: > Fix the following build warnings on x86: > > drivers/usb/chipidea/core.c: In function 'hw_phymode_configure': > drivers/usb/chipidea/core.c:226:3: warning: large integer implicitly > truncated to unsigned type [-Woverflow] > drivers/usb/chipidea/core.c:230:3: warning: lar

Re: [PATCH] USB: host: Use usb_hcd_platform_shutdown() wherever possible

2013-07-10 Thread Roger Quadros
On 07/09/2013 05:16 PM, Alan Stern wrote: > On Tue, 9 Jul 2013, Roger Quadros wrote: > >> Most HCD drivers are doing the same thing in their ".shutdown" callback >> so it makes sense to use the generic usb_hcd_platform_shutdown() >> handler there. >> >> Signed-off-by: Roger Quadros >> --- >> dri

[PATCH v2] musb: omap: Fix: pass all the resources to musb core

2013-07-10 Thread Kishon Vijay Abraham I
commit 09fc7d (usb: musb: fix incorrect usage of resource pointer) assumes musb core will always have only 2 resources. But for OMAP platforms there can be 3 resources (2 irq resource and 1 iomem resource). Fixed it here. Signed-off-by: Kishon Vijay Abraham I --- Changes from v1: *) Removed redun

Re: [PATCH v2] musb: omap: Fix: pass all the resources to musb core

2013-07-10 Thread Felipe Balbi
On Wed, Jul 10, 2013 at 04:29:22PM +0530, Kishon Vijay Abraham I wrote: > commit 09fc7d (usb: musb: fix incorrect usage of resource pointer) > assumes musb core will always have only 2 resources. But for OMAP > platforms there can be 3 resources (2 irq resource and 1 iomem > resource). Fixed it her

Re: [RFC v3] xhci: fix dma mask setup in xhci.c

2013-07-10 Thread Felipe Balbi
Hi, On Tue, Jul 09, 2013 at 02:43:45PM -0700, Sarah Sharp wrote: > On Tue, Jul 09, 2013 at 02:59:38PM +0300, Felipe Balbi wrote: > > Hi, > > > > On Mon, Jul 08, 2013 at 09:55:15PM -0700, Sarah Sharp wrote: > > > Felipe, Andy, and Seb, I have a couple questions below. > > > > > > On Fri, Jul 05,

Re: [PATCH 1/2] usb: dwc3: adapt to use dr_mode device tree helper

2013-07-10 Thread Felipe Balbi
On Tue, Jul 09, 2013 at 02:16:32PM +0300, Roger Quadros wrote: > Hi, > > On 07/06/2013 03:52 PM, Ruchika Kharwar wrote: > > This patch adapts the dwc3 to use the device tree helper > > "of_usb_get_dr_mode" for the mode of operation of the dwc3 instance > > being probed. > > > > Signed-off-by: Ruc

Re: [PATCH 2/2] [RFC] usb: dwc3: using the maximum_speed to determine if the usb3 phy is needed

2013-07-10 Thread Felipe Balbi
Hi, On Sat, Jul 06, 2013 at 07:53:57AM -0500, Ruchika Kharwar wrote: > When the initialization of usb3 phy fails, when enabled in the system > the dwc3_probe deferral is further qualified by the maximum speed. > In devices such as dra7xx, there are multiple dwc3 instances where the >

Re: [PATCH v2 1/1] usb/gadget: Kconfig: Fix configfs-based RNDIS function build

2013-07-10 Thread Michal Nazarewicz
On Tue, Jul 09 2013, Andrzej Pietrasiewicz wrote: > USB_CONFIGFS_RNDIS depends on USB_U_RNDIS. Select it. > > Reported-by: Fengguang Wu > Signed-off-by: Andrzej Pietrasiewicz > Signed-off-by: Kyungmin Park Acked-by: Michal Nazarewicz > --- > drivers/usb/gadget/Kconfig |1 + > 1 files cha

Edgeport 416 USB to serial convertor

2013-07-10 Thread Brian Peters
I am looking to use an Edgeport 416 USB to serial convertor under SLES SP2. When I plug in the device all 16 serial ports are discovered but after about 2 minutes they spontaneously disconnect and reconnect. Is this a known problem? Is there a newer driver I should be using? Any and all help appr

Re: [PATCH 1/2] usb: dwc3: adapt to use dr_mode device tree helper

2013-07-10 Thread Roger Quadros
On 07/10/2013 02:42 PM, Felipe Balbi wrote: > On Tue, Jul 09, 2013 at 02:16:32PM +0300, Roger Quadros wrote: >> Hi, >> >> On 07/06/2013 03:52 PM, Ruchika Kharwar wrote: >>> This patch adapts the dwc3 to use the device tree helper >>> "of_usb_get_dr_mode" for the mode of operation of the dwc3 instan

Re: [PATCH 1/2] usb: dwc3: adapt to use dr_mode device tree helper

2013-07-10 Thread Felipe Balbi
Hi, On Wed, Jul 10, 2013 at 04:11:52PM +0300, Roger Quadros wrote: > On 07/10/2013 02:42 PM, Felipe Balbi wrote: > > On Tue, Jul 09, 2013 at 02:16:32PM +0300, Roger Quadros wrote: > >> Hi, > >> > >> On 07/06/2013 03:52 PM, Ruchika Kharwar wrote: > >>> This patch adapts the dwc3 to use the device t

Re: [PATCH v2] musb: omap: Fix: pass all the resources to musb core

2013-07-10 Thread Kishon Vijay Abraham I
On Wednesday 10 July 2013 04:57 PM, Felipe Balbi wrote: > On Wed, Jul 10, 2013 at 04:29:22PM +0530, Kishon Vijay Abraham I wrote: >> commit 09fc7d (usb: musb: fix incorrect usage of resource pointer) >> assumes musb core will always have only 2 resources. But for OMAP >> platforms there can be 3 re

Re: [PATCH 1/2] usb: dwc3: adapt to use dr_mode device tree helper

2013-07-10 Thread Roger Quadros
On 07/10/2013 04:35 PM, Felipe Balbi wrote: > Hi, > > On Wed, Jul 10, 2013 at 04:11:52PM +0300, Roger Quadros wrote: >> On 07/10/2013 02:42 PM, Felipe Balbi wrote: >>> On Tue, Jul 09, 2013 at 02:16:32PM +0300, Roger Quadros wrote: Hi, On 07/06/2013 03:52 PM, Ruchika Kharwar wrote: >

Re: [PATCH 2/2] [RFC] usb: dwc3: using the maximum_speed to determine if the usb3 phy is needed

2013-07-10 Thread Ruchika Kharwar
On 07/10/2013 06:46 AM, Felipe Balbi wrote: Hi, On Sat, Jul 06, 2013 at 07:53:57AM -0500, Ruchika Kharwar wrote: When the initialization of usb3 phy fails, when enabled in the system the dwc3_probe deferral is further qualified by the maximum speed. In devices such as dra7xx, th

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Tue, 9 Jul 2013, Devin Heitmueller wrote: > So I hooked up the video and wrote a bit of Perl to parse the ISOC > stream and render the underlying video frames. I can see definitively > that the video returned from the device contains the corruption. This > rules out any sort of DMA or memory

Re: [PATCH] USB: host: Use usb_hcd_platform_shutdown() wherever possible

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Roger Quadros wrote: > On 07/09/2013 05:16 PM, Alan Stern wrote: > > On Tue, 9 Jul 2013, Roger Quadros wrote: > > > >> Most HCD drivers are doing the same thing in their ".shutdown" callback > >> so it makes sense to use the generic usb_hcd_platform_shutdown() > >> handler th

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
Hi Alan, On Wed, Jul 10, 2013 at 10:48 AM, Alan Stern wrote: > Digging into the scheduling code probably won't help much. However you > could try collecting a usbmon trace (see Documentation/usb/usbmon.txt). > This would clearly show the timing of URB submissions and completions. Good suggestio

Re: Edgeport 416 USB to serial convertor

2013-07-10 Thread Greg KH
On Wed, Jul 10, 2013 at 12:09:35PM +, Brian Peters wrote: > I am looking to use an Edgeport 416 USB to serial convertor under SLES SP2. Great, then please contact SuSE for support, as you are paying for it already :) There's nothing we can do with their kernel, as it is different from the lat

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
On Wed, Jul 10, 2013 at 10:58 AM, Devin Heitmueller wrote: >> I bet the problem is related to the usage of the URB_ISO_ASAP flag. >> em28xx_alloc_urbs() sets URB_ISO_ASAP in urb->transfer_flags, and the >> value never gets cleared. In fact, that flag bit is supposed to be set >> only in the first

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > > I bet the problem is related to the usage of the URB_ISO_ASAP flag. > > em28xx_alloc_urbs() sets URB_ISO_ASAP in urb->transfer_flags, and the > > value never gets cleared. In fact, that flag bit is supposed to be set > > only in the first URB of a

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > On Wed, Jul 10, 2013 at 10:58 AM, Devin Heitmueller > wrote: > >> I bet the problem is related to the usage of the URB_ISO_ASAP flag. > >> em28xx_alloc_urbs() sets URB_ISO_ASAP in urb->transfer_flags, and the > >> value never gets cleared. In fact,

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
On Wed, Jul 10, 2013 at 11:40 AM, Alan Stern wrote: >> Nope, that wasn't it. I am now only setting ISO_ASAP in the first >> packet, and I tried both leaving it as in on resubmit and clearing the >> flag prior to resubmit. > > usbmon is the best debugging tool at this point. http://www.devinheitm

[PATCH 1/6] ARM: OMAP3: Enable Hardware Save and Restore for USB Host

2013-07-10 Thread Roger Quadros
To ensure hardware context is restored while resuming from OFF mode we need to enable the Hardware SAR bit for the USB Host power domain. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/powerdomains3xxx_data.c |8 +--- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/a

[PATCH 0/6] USB: Implement runtime idling and remote wakeup for OMAP EHCI controller

2013-07-10 Thread Roger Quadros
Hi, This series implements suspend/resume for the OMAP EHCI host controller during runtime idle. This will cause its parent, the OMAP USB Host Module as well as the USB TLL Module to be put in suspend and hence allow the USB power domain to be put in a lower power state. Then we no longer prevent

[PATCH 2/6] ARM: dts: omap3beagle-xm: Add idle state pins for USB host

2013-07-10 Thread Roger Quadros
Add the Idle state pins for USB host and enable WAKEUP on DIR, DAT0-3, so that the PHY can wakeup the OMAP SoC from sleep on any USB activity (e.g. remote wakeup or connect/disconnect). Signed-off-by: Roger Quadros --- arch/arm/boot/dts/omap3-beagle-xm.dts | 29 +++-- 1

[PATCH 5/6] USB: Support wakeup IRQ for suspended controllers

2013-07-10 Thread Roger Quadros
Some platforms e.g. ehci-omap can generate an interrupt (i.e. remote wakeup) even when the controller is suspended i.e. HW_ACCESSIBLE is cleared. Introduce a flag "has_wakeup_irq" in struct usb_hcd to indicate such cases. We tackle this case by disabling the IRQ, scheduling a hub resume and enabl

[PATCH 3/6] mfd: omap-usb-host: move initialization to module_init()

2013-07-10 Thread Roger Quadros
We no longer need to be initialized in any particular order so move driver initialization to the standard place i.e. module_init() CC: Samuel Ortiz Signed-off-by: Roger Quadros --- drivers/mfd/omap-usb-host.c | 23 +++ drivers/mfd/omap-usb-tll.c | 20 ++-

[PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-10 Thread Roger Quadros
Call ehci_suspend/resume() during runtime suspend/resume as well as system suspend/resume. Use a flag "bound" to indicate that the HCD structures are valid. This is only true between usb_add_hcd() and usb_remove_hcd() calls. The flag can be used by omap_ehci_runtime_suspend/resume() handlers to a

[PATCH 4/6] mfd: omap-usb-host: Put pins in IDLE state on suspend

2013-07-10 Thread Roger Quadros
In order to support wake up from suspend use the pinctrl framework to put the USB host pins in IDLE state during suspend. CC: Samuel Ortiz Signed-off-by: Roger Quadros --- drivers/mfd/omap-usb-host.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > On Wed, Jul 10, 2013 at 11:40 AM, Alan Stern > wrote: > >> Nope, that wasn't it. I am now only setting ISO_ASAP in the first > >> packet, and I tried both leaving it as in on resubmit and clearing the > >> flag prior to resubmit. > > > > usbmon is

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
On Wed, Jul 10, 2013 at 12:30 PM, Alan Stern wrote: > If you use the bus analyzer at the same time, you could compare > microframe numbers. Ah, again, good suggestion. I'll get a usbmon trace in parallel to the Beagle. I'll have to move some stuff around though because I don't want to run the B

[PATCH] option: add Olivetti Olicard 200

2013-07-10 Thread Dan Williams
Speaks AT on interfaces 5 (command & PPP) and 3 (secondary), other interface protocols are unknown. Cc: sta...@vger.kernel.org Signed-off-by: Dan Williams --- diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5dd857d..feda580 100644 --- a/drivers/usb/serial/option.c ++

Re: [PATCH] usb: phy: samsung-usb2: Toggle HSIC GPIO from device tree

2013-07-10 Thread Julius Werner
Hi Felipe, This is intended to pull down a reset signal line, not to switch power to the device. I could implement that with the regulator framework too, but I think that would just be confusing and harder to understand without providing any benefit. It's really just a plain old GPIO. -- To unsubs

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > > I don't see any problems in the usbmon trace, but they might not show > > up there. In particular, the trace includes the status values only for > > the first 5 packets in each URB. Does the driver encounter any packets > > with a nonzero status?

Re: [PATCH 5/6] USB: Support wakeup IRQ for suspended controllers

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Roger Quadros wrote: > Some platforms e.g. ehci-omap can generate an interrupt > (i.e. remote wakeup) even when the controller is suspended i.e. > HW_ACCESSIBLE is cleared. > > Introduce a flag "has_wakeup_irq" in struct usb_hcd to indicate > such cases. > > We tackle this c

Re: [PATCH 6/6] USB: ehci-omap: Implement suspend/resume

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Roger Quadros wrote: > Call ehci_suspend/resume() during runtime suspend/resume > as well as system suspend/resume. > > Use a flag "bound" to indicate that the HCD structures are valid. > This is only true between usb_add_hcd() and usb_remove_hcd() calls. > > The flag can be

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
Hi Alan, On Wed, Jul 10, 2013 at 2:27 PM, Alan Stern wrote: > You inspired me to take a closer look at the usbmon log you made > available. There _is_ an error indication after all; the line with > timestamp 397263317 got an error in one of its 64 packets (but this > was the only error in the en

Re: [PATCH 5/6] USB: Support wakeup IRQ for suspended controllers

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Roger Quadros wrote: > Some platforms e.g. ehci-omap can generate an interrupt > (i.e. remote wakeup) even when the controller is suspended i.e. > HW_ACCESSIBLE is cleared. > > Introduce a flag "has_wakeup_irq" in struct usb_hcd to indicate > such cases. > > We tackle this c

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > Hi Alan, > > On Wed, Jul 10, 2013 at 2:27 PM, Alan Stern wrote: > > You inspired me to take a closer look at the usbmon log you made > > available. There _is_ an error indication after all; the line with > > timestamp 397263317 got an error in one

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
On Wed, Jul 10, 2013 at 3:37 PM, Alan Stern wrote: > 20-30 times each second? Okay... I didn't realize the errors were > that frequent. Yeah, now you see why I'm freaking out. If this were one corrupt line every 20 seconds, I wouldn't care less. But there are lines every few frames of video (

[PATCH] usb: USB host support should depend on HAS_DMA

2013-07-10 Thread Geert Uytterhoeven
If NO_DMA=y: drivers/built-in.o: In function `usb_hcd_unmap_urb_setup_for_dma': drivers/usb/core/hcd.c:1361: undefined reference to `dma_unmap_single' drivers/built-in.o: In function `usb_hcd_unmap_urb_for_dma': drivers/usb/core/hcd.c:1393: undefined reference to `dma_unmap_sg' drivers/usb/core/hc

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > > It's rather disturbing that they don't show up at all in the usbmon > > trace. This suggests two possibilities: > > > > The ehci-hcd driver is so messed up that not only did it fail > > to tell the hardware to send those missing pa

Re: [PATCH] usb: USB host support should depend on HAS_DMA

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Geert Uytterhoeven wrote: > If NO_DMA=y: > > drivers/built-in.o: In function `usb_hcd_unmap_urb_setup_for_dma': > drivers/usb/core/hcd.c:1361: undefined reference to `dma_unmap_single' > ,,, > > Commit d9ea21a779278da06d0cbe989594bf542ed213d7 ("usb: host: make > USB_ARCH_HA

[PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations

2013-07-10 Thread Geert Uytterhoeven
When builtin (CONFIG_USB_FOTG210_UDC=y): LD drivers/usb/gadget/built-in.o WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_probe() The variable fotg210_driver references the function

Re: [PATCH] usb: gadget: fotg210-udc: Remove bogus __init/__exit annotations

2013-07-10 Thread Sergei Shtylyov
On 07/11/2013 01:45 AM, Geert Uytterhoeven wrote: When builtin (CONFIG_USB_FOTG210_UDC=y): LD drivers/usb/gadget/built-in.o WARNING: drivers/usb/gadget/built-in.o(.data+0xbf8): Section mismatch in reference from the variable fotg210_driver to the function .init.text:fotg210_udc_prob

Re: Video corruption varies by system load

2013-07-10 Thread Devin Heitmueller
On Wed, Jul 10, 2013 at 5:21 PM, Alan Stern wrote: >> Yeah, I tried that a few days ago. I did a memset() on the >> transfer_buffer prior to every resubmit, because at one point I >> thought perhaps I was getting back the buffer without it having been >> filled in. > > And you found that the buff

Re: [PATCH] usb: USB host support should depend on HAS_DMA

2013-07-10 Thread Arnd Bergmann
On Wednesday 10 July 2013, Alan Stern wrote: > This isn't right. There are USB host controllers that use PIO, not > DMA. The HAS_DMA dependency should go with the controller driver, not > the USB core. > > On the other hand, the USB core does call various routines like > dma_unmap_single. It

Re: Audio I/O parameters

2013-07-10 Thread James Stone
Hi Clemens, On Mon, Jul 8, 2013 at 2:12 PM, James Stone wrote: >> Acquire audio card Audio0 >> creating alsa driver ... hw:USB,0|-|64|2|44100|0|0|nomon|swmeter|-|16bit >> Using ALSA driver USB-Audio running on card 0 - Focusrite Scarlett 2i4 >> USB at usb-:00:12.2-3, high speed >> configurin

Re: [PATCH] usb: phy: samsung-usb2: Toggle HSIC GPIO from device tree

2013-07-10 Thread Jingoo Han
On Wednesday, July 10, 2013 9:34 AM, Julius Werner wrote: > > This patch adds support for a new 'samsung,hsic-reset-gpio' in the > device tree, which will be interpreted as an active-low reset pin during > PHY initialization when it exists. Useful for intergrated HSIC devices > like an SMSC 3503 h

Re: [PATCH] usb: phy: samsung-usb2: Toggle HSIC GPIO from device tree

2013-07-10 Thread Fabio Estevam
Hi Julius, On Wed, Jul 10, 2013 at 2:42 PM, Julius Werner wrote: > Hi Felipe, > > This is intended to pull down a reset signal line, not to switch power > to the device. I could implement that with the regulator framework > too, but I think that would just be confusing and harder to understand >

Re: [PATCH] usb: USB host support should depend on HAS_DMA

2013-07-10 Thread Alan Stern
On Thu, 11 Jul 2013, Arnd Bergmann wrote: > On Wednesday 10 July 2013, Alan Stern wrote: > > This isn't right. There are USB host controllers that use PIO, not > > DMA. The HAS_DMA dependency should go with the controller driver, not > > the USB core. > > > > On the other hand, the USB core do

Re: [PATCH 1/2] usb: class: move "checking 'actual'" code block into "checking 'buffer[1]'" code block

2013-07-10 Thread Chen Gang
Hello Maintainers: Please help check this patch when you have time, thanks. BTW: this uninitialized variable warning may not be found by gcc compiler (which a gcc bug exists almost 10 years). Thanks. On 07/02/2013 12:06 PM, Chen Gang wrote: > The variable 'actual' is only used in "checking 'buf

Re: Video corruption varies by system load

2013-07-10 Thread Alan Stern
On Wed, 10 Jul 2013, Devin Heitmueller wrote: > So one might ask: why is the em28xx device sending a microframe with > corrupt bytes? One thing I've noticed is immediately prior to any > microframe containing corruption, there was a missing microframe - the > time between the microframe containi

[PATCH v12 10/13] usb: chipidea: add wait vbus lower than OTGSC_BSV before role starts

2013-07-10 Thread Peter Chen
When the gadget role starts, we need to make sure the vbus is lower than OTGSC_BSV, or there will be an vbus interrupt since we use B_SESSION_VALID as vbus interrupt to indicate connect and disconnect. When the host role starts, it may not be useful to wait vbus to lower than OTGSC_BSV, but it can

[PATCH v12 00/13] Add tested id switch and vbus connect detect support for Chipidea

2013-07-10 Thread Peter Chen
This patchset adds tested otg id switch function and vbus connect and disconnect detection for chipidea driver. And fix kinds of bugs found at chipidea drivers after enabling id and vbus detection. This patch is fully tested at imx6 sabresd platform. My chipidea repo: https://github.com/hzpeterche

[PATCH v12 06/13] usb: chipidea: add otg_cap attribute for otg capable

2013-07-10 Thread Peter Chen
Since we need otgsc to know vbus's status at some chipidea controllers even it is peripheral-only mode. Besides, some SoCs (eg, AR9331 SoC) don't have otgsc register even the DCCPARAMS_DC and DCCPARAMS_HC are both 1 at CAP_DCCPARAMS. We inroduce otg_cap attribute to indicate if the controller is ot

[PATCH v12 01/13] usb: chipidea: add vbus regulator control

2013-07-10 Thread Peter Chen
For boards which have board level vbus control (eg, through gpio), we need to vbus operation according to below rules: - For host, we need open vbus before start hcd, and close it after remove hcd. - For otg, the vbus needs to be on/off when usb role switches. When the host roles begins, it opens v

[PATCH v12 03/13] usb: chipidea: udc: otg_set_peripheral is useless for some chipidea users

2013-07-10 Thread Peter Chen
It is useless at below cases: - If we implement both usb host and device at chipidea driver. - If we don't need phy->otg. Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/u

[PATCH v12 02/13] usb: chipidea: imx: remove vbus regulator operation

2013-07-10 Thread Peter Chen
Since we have added vbus reguatlor operation at common host file (chipidea/host.c), the glue layer vbus operation isn't needed any more. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 30 +++--- 1 files changed, 7 insertions(+), 23 deletions(-) diff

[PATCH v12 07/13] usb: chipidea: disable all interrupts and clear all interrupts status

2013-07-10 Thread Peter Chen
During the initialization, it needs to disable all interrupts enable bit as well as clear all interrupts status bits to avoid exceptional interrupt. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drive

[PATCH v12 04/13] usb: chipidea: otg: Add otg file used to access otgsc

2013-07-10 Thread Peter Chen
This file is mainly used to access otgsc currently, it may add otg related things in the future. Signed-off-by: Peter Chen --- drivers/usb/chipidea/Makefile |2 +- drivers/usb/chipidea/bits.h | 10 drivers/usb/chipidea/core.c |3 +- drivers/usb/chipidea/otg.c| 50 +++

[PATCH v12 12/13] usb: chipidea: udc: .pullup is valid when vbus is on at CI_HDRC_PULLUP_ON_VBUS

2013-07-10 Thread Peter Chen
When the flag CI_HDRC_PULLUP_ON_VBUS is set, .pullup should only be called when the vbus is active. When the CI_HDRC_PULLUP_ON_VBUS is set, the controller only begins to run when the vbus is on, So, it is only meaningful software set pullup/pulldown after the controller begins to run. Signed-off-b

[PATCH v12 05/13] usb: chipidea: Add role init and destory APIs

2013-07-10 Thread Peter Chen
- The role's init will be called at probe procedure. - The role's destory will be called at fail patch at probe and driver's removal. - The role's start/stop will be called when specific role has started. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 10 -- drivers/usb/ch

[PATCH v12 09/13] usb: chipidea: add vbus interrupt handler

2013-07-10 Thread Peter Chen
We add vbus interrupt handler at ci_otg_work, it uses OTGSC_BSV(at otgsc) to know it is connect or disconnet event. Meanwhile, we introduce two flags id_event and b_sess_valid_event to indicate it is an id interrupt or a vbus interrupt. Signed-off-by: Peter Chen --- drivers/usb/chipidea/ci.h |

[PATCH v12 13/13] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget

2013-07-10 Thread Peter Chen
When we rmmod gadget, the ci->driver needs to be cleared. Otherwise, we plug in usb cable again, the driver will consider gadget is there, in fact, it was removed. Besides, consolidate the calling of ci->driver->disconnect, when we do rmmod gadget, the gadget's disconnect should be called from udc

[PATCH v12 08/13] usb: chipidea: move otg relate things to otg file

2013-07-10 Thread Peter Chen
Move otg relate things to otg file. Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 63 +-- drivers/usb/chipidea/otg.c | 57 +- drivers/usb/chipidea/otg.h |2 + 3 files changed, 70 insertions(+), 52

[PATCH v12 11/13] usb: chipidea: udc: misuse flag CI_HDRC_REGS_SHARED and CI_HDRC_PULLUP_ON_VBUS

2013-07-10 Thread Peter Chen
CI_HDRC_REGS_SHARED stands for the controller registers is shared with other USB drivers, if all USB drivers are at chipidea/, it doesn't needed to set. CI_HDRC_PULLUP_ON_VBUS stands for pullup dp when the vbus is on. This flag doesn't need to set if the vbus is always on for gadget since dp has al

Re: [PATCH v12 02/13] usb: chipidea: imx: remove vbus regulator operation

2013-07-10 Thread Sascha Hauer
On Thu, Jul 11, 2013 at 02:27:10PM +0800, Peter Chen wrote: > Since we have added vbus reguatlor operation at common > host file (chipidea/host.c), the glue layer vbus operation > isn't needed any more. > > Signed-off-by: Peter Chen > --- > drivers/usb/chipidea/ci_hdrc_imx.c | 30 +++--

Re: [PATCH v12 02/13] usb: chipidea: imx: remove vbus regulator operation

2013-07-10 Thread Peter Chen
On Thu, Jul 11, 2013 at 08:37:19AM +0200, Sascha Hauer wrote: > > > > - /* we only support host now, so enable vbus here */ > > - data->reg_vbus = devm_regulator_get(&pdev->dev, "vbus"); > > - if (!IS_ERR(data->reg_vbus)) { > > - ret = regulator_enable(data->reg_vbus); > > -