* Adding USB charge current property in the Linux Battery core @ 2011-11-09 8:13 ashishj3 2011-11-09 8:20 ` Felipe Balbi 0 siblings, 1 reply; 6+ messages in thread From: ashishj3 @ 2011-11-09 8:13 UTC (permalink / raw) To: linaro-dev, linux-kernel; +Cc: arnd, eric.miao, Mark Brown Hi, For a better performance in USB charging operation, the DA9052/53 charging current can be configured in accordance with the USB host current delivering capacity (known through USB drivers negotiation). To implement this useful feature, a new writable property "USB charge current" needs to be added in the Linux battery core. Let me know your views on it. Regards, Ashish ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Adding USB charge current property in the Linux Battery core 2011-11-09 8:13 Adding USB charge current property in the Linux Battery core ashishj3 @ 2011-11-09 8:20 ` Felipe Balbi 2011-11-09 12:13 ` Ashish Jangam 0 siblings, 1 reply; 6+ messages in thread From: Felipe Balbi @ 2011-11-09 8:20 UTC (permalink / raw) To: ashishj3; +Cc: linaro-dev, linux-kernel, arnd, eric.miao, Mark Brown [-- Attachment #1: Type: text/plain, Size: 791 bytes --] Hi, On Wed, Nov 09, 2011 at 01:43:37PM +0530, ashishj3 wrote: > For a better performance in USB charging operation, the DA9052/53 charging > current can be configured in accordance with the USB host current > delivering capacity (known through USB drivers negotiation). > > To implement this useful feature, a new writable property "USB charge current" > needs to be added in the Linux battery core. > > Let me know your views on it. that's the wrong way to do it. What we need is to use the transceiver notifications to notify every time someone calls usb_gadget_vbus_draw() and pass the mA parameter as argument to the event notification. Charger driver should 'subscribe' to transceiver notifications and use the mA argument to reconfigure charging. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Adding USB charge current property in the Linux Battery core 2011-11-09 8:20 ` Felipe Balbi @ 2011-11-09 12:13 ` Ashish Jangam 2011-11-09 12:19 ` Felipe Balbi 0 siblings, 1 reply; 6+ messages in thread From: Ashish Jangam @ 2011-11-09 12:13 UTC (permalink / raw) To: balbi; +Cc: linaro-dev, linux-kernel, arnd, eric.miao, Mark Brown, david-b [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1490 bytes --] > -----Original Message----- > From: Felipe Balbi [mailto:balbi@ti.com] > Sent: Wednesday, November 09, 2011 1:50 PM > To: Ashish Jangam > Cc: linaro-dev@lists.linaro.org; linux-kernel@vger.kernel.org; > arnd@arndb.de; eric.miao@linaro.org; Mark Brown > Subject: Re: Adding USB charge current property in the Linux Battery core > > Hi, > > On Wed, Nov 09, 2011 at 01:43:37PM +0530, ashishj3 wrote: > > For a better performance in USB charging operation, the DA9052/53 > charging > > current can be configured in accordance with the USB host current > > delivering capacity (known through USB drivers negotiation). > > > > To implement this useful feature, a new writable property "USB charge > current" > > needs to be added in the Linux battery core. > > > > Let me know your views on it. > > that's the wrong way to do it. What we need is to use the transceiver > notifications to notify every time someone calls usb_gadget_vbus_draw() > and pass the mA parameter as argument to the event notification. > This means that we need to modify the function usb_gadget_vbus_draw() to add a call like blocking_notifier_call_chain() but will this be fine with the usb gadget driver maintainers? > Charger driver should 'subscribe' to transceiver notifications and > use the mA argument to reconfigure charging. > > -- > balbi ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Adding USB charge current property in the Linux Battery core 2011-11-09 12:13 ` Ashish Jangam @ 2011-11-09 12:19 ` Felipe Balbi 2011-11-09 12:30 ` Ashish Jangam 0 siblings, 1 reply; 6+ messages in thread From: Felipe Balbi @ 2011-11-09 12:19 UTC (permalink / raw) To: Ashish Jangam Cc: balbi, linaro-dev, linux-kernel, arnd, eric.miao, Mark Brown, david-b [-- Attachment #1: Type: text/plain, Size: 1858 bytes --] On Wed, Nov 09, 2011 at 12:13:14PM +0000, Ashish Jangam wrote: > > > -----Original Message----- > > From: Felipe Balbi [mailto:balbi@ti.com] > > Sent: Wednesday, November 09, 2011 1:50 PM > > To: Ashish Jangam > > Cc: linaro-dev@lists.linaro.org; linux-kernel@vger.kernel.org; > > arnd@arndb.de; eric.miao@linaro.org; Mark Brown > > Subject: Re: Adding USB charge current property in the Linux Battery core > > > > Hi, > > > > On Wed, Nov 09, 2011 at 01:43:37PM +0530, ashishj3 wrote: > > > For a better performance in USB charging operation, the DA9052/53 > > charging > > > current can be configured in accordance with the USB host current > > > delivering capacity (known through USB drivers negotiation). > > > > > > To implement this useful feature, a new writable property "USB charge > > current" > > > needs to be added in the Linux battery core. > > > > > > Let me know your views on it. > > > > that's the wrong way to do it. What we need is to use the transceiver > > notifications to notify every time someone calls usb_gadget_vbus_draw() > > and pass the mA parameter as argument to the event notification. > > > > This means that we need to modify the function usb_gadget_vbus_draw() > to add a call like blocking_notifier_call_chain() but will this be fine with > the usb gadget driver maintainers? I am the USB gadget driver maintainer and I have plans to do that myself. First thing we need to do is convert the final UDC drivers to the udc Class which I wrote and Sebastian helped brushing it up, then we uninline the usb_gadget_* wrappers and move them to drivers/usb/gadget/udc-core.c, then we can move the transceiver notifier to the UDC as it makes more sense, and convert blocking into atomic notifier. After that we can add notifications to all gadget events/API/etc... -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Adding USB charge current property in the Linux Battery core 2011-11-09 12:19 ` Felipe Balbi @ 2011-11-09 12:30 ` Ashish Jangam 2011-11-09 12:33 ` Felipe Balbi 0 siblings, 1 reply; 6+ messages in thread From: Ashish Jangam @ 2011-11-09 12:30 UTC (permalink / raw) To: balbi; +Cc: linaro-dev, linux-kernel, arnd, eric.miao, Mark Brown, david-b [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2543 bytes --] > -----Original Message----- > From: Felipe Balbi [mailto:balbi@ti.com] > Sent: Wednesday, November 09, 2011 5:50 PM > To: Ashish Jangam > Cc: balbi@ti.com; linaro-dev@lists.linaro.org; linux- > kernel@vger.kernel.org; arnd@arndb.de; eric.miao@linaro.org; Mark Brown; > david-b@pacbell.net > Subject: Re: Adding USB charge current property in the Linux Battery core > > On Wed, Nov 09, 2011 at 12:13:14PM +0000, Ashish Jangam wrote: > > > > > -----Original Message----- > > > From: Felipe Balbi [mailto:balbi@ti.com] > > > Sent: Wednesday, November 09, 2011 1:50 PM > > > To: Ashish Jangam > > > Cc: linaro-dev@lists.linaro.org; linux-kernel@vger.kernel.org; > > > arnd@arndb.de; eric.miao@linaro.org; Mark Brown > > > Subject: Re: Adding USB charge current property in the Linux Battery > core > > > > > > Hi, > > > > > > On Wed, Nov 09, 2011 at 01:43:37PM +0530, ashishj3 wrote: > > > > For a better performance in USB charging operation, the DA9052/53 > > > charging > > > > current can be configured in accordance with the USB host current > > > > delivering capacity (known through USB drivers negotiation). > > > > > > > > To implement this useful feature, a new writable property "USB charge > > > current" > > > > needs to be added in the Linux battery core. > > > > > > > > Let me know your views on it. > > > > > > that's the wrong way to do it. What we need is to use the transceiver > > > notifications to notify every time someone calls usb_gadget_vbus_draw() > > > and pass the mA parameter as argument to the event notification. > > > > > > > This means that we need to modify the function usb_gadget_vbus_draw() > > to add a call like blocking_notifier_call_chain() but will this be fine > with > > the usb gadget driver maintainers? > > I am the USB gadget driver maintainer and I have plans to do that > myself. First thing we need to do is convert the final UDC drivers to > the udc Class which I wrote and Sebastian helped brushing it up, then we > uninline the usb_gadget_* wrappers and move them to > drivers/usb/gadget/udc-core.c, then we can move the transceiver notifier > to the UDC as it makes more sense, and convert blocking into atomic > notifier. This sounds good but since most PMICs have I2C bus connectivity using atomic notifier can introduce problems. > > After that we can add notifications to all gadget events/API/etc... > > -- > balbi ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Adding USB charge current property in the Linux Battery core 2011-11-09 12:30 ` Ashish Jangam @ 2011-11-09 12:33 ` Felipe Balbi 0 siblings, 0 replies; 6+ messages in thread From: Felipe Balbi @ 2011-11-09 12:33 UTC (permalink / raw) To: Ashish Jangam Cc: balbi, linaro-dev, linux-kernel, arnd, eric.miao, Mark Brown, david-b [-- Attachment #1: Type: text/plain, Size: 2068 bytes --] Hi, On Wed, Nov 09, 2011 at 12:30:19PM +0000, Ashish Jangam wrote: > > > > On Wed, Nov 09, 2011 at 01:43:37PM +0530, ashishj3 wrote: > > > > > For a better performance in USB charging operation, the DA9052/53 > > > > charging > > > > > current can be configured in accordance with the USB host current > > > > > delivering capacity (known through USB drivers negotiation). > > > > > > > > > > To implement this useful feature, a new writable property "USB charge > > > > current" > > > > > needs to be added in the Linux battery core. > > > > > > > > > > Let me know your views on it. > > > > > > > > that's the wrong way to do it. What we need is to use the transceiver > > > > notifications to notify every time someone calls usb_gadget_vbus_draw() > > > > and pass the mA parameter as argument to the event notification. > > > > > > > > > > This means that we need to modify the function usb_gadget_vbus_draw() > > > to add a call like blocking_notifier_call_chain() but will this be fine > > with > > > the usb gadget driver maintainers? > > > > I am the USB gadget driver maintainer and I have plans to do that > > myself. First thing we need to do is convert the final UDC drivers to > > the udc Class which I wrote and Sebastian helped brushing it up, then we > > uninline the usb_gadget_* wrappers and move them to > > drivers/usb/gadget/udc-core.c, then we can move the transceiver notifier > > to the UDC as it makes more sense, and convert blocking into atomic > > notifier. > > This sounds good but since most PMICs have I2C bus connectivity using atomic > notifier can introduce problems. we can't use blocking on atomic, right ? usb_gadget_vbus_draw() and most of the others (usb_gadget_connect/disconnect, usb_gadget_frame_number, and so on) are called from atomic context... What i2c transceivers will have to do, is that they will need to defer handling of the notification, which isn't all that big of a deal. If it takes 300 miliseconds more to start charging, users won't even notice. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-09 12:34 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-11-09 8:13 Adding USB charge current property in the Linux Battery core ashishj3 2011-11-09 8:20 ` Felipe Balbi 2011-11-09 12:13 ` Ashish Jangam 2011-11-09 12:19 ` Felipe Balbi 2011-11-09 12:30 ` Ashish Jangam 2011-11-09 12:33 ` Felipe Balbi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®