Linux Power Management development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 05/14] power: max17042_battery: Change name in power_supply_desc to "main-battery"
Date: Mon, 1 May 2017 17:50:50 +0200	[thread overview]
Message-ID: <20170501155050.o5226rcfzxtrzvju@earth> (raw)
In-Reply-To: <caf9b434-29bb-e03a-0287-c12de9beec0d@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]

Hi Hans,

On Mon, May 01, 2017 at 05:11:13PM +0200, Hans de Goede wrote:
> Thank you for merging all my recent patches.

You are welcome!

> On 01-05-17 14:22, Sebastian Reichel wrote:
> > > Change the name in max17042's power_supply_desc to "main-battery" to
> > > match, so that power_supply_am_i_supplied() can be used to implement
> > > POWER_SUPPLY_PROP_STATUS.
> > 
> > I did not queue this patch and patch 14. First of all: Currently 4/30
> > chargers have this, which I wouldn't call "almost all". I think this
> > is not the right solution, especially as it will break once a system
> > has more than one "main" battery (like some of the newer thinkpads).
> > 
> > For DT based systems we have generic support to specify the
> > dependency as phandle. This obviously won't work for you.
> > I suggest to use a device property for supplying the correct name
> > to the charger instead.
> 
> Ok, fair enough.
> 
> So to be clear you are suggesting that we modify the charger driver
> (or the power-supply-core) to check for a "supplied-to"
> string-array device property which then overrides the power_supply_config.supplied_to
> array's default value in the driver?
> 
> Or do you want to modify the fuel-gauge driver (or the power-supply-core)
> to check for a "supplied-from" string-array device property which then
> is used to fill in the power_supply.supplied_from array ?
> 
> Looking at how currently the power-supply-core fills in power_supply.supplied_from
> from devicetree when #ifdef CONFIG_OF is true, I think the best (and
> most consistent) solution would be to change the :
> 
> #else
> static inline int power_supply_check_supplies(struct power_supply *psy)
> {
>         return 0;
> }
> #endif
> 
> Code block to check for a "supplied-from" string-array device property
> and populate the power_supply.supplied_from string array with its
> contents if found.
> 
> If you can let me know how exactly you want to solve this I can whip
> up (and test) patch for this.

Adding this to non-DT power_supply_check_supplies() and naming the
property "supplied-from" sounds good.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-05-01 15:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 18:32 [PATCH v2 01/14] power: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers Hans de Goede
2017-04-14 18:32 ` [PATCH v2 02/14] power: max17042_battery: Use sign_extend32 instead of DIY code Hans de Goede
2017-05-01 11:36   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 03/14] power: max17047_battery: The temp alert values are 8-bit 2's complement Hans de Goede
2017-05-01 11:37   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 04/14] power: max17042_battery: Add default platform_data fallback data Hans de Goede
2017-04-15 10:31   ` Krzysztof Kozlowski
2017-05-01 11:37   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 05/14] power: max17042_battery: Change name in power_supply_desc to "main-battery" Hans de Goede
2017-05-01 12:22   ` Sebastian Reichel
2017-05-01 15:11     ` Hans de Goede
2017-05-01 15:50       ` Sebastian Reichel [this message]
2017-04-14 18:32 ` [PATCH v2 06/14] power: max17042_battery: Add support for the STATUS property Hans de Goede
2017-04-15 10:32   ` Krzysztof Kozlowski
2017-05-01 11:38   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 07/14] power: max17042_battery: Add external_power_changed callback Hans de Goede
2017-05-01 11:38   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 08/14] power: max17042_battery: Add support for the TECHNOLOGY attribute Hans de Goede
2017-04-15 10:33   ` Krzysztof Kozlowski
2017-05-01 11:39   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 09/14] power: max17042_battery: Add support for the VOLT_MIN property Hans de Goede
2017-05-01 11:39   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 10/14] power: max17042_battery: mAh readings depend on r_sns value Hans de Goede
2017-04-15 10:38   ` Krzysztof Kozlowski
2017-05-01 11:39   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 11/14] power: max17042_battery: Add support for the CHARGE_FULL_DESIGN property Hans de Goede
2017-04-15 10:38   ` Krzysztof Kozlowski
2017-05-01 11:40   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 12/14] power: max17042_battery: Add support for the CHARGE_NOW property Hans de Goede
2017-04-15 10:39   ` Krzysztof Kozlowski
2017-05-01 11:40   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 13/14] power: max17042_battery: Add support for the SCOPE property Hans de Goede
2017-05-01 11:41   ` Sebastian Reichel
2017-04-14 18:32 ` [PATCH v2 14/14] power: max77693_charger: Add supplied_to info to power_supply_config Hans de Goede
2017-05-01 12:19   ` Sebastian Reichel
2017-04-15 10:30 ` [PATCH v2 01/14] power: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers 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=20170501155050.o5226rcfzxtrzvju@earth \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=b.zolnierkie@samsung.com \
    --cc=hdegoede@redhat.com \
    --cc=krzk@kernel.org \
    --cc=linux-pm@vger.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