lkml.org 
[lkml]   [2014]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] power_supply: bq24261 charger driver
Hi!

> > > +static inline int bq24261_set_cv(struct bq24261_charger *chip, int cv)
> > > +{
> > > + int bat_volt;
> > > + int ret;
> > > + u8 reg_val;
> > > + u8 vindpm_val = 0x0;
> > > +
> > > + /*
> > > + * Setting VINDPM value as per the battery voltage
> > > + * VBatt Vindpm Register Setting
> > > + * < 3.7v 4.2v 0x0 (default)
> > > + * 3.71v - 3.96v 4.36v 0x2
> > > + * > 3.96v 4.6v 0x5
> > > + */
> > > + ret = get_battery_voltage(&bat_volt);
> > > + if (ret) {
> > > + dev_err(&chip->client->dev,
> > > + "Error getting battery voltage!!\n");
> > > + } else {
> >
> > You forget the error value and continue anyway.
>
> On error, throw the error and program default VINDPM value.

Is it good idea to attempt charging when we can't read battery
voltage?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-02-21 16:21    [W:0.049 / U:1.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site