All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Breck <liam@networkimprov.net>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v1 7/7] power: bq24190_charger: Set bq24190-battery device .type=unknown
Date: Wed, 22 Mar 2017 06:22:22 -0700	[thread overview]
Message-ID: <CAKvHMgT9=dWXXC66LarBVb-8c4BhOouZAqmAMsV3Sv9tTnmWsg@mail.gmail.com> (raw)
In-Reply-To: <7e117a52-bbf0-2a12-e98f-843da227e0c7@redhat.com>

Hi, thanks for reviews and comments on sysfs issue.

On Wed, Mar 22, 2017 at 5:25 AM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 21-03-17 23:09, Liam Breck wrote:
>>
>> From: Liam Breck <kernel@networkimprov.net>
>>
>> Not for upstream. Temporary workaround to prevent bq24190-battery device
>> from interfering with a fuel gauge that has
>> .type=power_supply_type_battery
>>
>> I'll move properties from -battery device to -charger in a subsequent
>> version.
>>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>
>
> Hmm, I don't like this. I was about to post v2 of my patches (which I will
> rebase on top of this series), which contains a patch to completely remove
> the battery power_supply. I understand if you think it is too early for
> that, but I believe that if we (temporarily) want to keep it around,
> it would be better to do something like this:

I need most of the properties in -battery; I am working on moving them
into -charger. It's not a trivial cut/paste but should be done by v2
next week.

This patch should clear the way for you to implement your battery
device, without touching the -battery code. That way I can run your
patches in my environment. Don't worry, it's not going upstream. I
didn't even include signed-off-by :-)

BTW I think we can just remove bdi->model; it's not used. However
let's not claim to support any chip we haven't actually tested, so in
hw_init()...

if (v != BQ24190_REG_VPRS_PN_24190 &&
    v != BQ24190_REG_VPRS_PN_yours)
        return -ENODEV;

>     /*
>      * Note the disable-battery-power-supply property is purely an in
>      * kernel interface to avoid having 2 battery type power_supplies for
>      * a single physical battery when there also is a fuel-gauge driver.
>      * The plan is to remove the battery power_supply from the bq24190
>      * driver completely, but that still needs some work.
>      * Do NOT use this property in DT files.
>      */
>     if (!device_property_read_bool(dev, "disable-battery-power-supply")) {
>         register(battery)...
>     }
>
> Sebastian would something like the above work for you as an interim
> solution ? Since this uses device-properties I can easily add the
> property to my i2c_board_info, and when the battery power_supply gets
> removed all together the board_info can be updated independently of
> the power_supply driver, so we can easily clean this up afterwards.

Would make sense if req'd upstream, but I don't think it will be.

> Regards,
>
> Hans
>
>
>
>> ---
>>  drivers/power/supply/bq24190_charger.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/power/supply/bq24190_charger.c
>> b/drivers/power/supply/bq24190_charger.c
>> index a52816b..12f3780 100644
>> --- a/drivers/power/supply/bq24190_charger.c
>> +++ b/drivers/power/supply/bq24190_charger.c
>> @@ -1228,7 +1228,7 @@ static enum power_supply_property
>> bq24190_battery_properties[] = {
>>
>>  static const struct power_supply_desc bq24190_battery_desc = {
>>         .name                   = "bq24190-battery",
>> -       .type                   = POWER_SUPPLY_TYPE_BATTERY,
>> +       .type                   = POWER_SUPPLY_TYPE_UNKNOWN,
>>         .properties             = bq24190_battery_properties,
>>         .num_properties         = ARRAY_SIZE(bq24190_battery_properties),
>>         .get_property           = bq24190_battery_get_property,
>>
>

  parent reply	other threads:[~2017-03-22 13:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 22:09 [PATCH v1 0/7] BQ24190 support for power_supply_battery_info and DT binding Liam Breck
2017-03-21 22:09 ` [PATCH v1 1/7] devicetree: power: battery: Add properties for pre-charge and end-charge current Liam Breck
2017-03-24  9:01   ` Sebastian Reichel
2017-03-25  0:34     ` Liam Breck
2017-03-29  0:43       ` Rob Herring
     [not found]   ` <20170321220921.5834-2-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-03-22 12:04     ` Hans de Goede
2017-03-29  0:39     ` Rob Herring
2017-03-29  1:42       ` Liam Breck
2017-03-21 22:09 ` [PATCH v1 2/7] devicetree: power: Add docs for TI BQ24190 battery charger Liam Breck
2017-03-24  9:00   ` Sebastian Reichel
     [not found]   ` <20170321220921.5834-3-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-03-22 12:04     ` Hans de Goede
2017-03-29  0:47     ` Rob Herring
2017-03-29  1:48       ` Liam Breck
2017-03-21 22:09 ` [PATCH v1 3/7] power: power_supply_core: Add *_battery_info fields for pre- and end-charge current Liam Breck
2017-03-22 12:12   ` Hans de Goede
2017-03-24  9:07   ` Sebastian Reichel
2017-03-21 22:09 ` [PATCH v1 4/7] power: bq24190_charger: Uniform pm_runtime_get() failure handling Liam Breck
2017-03-22 12:14   ` Hans de Goede
2017-03-22 15:35   ` Tony Lindgren
2017-03-24  9:13   ` Sebastian Reichel
2017-03-21 22:09 ` [PATCH v1 5/7] power: bq24190_charger: Reorder init sequence in probe() Liam Breck
2017-03-22 12:14   ` Hans de Goede
2017-03-22 15:36     ` Tony Lindgren
2017-03-21 22:09 ` [PATCH v1 6/7] power: bq24190_charger: Add power_supply_battery_info and devicetree support Liam Breck
2017-03-22 12:15   ` Hans de Goede
2017-03-24  9:20   ` Sebastian Reichel
2017-03-21 22:09 ` [PATCH v1 7/7] power: bq24190_charger: Set bq24190-battery device .type=unknown Liam Breck
2017-03-22 12:25   ` Hans de Goede
2017-03-22 13:15     ` Hans de Goede
2017-03-22 13:37       ` Liam Breck
2017-03-22 14:41         ` Hans de Goede
2017-03-22 18:33           ` Liam Breck
2017-03-23  8:18             ` Hans de Goede
2017-03-23  8:55               ` Liam Breck
2017-03-22 13:22     ` Liam Breck [this message]
2017-03-23 10:52   ` Sebastian Reichel
2017-03-23 11:31     ` Liam Breck
2017-03-23 13:37       ` Sebastian Reichel
2017-03-23 19:05         ` Liam Breck
2017-03-23 20:47     ` Liam Breck
2017-03-24  9:39       ` Sebastian Reichel
2017-03-24 10:44         ` Liam Breck
2017-03-24 11:22           ` Sebastian Reichel
2017-03-24 11:56             ` Liam Breck
2017-03-29 14:12               ` Sebastian Reichel
2017-04-14 22:43     ` Liam Breck

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='CAKvHMgT9=dWXXC66LarBVb-8c4BhOouZAqmAMsV3Sv9tTnmWsg@mail.gmail.com' \
    --to=liam@networkimprov.net \
    --cc=hdegoede@redhat.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /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.