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

2016-10-07 Thread Baolin Wang
Hi Neil, On 5 October 2016 at 18:44, NeilBrown wrote: > On Wed, Oct 05 2016, Felipe Balbi wrote: > >> Hi Baolin, >> >> Baolin Wang writes: > But you do! > The mA number from the USB configuration is passed to > usb_gadget_vbus_draw. >

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

2016-10-05 Thread NeilBrown
On Wed, Oct 05 2016, Felipe Balbi wrote: > Hi Baolin, > > Baolin Wang writes: But you do! The mA number from the USB configuration is passed to usb_gadget_vbus_draw. Your patch passes that to usb_charger_set_cur_limit_by_type() which calls

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

2016-10-05 Thread Baolin Wang
Hi Felipe, On 5 October 2016 at 15:47, Felipe Balbi wrote: > > Hi Baolin, > > Baolin Wang writes: But you do! The mA number from the USB configuration is passed to usb_gadget_vbus_draw. Your patch passes that to

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

2016-10-05 Thread Felipe Balbi
Hi Baolin, Baolin Wang writes: >>> But you do! >>> The mA number from the USB configuration is passed to usb_gadget_vbus_draw. >>> Your patch passes that to usb_charger_set_cur_limit_by_type() >>> which calls __usb_charger_set_cur_limit_by_type() which will set the >>>

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

2016-10-05 Thread Baolin Wang
Hi Felipe, >> But you do! >> The mA number from the USB configuration is passed to usb_gadget_vbus_draw. >> Your patch passes that to usb_charger_set_cur_limit_by_type() >> which calls __usb_charger_set_cur_limit_by_type() which will set the >> cur_limit for whichever type uchger->type currently

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

2016-09-18 Thread Baolin Wang
Hi Neil, Sorry for late reply due yo my holiday. On 10 September 2016 at 05:19, NeilBrown wrote: > On Fri, Sep 09 2016, Baolin Wang wrote: > >>> >>> In practice, the USB PHY and the Power manager will often be in the same >>> IC (the PMIC) so the driver for one could look at the

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

2016-09-15 Thread Pavel Machek
Hi! > > That's not actually 100% clear to me - for what the wm831x is doing it > > probably *does* want the higher limit. This is a system inflow limit > > (as it should be for this), at least the charger will adapt to voltage > > variations though other users in the system are much less likely

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

2016-09-14 Thread Mark Brown
On Wed, Sep 14, 2016 at 07:50:00PM +0200, NeilBrown wrote: > On Wed, Sep 14 2016, Mark Brown wrote: > Ah my mistake, sorry. > When earlier you said: > > It's a > > current limiter intended to sit in line with the USB power lines

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

2016-09-14 Thread NeilBrown
On Wed, Sep 14 2016, Mark Brown wrote: > TI do a lot of the more software managed chargers (which I suspect are > the main thing Felipe will have looked at) if that's what you're > referring to here? The device is implementing pretty much the algorithm > you're describing in that e-mail so I'm a

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

2016-09-14 Thread Mark Brown
On Wed, Sep 14, 2016 at 04:11:58PM +0200, NeilBrown wrote: > On Wed, Sep 14 2016, Mark Brown wrote: > > Yes, the idea is that the charger will back off charging and stop > > entirely if the rest of the system is consuming too much power to allow > > it to continue effectively. The same thing

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

2016-09-14 Thread NeilBrown
On Wed, Sep 14 2016, Mark Brown wrote: > [ Unknown signature status ] > On Tue, Sep 13, 2016 at 10:00:28AM +0200, NeilBrown wrote: >> On Mon, Sep 12 2016, Mark Brown wrote: > >> > That's not actually 100% clear to me - for what the wm831x is doing it >> > probably *does* want the higher limit.

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

2016-09-14 Thread Mark Brown
On Tue, Sep 13, 2016 at 10:00:28AM +0200, NeilBrown wrote: > On Mon, Sep 12 2016, Mark Brown wrote: > > That's not actually 100% clear to me - for what the wm831x is doing it > > probably *does* want the higher limit. This is a system inflow limit > > (as it should be for this), at least the

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

2016-09-13 Thread NeilBrown
On Mon, Sep 12 2016, Mark Brown wrote: > [ Unknown signature status ] > On Mon, Sep 12, 2016 at 03:27:18PM +0200, NeilBrown wrote: >> On Mon, Sep 12 2016, Mark Brown wrote: > >> > It's no worse than any other board file situation - if someone has that >> > problem they get to fix it. > >> My

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

2016-09-12 Thread Mark Brown
On Mon, Sep 12, 2016 at 03:27:18PM +0200, NeilBrown wrote: > On Mon, Sep 12 2016, Mark Brown wrote: > > It's no worse than any other board file situation - if someone has that > > problem they get to fix it. > My point is that the present design does not appear to scale beyond a > single USB

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

