Re: [PATCH v5 3/7] phy: Add set_mode callback

2016-06-21 Thread Kishon Vijay Abraham I
Hi, On Tuesday 10 May 2016 05:09 AM, David Lechner wrote: > The initial use for this is for PHYs that have a mode related to USB OTG. > There are several SoCs (e.g. TI OMAP and DA8xx) that have a mode setting > in the USB PHY to override OTG VBUS and ID signals. > > Of course, the enum can be

stuck after usb_kill_urb

2016-06-21 Thread Saurin G. Suthar
Hi, I am using linux kernel 4.1.15Here is the "lsusb -tv² output (Just shown related devices) # lsusb -tv /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/3p, 12M |__ Port 1: Dev 2, If 0, Class=Communications, Driver=cdc_acm, 12M |__ Port 1: Dev 2, If 1, Class=CDC Data,

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 05:47:47PM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > >> >> >> >> >>> + * @otg_dev: OTG controller device, if needs to be used with > >> >> >> >> >>> OTG core. > >> >> >> >> >> > >> >> >> >> >> do you really know of any platform

[PATCH 3/3] dt-bindings: Document the STM32 USB OTG DWC2 core binding

2016-06-21 Thread Bruno Herrera
Signed-off-by: Bruno Herrera --- Documentation/devicetree/bindings/usb/dwc2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/dwc2.txt b/Documentation/devicetree/bindings/usb/dwc2.txt index 20a68bf..79e5370 100644 ---

[PATCH 2/3] ARM: dts: STM32 Add USB FS host mode support

2016-06-21 Thread Bruno Herrera
Signed-off-by: Bruno Herrera --- arch/arm/boot/dts/stm32f429-disco.dts | 30 ++ arch/arm/boot/dts/stm32f429.dtsi | 33 - arch/arm/boot/dts/stm32f469-disco.dts | 30 ++ 3 files

[PATCH 1/3] usb: dwc2: Add support for STM32F429/439/469 USB OTG in FS mode with internal PHY

2016-06-21 Thread Bruno Herrera
Signed-off-by: Bruno Herrera --- drivers/usb/dwc2/core.c | 18 ++ drivers/usb/dwc2/core.h | 5 + drivers/usb/dwc2/hcd.c | 12 +++- drivers/usb/dwc2/hw.h | 2 ++ drivers/usb/dwc2/platform.c | 37

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 22:50, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: This patch introduces the usb charger driver based on usb gadget that makes an enhancement to a power driver. It works well in practice but that requires a

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:53, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: > Can't you just tie a charger to a UDC and avoid the charger class > completely? Yeah, I also hope so. But we really want something to manage

Re: [PATCH 08/12] doc: binding: pwrseq-usb-generic: add binding doc for generic usb power sequence driver

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 04:26:53PM -0500, Rob Herring wrote: > On Tue, Jun 21, 2016 at 10:11:17AM +0800, Peter Chen wrote: > > On Mon, Jun 20, 2016 at 11:16:07AM -0500, Rob Herring wrote: > > > On Mon, Jun 20, 2016 at 07:26:51PM +0800, Peter Chen wrote: > > > > On Fri, Jun 17, 2016 at 12:16:48PM

[PATCH 2/3] usb: gadget: composite: ability for USB functions to process control requests in config 0

2016-06-21 Thread Felix Hädicke
It can sometimes be necessary for gadget drivers to process non-standard control requests, which host devices can send without having sent USB_REQ_SET_CONFIGURATION. Therefore, the req_match() usb_function method is enhanced with the new parameter "config0". When a USB configuration is active,

[PATCH 3/3] usb: gadget: f_fs: handle control requests in config 0

2016-06-21 Thread Felix Hädicke
Introduces a new FunctionFS descriptor flag named FUNCTIONFS_CONFIG0_SETUP. When this flag is enabled, FunctionFS userspace drivers can process non-standard control requests in configuration 0. Signed-off-by: Felix Hädicke --- drivers/usb/gadget/function/f_fs.c | 5 +++--

[PATCH 1/3] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-06-21 Thread Felix Hädicke
Introduces a new FunctionFS descriptor flag named FUNCTIONFS_ALL_CTRL_RECIP. When this flag is enabled, control requests, which are not explicitly directed to an interface or endpoint, can be handled. This allows FunctionFS userspace drivers to process non-standard control requests.

Re: [PATCHv3 0/2] USB Type-C Connector class

