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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> Pavel Machek writes: >> > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: >> >> >> >> Hi, >> >> >> >> Felipe Balbi writes: >> >> >> But cellphone user knows what he connected his charger to, and that's >> >> >> why it

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> Pavel Machek writes: >> > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: >> >> >> >> Hi, >> >> >> >> Felipe Balbi writes: >> >> >> But cellphone user knows what he connected his charger to, and that's >> >> >> why it is useful to be able to lower the current.

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> > Of course, we may do something sensible by default. But manual >> > controls should still be present. You called them "stupid" but they >> > are not. >> > >> > Note that just because you detected wall charger does not even mean >> > you are connected

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> > Of course, we may do something sensible by default. But manual >> > controls should still be present. You called them "stupid" but they >> > are not. >> > >> > Note that just because you detected wall charger does not even mean >> > you are connected to wall

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

2016-04-18 Thread Pavel Machek
Hi! > > Of course, we may do something sensible by default. But manual > > controls should still be present. You called them "stupid" but they > > are not. > > > > Note that just because you detected wall charger does not even mean > > you are connected to wall charger. See the link below. > >

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

2016-04-18 Thread Pavel Machek
Hi! > > Of course, we may do something sensible by default. But manual > > controls should still be present. You called them "stupid" but they > > are not. > > > > Note that just because you detected wall charger does not even mean > > you are connected to wall charger. See the link below. > >

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 14:42:58, Felipe Balbi wrote: > > Hi, > > Pavel Machek writes: > > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: > >> > >> Hi, > >> > >> Felipe Balbi writes: > >> >> But cellphone user knows what he connected his charger to, and that's > >>

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 14:42:58, Felipe Balbi wrote: > > Hi, > > Pavel Machek writes: > > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: > >> > >> Hi, > >> > >> Felipe Balbi writes: > >> >> But cellphone user knows what he connected his charger to, and that's > >> >> why it is useful to be able

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >> manually ??? Hell no! Charger IC should be able to do this no >> >> problem. I would be surprised if there's any charger IC out there which >> >> blindly connects a 1.8A load from the start. What these ICs do is that >> >> they slowly increment the

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >> manually ??? Hell no! Charger IC should be able to do this no >> >> problem. I would be surprised if there's any charger IC out there which >> >> blindly connects a 1.8A load from the start. What these ICs do is that >> >> they slowly increment the load and check

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: >> >> Hi, >> >> Felipe Balbi writes: >> >> But cellphone user knows what he connected his charger to, and that's >> >> why it is useful to be able to lower the current. Even when you

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: >> >> Hi, >> >> Felipe Balbi writes: >> >> But cellphone user knows what he connected his charger to, and that's >> >> why it is useful to be able to lower the current. Even when you said >> >> "less is just stupid" I

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

2016-04-18 Thread Pavel Machek
Hi! On Mon 2016-04-18 10:59:23, David Laight wrote: > From: Pavel Machek > > Sent: 18 April 2016 11:40 > ... > > > >> > Actually, less is not stupid. Charging li-ion battery from li-ion > > > >> > battery might > > > >> > be stupid. Imagine I'm on train, with device like N900 (50% battery) > >

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

2016-04-18 Thread Pavel Machek
Hi! On Mon 2016-04-18 10:59:23, David Laight wrote: > From: Pavel Machek > > Sent: 18 April 2016 11:40 > ... > > > >> > Actually, less is not stupid. Charging li-ion battery from li-ion > > > >> > battery might > > > >> > be stupid. Imagine I'm on train, with device like N900 (50% battery) > >

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

2016-04-18 Thread David Laight
From: Pavel Machek > Sent: 18 April 2016 11:40 ... > > >> > Actually, less is not stupid. Charging li-ion battery from li-ion > > >> > battery might > > >> > be stupid. Imagine I'm on train, with device like N900 (50% battery) > > >> > and power bank > > >> > (3Ah). I'm actively using the

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

