mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Ashish Jangam <Ashish.Jangam@kpitcummins.com>
Cc: "balbi@ti.com" <balbi@ti.com>,
	"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"eric.miao@linaro.org" <eric.miao@linaro.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"david-b@pacbell.net" <david-b@pacbell.net>
Subject: Re: Adding USB charge current property in the Linux Battery core
Date: Wed, 9 Nov 2011 14:33:44 +0200	[thread overview]
Message-ID: <20111109123339.GC16315@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <C3AE124F08223B42BC95AEB82F0F6CED1F9BF409@KCHJEXMB02.kpit.com>

[-- 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 --]

      reply	other threads:[~2011-11-09 12:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09  8:13 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111109123339.GC16315@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.com \
    --cc=Ashish.Jangam@kpitcummins.com \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=david-b@pacbell.net \
    --cc=eric.miao@linaro.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®