2016-06-21 Thread Guenter Roeck
On Tue, Jun 21, 2016 at 05:51:49PM +0300, Heikki Krogerus wrote: > Hi, > > I'm considering all the RFCs I send after v1 as v2 (I don't remember > how many I send). Hope this is OK and hope there is nothing big > missing anymore (or broken). > > Sorry about the delay. I've been really busy with

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Guenter Roeck
On Tue, Jun 21, 2016 at 09:43:20PM +0200, Oliver Neukum wrote: > On Tue, 2016-06-21 at 06:24 -0700, Guenter Roeck wrote: > > On 06/21/2016 06:08 AM, Oliver Neukum wrote: > > > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > > >> The purpose of this class is to provide unified interface

Re: [PATCH 08/12] doc: binding: pwrseq-usb-generic: add binding doc for generic usb power sequence driver

2016-06-21 Thread Rob Herring
On Tue, Jun 21, 2016 at 10:11:17AM +0800, Peter Chen wrote: > On Mon, Jun 20, 2016 at 11:16:07AM -0500, Rob Herring wrote: > > On Mon, Jun 20, 2016 at 07:26:51PM +0800, Peter Chen wrote: > > > On Fri, Jun 17, 2016 at 12:16:48PM -0500, Rob Herring wrote: > > > > On Fri, Jun 17, 2016 at 5:09 AM,

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Oliver Neukum
On Tue, 2016-06-21 at 16:58 +0300, Heikki Krogerus wrote: > On Tue, Jun 21, 2016 at 03:08:52PM +0200, Oliver Neukum wrote: > > > The firmware will surely want to display something. So it is possible > > that we start the OS will a valid power contract. How do we deal > > with that? Renegotiate?

Re: [PATCHv3 1/2] usb: USB Type-C connector class

2016-06-21 Thread Oliver Neukum
On Tue, 2016-06-21 at 17:51 +0300, Heikki Krogerus wrote: > +What: /sys/class/typec//supported_data_roles > +Data: June 2016 > +Contact: Heikki Krogerus > +Description: > + Lists the USB data roles, host or device, the port is

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Oliver Neukum
On Tue, 2016-06-21 at 06:24 -0700, Guenter Roeck wrote: > On 06/21/2016 06:08 AM, Oliver Neukum wrote: > > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > >> The purpose of this class is to provide unified interface for user > >> space to get the status and basic information about USB

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

2016-06-21 Thread Dinh Nguyen
On 06/21/2016 02:15 PM, John Youn wrote: > > Can you resend this to Philipp Zabel. > > Hi Philipp, > > Could you take this in your reset/next tree? It depends on the > following patch there: > > http://marc.info/?l=linux-usb=146473891018262=2 > I've resent that patch to Philipp. Thanks,

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

2016-06-21 Thread John Youn
On 6/21/2016 1:06 AM, Felipe Balbi wrote: > > Hi, > > John Youn writes: >> On 6/3/2016 8:59 AM, dingu...@opensource.altera.com wrote: >>> From: Dinh Nguyen >>> >>> Allow for platforms that have a reset controller driver in place to bring

[PATCH] usb: renesas_usbhs: make usbhs_write32() static

2016-06-21 Thread Ben Dooks
The usbhs_write32 function is not used outside of the rcar3.c file, so fix the following sparse warning by making it static: drivers/usb/renesas_usbhs/rcar3.c:26:6: warning: symbol 'usbhs_write32' was not declared. Should it be static? Signed-off-by: Ben Dooks ---

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 01:02:59PM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > >> >> So far, I haven't seen anybody talking about real USB OTG (the spec) > >> >> when they say OTG. Usually they just mean "a method for swapping between > >> >> host and

Re: [PATCH v4] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-06-21 Thread Alan Stern
On Tue, 21 Jun 2016, Nicolas Ferre wrote: > Le 21/06/2016 03:32, Wenyou Yang a �crit : > > In order to save power consumption, as a workaround, forcibly suspend > > the USB PORTA/B/C via setting the SUSPEND_A/B/C bits of OHCI Interrupt > > Configuration Register in the SFR while OHCI USB suspend.

Re: [PATCH v4] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-06-21 Thread Nicolas Ferre
Le 21/06/2016 03:32, Wenyou Yang a écrit : > In order to save power consumption, as a workaround, forcibly suspend > the USB PORTA/B/C via setting the SUSPEND_A/B/C bits of OHCI Interrupt > Configuration Register in the SFR while OHCI USB suspend. > > This suspend operation must be done before

