Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-20 Thread Roger Quadros
Peter, On 20/05/16 04:39, Peter Chen wrote: > On Wed, May 18, 2016 at 03:45:11PM +0300, Roger Quadros wrote: >> On 18/05/16 06:18, Peter Chen wrote: >>> On Mon, May 16, 2016 at 12:51:53PM +0300, Roger Quadros wrote: >>>> On 16/05/16 12:23, Peter Chen wrote: >&

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-19 Thread Roger Quadros
On 18/05/16 17:46, Jun Li wrote: > > I didn't want to have complex Kconfig so decided to have otg as built-in only. What do you want me to change in existing code? and why? >>> >>> Remove those stuff which only for pass diff driver config Like every >>> controller driver need

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 18/05/16 16:12, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Wednesday, May 18, 2016 8:43 PM >> To: Jun Li <jun...@nxp.com>; Peter Chen <hzpeterc...@gmail.com> >> Cc: peter.c...@f

Re: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-18 Thread Roger Quadros
Hi Peter, On 18/05/16 10:45, Peter Chen wrote: > > > On Mon, May 16, 2016 at 5:00 PM, Roger Quadros <rog...@ti.com > <mailto:rog...@ti.com>> wrote: > > On 13/05/16 13:03, Roger Quadros wrote: > > It provides APIs for the following tasks > &

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 18/05/16 06:18, Peter Chen wrote: > On Mon, May 16, 2016 at 12:51:53PM +0300, Roger Quadros wrote: >> On 16/05/16 12:23, Peter Chen wrote: >>> On Mon, May 16, 2016 at 11:26:57AM +0300, Roger Quadros wrote: >>>> Hi, >>>> >>>> On 16/05/16 10:

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 17/05/16 11:28, Jun Li wrote: > Hi Roger, > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Tuesday, May 17, 2016 4:09 PM >> To: Jun Li <jun...@nxp.com>; Peter Chen <hzpeterc...@gmail.com> >> Cc: peter.c...@f

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-17 Thread Roger Quadros
On 17/05/16 10:38, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Monday, May 16, 2016 5:52 PM >> To: Peter Chen <hzpeterc...@gmail.com> >> Cc: peter.c...@freescale.com; ba...@kernel.org; t...@

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-16 Thread Roger Quadros
On 16/05/16 12:23, Peter Chen wrote: > On Mon, May 16, 2016 at 11:26:57AM +0300, Roger Quadros wrote: >> Hi, >> >> On 16/05/16 10:02, Peter Chen wrote: >>> On Fri, May 13, 2016 at 01:03:27PM +0300, Roger Quadros wrote: >>>> + >>>> +static in

