lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mfd: add bq2415x charger driver
From
2011/12/6 Sebastian Reichel <sre@debian.org>:
> On Tue, Dec 06, 2011 at 04:49:37AM +0200, Felipe Contreras wrote:
>> Not really. There are 6 bits: 640, 320, 160, 80, 40, 20. So values
>> from 0 to 1260mV can be represented, at steps of 20mV. A value of 0
>> means 3.5V.
>
> I just checked it. You'r driver just writes 0x42 to the register,
> which makes use of the described platform specific resistor.
>
>> bq2415x_i2c_write(cli, BQ2415X_CHG_CTL, 0x42);
>
> I know that 42 is the "Answer to the Ultimate Question of Life, the
> Universe, and Everything" [0]. But in this case 0x42 is platform
> specific. Check page 30 in the specs, From Table 9 onwards.

Well, you were talking about BQ2415X_VOLTAGE_SCALE, which I used for
the voltage register calculation.

But yeah, you are right about BQ2415X_CHG_CTL. Maybe it would make
sense to make it a platform driver, or perhaps just expose functions
so the board can set the right values.

>> > Apart from this I think those values should be exposed to sysfs
>> > via /sys/class/power_supply.
>>
>> Perhaps. Although I don't see much of the power supply interface that
>> could be useful here, but if so, I guess this should be indeed in
>> 'drivers/power'.
>
> So it may need some new entries. Normal mobile userspace wants to
> know at least charging status & speed. Also it's probably a good
> idea to make current_limit sysfs entry writeable, so that advanced
> users can overwrite a autodetected value (e.g. a dumb wallcharger
> may be detected as 100mA, but can provide 1A).

True. drivers/power it is then :)

--
Felipe Contreras


\
 
 \ /
  Last update: 2011-12-06 14:53    [W:0.050 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site