public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Phil Reid <preid@electromag.com.au>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	Rhyland Klein <rklein@nvidia.com>,
	Alexandru Stan <amstan@chromium.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Doug Anderson <dianders@chromium.org>
Subject: Re: [PATCH v3 1/2] power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats
Date: Wed, 6 Jun 2018 18:09:57 -0700	[thread overview]
Message-ID: <20180607010955.GA209574@rodete-desktop-imager.corp.google.com> (raw)
In-Reply-To: <7cbe27cf-2917-a17b-07bf-e5fdeb5fef15@electromag.com.au>

Hi Phil,

On Wed, Jun 06, 2018 at 10:03:59AM +0800, Phil Reid wrote:
> On 2/06/2018 09:28, Brian Norris wrote:
> >   drivers/power/supply/sbs-battery.c | 54 +++++++++++++++++++++++++-----
> >   1 file changed, 46 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
> > index 83d7b4115857..a9691ea42f44 100644
> > --- a/drivers/power/supply/sbs-battery.c
> > +++ b/drivers/power/supply/sbs-battery.c

...

> > @@ -806,6 +837,7 @@ static int sbs_probe(struct i2c_client *client,
> >   	if (!chip)
> >   		return -ENOMEM;
> > +	chip->flags = (u32)(uintptr_t)of_device_get_match_data(&client->dev);
> >   	chip->client = client;
> >   	chip->enable_detection = false;
> >   	psy_cfg.of_node = client->dev.of_node;
> > @@ -915,12 +947,15 @@ static int sbs_suspend(struct device *dev)
> >   	if (chip->poll_time > 0)
> >   		cancel_delayed_work_sync(&chip->work);
> > -	/*
> > -	 * Write to manufacturer access with sleep command.
> > -	 * Support is manufacturer dependend, so ignore errors.
> > -	 */
> > -	sbs_write_word_data(client, sbs_data[REG_MANUFACTURER_DATA].addr,
> > -		MANUFACTURER_ACCESS_SLEEP);
> > +	if (chip->flags & SBS_FLAGS_TI_BQ20Z75) {
> > +		/*
> > +		 * Write to manufacturer access with sleep command.
> > +		 * Support is manufacturer dependent, so ignore errors.
> > +		 */
> > +		sbs_write_word_data(client,
> > +				    sbs_data[REG_MANUFACTURER_DATA].addr,
> > +				    MANUFACTURER_ACCESS_SLEEP);
> > +	}
> 
> Now that this is only being done for only TI devices that support this I would think the comment
> about ignoring errors needs to go, and errors checks added.
> Ditto in the new sbs_get_ti_battery_presence_and_health()

Seems reasonable. I'll look at doing that and respinning.

> >   	return 0;
> >   }

Thanks,
Brian

      reply	other threads:[~2018-06-07  1:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02  1:28 [PATCH v3 1/2] power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats Brian Norris
2018-06-02  1:29 ` [PATCH v3 2/2] dt-bindings: power: sbs-battery: re-document "ti,bq20z75" Brian Norris
2018-06-05 20:18   ` Rob Herring
2018-06-06  2:03 ` [PATCH v3 1/2] power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats Phil Reid
2018-06-07  1:09   ` Brian Norris [this message]

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=20180607010955.GA209574@rodete-desktop-imager.corp.google.com \
    --to=briannorris@chromium.org \
    --cc=amstan@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=preid@electromag.com.au \
    --cc=rklein@nvidia.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