All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] power: supply: max17042_battery: add technology property support
Date: Mon, 26 Sep 2016 18:32:52 +0200	[thread overview]
Message-ID: <20160926163252.GA3196@kozik-lap> (raw)
In-Reply-To: <87eg46x1ir.fsf@machinist.wiedmeyer.de>

On Mon, Sep 26, 2016 at 02:56:44PM +0200, Wolfgang Wiedmeyer wrote:
> 
> Krzysztof Kozlowski writes:
> 
> > On Sun, Sep 25, 2016 at 11:10:11PM +0200, Wolfgang Wiedmeyer wrote:
> >> This patch reports the battery technology as Li-ion.
> >> 
> >> Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
> >> ---
> >>  drivers/power/max17042_battery.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >> 
> >> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
> >> index 20cb1fd..43cb5df 100644
> >> --- a/drivers/power/max17042_battery.c
> >> +++ b/drivers/power/max17042_battery.c
> >> @@ -92,6 +92,7 @@ static enum power_supply_property max17042_battery_props[] = {
> >>  	POWER_SUPPLY_PROP_TEMP_MIN,
> >>  	POWER_SUPPLY_PROP_TEMP_MAX,
> >>  	POWER_SUPPLY_PROP_HEALTH,
> >> +	POWER_SUPPLY_PROP_TECHNOLOGY,
> >>  	POWER_SUPPLY_PROP_CURRENT_NOW,
> >>  	POWER_SUPPLY_PROP_CURRENT_AVG,
> >>  };
> >> @@ -296,6 +297,9 @@ static int max17042_get_property(struct power_supply *psy,
> >>  		if (ret < 0)
> >>  			return ret;
> >>  		break;
> >> +	case POWER_SUPPLY_PROP_TECHNOLOGY:
> >> +		val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
> >
> > How can you be sure it is always Li-Ion? For wearables and mobiles, rather yes, but
> > the driver is also used in other devices. Technically, specs are saying
> > it might be used also with Li-Poly applications.
> 
> I suppose that there is no way to detect this. Would it be ok if I add
> an optional Device Tree property that allows to specify if it's Li-Ion
> or Li-Poly? If the property is not supplied, then "unknown" is returned.

I am not sure in such case what will be the benefit of exposing this to
user-space... but it won't harm neither and sounds like a valid usage of
DT properties. Fine with me.

Best regards,
Krzysztof

      reply	other threads:[~2016-09-26 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 21:10 [PATCH 0/2] power: supply: max17042_battery: Improve properties Wolfgang Wiedmeyer
2016-09-25 21:10 ` [PATCH 1/2] power: supply: max17042_battery: use VF SOC register for capacity property Wolfgang Wiedmeyer
2016-09-26 11:16   ` Krzysztof Kozlowski
2016-09-26 13:13     ` Wolfgang Wiedmeyer
2016-09-25 21:10 ` [PATCH 2/2] power: supply: max17042_battery: add technology property support Wolfgang Wiedmeyer
2016-09-26 10:55   ` Krzysztof Kozlowski
2016-09-26 12:56     ` Wolfgang Wiedmeyer
2016-09-26 16:32       ` Krzysztof Kozlowski [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=20160926163252.GA3196@kozik-lap \
    --to=krzk@kernel.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=wolfgit@wiedmeyer.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.