From: "Heiko Stübner" <heiko@sntech.de>
To: Rob Herring <robherring2@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	David Woodhouse <dwmw2@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 1/3] dt-bindings: document gpio-charger bindings
Date: Wed, 12 Mar 2014 15:57:18 +0100	[thread overview]
Message-ID: <4446481.1MqT47xhP8@phil> (raw)
In-Reply-To: <CAL_JsqKoOhHpJ_OL23WbitQbiJJKLpWrtezT824FP0qtZ2xrEg@mail.gmail.com>
Hi Rob,
Am Mittwoch, 12. März 2014, 09:28:46 schrieb Rob Herring:
> On Wed, Mar 12, 2014 at 8:46 AM, Heiko Stübner <heiko@sntech.de> wrote:
> > From: Heiko Stuebner <heiko.stuebner@bq.com>
> > 
> > This documents the binding for the gpio-charger power-supply.
> 
> How does this relate to what's documented in power_supply.txt and
> charger-manager.txt? Both have references to USB charging. Doesn't
> this need some connection to a battery node?
Yep, the gpio-charger takes the position of the "some,usb-charger" from 
power_supply.txt .
       usb_charger: charger {
               compatible = "gpio-charger";
               charger-type = "usb-sdp";
               gpios = <&gpf0 2 0 0 0>;
       }
       battery {
               power-supplies = <&usb_charger>;
       };
I guess the binding doc could reflect this.
I haven't deeply looked into what charger-manager does, bit it seems to be a 
layer on top of chargers and batteries, controlling them. So it seems to be 
used with more intelligent components.
My setup using gpio-charger for example is vastly simpler, it's just a gpio 
reporting charger present (for gpio-charger), an adc reporting the battery 
voltage and another gpio reporting the charging state (which is already 
handled in generic-adc-battery, but needs a dt binding too).
Heiko
> > Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com>
> > ---
> > 
> >  .../bindings/power_supply/gpio-charger.txt         | 23
> >  ++++++++++++++++++++++ 1 file changed, 23 insertions(+)
> >  create mode 100644
> >  Documentation/devicetree/bindings/power_supply/gpio-charger.txt> 
> > diff --git
> > a/Documentation/devicetree/bindings/power_supply/gpio-charger.txt
> > b/Documentation/devicetree/bindings/power_supply/gpio-charger.txt new
> > file mode 100644
> > index 0000000..fad87a4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power_supply/gpio-charger.txt
> > @@ -0,0 +1,23 @@
> > +gpio-charger
> > +
> > +Required properties :
> > + - compatible : "gpio-charger"
> > + - gpios : GPIO indicating the charger presence.
> > +   See GPIO binding in bindings/gpio/gpio.txt .
> > + - charger-type : power supply type, one of
> > +     unknown
> > +     battery
> > +     ups
> > +     mains
> > +     usb-sdp (USB standard downstream port)
> > +     usb-dcp (USB dedicated charging port)
> > +     usb-cdp (USB charging downstream port)
> > +     usb-aca (USB accessory charger adapter)
> > +
> > +Example:
> > +
> > +       charger {
> > +               compatible = "gpio-charger";
> > +               charger-type = "usb-sdp";
> > +               gpios = <&gpf0 2 0 0 0>;
> > +       }
> > --
> > 1.8.5.3
next prev parent reply	other threads:[~2014-03-12 14:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 13:45 [PATCH 0/3] gpio-charger: add devicetree support Heiko Stübner
2014-03-12 13:46 ` [PATCH 1/3] dt-bindings: document gpio-charger bindings Heiko Stübner
2014-03-12 14:28   ` Rob Herring
2014-03-12 14:57     ` Heiko Stübner [this message]
2014-03-12 13:48 ` [PATCH 2/3] power: gpio-charger: add device tree support Heiko Stübner
2014-03-12 13:48 ` [PATCH 3/3] power: gpio-charger: do not use gpio value directly Heiko Stübner
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=4446481.1MqT47xhP8@phil \
    --to=heiko@sntech.de \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robherring2@gmail.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 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).