From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "mazziesaccount@gmail.com" <mazziesaccount@gmail.com>
Cc: "broonie@kernel.org" <broonie@kernel.org>,
"Mutanen, Mikko" <Mikko.Mutanen@fi.rohmeurope.com>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"Laine, Markus" <Markus.Laine@fi.rohmeurope.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"sre@kernel.org" <sre@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [RFC PATCH 1/3] dt_bindings: ROHM BD99954 Charger
Date: Mon, 10 Feb 2020 13:00:44 +0000 [thread overview]
Message-ID: <fbbacf0597222443941ac1736fbf6de4dccd6d70.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <fc866eb870e1980fd2a5cd37cf02cde5e8fb3d06.1581327762.git.matti.vaittinen@fi.rohmeurope.com>
On Mon, 2020-02-10 at 14:11 +0200, Matti Vaittinen wrote:
> The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion
> secondary battery. Intended to be used in space-constraint equipment
> such
> as Low profile Notebook PC, Tablets and other applications. BD99954
> provides a Dual-source Battery Charger, two port BC1.2 detection and
> a
> Battery Monitor.
>
> Document the DT bindings for BD99954
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> ---
> I think these properties could probably be generic and not
> vendor specific, right? If so, then I could try adding parser
> function(s) for them in power/supply framework. How do you
> guys see this?
Sorry folks. I wasn't reading existing docs carefully enough. I skipped
battery.txt as I was doing driver for charger... I should've understood
that many of the limits here come from battery properties :/
So right after sending this out I hit the battry.txt binding doc and
following note in power_supply_class.rst:
"Drivers should call power_supply_get_battery_info() to obtain battery
characteristics from a devicetree battery node, defined in think there
must be quite a few examples of that in-tree too.
Documentation/devicetree/bindings/power/supply/battery.txt"
It seems we already have bunch of common bindings and the helper. I'd
better study the charging properties from battery.txt and re-use those
I can re-use. I still see couple of things we might want to add?
(My new guess for "the correect thing to do" is that the charging
currents and voltages should be given in a battery node. The driver
should then use power_supply_get_battery_info() to extract this
information - makes sense. Input current limits are still different
thing)
>
> .../bindings/power/supply/rohm,bdDocumentation/devicetree/bindings/p
> ower/supply/battery.txt.9995x.yaml | 118 ++++++++++++++++++
> 1 file changed, 118 insertions(+)
> create mode 100644
> Documentation/devicetree/bindings/power/supply/rohm,bd9995x.yaml
>
> diff --git
> a/Documentation/devicetree/bindings/power/supply/rohm,bd9995x.yaml
> b/Documentation/devicetree/bindings/power/supply/rohm,bd9995x.yaml
> new file mode 100644
> index 000000000000..ba9fe1dc3f2f
> --- /dev/null
> +++
> b/Documentation/devicetree/bindings/power/supply/rohm,bd9995x.yaml
> @@ -0,0 +1,118 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/supply/rohm,bd9995x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ROHM BD99954 Battery charger driver
> +
> +maintainers:
> + - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> + - Markus Laine <markus.laine@fi.rohmeurope.com>
> + - Mikko Mutanen <mikko.mutanen@fi.rohmeurope.com>
> +
> +description: |
> + The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-
> Ion
> + secondary battery intended to be used in space-constraint
> equipment such
> + as Low profile Notebook PC, Tablets and other applications.
> BD99954
> + provides a Dual-source Battery Charger, two port BC1.2 detection
> and a
> + Battery Monitor.
> +
> +properties:
> + compatible:
> + const: rohm,bd9995x-charger
> +
> + rohm,vbus-input-current-limit-microamp:
> + description:
> + system specific VBUS input current limit (in microamps).
> + minimum: 32000
> + maximum: 16352000
> + multipleOf: 32000
> +
> + rohm,vcc-input-current-limit-microamp:
> + description:
> + system specific VCC/VACP input current limit (in microamps).
> + minimum: 32000
> + maximum: 16352000
> + multipleOf: 32000
I think these input current limits (input for charger) can't be in
battery node. These are system/charger limits, right?
> + rohm,trickle-charging-current-microamp:
I think this should be replaced by precharge-current-microamp:
> + description:
> + battery specific value for trickle-charging current.
> + minimum: 64000
> + maximum: 1024000
> + multipleOf: 64000
> +
> + rohm,pre-charging-current-microamp:
This should be replaced by constant-charge-current-max-microamp:
> + description:
> + battery specific value for pre-charging current.
> + minimum: 64000
> + maximum: 1024000
> + multipleOf: 64000
> +
> + rohm,fast-charging-regulation-microvolt:
This should be replaced by constant-charge-voltage-max-microvolt:
> + description:
> + battery/system specific upper limit for battry/system voltage.
> + minimum: 2560000
> + maximum: 19200000
> + multipleOf: 16000
> +
> + rohm,vsys-regulation-microvolt:
> + description:
> + system specific lower limit for system voltage.
> + minimum: 2560000
> + maximum: 19200000
> + multipleOf: 64000
> +
> + rohm,pre-charge-voltage-threshold-microvolt:
> + description:
> + voltage limit for changing from trickle to pre-charging.
Can we use voltage-min-design-microvolt: for this or invent a new one?
> + minimum: 2048000
> + maximum: 19200000
> + multipleOf: 64000
> +
> + rohm,re-charge-battery-voltage-microvolt:
> + description:
> + voltage limit for automatically re-starting the battery
I don't see a match for this either.
> charging.
> + minimum: 2560000
> + maximum: 19200000
> + multipleOf: 16000
> +
> + rohm,battery-over-voltage-threshold-microvolt:
> + description:
> + voltage limit for detecting battery over voltage.
And this is also something we might want to add?
> + minimum: 2560000
> + maximum: 19200000
> + multipleOf: 16000
> +
> +required:
> + - compatible
> + - rohm,vbus-input-current-limit-microamp
> + - rohm,vcc-input-current-limit-microamp
> + - rohm,trickle-charging-current-microamp
> + - rohm,pre-charging-current-microamp
> + - rohm,fast-charging-regulation-microvolt
> + - rohm,vsys-regulation-microvolt
> + - rohm,pre-charge-voltage-threshold-microvolt
> + - rohm,re-charge-battery-voltage-microvolt
> + - rohm,battery-over-voltage-threshold-microvolt
> +
> +examples:
> + - |
> + i2c {
> + charger@9 {
> + compatible = "rohm,bd9995x-charger";
> + reg = <0x9>;
> + interrupt-parent = <&gpio1>;
> + interrupts = <29 8>;
> + rohm,vsys-regulation-microvolt = <8960000>;
> + rohm,vbus-input-current-limit-microamp = <1472000>;
> + rohm,vcc-input-current-limit-microamp = <1472000>;
> + rohm,trickle-charging-current-microamp = <256000>;
> + rohm,pre-charging-current-microamp = <256000>;
> + rohm,fast-charging-regulation-microvolt = <8400000>;
> + rohm,pre-charge-voltage-threshold-microvolt = <2048000>;
> + rohm,re-charge-battery-voltage-microvolt = <8112000>;
> + rohm,battery-over-voltage-threshold-microvolt =
> <8912000>;
> + };
> + };
> --
> 2.21.0
>
>
next prev parent reply other threads:[~2020-02-10 13:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 12:11 [RFC PATCH 0/3] Support ROHM BD99954 charger IC Matti Vaittinen
2020-02-10 12:11 ` [RFC PATCH 1/3] dt_bindings: ROHM BD99954 Charger Matti Vaittinen
2020-02-10 13:00 ` Vaittinen, Matti [this message]
2020-02-10 12:13 ` [RFC PATCH 2/3] power: (regmap:) Add linear_range helper Matti Vaittinen
2020-02-11 19:06 ` Mark Brown
2020-02-12 6:56 ` Vaittinen, Matti
2020-02-14 11:47 ` Mark Brown
2020-02-14 12:32 ` Vaittinen, Matti
2020-02-18 7:23 ` Vaittinen, Matti
2020-02-18 13:49 ` Mark Brown
2020-02-19 8:14 ` Vaittinen, Matti
2020-02-10 12:13 ` [RFC PATCH 3/3] power: supply: Support ROHM bd99954 charger Matti Vaittinen
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=fbbacf0597222443941ac1736fbf6de4dccd6d70.camel@fi.rohmeurope.com \
--to=matti.vaittinen@fi.rohmeurope.com \
--cc=Markus.Laine@fi.rohmeurope.com \
--cc=Mikko.Mutanen@fi.rohmeurope.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mazziesaccount@gmail.com \
--cc=robh+dt@kernel.org \
--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).