From: Andreas Dannenberg <dannenberg@ti.com>
To: Laurentiu Palcu <lpalcu@gmail.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
linux-pm@vger.kernel.org, "Sebastian Reichel" <sre@kernel.org>,
"Laurentiu Palcu" <laurentiu.palcu@intel.com>,
"Pali Rohár" <pali.rohar@gmail.com>,
"Dmitry Eremin-Solenikov" <dbaryshkov@gmail.com>
Subject: Re: [RFC] TI BQ242xx Battery Charger Development/Consolidation Plans
Date: Wed, 12 Aug 2015 11:10:47 -0500 [thread overview]
Message-ID: <55CB7007.3020403@ti.com> (raw)
In-Reply-To: <CAD03FC+DqSdg_LZ-SNaCNLsh9eZS9hSeJL5Q+8aWU+bGVcVPDQ@mail.gmail.com>
Hi Palcu,
On 08/07/2015 03:58 AM, Laurentiu Palcu wrote:
> Hi Andreas,
>
> On 5 Aug 2015 19:11, "Andreas Dannenberg" <dannenberg@ti.com> wrote:
>>
>> Not too long I ago started working on a new driver called bq242xx_charger.c
>> that will add support for TI's BQ24250, BQ24251, BQ24261M, and BQ24262 Li-Ion
>> battery charger/power-path management ICs and that work is about 50% done. I
>> chose a working name of bq242xx_charger.c in the hopes that in addition to
>> providing immediate support for said devices that this driver can later be used
>> as a platform to add other devices of the BQ242xx sub-family in an effort to
>> re-use/consolidate and help keep drivers/power organized.
>>
>> Long story short I also realized that we just got a new bq24257_charger.c
>> driver (for the BQ24257) already in the Linux 4.2 tree which creates somewhat
>> of a conflict with the bq242xx_charger.c work in progress.
>>
>> I would like to solicit ideas/comments regarding the following plan of attack:
>>
>> - Continue bq242xx_charger.c development as scoped in the first paragraph
>> - Work on getting it accepted into upstream
>> - As future work, absorb the already existing bq24257_charger.c driver into the
>> bq242xx_charger.c driver, and deprecate its usage
>
> Using wildcards in the driver name looks like a good idea until a new
> part that fits the naming scheme appears but it's a totally different
> product...
Thanks for your comments. It's really good and timely to have this discussion.
Generally I would agree but since this driver would encompass several devices from
the start on, all from a rather narrowly defined sub-family IMHO it would make
sense to give it a wildcard name rather than a single part number which won't
apply from the get-go to most what the driver would support. But this all might
be a moot point...
> Assuming those chips have a similar register layout as
> BQ24257, why don't you start with the existing bq24257_charger driver
> and build on that? Then, in Kconfig, make it clear what parts are
> supported by the driver. This practice is quite common in Linux
> kernel.
The BQ24257 is more or less a subset of the BQ24250/BQ24251 devices I'm working
on (once of the main difference is that the latter support dynamic power path
management which is a pretty useful feature) so generally speaking yes they
could sit in the same driver. The register maps look exactly the same so it
definitely makes sense to consolidate here.
I'll do some more digging in BQ24257_charger.c to see how feature-complete it
is and what it would mean adding support for "my" BQ24250/bq24251 devices.
One concern I have with bq24257_charger.c is the extensive use of regmap fields.
While certainly elegant I'm worried about the overhead/memory it consumes vs.
simple #defines. For example the charger code creates 27 instances of struct
regmap_field at runtime which consumes ~650 bytes of memory, and another 27
instances of struct reg_field allocated at load time consuming 540 byte, bringing
the total to almost 1.2KB (along the lines, bq25890_charger.c has 72 register
fields and consumes almost 3x that amount of memory for the same reasons).
Maybe it's because I'm from an MCU background but this sounds like a lot of
memory to me to hold 6 bytes worth of actual data (the device registers)...
>> There might be a potential risk for user confusion for a transitional time if
>> somebody was just looking at the filenames to select their driver due to part
>> number overlap. However I argue folks are more likely to go the Kconfig route
>> to select their driver so this may not be a problem after all.
>
> This one is tricky. If the BQ24257 chip became part of a commercial
> product, then the customers will have to change the .config after
> doing a kernel upgrade. Customers are not keen on doing that for a
> commercially released product.
Understood. Migrating stuff is never fun. If I can find a good way to split/merge
my work into yours (and Ram's) hopefully it won't come to that.
Thanks and Regards,
--
Andreas Dannenberg
Texas Instruments Inc.
>
> Sebastian, what do you think?
>
> laurentiu
>
next prev parent reply other threads:[~2015-08-12 16:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 16:36 [PATCH RESEND] power: bq24190_charger: Fix charge type sysfs property Andreas Dannenberg
2015-08-04 16:45 ` Dan Murphy
2015-08-04 16:54 ` Andrew F. Davis
2015-08-05 4:09 ` Sebastian Reichel
2015-08-05 16:05 ` [RFC] TI BQ242xx Battery Charger Development/Consolidation Plans Andreas Dannenberg
2015-08-07 8:58 ` Laurentiu Palcu
2015-08-11 11:12 ` Pallala, Ramakrishna
2015-08-12 16:20 ` Andreas Dannenberg
2015-08-13 16:19 ` Pallala, Ramakrishna
2015-08-12 16:10 ` Andreas Dannenberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-08-05 16:28 Andreas Dannenberg
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=55CB7007.3020403@ti.com \
--to=dannenberg@ti.com \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=laurentiu.palcu@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=lpalcu@gmail.com \
--cc=pali.rohar@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).