2016-04-18 Thread David Laight
From: Pavel Machek > Sent: 18 April 2016 11:40 ... > > >> > Actually, less is not stupid. Charging li-ion battery from li-ion > > >> > battery might > > >> > be stupid. Imagine I'm on train, with device like N900 (50% battery) > > >> > and power bank > > >> > (3Ah). I'm actively using the

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >> > a) you are connected to a dedicated charger >> >> > >> >> > In this case, you can get up to 2000mA depending on the charger. >> >> > >> >> > If $this charger can give you or not 2000mA is not detectable, >> >> > so what do

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >> > a) you are connected to a dedicated charger >> >> > >> >> > In this case, you can get up to 2000mA depending on the charger. >> >> > >> >> > If $this charger can give you or not 2000mA is not detectable, >> >> > so what do charging ICs do

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: > > Hi, > > Felipe Balbi writes: > >> But cellphone user knows what he connected his charger to, and that's > >> why it is useful to be able to lower the current. Even when you said > >> "less is just stupid" I demonstrated it is

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 13:55:17, Felipe Balbi wrote: > > Hi, > > Felipe Balbi writes: > >> But cellphone user knows what he connected his charger to, and that's > >> why it is useful to be able to lower the current. Even when you said > >> "less is just stupid" I demonstrated it is not, at least in

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

2016-04-18 Thread Pavel Machek
Hi! > >> manually ??? Hell no! Charger IC should be able to do this no > >> problem. I would be surprised if there's any charger IC out there which > >> blindly connects a 1.8A load from the start. What these ICs do is that > >> they slowly increment the load and check voltage level. They'll

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

2016-04-18 Thread Pavel Machek
Hi! > >> manually ??? Hell no! Charger IC should be able to do this no > >> problem. I would be surprised if there's any charger IC out there which > >> blindly connects a 1.8A load from the start. What these ICs do is that > >> they slowly increment the load and check voltage level. They'll

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

2016-04-18 Thread Felipe Balbi
Hi, Felipe Balbi writes: >> But cellphone user knows what he connected his charger to, and that's >> why it is useful to be able to lower the current. Even when you said >> "less is just stupid" I demonstrated it is not, at least in case when and btw, you haven't demonstrated

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

2016-04-18 Thread Felipe Balbi
Hi, Felipe Balbi writes: >> But cellphone user knows what he connected his charger to, and that's >> why it is useful to be able to lower the current. Even when you said >> "less is just stupid" I demonstrated it is not, at least in case when and btw, you haven't demonstrated anything. You

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > On Mon 2016-04-18 13:30:54, Felipe Balbi wrote: >> >> Hi, >> >> Pavel Machek writes: >> >> > Very often, you want to charge using 1.8A from an old desktop PC. >> >> >> >> if that old desktop's port is not a charging port, you shouldn't

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > On Mon 2016-04-18 13:30:54, Felipe Balbi wrote: >> >> Hi, >> >> Pavel Machek writes: >> >> > Very often, you want to charge using 1.8A from an old desktop PC. >> >> >> >> if that old desktop's port is not a charging port, you shouldn't be >> >> allowed to do that.

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 13:30:54, Felipe Balbi wrote: > > Hi, > > Pavel Machek writes: > >> > Very often, you want to charge using 1.8A from an old desktop PC. > >> > >> if that old desktop's port is not a charging port, you shouldn't be > >> allowed to do that. Not ever. > > > > Yes,

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

2016-04-18 Thread Pavel Machek
On Mon 2016-04-18 13:30:54, Felipe Balbi wrote: > > Hi, > > Pavel Machek writes: > >> > Very often, you want to charge using 1.8A from an old desktop PC. > >> > >> if that old desktop's port is not a charging port, you shouldn't be > >> allowed to do that. Not ever. > > > > Yes, Felipe just

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

2016-04-18 Thread Pavel Machek
Hi! > >> > a) you are connected to a dedicated charger > >> > > >> > In this case, you can get up to 2000mA depending on the charger. > >> > > >> > If $this charger can give you or not 2000mA is not detectable, > >> > so what do charging ICs do ? They slowly increase the

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

2016-04-18 Thread Pavel Machek
Hi! > >> > a) you are connected to a dedicated charger > >> > > >> > In this case, you can get up to 2000mA depending on the charger. > >> > > >> > If $this charger can give you or not 2000mA is not detectable, > >> > so what do charging ICs do ? They slowly increase the

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> > Very often, you want to charge using 1.8A from an old desktop PC. >> >> if that old desktop's port is not a charging port, you shouldn't be >> allowed to do that. Not ever. > > Yes, Felipe just decided that I should not be able to charge my N900 > in

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> > Very often, you want to charge using 1.8A from an old desktop PC. >> >> if that old desktop's port is not a charging port, you shouldn't be >> allowed to do that. Not ever. > > Yes, Felipe just decided that I should not be able to charge my N900 > in useful way.

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