Re: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-16 Thread Roger Quadros
On 13/05/16 13:03, Roger Quadros wrote: > It provides APIs for the following tasks > > - Registering an OTG/dual-role capable controller > - Registering Host and Gadget controllers to OTG core > - Providing inputs to and kicking the OTG state machine > > Provide a dual-ro

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-16 Thread Roger Quadros
On 16/05/16 11:13, Peter Chen wrote: > On Mon, May 16, 2016 at 11:01:27AM +0300, Roger Quadros wrote: >> On 16/05/16 05:13, Peter Chen wrote: >>> On Thu, May 12, 2016 at 03:13:48PM +0300, Roger Quadros wrote: >>>> Hi, >>>> >>>>

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-16 Thread Roger Quadros
Hi, On 16/05/16 10:02, Peter Chen wrote: > On Fri, May 13, 2016 at 01:03:27PM +0300, Roger Quadros wrote: >> + >> +static int usb_gadget_connect_control(struct usb_gadget *gadget, bool >> connect) >> +{ >> +struct usb_udc *udc; >> + >> +mutex

Re: [PATCH v8 10/14] usb: otg: add hcd companion support

2016-05-16 Thread Roger Quadros
On 13/05/16 21:13, Rob Herring wrote: > On Fri, May 13, 2016 at 5:03 AM, Roger Quadros <rog...@ti.com> wrote: >> From: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com> >> >> Since some host controller (e.g. EHCI) needs a companion host controlle

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-16 Thread Roger Quadros
On 16/05/16 05:13, Peter Chen wrote: > On Thu, May 12, 2016 at 03:13:48PM +0300, Roger Quadros wrote: >> Hi, >> >> On 12/05/16 13:31, Yoshihiro Shimoda wrote: >>> Hi, >>> >>>> From: Roger Quadros >>>> Sent: Thursday, May 12, 2016 6

[PATCH v8 01/14] usb: hcd: Initialize hcd->flags to 0

2016-05-13 Thread Roger Quadros
5:c005cb64 r4:ee429940 [ 91.759209] handlers: [ 91.759255] [] usb_hcd_irq [usbcore] [ 91.759260] Disabling IRQ #254 Signed-off-by: Roger Quadros <rog...@ti.com> Reviewed-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/core/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH v8 00/14] USB OTG/dual-role framework

2016-05-13 Thread Roger Quadros
o OTG. Here we don't support fancy OTG features like HNP, SRP, on the fly role-swap. The mode of operation is determined based on ID pin (cable type) and the role doesn't change till the cable type changes. -- cheers, -roger Roger Quadros (13): usb: hcd: Initialize hcd->flags to 0 usb: otg-fsm

[PATCH v8 10/14] usb: otg: add hcd companion support

2016-05-13 Thread Roger Quadros
; Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- Documentation/devicetree/bindings/usb/generic.txt | 3 +++ drivers/usb/common/usb-otg.c | 32 --- include/linux/usb/otg.h | 7 ++

[PATCH v8 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined

2016-05-13 Thread Roger Quadros
, from drivers/usb/dwc3/ep0.c:33: include/linux/usb/otg-fsm.h:30:1: warning: "VDBG" redefined In file included from drivers/usb/dwc3/ep0.c:31: include/linux/usb/composite.h:615:1: warning: this is the location of the previous definition Signed-off-by: Roger Quadros <rog...@

[PATCH v8 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-13 Thread Roger Quadros
The OTG core will use struct otg_hcd_ops to interface with the HCD controller. The main purpose of this interface is to avoid directly calling HCD APIs from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB is m. Signed-off-by: Roger Quadros <rog...@ti.

[PATCH v8 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-13 Thread Roger Quadros
This is to prevent missing symbol build error if OTG is enabled (built-in) and HCD core (CONFIG_USB) is module. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/chipidea/otg_fsm.c | 7 +++ drivers/usb/common/usb-ot

[PATCH v8 04/14] usb: otg-fsm: use usb_otg wherever possible

2016-05-13 Thread Roger Quadros
Move otg_fsm into usb_otg and use usb_otg wherever possible in the usb_otg APIs. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/chipidea/ci.h| 1 - drivers/usb/chipidea/core.c | 14 +-- drivers/usb/chipidea/debug

[PATCH v8 07/14] usb: otg: get rid of CONFIG_USB_OTG_FSM in favour of CONFIG_USB_OTG

2016-05-13 Thread Roger Quadros
Let's use CONFIG_USB_OTG as a single config option to enable USB OTG and the OTG FSM. This makes things a lot less confusing. Update all users of CONFIG_USB_OTG_FSM to CONFIG_USB_OTG. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- Docum

[PATCH v8 06/14] usb: gadget.h: Add OTG to gadget interface

2016-05-13 Thread Roger Quadros
The OTG core will use struct otg_gadget_ops to start/stop the gadget controller. The main purpose of this interface is to avoid directly calling usb_gadget_start/stop() from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB_GADGET is m. Signed-off-by: Roger

[PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-13 Thread Roger Quadros
and a different cable type is inserted. As we don't need most of the complex OTG states and OTG timers we implement a lean DRD state machine in usb-otg.c. The DRD state machine is only interested in 2 hardware inputs 'id' and 'b_sess_vld'. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/

[PATCH v8 09/14] usb: of: add an API to get OTG device from USB controller node

2016-05-13 Thread Roger Quadros
The OTG controller and the USB controller can be linked via the 'otg-controller' property in the USB controller's device node. of_usb_get_otg() can be used to get the OTG controller device from the USB controller's device node. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Pete

[PATCH v8 11/14] usb: otg: use dev_dbg() instead of VDBG()

2016-05-13 Thread Roger Quadros
Now that we have a device reference in struct usb_otg let's use dev_dbg() for debug messages. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/common/usb-otg-fsm.c | 19 +++ 1 file changed, 7 insertions(+),

[PATCH v8 12/14] usb: hcd: Adapt to OTG core

2016-05-13 Thread Roger Quadros
. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/core/hcd.c | 55 + include/linux/usb/hcd.h | 4 2 files changed, 59 insertions(+) diff --git a/drivers/usb/core/hcd.c b/driv

[PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-13 Thread Roger Quadros
a circular locking dependency. Ignore softconnect sysfs control when we're in OTG mode as OTG FSM takes care of gadget softconnect using the b_bus_req mechanism. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/gadget/udc/udc-core.c | 194 -- i

[PATCH v8 14/14] usb: host: xhci-plat: Add otg device to platform data

2016-05-13 Thread Roger Quadros
Host controllers that are part of an OTG/dual-role instance need to somehow pass the OTG controller device information to the HCD core. We use platform data to pass the OTG controller device. Signed-off-by: Roger Quadros <rog...@ti.com> Reviewed-by: Peter Chen <peter.c...@nxp.com>

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
Hi, On 12/05/16 13:31, Yoshihiro Shimoda wrote: > Hi, > >> From: Roger Quadros >> Sent: Thursday, May 12, 2016 6:32 PM >> >> Hi, >> >> On 12/05/16 11:34, Roger Quadros wrote: >>> On 12/05/16 07:00, Yoshihiro Shimoda wrote: >>>> Hi,

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
Hi, On 12/05/16 11:34, Roger Quadros wrote: > On 12/05/16 07:00, Yoshihiro Shimoda wrote: >> Hi, >> >>> From: Alan Stern >>> Sent: Wednesday, May 11, 2016 11:47 PM >>> >>> On Wed, 11 May 2016, Roger Quadros wrote: >>> >>

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-12 Thread Roger Quadros
On 12/05/16 07:00, Yoshihiro Shimoda wrote: > Hi, > >> From: Alan Stern >> Sent: Wednesday, May 11, 2016 11:47 PM >> >> On Wed, 11 May 2016, Roger Quadros wrote: >> >>>> What I mean is if you have 2 EHCI controllers with 2 companion >>>&

Re: [PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-12 Thread Roger Quadros
On 12/05/16 11:18, Peter Chen wrote: > On Wed, May 11, 2016 at 03:32:30PM +0300, Roger Quadros wrote: >> Peter, >> >> On 11/05/16 14:02, Roger Quadros wrote: >>> On 11/05/16 09:10, Peter Chen wrote: >>>> On Mon, May 02, 2016 at 03:18:48PM +0300, Rog

[PATCH v8 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Roger Quadros
. NOTE: OTG IRQ handler is yet to be added. This is a preparatory step. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/us

[PATCH v8 0/5] dwc3: omap: fixes and dual-role preparation

2016-05-11 Thread Roger Quadros
map and core.c for shared otg interrupt. v5: Internal revision. Not sent to mailing list. v4: first version that was reviewed. cheers, -roger Roger Quadros (5): usb: dwc3: omap: use request_threaded_irq() usb: dwc3: omap: Mark the interrupt handler as shared usb: dwc3: omap: Don't set POWERPRES

[PATCH v8 5/5] usb: dwc3: core: cleanup IRQ resources

2016-05-11 Thread Roger Quadros
compatibility for a single named interrupt for all 3 interrupts (e.g. for dwc3-pci) and single unnamed interrupt for all 3 interrupts (e.g. old DT). Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/core.c | 10 -- drivers/usb/dwc3/core.h | 3 +++ drivers/usb/dwc3/gadget.

[PATCH v8 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-11 Thread Roger Quadros
ields in the same register." Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index b58546c..dd55e08 100644 --- a/drive

[PATCH v8 2/5] usb: dwc3: omap: Mark the interrupt handler as shared

2016-05-11 Thread Roger Quadros
On OMAPs, OTG events come on the same IRQ so we need to share this IRQ with the OTG device driver. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/us

[PATCH v8 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-11 Thread Roger Quadros
Don't make any decisions regarding VBUS session based on ID status. That is best left to the OTG core. Pass ID and VBUS events independent of each other so that OTG core knows exactly what to do. This makes dual-role with extcon work with OTG irq on OMAP platforms. Signed-off-by: Roger Quadros

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-11 Thread Roger Quadros
On 11/05/16 16:54, Rob Herring wrote: > On Wed, May 04, 2016 at 04:47:18PM +0300, Roger Quadros wrote: >> On 04/05/16 16:17, Rob Herring wrote: >>> On Mon, May 02, 2016 at 03:18:53PM +0300, Roger Quadros wrote: >>>> From: Yoshihiro Shimoda <yoshihiro.shimoda...@

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Roger Quadros
On 11/05/16 15:39, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >>>>> static irqreturn_t dwc3_omap_threaded_interrupt(int irq, void *_omap) >>>>> { >>>>> struct dwc3_omap *omap = _omap; >>>&

Re: [PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-11 Thread Roger Quadros
Peter, On 11/05/16 14:02, Roger Quadros wrote: > On 11/05/16 09:10, Peter Chen wrote: >> On Mon, May 02, 2016 at 03:18:48PM +0300, Roger Quadros wrote: >>> This is to prevent missing symbol build error if OTG is >>> enabled (built-in) and HCD core (CONFIG_USB) is

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Roger Quadros
On 11/05/16 12:47, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >>> Roger Quadros <rog...@ti.com> writes: >>>>>> @@ -497,8 +503,8 @@ static int dwc3_omap_probe(struct platform_device >>>>>>

Re: [PATCH v7 00/14] USB OTG/dual-role framework

2016-05-11 Thread Roger Quadros
On 11/05/16 11:36, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:43PM +0300, Roger Quadros wrote: >> Hi, >> >> This series centralizes OTG/Dual-role functionality in the kernel. >> As of now I've got Dual-role functionality working pretty reliably on >> dra7-

Re: [PATCH v7 09/14] usb: of: add an API to get OTG device from USB controller node

2016-05-11 Thread Roger Quadros
On 11/05/16 11:40, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:52PM +0300, Roger Quadros wrote: >> The OTG controller and the USB controller an be linked via the > > Typo? Will fix. cheers, -roger > > Others are ok for me. > > Acked-by: Peter Chen <

Re: [PATCH v7 08/14] usb: otg: add OTG/dual-role core

2016-05-11 Thread Roger Quadros
On 11/05/16 11:34, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:51PM +0300, Roger Quadros wrote: >> + >> +if (config->otg_work) /* custom otg_work ? */ >> +INIT_WORK(>work, config->otg_work); >> +else >> +INIT_WORK(

Re: [PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-11 Thread Roger Quadros
On 11/05/16 09:10, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:48PM +0300, Roger Quadros wrote: >> This is to prevent missing symbol build error if OTG is >> enabled (built-in) and HCD core (CONFIG_USB) is module. >> >> Signed-off-by: Roger Quadros <rog...@t

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Roger Quadros
Felipe, On 10/05/16 13:12, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >>>> @@ -497,8 +503,8 @@ static int dwc3_omap_probe(struct platform_device >>>> *pdev) >>>>/* check the DMA Status */ >&g

Re: [PATCH v7 5/5] usb: dwc3: core: cleanup IRQ resources

2016-05-10 Thread Roger Quadros
On 10/05/16 13:14, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >>>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>>> index 186a886..2e20892 100644 >>>> --- a/drivers/usb/dwc3/core.h >>>

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Roger Quadros
On 10/05/16 13:04, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> On 10/05/16 12:54, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros <rog...@ti.com> writes: >>>> TRM [1] recommends

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Roger Quadros
On 10/05/16 13:04, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> On 10/05/16 12:54, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros <rog...@ti.com> writes: >>>> TRM [1] recommends

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-10 Thread Roger Quadros
On 10/05/16 13:12, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >>>> @@ -497,8 +503,8 @@ static int dwc3_omap_probe(struct platform_device >>>> *pdev) >>>>/* check the DMA Status */ >>>>reg = d

Re: [PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Roger Quadros
On 10/05/16 13:05, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> On 10/05/16 12:55, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros <rog...@ti.com> writes: >>>> Don't make any decision

Re: [PATCH v7 5/5] usb: dwc3: core: cleanup IRQ resources

2016-05-10 Thread Roger Quadros
On 10/05/16 13:03, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> Implementations might use different IRQs for >> host, gadget and OTG so use named interrupt resources >> to allow Device tree to specify the 3 interrupts. >

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-10 Thread Roger Quadros
On 10/05/16 12:58, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> We intend to share this interrupt with the OTG driver an to ensure >> that irqflags match for the shared interrupt handlers we use >> request_threaded_irq() >&

Re: [PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Roger Quadros
On 10/05/16 12:55, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> Don't make any decisions regarding VBUS session based on ID >> status. That is best left to the OTG core. >> >> Pass ID and VBUS events independent of each ot

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Roger Quadros
On 10/05/16 12:54, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> TRM [1] recommends that POWERPRESENT bit must not be >> set and left at it's default value of 0. >> >> [1] OMAP542x TRM - http://www.ti.com/lit/pdf/swpu

[PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-10 Thread Roger Quadros
. NOTE: OTG IRQ handler is yet to be added. This is a preparatory step. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c

[PATCH v7 2/5] usb: dwc3: omap: Mark the interrupt handler as shared

2016-05-10 Thread Roger Quadros
On OMAPs, OTG events come on the same IRQ so we need to share this IRQ with the OTG device driver. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/us

[PATCH v7 5/5] usb: dwc3: core: cleanup IRQ resources

2016-05-10 Thread Roger Quadros
compatibility for a single named interrupt for all 3 interrupts (e.g. for dwc3-pci) and single unnamed interrupt for all 3 interrupts (e.g. old DT). Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/core.c | 26 -- drivers/usb/dwc3/core.h | 5 + drive

[PATCH v7 0/5] dwc3: omap: fixes and dual-role preparation

2016-05-10 Thread Roger Quadros
. - use tracepoints instead of dev_dbg(). - match IRQ flags in dwc3_omap and core.c for shared otg interrupt. v5: Internal revision. Not sent to mailing list. v4: first version that was reviewed. cheers, -roger Roger Quadros (5): usb: dwc3: omap: use request_threaded_irq() usb: dwc3: omap: Mark

[PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Roger Quadros
Don't make any decisions regarding VBUS session based on ID status. That is best left to the OTG core. Pass ID and VBUS events independent of each other so that OTG core knows exactly what to do. This makes dual-role with extcon work with OTG irq on OMAP platforms. Signed-off-by: Roger Quadros

[PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Roger Quadros
ields in the same register." Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/dwc3/dwc3-omap.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index a30944d..1f7259d 100644 --- a/drive

Re: [PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-10 Thread Roger Quadros
On 10/05/16 11:03, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Tuesday, May 10, 2016 3:35 PM >> To: Peter Chen <hzpeterc...@gmail.com> >> Cc: peter.c...@freescale.com; st...@row

Re: [PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-10 Thread Roger Quadros
On 10/05/16 11:12, Felipe Balbi wrote: > > Hi, > > Roger Quadros <rog...@ti.com> writes: >> On 10/05/16 06:14, Peter Chen wrote: >>> On Mon, May 09, 2016 at 12:45:38PM +0300, Roger Quadros wrote: >>>> On 06/05/16 12:41, Peter Chen wrote: >>

Re: [PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-10 Thread Roger Quadros
On 10/05/16 06:14, Peter Chen wrote: > On Mon, May 09, 2016 at 12:45:38PM +0300, Roger Quadros wrote: >> On 06/05/16 12:41, Peter Chen wrote: >>> On Mon, May 02, 2016 at 03:18:46PM +0300, Roger Quadros wrote: >>>> The OTG core will use struct otg_hcd_ops to interfac

Re: [PATCH v7 11/14] usb: otg: use dev_dbg() instead of VDBG()

2016-05-09 Thread Roger Quadros
On 06/05/16 12:04, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:54PM +0300, Roger Quadros wrote: >> Now that we have a device reference in struct usb_otg >> let's use dev_dbg() for debug messages. >> >> Signed-off-by: Roger Quadros <rog...@ti.com> >> -

Re: [PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-09 Thread Roger Quadros
On 06/05/16 12:41, Peter Chen wrote: > On Mon, May 02, 2016 at 03:18:46PM +0300, Roger Quadros wrote: >> The OTG core will use struct otg_hcd_ops to interface >> with the HCD controller. >> >> The main purpose of this interface is to avoid directly >> c

Re: [PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-04 Thread Roger Quadros
On 04/05/16 16:17, Rob Herring wrote: > On Mon, May 02, 2016 at 03:18:53PM +0300, Roger Quadros wrote: >> From: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com> >> >> Since some host controller (e.g. EHCI) needs a companion host controller >> (e.g. OHCI), thi

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-05-04 Thread Roger Quadros
On 04/05/16 11:03, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Wednesday, May 04, 2016 2:37 PM >> To: Peter Chen <hzpeterc...@gmail.com> >> Cc: Jun Li <jun...@nxp.com>; st.

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-05-04 Thread Roger Quadros
Peter, On 04/05/16 06:35, Peter Chen wrote: > On Tue, May 03, 2016 at 06:44:46PM +0300, Roger Quadros wrote: >> Hi, >> >> On 03/05/16 10:06, Jun Li wrote: >>> Hi >>> >>>>>>>>>>> /** >>>>>>&g

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-05-03 Thread Roger Quadros
Hi, On 03/05/16 10:06, Jun Li wrote: > Hi > > /** > + * usb_gadget_start - start the usb gadget controller and > +connect to bus > + * @gadget: the gadget device to start > + * > + * This is external API for use by OTG core. > + *

[PATCH v7 00/14] USB OTG/dual-role framework

2016-05-02 Thread Roger Quadros
ble type changes. -- cheers, -roger Roger Quadros (13): usb: hcd: Initialize hcd->flags to 0 usb: otg-fsm: Prevent build warning "VDBG" redefined usb: hcd.h: Add OTG to HCD interface usb: otg-fsm: use usb_otg wherever possible usb: otg-fsm: move host controller operations into usb

[PATCH v7 07/14] usb: otg: get rid of CONFIG_USB_OTG_FSM in favour of CONFIG_USB_OTG

2016-05-02 Thread Roger Quadros
Let's use CONFIG_USB_OTG as a single config option to enable USB OTG and the OTG FSM. This makes things a lot less confusing. Update all users of CONFIG_USB_OTG_FSM to CONFIG_USB_OTG. Signed-off-by: Roger Quadros <rog...@ti.com> --- Documentation/usb/chipidea.txt | 2 +- drivers/usb/ch

[PATCH v7 10/14] usb: otg: add hcd companion support

2016-05-02 Thread Roger Quadros
; Signed-off-by: Roger Quadros <rog...@ti.com> --- Documentation/devicetree/bindings/usb/generic.txt | 3 +++ drivers/usb/common/usb-otg.c | 32 --- include/linux/usb/otg.h | 7 - 3 files changed, 32 insertions(+), 10 deleti

[PATCH v7 09/14] usb: of: add an API to get OTG device from USB controller node

2016-05-02 Thread Roger Quadros
The OTG controller and the USB controller an be linked via the 'otg-controller' property in the USB controller's device node. of_usb_get_otg() can be used to get the OTG controller device from the USB controller's device node. Signed-off-by: Roger Quadros <rog...@ti.com> --- Documen

[PATCH v7 01/14] usb: hcd: Initialize hcd->flags to 0

2016-05-02 Thread Roger Quadros
5:c005cb64 r4:ee429940 [ 91.759209] handlers: [ 91.759255] [] usb_hcd_irq [usbcore] [ 91.759260] Disabling IRQ #254 Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/core/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c ind

[PATCH v7 12/14] usb: hcd: Adapt to OTG core

2016-05-02 Thread Roger Quadros
. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/core/hcd.c | 55 + include/linux/usb/hcd.h | 4 2 files changed, 59 insertions(+) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 9484539..cfc8232

[PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-02 Thread Roger Quadros
The OTG core will use struct otg_hcd_ops to interface with the HCD controller. The main purpose of this interface is to avoid directly calling HCD APIs from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB is m. Signed-off-by: Roger Quadros <rog...@ti.

[PATCH v7 08/14] usb: otg: add OTG/dual-role core

2016-05-02 Thread Roger Quadros
and a different cable type is inserted. As we don't need most of the complex OTG states and OTG timers we implement a lean DRD state machine in usb-otg.c. The DRD state machine is only interested in 2 hardware inputs 'id' and 'b_sess_vld'. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/

[PATCH v7 14/14] usb: host: xhci-plat: Add otg device to platform data

2016-05-02 Thread Roger Quadros
Host controllers that are part of an OTG/dual-role instance need to somehow pass the OTG controller device information to the HCD core. We use platform data to pass the OTG controller device. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/host/xhci-plat.c

[PATCH v7 11/14] usb: otg: use dev_dbg() instead of VDBG()

2016-05-02 Thread Roger Quadros
Now that we have a device reference in struct usb_otg let's use dev_dbg() for debug messages. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/common/usb-otg-fsm.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/usb/common/u

[PATCH v7 13/14] usb: gadget: udc: adapt to OTG core

2016-05-02 Thread Roger Quadros
in OTG mode as OTG FSM takes care of gadget softconnect using the b_bus_req mechanism. Signed-off-by: Roger Quadros <rog...@ti.com> --- drivers/usb/gadget/udc/udc-core.c | 161 +++--- include/linux/usb/gadget.h| 4 + 2 files changed, 156 insertions

[PATCH v7 04/14] usb: otg-fsm: use usb_otg wherever possible

2016-05-02 Thread Roger Quadros
Move otg_fsm into usb_otg and use usb_otg wherever possible in the usb_otg APIs. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/chipidea/ci.h| 1 - drivers/usb/chipidea/core.c | 14 +-- drivers/usb/chipidea/debug

[PATCH v7 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined

2016-05-02 Thread Roger Quadros
, from drivers/usb/dwc3/ep0.c:33: include/linux/usb/otg-fsm.h:30:1: warning: "VDBG" redefined In file included from drivers/usb/dwc3/ep0.c:31: include/linux/usb/composite.h:615:1: warning: this is the location of the previous definition Signed-off-by: Roger Quadros <

[PATCH v7 06/14] usb: gadget.h: Add OTG to gadget interface

2016-05-02 Thread Roger Quadros
The OTG core will use struct otg_gadget_ops to start/stop the gadget controller. The main purpose of this interface is to avoid directly calling usb_gadget_start/stop() from the OTG core as they wouldn't be defined in the built-in symbol table if CONFIG_USB_GADGET is m. Signed-off-by: Roger

[PATCH v7 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops

2016-05-02 Thread Roger Quadros
This is to prevent missing symbol build error if OTG is enabled (built-in) and HCD core (CONFIG_USB) is module. Signed-off-by: Roger Quadros <rog...@ti.com> Acked-by: Peter Chen <peter.c...@nxp.com> --- drivers/usb/chipidea/otg_fsm.c | 7 +++ drivers/usb/common/usb-ot

Re: [PATCH v5] kconfig/symbol.c: handle choice_values that depend on 'm' symbols

2016-05-02 Thread Roger Quadros
I assumed that only tristate choice-values can have visibility 'm', > which was wrong: tristate dependencies can result in 'm' > visibility. > > So, add an explicit test if a symbol is of type tristate. > > I am a bit unsure how to handle Tested-By credits when patch

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-04-28 Thread Roger Quadros
On 28/04/16 13:23, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Thursday, April 28, 2016 5:55 PM >> To: Jun Li <jun...@nxp.com>; st...@rowland.harvard.edu; ba...@kernel.org; >> gre...@lin

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-04-28 Thread Roger Quadros
Hi, On 27/04/16 14:22, Roger Quadros wrote: > On 26/04/16 03:07, Jun Li wrote: >> Hi >> >>> -Original Message- >>> From: Roger Quadros [mailto:rog...@ti.com] >>> Sent: Monday, April 25, 2016 10:04 PM >>> To: Jun Li <jun...@nxp.com&

Re: [PATCH v2] xhci: Cleanup only when releasing primary hcd.

2016-04-28 Thread Roger Quadros
0] c0619510 unbind_store+0x120/0x150 > [c00efe47bc20] c06183c4 drv_attr_store+0x64/0xa0 > [c00efe47bc60] c039f1d0 sysfs_kf_write+0x80/0xb0 > [c00efe47bca0] c039e14c kernfs_fop_write+0x18c/0x1f0 > [c00efe47bcf0] c02e962c __vfs_write+0x6c/0x190 > [c0

Re: [PATCH v2] xhci: Cleanup only when releasing primary hcd.

2016-04-28 Thread Roger Quadros
Hi Joe, On 27/04/16 23:41, Joe Lawrence wrote: > Hello Mathias, Roger, Gabriel > > I've been chasing strange MSI / legacy IRQ behavior from xHCI for a > couple days and wanted to report a few things that may be effected by > Gabriel's recent "xhci: Cleanup only when releasing primary hcd" patch

Re: [PATCH v6 07/12] usb: otg: add OTG/dual-role core

2016-04-28 Thread Roger Quadros
On 28/04/16 04:54, Peter Chen wrote: > On Wed, Apr 27, 2016 at 01:59:44PM +0300, Roger Quadros wrote: >> Hi, >> >> On 27/04/16 06:15, Peter Chen wrote: >>> On Tue, Apr 26, 2016 at 04:21:07PM +0800, Peter Chen wrote: >>>> On Tue, Apr 26, 2016 a

Re: [PATCH v6 11/12] usb: core: hub: Notify OTG fsm when A device sets b_hnp_enable

2016-04-27 Thread Roger Quadros
On 18/04/16 10:08, Peter Chen wrote: > On Tue, Apr 05, 2016 at 05:05:16PM +0300, Roger Quadros wrote: >> This is the a_set_b_hnp_enable flag in the OTG state machine >> diagram and must be set when the A-Host has successfully set >> the b_hnp_enable feature of the OTG-

Re: [PATCH] usb: dwc3: omap: get rid of dma_status

2016-04-27 Thread Roger Quadros
Felipe, On 11/04/16 17:18, Roger Quadros wrote: > dma_status bit flag is set but never really used > so get rid of it. > > Reported-by: Felipe Balbi <ba...@kernel.org> > Signed-off-by: Roger Quadros <rog...@ti.com> Gentle ping on this one for -next. Thanks. cheers, -

Re: [PATCH v6 09/12] usb: gadget: udc: adapt to OTG core

2016-04-27 Thread Roger Quadros
On 26/04/16 03:07, Jun Li wrote: > Hi > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Monday, April 25, 2016 10:04 PM >> To: Jun Li <jun...@nxp.com>; st...@rowland.harvard.edu; ba...@kernel.org; >> gre...@linuxfoun

Re: [PATCH v6 07/12] usb: otg: add OTG/dual-role core

2016-04-27 Thread Roger Quadros
Hi Jun, On 26/04/16 05:07, Jun Li wrote: > Hi Roger > >> -Original Message----- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Tuesday, April 05, 2016 10:05 PM >> To: st...@rowland.harvard.edu; ba...@kernel.org; >> gre...@linuxfoundation

Re: [PATCH v6 08/12] usb: hcd: Adapt to OTG core

2016-04-27 Thread Roger Quadros
On 27/04/16 14:00, Roger Quadros wrote: > On 27/04/16 13:16, Jun Li wrote: >> Hi >> >>> >>> + >>> +static struct otg_hcd_ops otg_hcd_intf = { >>> + .add = usb_add_hcd, >>> + .remove = usb_remove_hcd, >>> + .usb_bus

Re: [PATCH v6 08/12] usb: hcd: Adapt to OTG core

2016-04-27 Thread Roger Quadros
On 27/04/16 13:16, Jun Li wrote: > Hi > >> >> + >> +static struct otg_hcd_ops otg_hcd_intf = { >> +.add = usb_add_hcd, >> +.remove = usb_remove_hcd, >> +.usb_bus_start_enum = usb_bus_start_enum, > > Build break if CONFIG_USB_OTG is not enabled: > >

Re: [PATCH v6 07/12] usb: otg: add OTG/dual-role core

2016-04-27 Thread Roger Quadros
@gmail.com] >>>> Sent: Tuesday, April 26, 2016 2:28 PM >>>> To: Jun Li <jun...@nxp.com> >>>> Cc: Roger Quadros <rog...@ti.com>; st...@rowland.harvard.edu; >>>> ba...@kernel.org; gre...@linuxfoundation.org; peter.c...@freescale.com; >

Re: [PATCH v6 07/12] usb: otg: add OTG/dual-role core

2016-04-25 Thread Roger Quadros
Peter, On 21/04/16 09:52, Peter Chen wrote: > On Tue, Apr 05, 2016 at 05:05:12PM +0300, Roger Quadros wrote: >> It provides APIs for the following tasks >> >> - Registering an OTG/dual-role capable controller >> - Registering Host and Gadget controllers to OTG

<    1   2   3   4   5   6   7   8   9   10   >