2016-09-12 Thread NeilBrown
On Mon, Sep 12 2016, Mark Brown wrote: > [ Unknown signature status ] > On Sat, Sep 10, 2016 at 07:57:26AM +1000, NeilBrown wrote: >> On Fri, Sep 09 2016, Mark Brown wrote: > >> > The wm831x driver in the patch series is an example of such hardware - >> > it is purely a power manager, it has no

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

2016-09-12 Thread Mark Brown
On Sat, Sep 10, 2016 at 07:57:26AM +1000, NeilBrown wrote: > On Fri, Sep 09 2016, Mark Brown wrote: > > The wm831x driver in the patch series is an example of such hardware - > > it is purely a power manager, it has no USB PHY hardware at all. It's a > The "probe" routine calls > +

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

2016-09-09 Thread NeilBrown
On Fri, Sep 09 2016, Mark Brown wrote: > [ Unknown signature status ] > On Fri, Sep 09, 2016 at 09:13:31AM +1000, NeilBrown wrote: > >> Conceptually, the PHY is separate from the power manager and a solution >> which recognises that will be more universal. > > The wm831x driver in the patch

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

2016-09-09 Thread NeilBrown
On Fri, Sep 09 2016, Baolin Wang wrote: >> >> In practice, the USB PHY and the Power manager will often be in the same >> IC (the PMIC) so the driver for one could look at the registers for the >> other. >> But there is no guarantee that the hardware works like that. It is >> best to create a

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

2016-09-09 Thread Mark Brown
On Fri, Sep 09, 2016 at 09:13:31AM +1000, NeilBrown wrote: > Conceptually, the PHY is separate from the power manager and a solution > which recognises that will be more universal. The wm831x driver in the patch series is an example of such hardware - it is purely a power manager, it has no USB

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

2016-09-09 Thread Baolin Wang
On 9 September 2016 at 07:13, NeilBrown wrote: > On Thu, Sep 08 2016, Baolin Wang wrote: > >> On 8 September 2016 at 15:31, NeilBrown wrote: >>> On Thu, Sep 08 2016, Baolin Wang wrote: Now the usb charger will not get charger type from 'extcon'

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

2016-09-08 Thread NeilBrown
On Thu, Sep 08 2016, Baolin Wang wrote: > On 8 September 2016 at 15:31, NeilBrown wrote: >> On Thu, Sep 08 2016, Baolin Wang wrote: >>> >>> Now the usb charger will not get charger type from 'extcon' subsystem, >>> we get the charger type from 'power_supply' and calllback >>>

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

2016-09-08 Thread Baolin Wang
On 8 September 2016 at 15:31, NeilBrown wrote: > On Thu, Sep 08 2016, Baolin Wang wrote: > >> Hi Neil, >> >> On 6 September 2016 at 13:40, NeilBrown wrote: >>> On Mon, Aug 29 2016, Baolin Wang wrote: >>> Hi Felipe, On 11 August 2016 at 11:14,

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

2016-09-08 Thread NeilBrown
On Thu, Sep 08 2016, Baolin Wang wrote: > Hi Neil, > > On 6 September 2016 at 13:40, NeilBrown wrote: >> On Mon, Aug 29 2016, Baolin Wang wrote: >> >>> Hi Felipe, >>> >>> On 11 August 2016 at 11:14, Baolin Wang wrote: Hi Felipe, On 1

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

2016-09-08 Thread Baolin Wang
Hi Neil, On 6 September 2016 at 13:40, NeilBrown wrote: > On Mon, Aug 29 2016, Baolin Wang wrote: > >> Hi Felipe, >> >> On 11 August 2016 at 11:14, Baolin Wang wrote: >>> Hi Felipe, >>> >>> On 1 August 2016 at 15:09, Baolin Wang

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

2016-09-06 Thread Felipe Balbi
Hi, NeilBrown writes: > Firstly, you have made the current limit associated with each cable type > configurable (__usb_charger_set_cur_limit_by_type). This is nonsense. > The standard (e.g. BC-1.2) declares what the current limits are. There > is no reason for those not

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

2016-09-05 Thread NeilBrown
On Mon, Aug 29 2016, Baolin Wang wrote: > Hi Felipe, > > On 11 August 2016 at 11:14, Baolin Wang wrote: >> Hi Felipe, >> >> On 1 August 2016 at 15:09, Baolin Wang wrote: >>> Currently the Linux kernel does not provide any standard integration of

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

2016-08-29 Thread Baolin Wang
Hi Felipe, On 11 August 2016 at 11:14, Baolin Wang wrote: > Hi Felipe, > > On 1 August 2016 at 15:09, Baolin Wang wrote: >> Currently the Linux kernel does not provide any standard integration of this >> feature that integrates the USB subsystem

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

2016-08-10 Thread Baolin Wang
Hi Felipe, On 1 August 2016 at 15:09, Baolin Wang wrote: > 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

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

2016-08-01 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