Re: [PATCH v4] usb: ohci-at91: Forcibly suspend ports while USB suspend

2016-06-21 Thread Alexandre Belloni
On 21/06/2016 at 09:32:44 +0800, Wenyou Yang wrote : > In order to save power consumption, as a workaround, forcibly suspend > the USB PORTA/B/C via setting the SUSPEND_A/B/C bits of OHCI Interrupt > Configuration Register in the SFR while OHCI USB suspend. > > This suspend operation must be done

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Mark Brown
On Tue, Jun 21, 2016 at 02:50:27PM +0300, Felipe Balbi wrote: > Mark Brown writes: > > The wm831x has no DT support currently. > okay, perhaps its time to add it. The only platform using it would need the DT connector overlays completing in order to be able to convert to

[PATCHv3 0/2] USB Type-C Connector class

2016-06-21 Thread Heikki Krogerus
Hi, I'm considering all the RFCs I send after v1 as v2 (I don't remember how many I send). Hope this is OK and hope there is nothing big missing anymore (or broken). Sorry about the delay. I've been really busy with some internal tasks. I'm guessing we missed v4.8 with this thing. I'm sorry

[PATCHv3 1/2] usb: USB Type-C connector class

2016-06-21 Thread Heikki Krogerus
The purpose of USB Type-C connector class is to provide unified interface for the user space to get the status and basic information about USB Type-C connectors on a system, control over data role swapping, and when USB PD is available, also control over power role swapping and Alternate Modes.

[PATCHv3 2/2] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2016-06-21 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/Kconfig | 14 ++ drivers/usb/typec/Makefile | 1 +

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> This patch introduces the usb charger driver based on usb gadget that >>> makes an enhancement to a power driver. It works well in practice but >>> that requires a system with suitable hardware. >>> >>> The basic conception of the usb charger

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> >> >> >>> + * @otg_dev: OTG controller device, if needs to be used with >> >> >> >> >>> OTG core. >> >> >> >> >> >> >> >> >> >> do you really know of any platform which has a separate OTG >> >> >> >> >> controller? >> >> >> >> >> >> >> >>

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Can't you just tie a charger to a UDC and avoid the charger class >> completely? > > Yeah, I also hope so. But we really want something to manage the > charger devices, do you have any good suggestion to avoid the 'class' > but also can manage

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Heikki Krogerus
On Tue, Jun 21, 2016 at 03:08:52PM +0200, Oliver Neukum wrote: > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > > The purpose of this class is to provide unified interface for user > > space to get the status and basic information about USB Type-C > > Connectors in the system, control

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Oliver Neukum
On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: > The purpose of this class is to provide unified interface for user > space to get the status and basic information about USB Type-C > Connectors in the system, control data role swapping, and when USB PD > is available, also power role

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 03:35:00PM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > >> >> >> >>> + * @otg_dev: OTG controller device, if needs to be used with > >> >> >> >>> OTG core. > >> >> >> >> > >> >> >> >> do you really know of any platform which has a

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-06-21 Thread Guenter Roeck
On 06/21/2016 06:08 AM, Oliver Neukum wrote: On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote: The purpose of this class is to provide unified interface for user space to get the status and basic information about USB Type-C Connectors in the system, control data role swapping, and when

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Felipe Balbi writes: > Can't you just tie a charger to a UDC and avoid the charger class > completely? Yeah, I also hope so. But we really want something to manage the charger devices, do you have any good suggestion to avoid the

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 18:25, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> This patch introduces the usb charger driver based on usb gadget that >> makes an enhancement to a power driver. It works well in practice but >> that requires a system with

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: Can't you just tie a charger to a UDC and avoid the charger class completely? >>> >>> Yeah, I also hope so. But we really want something to manage the >>> charger devices, do you have any good suggestion to avoid the

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:36, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Baolin Wang writes: > Baolin Wang writes: >>> Can't you just tie a charger to a UDC and avoid the charger class

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Baolin Wang writes: Can't you just tie a charger to a UDC and avoid the charger class completely? >>> >>> Yeah, I also hope so. But we really want something to manage the >>> charger devices, do you have any

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Baolin Wang writes: Baolin Wang writes: >> Can't you just tie a charger to a UDC and avoid the charger class >> completely? > > Yeah, I also hope so. But we really want

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> >> >>> + * @otg_dev: OTG controller device, if needs to be used with OTG >> >> >> >>> core. >> >> >> >> >> >> >> >> do you really know of any platform which has a separate OTG >> >> >> >> controller? >> >> >> >> >> >> >> > >> >> >> >

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 20:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Baolin Wang writes: > Can't you just tie a charger to a UDC and avoid the charger class > completely? Yeah, I also hope so. But

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: > On 21 June 2016 at 19:03, Mark Brown wrote: >> On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: >>> Baolin Wang writes: >>> > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct

