mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Madhusudhan" <madhu.cr@ti.com>
To: "'Grazvydas Ignotas'" <notasas@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,
	"'Anton Vorontsov'" <avorontsov@ru.mvista.com>,
	<linux-omap@vger.kernel.org>
Subject: RE: [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCI charger
Date: Wed, 2 Dec 2009 10:59:35 -0600	[thread overview]
Message-ID: <004201ca7370$d3c9ce70$544ff780@am.dhcp.ti.com> (raw)
In-Reply-To: <6ed0b2680911301333p19b14d5dxac81f976d0c35c61@mail.gmail.com>



> -----Original Message-----
> From: Grazvydas Ignotas [mailto:notasas@gmail.com]
> Sent: Monday, November 30, 2009 3:33 PM
> To: Madhusudhan
> Cc: linux-kernel@vger.kernel.org; Anton Vorontsov; linux-
> omap@vger.kernel.org
> Subject: Re: [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCI
> charger
> 
> On Mon, Nov 30, 2009 at 8:45 PM, Madhusudhan <madhu.cr@ti.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Grazvydas Ignotas [mailto:notasas@gmail.com]
> >> Sent: Friday, November 27, 2009 8:44 AM
> >> To: linux-kernel@vger.kernel.org
> >> Cc: Anton Vorontsov; Madhusudhan Chikkature; linux-
> omap@vger.kernel.org;
> >> Grazvydas Ignotas
> >> Subject: [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCI
> charger
> >>
> >> 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.
> >>
> >> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> >> ---
> >> For this driver to work, TWL4030-core needs to be patched to use
> >> correct macros so that it registers twl4030_bci platform_device.
> >> I'll send patches for this later.
> >>
> >>  drivers/power/Kconfig           |    7 +
> >>  drivers/power/Makefile          |    1 +
> >>  drivers/power/twl4030_charger.c |  499
> >
> > Is the file name changed from twl4030_bci_battery.c to twl4030_charger.c
> because it mainly supports voltage monitoring only while charging? If yes,
> potentially we can add support for monitoring also in discharge state. Do
> we intend to change the file name then?
> 
> Does the hardware support any monitoring in discharge state? I'm
> unable to get any readings, only frozen values (that never update)
> from what it had when it was charging. Here is TI confirmation that at
> least temperature monitoring won't work while discharging:
> http://e2e.ti.com/forums/p/8202/31818.aspx#31818
> 
> For this reason I consider BCI a charger.
> 
In the discharge path BCI might not update the registers. It is worth
experiment to try and use MADC conversion to get the values. A driver for
madc is being currently discussed. See the patch:

http://patchwork.kernel.org/patch/62746/

We can try this once the madc driver is accepted in mainline and submit an
update patch to the BCI driver. As a first step I agree that the current BCI
patch should go upstream.

Reviewed-by: Madhusudhan Chikkature <madhu.cr@ti.com>

Thanks,
Madhu

> > Also adding the tested-on info could be helpful here.
> 
> ok
> 
> <snip>
> 
> >> +     case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> >> +             /* charging must be active for meaningful result */
> >> +             if (!is_charging) {
> >
> > How about putting a kern_info here?
> 
> That would potentially flood dmesg, will just return -EINVAL like
> Anton suggests.
> 
> >> +                     val->intval = 0;
> >> +                     break;
> >> +             }
> >> +             ret = twl4030_get_voltage(voltage_reg);
> >> +             if (ret < 0)
> >> +                     return ret;
> >> +             val->intval = ret;
> >> +             break;
> >> +     case POWER_SUPPLY_PROP_CURRENT_NOW:
> >> +             if (!is_charging) {
> >> +                     val->intval = 0;
> > Ditto
> >> +                     break;
> >> +             }
> >> +             /* current measurement is shared between AC and USB */
> >> +             ret = twl4030_charger_get_current();
> >> +             if (ret < 0)
> >> +                     return ret;
> >> +             val->intval = ret;
> >> +             break;
> >> +     case POWER_SUPPLY_PROP_ONLINE:
> > Does this indicate the source of charging like USB or AC??
> 
> There are 2 charging devices registered now, AC and USB, each returns
> it's state. This is what most other drivers do.
> 
> I'll send v2 later, it will also have more accurate voltage formulas I
> got from TI.


  reply	other threads:[~2009-12-02 16:59 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27 14:44 Grazvydas Ignotas
2009-11-27 14:54 ` Anton Vorontsov
2009-11-27 15:47   ` Grazvydas Ignotas
2009-11-27 16:23     ` Mark Brown
2009-11-30 18:45 ` Madhusudhan
2009-11-30 18:58   ` Anton Vorontsov
2009-12-02 20:38     ` Grazvydas Ignotas
2009-12-02 21:27       ` Anton Vorontsov
2009-12-02 21:32         ` Grazvydas Ignotas
2009-11-30 21:33   ` Grazvydas Ignotas
2009-12-02 16:59     ` Madhusudhan [this message]
2009-12-02 17:33 ` Felipe Balbi
2009-12-02 20:34   ` Grazvydas Ignotas
2009-12-02 20:49     ` Felipe Balbi
2009-12-02 21:29       ` Grazvydas Ignotas
2009-12-02 21:54         ` Anton Vorontsov
2009-12-02 22:31           ` Felipe Balbi
2009-12-02 22:59             ` Anton Vorontsov
2009-12-03  8:39               ` Felipe Balbi
2009-12-03 10:55                 ` Grazvydas Ignotas
2009-12-03 11:03                   ` Felipe Balbi
2009-12-10 14:09                     ` Grazvydas Ignotas
2009-12-10 14:18                       ` Anton Vorontsov
2009-12-10 14:21                         ` Felipe Balbi
2009-12-10 14:44                           ` Anton Vorontsov
2009-12-10 16:51                             ` Felipe Balbi
2009-12-10 20:51                               ` Grazvydas Ignotas
2009-12-11 11:31                                 ` [RFC/PATCH 0/5] usb transceiver notifier Felipe Balbi
2009-12-11 11:31                                 ` [RFC/PATCH 1/5] usb: otg: add notifier support Felipe Balbi
2009-12-11 11:55                                   ` Mark Brown
2009-12-11 11:58                                     ` Felipe Balbi
2010-01-26 11:16                                   ` David Brownell
2010-01-26 13:11                                     ` Mark Brown
2010-01-26 13:35                                       ` David Brownell
2010-01-26 14:14                                         ` Felipe Balbi
2010-01-26 14:24                                           ` Oliver Neukum
2010-01-26 14:30                                             ` Felipe Balbi
2010-01-26 15:16                                               ` David Brownell
2010-01-26 15:21                                           ` David Brownell
2010-01-26 18:50                                             ` Felipe Balbi
2010-01-26 14:21                                         ` Mark Brown
2010-01-26 15:44                                           ` David Brownell
2010-01-26 16:13                                             ` Mark Brown
2010-01-26 14:10                                     ` Felipe Balbi
2010-01-26 14:19                                       ` Felipe Balbi
2010-01-26 15:33                                         ` David Brownell
2010-01-26 15:07                                       ` David Brownell
2010-01-26 19:09                                         ` Felipe Balbi
2010-01-26 19:15                                           ` Felipe Balbi
2009-12-11 11:31                                 ` [RFC/PATCH 2/5] usb: otg: twl4030: add support for notifier Felipe Balbi
2009-12-11 17:22                                   ` sai pavan
2009-12-11 20:40                                     ` Felipe Balbi
2009-12-12 18:34                                       ` Mark Brown
2009-12-14 10:30                                         ` [RFC/PATCH 0/4] twl4030 threaded_irq support Felipe Balbi
2010-01-26  7:06                                           ` David Brownell
2010-01-26  7:36                                             ` David Brownell
2010-01-26 10:07                                             ` Mark Brown
2010-01-26 11:02                                             ` Felipe Balbi
2010-01-26 12:18                                               ` David Brownell
2009-12-14 10:30                                         ` [RFC/PATCH 1/4] input: keyboard: twl4030: move to request_threaded_irq Felipe Balbi
2009-12-14 10:30                                         ` [RFC/PATCH 2/4] input: misc: " Felipe Balbi
2009-12-14 11:31                                           ` Shilimkar, Santosh
2009-12-14 11:40                                             ` Felipe Balbi
2009-12-14 13:16                                               ` Shilimkar, Santosh
2009-12-14 10:30                                         ` [RFC/PATCH 3/4] rtc: " Felipe Balbi
2009-12-14 10:30                                         ` [RFC/PATCH 4/4] usb: otg: " Felipe Balbi
2009-12-11 11:31                                 ` [RFC/PATCH 3/5] usb: musb: add support for ulpi block Felipe Balbi
2009-12-11 11:31                                 ` [RFC/PATCH 4/5] usb: musb: isp1704: add registers from isp1704 Felipe Balbi
2009-12-11 12:35                                   ` Krogerus Heikki (EXT-Teleca/Helsinki)
2009-12-11 12:57                                     ` Felipe Balbi
2009-12-11 11:31                                 ` [RFC/PATCH 5/5] usb: musb: musb supports otg notifier Felipe Balbi
2009-12-11 11:40                                   ` Felipe Balbi
2009-12-30 19:07                             ` [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCI charger Madhusudhan
2009-12-10 14:19                       ` Felipe Balbi

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='004201ca7370$d3c9ce70$544ff780@am.dhcp.ti.com' \
    --to=madhu.cr@ti.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --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

Powered by JetHome