linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Murthy <arunrmurthy.83@gmail.com>
To: Grazvydas Ignotas <notasas@gmail.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	Felipe Balbi <balbi@ti.com>, Madhusudhan <madhu.cr@ti.com>
Subject: Re: [PATCH v3] power_supply: Add driver for TWL4030/TPS65950 BCI charger
Date: Mon, 27 Sep 2010 16:00:35 +0530	[thread overview]
Message-ID: <AANLkTik=M9S6iB9YitHevJ0e7X=jxsug6qLkYdGBqmoo@mail.gmail.com> (raw)
In-Reply-To: <1285529740-28232-1-git-send-email-notasas@gmail.com>

On Mon, Sep 27, 2010 at 1:05 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
>
> TWL4030/TPS65950 is a multi-function device with integrated charger,
> which allows charging from AC or USB. This driver enables the
> charger and provides several monitoring functions.
>
> Tested on OMAP3 Pandora board.
>
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> This is v3 of BCI charger driver I first sent nearly a year ago [1].
> I've updated it to use the new OTG notifiers for VBUS notifications,
> however it still is not able to determine charge current to use.
> For that reason there is now a temporary module param to enable USB
> charging, until I can figure out how to get that info from the gadget
> stack (hopefully Felipe can help me here).
On detecting USB plug, the driver is suppose to detect the type of usb
device. Then if the device is a PC(standard host) the charging current
is to be obtained from the usb stack. Hence the driver will have to
wait until the usb stack or driver notifies the current that can be
drawn. The usb stack or driver gets to know the amount of current to
be drawn through the negotiations that happen between the host and
device.

> +
> +       platform_set_drvdata(pdev, bci);
> +
> +       bci->ac.name = "twl4030_ac";
> +       bci->ac.type = POWER_SUPPLY_TYPE_MAINS;
> +       bci->ac.properties = twl4030_charger_props;
> +       bci->ac.num_properties = ARRAY_SIZE(twl4030_charger_props);
> +       bci->ac.get_property = twl4030_bci_get_property;
> +
> +       ret = power_supply_register(&pdev->dev, &bci->ac);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed to register ac: %d\n", ret);
> +               goto fail_register_ac;
> +       }
> +
> +       bci->usb.name = "twl4030_usb";
> +       bci->usb.type = POWER_SUPPLY_TYPE_USB;
> +       bci->usb.properties = twl4030_charger_props;
> +       bci->usb.num_properties = ARRAY_SIZE(twl4030_charger_props);
> +       bci->usb.get_property = twl4030_bci_get_property;
> +
> +       ret = power_supply_register(&pdev->dev, &bci->usb);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed to register usb: %d\n", ret);
> +               goto fail_register_usb;
> +       }
Only AC and USB monitoring is achieved by registering with power supply class.
How is battery monitored?
An instance of battery is to be registered with power supply class in
order to monitor battery.

Thanks and Regards,
Arun R Murthy
---------------------

      parent reply	other threads:[~2010-09-27 11:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-26 19:35 [PATCH v3] power_supply: Add driver for TWL4030/TPS65950 BCI charger Grazvydas Ignotas
2010-09-27  6:18 ` Felipe Balbi
2010-09-27  9:57   ` Grazvydas Ignotas
     [not found] ` <AANLkTinkxokX9BGtxysYOr19xbZR4S8oPRYUAyneutzc@mail.gmail.com>
2010-09-27  8:16   ` Felipe Balbi
2010-09-27 10:54   ` Grazvydas Ignotas
2010-09-27 12:35     ` Arun Murthy
2010-09-27 13:08       ` Grazvydas Ignotas
2010-09-27 16:13         ` Arun Murthy
2010-09-27 19:42           ` Grazvydas Ignotas
2010-09-27 10:30 ` Arun Murthy [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='AANLkTik=M9S6iB9YitHevJ0e7X=jxsug6qLkYdGBqmoo@mail.gmail.com' \
    --to=arunrmurthy.83@gmail.com \
    --cc=balbi@ti.com \
    --cc=cbouatmailru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=madhu.cr@ti.com \
    --cc=notasas@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).