[PATCH 14/14] xhci: get rid of platform data

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus No more users for it. Signed-off-by: Heikki Krogerus Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-plat.c | 5 + include/linux/usb/xhci_pdriver.h | 27

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:49, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>> Can't you just tie a charger to a UDC and avoid the charger class >>> completely? >> >> Yeah, I also hope so. But we really want something to manage the >> charger devices,

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:53, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> On 21 June 2016 at 19:03, Mark Brown wrote: >>> On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: Baolin Wang

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Felipe Balbi
Hi, Mark Brown writes: > [ Unknown signature status ] > On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: >> Baolin Wang writes: >> > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct platform_device >> > *pdev) >> >}

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 11:18:21AM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > >> Peter Chen writes: > >> >> >>> + > >> >> >>> + /* start host */ > >> >> >>> + ret = hcd_ops->add(otg->primary_hcd.hcd, > >> >> >>>

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 19:03, Mark Brown wrote: > On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: >> Baolin Wang writes: >> > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct platform_device >> > *pdev) >> > } >> > }

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Mark Brown
On Tue, Jun 21, 2016 at 01:30:49PM +0300, Felipe Balbi wrote: > Baolin Wang writes: > > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct platform_device > > *pdev) > > } > > } > > + if (wm831x_pdata && wm831x_pdata->usb_gadget) { > > +

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
On 21 June 2016 at 18:27, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> For supporting the usb charger, it adds the usb_charger_init() and >> usb_charger_exit() functions for usb charger initialization and exit. >> >> It will report to the usb

Re: [PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: > For supporting the usb charger, it adds the usb_charger_init() and > usb_charger_exit() functions for usb charger initialization and exit. > > It will report to the usb charger when the gadget state is changed, > then the usb charger can do the

[PATCH 12/14] xhci: plat: adapt to unified device property interface

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus Requesting the only property that the driver needs using the unified device property interface so it will be available for all types of platforms, not just the ones using DT. Signed-off-by: Heikki Krogerus

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

2016-06-21 Thread Felipe Balbi
Hi, Tony Lindgren writes: > * Felipe Balbi [160621 03:06]: >> 8<-- >> vbus = read(VBUS_STATE); /* could be a gpio_get_value() */ >> id = read(ID_STATE); /* could be a

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

2016-06-21 Thread Tony Lindgren
* Felipe Balbi [160621 03:06]: > 8<-- > vbus = read(VBUS_STATE); /* could be a gpio_get_value() */ > id = read(ID_STATE); /* could be a gpio_get_value() */ > > set_role(id); >

[PATCH v7 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy

2016-06-21 Thread Frank Wang
The newer SoCs (rk3366, rk3399) take a different usb-phy IP block than rk3288 and before, and most of phy-related registers are also different from the past, so a new phy driver is required necessarily. Signed-off-by: Frank Wang Suggested-by: Heiko Stuebner

[PATCH] usb: gadget: pch_udc: reorder spin_[un]lock to avoid deadlock

2016-06-21 Thread iari
From: Iago Abal Fixes: d3cb25a12138 (usb: gadget: udc: fix spin_lock in pch_udc) The above commit reordered spin_lock/unlock and now `>lock' is acquired (rather than released) before calling `dev->driver->disconnect', `dev->driver->setup', `dev->driver->suspend',

[PATCH v7 0/2] Add a new Rockchip usb2 phy driver

2016-06-21 Thread Frank Wang
The newer SoCs (rk3366, rk3399) of Rock-chip take a different usb-phy IP block than rk3288 and before, and most of phy-related registers are also different from the past, so a new phy driver is required necessarily. These series patches add phy-rockchip-inno-usb2.c and the corresponding

Re: [PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: > @@ -607,8 +647,31 @@ static int wm831x_power_probe(struct platform_device > *pdev) > } > } > > + if (wm831x_pdata && wm831x_pdata->usb_gadget) { > + power->usb_charger = > +

[PATCH v7 1/2] Documentation: bindings: add DT documentation for Rockchip USB2PHY

2016-06-21 Thread Frank Wang
Signed-off-by: Frank Wang Acked-by: Rob Herring Reviewed-by: Heiko Stuebner --- Changes in v7: None Changes in v6: - Changed '_' to '-' for otg-id and otg-bvalid property. Changes in v5: - Added 'reg' property to identify the

Re: [PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi, Baolin Wang writes: > This patch introduces the usb charger driver based on usb gadget that > makes an enhancement to a power driver. It works well in practice but > that requires a system with suitable hardware. > > The basic conception of the usb charger is that,

[PATCH 13/14] usb: dwc3: host: use build-in property instead of platform data

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus This should allow xhci to remove handling of platform data. Signed-off-by: Heikki Krogerus Cc: Felipe Balbi Signed-off-by: Mathias Nyman ---

Re: [RFC 0/8] usb: phy: msm: various cleanups

2016-06-21 Thread Felipe Balbi
Hi, Arnd Bergmann writes: > I stumbled over this warning last week, which showed up after I had > removed an incorrect patch from my randconfig build setup: > > drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': > drivers/usb/phy/phy-msm-usb.c:1735:14: error:

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> So far, I haven't seen anybody talking about real USB OTG (the spec) >> >> when they say OTG. Usually they just mean "a method for swapping between >> >> host and peripheral roles, but we really don't want all the extra cost >> >> of the OTG

Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy

2016-06-21 Thread Heiko Stübner
Hi Frank, Am Dienstag, 21. Juni 2016, 15:52:45 schrieb Frank Wang: > On 2016/6/20 12:56, Guenter Roeck wrote: > > On Sun, Jun 19, 2016 at 8:32 PM, Frank Wang wrote: > >>> Turns out my problem was one of terminology. Using "suspend" and > >>> "resume" to me suggested

Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy

2016-06-21 Thread Frank Wang
Hi Heiko, On 2016/6/21 17:05, Heiko Stübner wrote: Hi Frank, Am Dienstag, 21. Juni 2016, 15:52:45 schrieb Frank Wang: On 2016/6/20 12:56, Guenter Roeck wrote: On Sun, Jun 19, 2016 at 8:32 PM, Frank Wang wrote: Turns out my problem was one of terminology. Using

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 10:26:00AM +0300, Felipe Balbi wrote: > > Hi, > > >> > >> So far, I haven't seen anybody talking about real USB OTG (the spec) > >> when they say OTG. Usually they just mean "a method for swapping between > >> host and peripheral roles, but we really don't want all the

Re: [PATCH v4 5/5] usb: dwc3: rockchip: add devicetree bindings documentation

2016-06-21 Thread William Wu
Dear Heiko, On 06/20/2016 10:44 PM, Heiko Stübner wrote: Hi William, Am Freitag, 17. Juni 2016, 17:18:59 schrieb William Wu: On 06/17/2016 07:15 AM, Heiko Stübner wrote: Am Donnerstag, 2. Juni 2016, 20:34:56 schrieb William Wu: This patch adds the devicetree documentation required for

[PATCH v12 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-06-21 Thread Baolin Wang
Currently the Linux kernel does not provide any standard integration of this feature that integrates the USB subsystem with the system power regulation provided by PMICs meaning that either vendors must add this in their kernels or USB gadget devices based on Linux (such as mobile phones) may not

[PATCH v12 2/4] gadget: Support for the usb charger framework

2016-06-21 Thread Baolin Wang
For supporting the usb charger, it adds the usb_charger_init() and usb_charger_exit() functions for usb charger initialization and exit. It will report to the usb charger when the gadget state is changed, then the usb charger can do the power things. Signed-off-by: Baolin Wang

[PATCH v12 3/4] gadget: Integrate with the usb gadget supporting for usb charger

2016-06-21 Thread Baolin Wang
When the usb gadget supporting for usb charger is ready, the usb charger can implement the usb_charger_plug_by_gadget() function and usb_charger_exit() function by getting 'struct usb_charger' from 'struct gadget'. Signed-off-by: Baolin Wang Reviewed-by: Li Jun

[PATCH v12 4/4] power: wm831x_power: Support USB charger current limit management

2016-06-21 Thread Baolin Wang
Integrate with the newly added USB charger interface to limit the current we draw from the USB input based on the input device configuration identified by the USB stack, allowing us to charge more quickly from high current inputs without drawing more current than specified from others.

[PATCH v12 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
This patch introduces the usb charger driver based on usb gadget that makes an enhancement to a power driver. It works well in practice but that requires a system with suitable hardware. The basic conception of the usb charger is that, when one usb charger is added or removed by reporting from

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> Peter Chen writes: >> >> >>> + >> >> >>> + /* start host */ >> >> >>> + ret = hcd_ops->add(otg->primary_hcd.hcd, >> >> >>> +otg->primary_hcd.irqnum, >> >> >>> +

Re: [PATCH v4 5/5] usb: dwc3: rockchip: add devicetree bindings documentation

2016-06-21 Thread Felipe Balbi
Hi, William Wu writes: > This patch adds the devicetree documentation required for Rockchip > USB3.0 core wrapper consisting of USB3.0 IP from Synopsys. > > It supports DRD mode, and could operate in device mode (SS, HS, FS) > and host mode (SS, HS, FS, LS). > >

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

2016-06-21 Thread Peter Chen
On Tue, Jun 21, 2016 at 10:19:32AM +0300, Felipe Balbi wrote: > > Hi, > > Peter Chen writes: > >> >>> + > >> >>> + /* start host */ > >> >>> + ret = hcd_ops->add(otg->primary_hcd.hcd, > >> >>> +

Re: [RESEND PATCH] usb: dwc2: Add reset control to dwc2

2016-06-21 Thread Felipe Balbi
Hi, John Youn writes: > On 6/3/2016 8:59 AM, dingu...@opensource.altera.com wrote: >> From: Dinh Nguyen >> >> Allow for platforms that have a reset controller driver in place to bring >> the USB IP out of reset. >> >> Signed-off-by:

[PATCH 11/14] xhci: rename and simplify last_trb_on_last_seg() helper

2016-06-21 Thread Mathias Nyman
It's only used with rings that have link trbs Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 65 +--- 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c

Re: [RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Baolin Wang
Hi Felipe, On 21 June 2016 at 15:45, Felipe Balbi wrote: > > Hi Baolin, > > Baolin Wang writes: -Original Message- From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- ow...@vger.kernel.org] On Behalf Of Baolin Wang Sent:

[PATCH 09/14] xhci: rework inc_deq() and fix off by one error.

2016-06-21 Thread Mathias Nyman
inc_deq() is called both for rings with link trbs and the event ring without link trbs. The last_trb() check in inc_deq() has a off by one error, going beyond allocated array when checking if trb == [TRBS_PER_SEGMENT], and the whole inc_deq() depend on this. Rewrite the inc_deq() funciton, remove

[PATCH 10/14] xhci: remove enqueue_is_link() helper

2016-06-21 Thread Mathias Nyman
Only used in one place, replace with trb_is_link() helper Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index

Re: [RFC][PATCH] usb: gadget: Allow to build both USB functions and legacy gadgets

2016-06-21 Thread Felipe Balbi
Krzysztof Opasiak writes: > Hi, > > On Tue, Jun 7, 2016 at 3:27 AM, Peter Chen wrote: >> On Mon, Jun 06, 2016 at 09:40:33PM +0200, Krzysztof Opasiak wrote: >>> Currently it is possible to build in some subset of usb functions >>> *OR* some gadget

Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy

2016-06-21 Thread Frank Wang
Hi Heiko, On 2016/6/20 12:56, Guenter Roeck wrote: Hi Frank, On Sun, Jun 19, 2016 at 8:32 PM, Frank Wang wrote: Hi Heiko & Guenter, On 2016/6/20 11:00, Guenter Roeck wrote: On Sun, Jun 19, 2016 at 6:27 PM, Frank Wang wrote: Hi

Re: [PATCH v3 00/13] usb: dwc2: Fix up gadget isochronous support

2016-06-21 Thread Felipe Balbi
Hi, John Youn writes: > On 5/25/2016 6:06 PM, John Youn wrote: >> The following patch series fixes up isochronous support for the dwc2 >> gadget. The existing isochronous support lacked a few features. Most >> notably it did not properly sync up with the first packet and

[PATCH 06/14] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-06-21 Thread Mathias Nyman
If the last trb before a link is not packet size aligned, and is not splittable then use a bounce buffer for that chunk of max packet size unalignable data. Allocate a max packet size bounce buffer for every segment of a bulk endpoint ring at the same time as allocating the ring. If we need to

[PATCH 08/14] xhci: use and add separate function for checking for link trbs

2016-06-21 Thread Mathias Nyman
Add a new is_link_trb() function that only checks for link trbs. We want to split generic last_trb() function which is used for both event rings without link trbs, and endpoint and command rings with links. This will allow us to easier check for link trbs added mid segments. Signed-off-by:

[PATCH 07/14] xhci: clean up event ring checks from inc_enq()

2016-06-21 Thread Mathias Nyman
Remove the event ring related checks in inc_enq() Host hardware is the producer of events on the event ring, driver will not queue anything, or call inc_enq() for the event ring. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 64

[PATCH 01/14] xhci: rename ep_ring variable in queue_bulk_tx(), no functional change

2016-06-21 Thread Mathias Nyman
Tiny change, a bit more readable. The real reason for this change is that the coming td fragment work had several over 80 lines character lines split just because of a few extra characters in variable names. no functional changes Signed-off-by: Mathias Nyman ---

[PATCH 04/14] xhci: don't rely on precalculated value of needed trbs in the enqueue loop

2016-06-21 Thread Mathias Nyman
Queue trbs until all payload data in the urb is tranferred. The actual number of trbs might need to change from the pre-calculated number when the packet alignment restrictions for td fragments in xhci 4.11.7.1 are taken into account. Long term plan is to get rid of calculating the needed trbs

[PATCH 05/14] xhci: align the last trb before link if it is easily splittable.

2016-06-21 Thread Mathias Nyman
TD fragments section 4.11.7.1 in xhci specs have additional requirements on how trbs in TDs must be organized. TD fragments shall not span transfer ring segments and TD fragments must be packet aligned. Normally we don't care about TD fragments, on TD is one big fragment, but if a TD spans ring

[PATCH 02/14] xhci: properly prepare zero packet TD after normal bulk TD.

2016-06-21 Thread Mathias Nyman
If a zero-length packet is needed after a bulk transfer, then an additional zero length TD was prepared before enqueueing the bulk transfer This set up the zero packet TD structure with incorrect td->start_seg and td->first_trb pointers. Prepare the zero packet TD after the data bulk TD is

[PATCH 03/14] xhci: use boolean to indicate last trb in td remainder calculation

2016-06-21 Thread Mathias Nyman
We only need to know if we are queuing the last trb for a TD when calculating the td remainder field. The total number of trbs left is not used. We won't be able to trust the pre-calculated number of trbs used if we need to align trb data by splitting or merging trbs in order to satisfy comply

[PATCH 00/14] xhci features for usb-next

2016-06-21 Thread Mathias Nyman
Hi Greg These patches for 4.8 contain td-fragment work that ensures bulk tranfers finally follows the aligment requirements in the xhci specs. Also reworking helper functions for checking last and link trbs, and cleanups for platform data -Mathias Heikki Krogerus (3): xhci: plat: adapt to

Re: [RESEND PATCH v11 1/4] gadget: Introduce the usb charger framework

2016-06-21 Thread Felipe Balbi
Hi Baolin, Baolin Wang writes: >>> -Original Message- >>> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb- >>> ow...@vger.kernel.org] On Behalf Of Baolin Wang >>> Sent: Monday, June 13, 2016 4:47 PM >>> To: ba...@kernel.org; gre...@linuxfoundation.org;

[PATCH] usb: dwc3: gadget: issue ENDTRANSFER conditional on resource_index

2016-06-21 Thread Felipe Balbi
Because of recent changes to transfer handling on DWC3, we will not get XferComplete unless we completely fill up our TRB ring. This means that we might get a Reset or Disconnect without getting a XferComplete first. In order to correctly release our allocated Transfer Resource, we must issue

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

2016-06-21 Thread Felipe Balbi
Hi, Yoshihiro Shimoda writes: > Hi Roger, > >> From: Roger Quadros >> Sent: Monday, June 20, 2016 7:13 PM >> >> Hi, >> >> On 20/06/16 10:45, Felipe Balbi wrote: > < snip > >> >> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h >> >> index

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> >> > 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 >> >>

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

2016-06-21 Thread Felipe Balbi
Hi, Peter Chen writes: >> >>> + >> >>> +/* start host */ >> >>> +ret = hcd_ops->add(otg->primary_hcd.hcd, >> >>> + otg->primary_hcd.irqnum, >> >>> +

  1   2   >