Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222246

Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger

From Laurentiu Palcu <laurentiu.palcu@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger
Date 2015-09-10 17:00 +0200
Message-ID <q7buq-4DO-9@gated-at.bofh.it> (permalink)
References (1 earlier) <q5VL3-2oy-5@gated-at.bofh.it> <q6Dj4-6hq-19@gated-at.bofh.it> <q6F1v-jD-7@gated-at.bofh.it> <q6RvI-1rs-17@gated-at.bofh.it> <q6XhM-1ek-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 10, 2015 at 08:49:26AM +0900, Krzysztof Kozlowski wrote:
> On 10.09.2015 02:31, Andreas Dannenberg wrote:
> > On Wed, Sep 09, 2015 at 01:17:11PM +0900, Krzysztof Kozlowski wrote:
> >> On 09.09.2015 11:26, Andreas Dannenberg wrote:
> >>> Krzysztof, good observation! In bq2425x_charger.c (formerly known as
> >>> bq24257_charger.c :) that I worked on the unit used was uA. At that time
> >>> I did a quick check and there didn't seem to be a clear standard whether
> >>> to use the "micro" or "milli" units - different drivers use different
> >>> units. However there seems to be a tendency for the TI drivers to prefer
> >>> "milli" (bq2415x_charger.c, bq24735-charger.c)
> >>>
> >>> Personally I think "milli" units are more appropriate for chargers since
> >>> they provide sufficient granularity and the numbers don't become too big
> >>> (try typing a voltage in the Volt-range in uV, it's very easy to get the
> >>> number of 0s wrong). However since the driver was already there I left
> >>> that aspect alone to preserve compatibility.
> >>
> >> I am fine with both units but milli indeed seems easier to judge by fast
> >> looking and less error-prone. Whatever you choose - choose the same one. :)
> > 
> > Ok sounds good. If so, I could go ahead and change the units in the
> > bq2425x_charger.c over to mA and mV?
> 
> Wait, these are existing bindings (for bq24257). You cannot change
> existing binding.
> 
> Best regards,
> Krzysztof
> 
> > It would be a bit labor some and I
> > also want to see what Laurentiu thinks but this way we could have most
> > of those TI charger drivers use the same units (the new bq24261 driver
> > Ram posted also uses mA/mV). Except bq25890_charger.c.... that would
> > still use uA/uV....
> > 
> > Laurentiu -- what made you chose the "micro" units for bq24257_charger.c
> > and bq25890_charger.c?
When I started writing the BQ24257 driver, I had a look on what existed
already. Somehow, I don't know why, I settled on bq24190_charger which
has all the units in uA/uV. I thought it's the de-facto standard for
charger drivers... :/

For bindings, I looked at the existing TI chips bindings and chose the
same binding names, where possible. But for some dumb reason, I missed
that the units already used where mainly in mA/mV and, honestly, I
didn't even suspect units must be consistent from device to device. What
happens if a chip needs a more fine grained setting? I agree on binding
name consistency though: ti,charge-current (for example) should mean the
same for all TI chargers.

That said, is not much we can do on the mA/uA or mV/uV front... At least
we can agree on using the same binding names.

laurentiu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261  charger Andreas Dannenberg <dannenberg@ti.com> - 2015-09-09 04:30 +0200
  Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-09-09 06:20 +0200
    Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261  charger Andreas Dannenberg <dannenberg@ti.com> - 2015-09-09 19:40 +0200
      Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261 charger Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-09-10 01:50 +0200
        Re: [PATCH] power: bq24261_charger: Add support for TI BQ24261  charger Laurentiu Palcu <laurentiu.palcu@intel.com> - 2015-09-10 17:00 +0200

csiph-web