From: "Andrew F. Davis" <afd@ti.com>
To: Liam Breck <liam@networkimprov.net>
Cc: linux-pm@vger.kernel.org, Liam Breck <kernel@networkimprov.net>
Subject: Re: [PATCH] power: bq27xxx_battery: Unique chip IDs
Date: Wed, 8 Mar 2017 11:58:52 -0600 [thread overview]
Message-ID: <739da500-67dc-ec2e-f790-e68855c31594@ti.com> (raw)
In-Reply-To: <CAKvHMgR2g3OftVOfPiunDf25EsCz0f5LXW3ch-TZd8dr0tLBJQ@mail.gmail.com>
On 03/08/2017 11:45 AM, Liam Breck wrote:
> On Wed, Mar 8, 2017 at 9:23 AM, Andrew F. Davis <afd@ti.com> wrote:
>> On 03/07/2017 05:05 PM, Liam Breck wrote:
>>> From: Liam Breck <kernel@networkimprov.net>
>>>
>>> Assign every chip a unique ID, to enable
>>> power_supply_battery_info config for all supported chips.
>>> There are no functional changes to the driver.
>>>
>>> Depends-on: power: bq27xxx_battery: Add power_supply_battery_info support
>>> Signed-off-by: Liam Breck <kernel@networkimprov.net>
>>>
>>> ---
>>> Andrew, let me know if you'd like me to include this in the other patchset.
>>
>> Why do we need this at all? It may be just bit too early for me, but I'm
>> not seeing what this gets us, that couldn't be done before.
>
> Sadly, the chips mostly have different dm_reg tables, so we need the
> real chip ID to give each a table.
>
> My last rev only supported IDs associated with a single chip: 500,
> 545, 421. In the 421 case, we had to split off that ID.
>
Okay, then if we need a new ID lets add it. Going back to having a table
of pointers is a step back, we used to do it this way, but every-time a
new chip appeared or we found a delta in an existing chip(s) (like you
are finding now) we would have to re-organize the pointer table and
other associated tables, it is much cleaner and easier to review (more
important than code size by orders of magnitude IMHO) to just add a new
entry into the big master table of registers.
>
>>> drivers/power/supply/bq27xxx_battery.c | 94 +++++++++++++++++-------------
>>> drivers/power/supply/bq27xxx_battery_i2c.c | 14 ++---
>>> include/linux/power/bq27xxx_battery.h | 15 +++--
>>> 3 files changed, 71 insertions(+), 52 deletions(-)
>>>
>>> diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
>>> index ed976a1..30af0e4 100644
>>> --- a/drivers/power/supply/bq27xxx_battery.c
>>> +++ b/drivers/power/supply/bq27xxx_battery.c
>
>>> +static u8* bq27xxx_regs[] = {
>>> + [BQ27000] = bq27000_regs, /* really bq27200 */
>>> + [BQ27010] = bq27010_regs, /* really bq27210 */
>>
>> Not strictly true, the bq270x0 and bq272x0 are different chips, one has
>> an HDQ bus and the other I2C, later chips have both ports on each chip.
>
> Oh, I saw only the 200 & 210 in _i2c.c, and forgot that the driver
> supports another interface. I'll remove those comments.
>
> I won't separate these IDs as none of them support DM update.
>
> Think you could do some testing soon?
>
Yeah, I could probably fit some testing into my schedule, I'll see what
v9 looks like before I unpack the boards.
next prev parent reply other threads:[~2017-03-08 17:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 23:05 [PATCH] power: bq27xxx_battery: Unique chip IDs Liam Breck
2017-03-08 17:23 ` Andrew F. Davis
2017-03-08 17:45 ` Liam Breck
2017-03-08 17:58 ` Andrew F. Davis [this message]
2017-03-08 18:16 ` Liam Breck
2017-03-08 18:23 ` Andrew F. Davis
2017-03-08 21:22 ` Liam Breck
2017-03-08 23:49 ` Liam Breck
2017-03-09 15:30 ` Andrew F. Davis
2017-03-09 15:38 ` Andrew F. Davis
2017-03-09 17:26 ` Liam Breck
2017-03-09 17:33 ` Andrew F. Davis
2017-03-09 17: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=739da500-67dc-ec2e-f790-e68855c31594@ti.com \
--to=afd@ti.com \
--cc=kernel@networkimprov.net \
--cc=liam@networkimprov.net \
--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