2016-04-18 Thread Pavel Machek
Hi! > >> >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > >> >> > >> >> According to the spec we should always be talking about unit loads (1 > >> >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not > >> >> work for SS capable ports and SS gadgets (we

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

2016-04-18 Thread Pavel Machek
Hi! > >> >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > >> >> > >> >> According to the spec we should always be talking about unit loads (1 > >> >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not > >> >> work for SS capable ports and SS gadgets (we

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > Hi! > >> > It's your HW :-) You tell me if it's really necessary. But, hey, if you >> > get enumerated @500mA, this is the host telling you it _CAN_ give you >> > 500mA. In that case, why wouldn't you ? > > Dunno, perhaps not to drain battery in host too

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: > Hi! > >> > It's your HW :-) You tell me if it's really necessary. But, hey, if you >> > get enumerated @500mA, this is the host telling you it _CAN_ give you >> > 500mA. In that case, why wouldn't you ? > > Dunno, perhaps not to drain battery in host too quickly? > Or

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >> >> >> >> According to the spec we should always be talking about unit loads (1 >> >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not >> >> work for SS

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

2016-04-18 Thread Felipe Balbi
Hi, Pavel Machek writes: >> >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >> >> >> >> According to the spec we should always be talking about unit loads (1 >> >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not >> >> work for SS capable ports and SS

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

2016-04-10 Thread Pavel Machek
Hi! > >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > >> > >> According to the spec we should always be talking about unit loads (1 > >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not > >> work for SS capable ports and SS gadgets (we have quite a

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

2016-04-10 Thread Pavel Machek
Hi! > > It's your HW :-) You tell me if it's really necessary. But, hey, if you > > get enumerated @500mA, this is the host telling you it _CAN_ give you > > 500mA. In that case, why wouldn't you ? Dunno, perhaps not to drain battery in host too quickly? Or perhaps you are charging from external

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

2016-04-10 Thread Pavel Machek
Hi! > >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > >> > >> According to the spec we should always be talking about unit loads (1 > >> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not > >> work for SS capable ports and SS gadgets (we have quite a

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

2016-04-10 Thread Pavel Machek
Hi! > > It's your HW :-) You tell me if it's really necessary. But, hey, if you > > get enumerated @500mA, this is the host telling you it _CAN_ give you > > 500mA. In that case, why wouldn't you ? Dunno, perhaps not to drain battery in host too quickly? Or perhaps you are charging from external

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

2016-04-04 Thread Greg KH
On Mon, Apr 04, 2016 at 09:04:48AM -0700, Mark Brown wrote: > On Mon, Apr 04, 2016 at 01:47:50PM +0300, Felipe Balbi wrote: > > Mark Brown writes: > > > > It does in this new world order. IIRC on an earlier round of review > > > there was some code that didn't use a bus but

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

2016-04-04 Thread Greg KH
On Mon, Apr 04, 2016 at 09:04:48AM -0700, Mark Brown wrote: > On Mon, Apr 04, 2016 at 01:47:50PM +0300, Felipe Balbi wrote: > > Mark Brown writes: > > > > It does in this new world order. IIRC on an earlier round of review > > > there was some code that didn't use a bus but that got complaints

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

2016-04-04 Thread Mark Brown
On Mon, Apr 04, 2016 at 01:47:50PM +0300, Felipe Balbi wrote: > Mark Brown writes: > > It does in this new world order. IIRC on an earlier round of review > > there was some code that didn't use a bus but that got complaints that > > it was trying to reimplement the bus

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

2016-04-04 Thread Mark Brown
On Mon, Apr 04, 2016 at 01:47:50PM +0300, Felipe Balbi wrote: > Mark Brown writes: > > It does in this new world order. IIRC on an earlier round of review > > there was some code that didn't use a bus but that got complaints that > > it was trying to reimplement the bus functionality. > fair

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

2016-04-04 Thread Felipe Balbi
Hi, Mark Brown writes: > On Fri, Apr 01, 2016 at 08:43:10AM +0300, Felipe Balbi wrote: >> Mark Brown writes: > >> > IIRC Greg didn't want new classes? > >> good point. Still, this doesn't seem to fit a but_type IMO. > > It does in this new world order.

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

2016-04-04 Thread Felipe Balbi
Hi, Mark Brown writes: > On Fri, Apr 01, 2016 at 08:43:10AM +0300, Felipe Balbi wrote: >> Mark Brown writes: > >> > IIRC Greg didn't want new classes? > >> good point. Still, this doesn't seem to fit a but_type IMO. > > It does in this new world order. IIRC on an earlier round of review >

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

2016-04-01 Thread Mark Brown
On Fri, Apr 01, 2016 at 08:43:10AM +0300, Felipe Balbi wrote: > Mark Brown writes: > > IIRC Greg didn't want new classes? > good point. Still, this doesn't seem to fit a but_type IMO. It does in this new world order. IIRC on an earlier round of review there was some code

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

2016-04-01 Thread Mark Brown
On Fri, Apr 01, 2016 at 08:43:10AM +0300, Felipe Balbi wrote: > Mark Brown writes: > > IIRC Greg didn't want new classes? > good point. Still, this doesn't seem to fit a but_type IMO. It does in this new world order. IIRC on an earlier round of review there was some code that didn't use a bus

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

2016-03-31 Thread Felipe Balbi
Hi, Mark Brown writes: > On Thu, Mar 31, 2016 at 09:42:58AM +0300, Felipe Balbi wrote: >> Baolin Wang writes: > >> > I want to use bus structure to manage the charger device. Maybe choose >> > class to manage them? > >> I guess a class would fit

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

2016-03-31 Thread Felipe Balbi
Hi, Mark Brown writes: > On Thu, Mar 31, 2016 at 09:42:58AM +0300, Felipe Balbi wrote: >> Baolin Wang writes: > >> > I want to use bus structure to manage the charger device. Maybe choose >> > class to manage them? > >> I guess a class would fit better in this case. > > IIRC Greg didn't want

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

2016-03-31 Thread Mark Brown
On Thu, Mar 31, 2016 at 09:42:58AM +0300, Felipe Balbi wrote: > Baolin Wang writes: > > I want to use bus structure to manage the charger device. Maybe choose > > class to manage them? > I guess a class would fit better in this case. IIRC Greg didn't want new classes?

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

2016-03-31 Thread Mark Brown
On Thu, Mar 31, 2016 at 09:42:58AM +0300, Felipe Balbi wrote: > Baolin Wang writes: > > I want to use bus structure to manage the charger device. Maybe choose > > class to manage them? > I guess a class would fit better in this case. IIRC Greg didn't want new classes? signature.asc

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 18:06, Felipe Balbi wrote: > Baolin Wang writes: >> [ text/plain ] >> On 31 March 2016 at 16:18, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: +#define

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 18:06, Felipe Balbi wrote: > Baolin Wang writes: >> [ text/plain ] >> On 31 March 2016 at 16:18, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Baolin Wang writes: +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >>> >>> According to the spec we

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

2016-03-31 Thread Felipe Balbi
Baolin Wang writes: > [ text/plain ] > On 31 March 2016 at 16:18, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >> >> According to the

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

2016-03-31 Thread Felipe Balbi
Baolin Wang writes: > [ text/plain ] > On 31 March 2016 at 16:18, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) >> >> According to the spec we should always be talking about unit loads (1 >> unit

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 16:18, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > > According to the spec we should always be talking about unit loads (1 > unit load is

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 16:18, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) > > According to the spec we should always be talking about unit loads (1 > unit load is 100mA for HS/FS/LS and 150mA for SS). Also,

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

2016-03-31 Thread Felipe Balbi
Hi, Baolin Wang writes: > +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) According to the spec we should always be talking about unit loads (1 unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not work for SS

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

2016-03-31 Thread Felipe Balbi
Hi, Baolin Wang writes: > +#define DEFAULT_SDP_CUR_LIMIT(500 - DEFAULT_CUR_PROTECT) According to the spec we should always be talking about unit loads (1 unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not work for SS capable ports and SS

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 14:42, Felipe Balbi wrote: +#define DEFAULT_CUR_PROTECT (50) >>> >>> Where is this coming from ? Also, () are not necessary. >> >> Just want to protect the default current limitation. If that does not >> need, I'll remove it. > > It's your HW :-) You

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

2016-03-31 Thread Baolin Wang
On 31 March 2016 at 14:42, Felipe Balbi wrote: +#define DEFAULT_CUR_PROTECT (50) >>> >>> Where is this coming from ? Also, () are not necessary. >> >> Just want to protect the default current limitation. If that does not >> need, I'll remove it. > > It's your HW :-) You tell me if it's

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

2016-03-31 Thread Felipe Balbi
Baolin Wang writes: >>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig >>> index af5d922..82a5b3c 100644 >>> --- a/drivers/usb/gadget/Kconfig >>> +++ b/drivers/usb/gadget/Kconfig >>> @@ -133,6 +133,13 @@ config U_SERIAL_CONSOLE >>> help >>>

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

2016-03-31 Thread Felipe Balbi
Baolin Wang writes: >>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig >>> index af5d922..82a5b3c 100644 >>> --- a/drivers/usb/gadget/Kconfig >>> +++ b/drivers/usb/gadget/Kconfig >>> @@ -133,6 +133,13 @@ config U_SERIAL_CONSOLE >>> help >>> It supports the

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

2016-03-31 Thread Baolin Wang
On 30 March 2016 at 18:09, Felipe Balbi wrote: >> --- >> drivers/usb/gadget/Kconfig |7 + >> drivers/usb/gadget/Makefile |1 + >> drivers/usb/gadget/charger.c| 669 >> +++ > > It seems to me this should be part of

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

2016-03-31 Thread Baolin Wang
On 30 March 2016 at 18:09, Felipe Balbi wrote: >> --- >> drivers/usb/gadget/Kconfig |7 + >> drivers/usb/gadget/Makefile |1 + >> drivers/usb/gadget/charger.c| 669 >> +++ > > It seems to me this should be part of udc-core's

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

2016-03-31 Thread Felipe Balbi
Mark Brown writes: > [ text/plain ] > On Wed, Mar 30, 2016 at 01:09:00PM +0300, Felipe Balbi wrote: >> Baolin Wang writes: > >> > +#include >> > +#include >> > +#include >> > +#include > >> not very nice to depend on either of or platform_device

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

2016-03-31 Thread Felipe Balbi
Mark Brown writes: > [ text/plain ] > On Wed, Mar 30, 2016 at 01:09:00PM +0300, Felipe Balbi wrote: >> Baolin Wang writes: > >> > +#include >> > +#include >> > +#include >> > +#include > >> not very nice to depend on either of or platform_device here. What about >> PCI-based devices ? > >

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

2016-03-30 Thread Mark Brown
On Wed, Mar 30, 2016 at 01:09:00PM +0300, Felipe Balbi wrote: > Baolin Wang writes: > > +#include > > +#include > > +#include > > +#include > not very nice to depend on either of or platform_device here. What about > PCI-based devices ? The header inclusion

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

2016-03-30 Thread Mark Brown
On Wed, Mar 30, 2016 at 01:09:00PM +0300, Felipe Balbi wrote: > Baolin Wang writes: > > +#include > > +#include > > +#include > > +#include > not very nice to depend on either of or platform_device here. What about > PCI-based devices ? The header inclusion shouldn't be conditional though.

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

2016-03-30 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,

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

2016-03-30 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, when one usb charger > is

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

2016-03-19 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

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

2016-03-19 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 v7 1/4] gadget: Introduce the usb charger framework

2016-03-19 Thread Oliver Neukum
On Wed, 2016-03-16 at 19:46 +0800, Baolin Wang wrote: > 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

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

2016-03-19 Thread Oliver Neukum
On Wed, 2016-03-16 at 19:46 +0800, Baolin Wang wrote: > 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

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

2016-03-19 Thread Baolin Wang
On 16 March 2016 at 20:09, Oliver Neukum wrote: > On Wed, 2016-03-16 at 19:46 +0800, Baolin Wang wrote: >> 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

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

2016-03-19 Thread Baolin Wang
On 16 March 2016 at 20:09, Oliver Neukum wrote: > On Wed, 2016-03-16 at 19:46 +0800, Baolin Wang wrote: >> 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

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

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

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

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

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

2015-12-08 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

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

2015-12-08 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