public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurentiu Palcu <laurentiu.palcu@intel.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Sebastian Reichel <sre@kernel.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/2] power_supply: Add support for TI BQ25890 charger chip
Date: Tue, 19 May 2015 12:14:42 +0300	[thread overview]
Message-ID: <20150519091442.GF14396@lpalcu-linux> (raw)
In-Reply-To: <CAJKOXPfDcTMEd576cVspXKT2kb__49rQSk-BbxXy5ZinO8n5yA@mail.gmail.com>

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

  reply	other threads:[~2015-05-19  9:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 14:06 [PATCH 0/2] Add support for BQ25890 charger chip Laurentiu Palcu
2015-05-15 14:06 ` [PATCH 1/2] Documentation: devicetree: Add TI BQ25890 bindings Laurentiu Palcu
2015-05-16 11:53   ` Krzysztof Kozlowski
2015-05-18  6:54     ` Laurentiu Palcu
2015-05-15 14:06 ` [PATCH 2/2] power_supply: Add support for TI BQ25890 charger chip Laurentiu Palcu
2015-05-02 14:59   ` Pavel Machek
2015-06-24  7:32     ` Laurentiu Palcu
2015-06-24  8:30       ` Pavel Machek
2015-06-24  9:20         ` Laurentiu Palcu
2015-05-19  8:40   ` Krzysztof Kozlowski
2015-05-19  9:14     ` Laurentiu Palcu [this message]
2015-05-19 10:03       ` Krzysztof Kozlowski

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=20150519091442.GF14396@lpalcu-linux \
    --to=laurentiu.palcu@intel.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /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