lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] power_supply: Add support for TI BQ25890 charger chip
Hi Krzysztof,

On Tue, May 19, 2015 at 05:40:25PM +0900, Krzysztof Kozlowski wrote:
> > +
> > +static int bq25890_chip_reset(struct bq25890_device *bq)
> > +{
> > + int ret;
> > +
> > + ret = bq25890_field_write(bq, F_REG_RST, 1);
> > + if (ret < 0)
> > + return ret;
> > +
> > + do {
> > + ret = bq25890_field_read(bq, F_REG_RST);
> > + if (ret < 0)
> > + return ret;
> > +
> > + usleep_range(5, 10);
> > + } while (ret == 1);
>
> Is it possible to loop here indefinetely?
According to specifications, this field is "Reset to 0 after register
reset is completed", so I'm trusting the chip will behave as advertised!
:) We could implement a safety mechanism to avoid looping in case the
chip misbehaves but I don't think it's worth it. What do you think?

I'll address the other comments in v2.

Thanks for reviewing,
laurentiu


\
 
 \ /
  Last update: 2015-05-19 11:41    [W:0.117 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site