devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, Marcel Partap <mpartap@gmx.net>,
	Michael Scott <michael.scott@linaro.org>,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH] power: supply: cpcap-battery: Add a battery driver
Date: Sat, 20 May 2017 10:05:33 -0700	[thread overview]
Message-ID: <20170520170533.GN10472@atomide.com> (raw)
In-Reply-To: <20170519055146.2038-1-tony@atomide.com>

* Tony Lindgren <tony@atomide.com> [170518 22:55]:
> Note that I left out the battery interrupt handling for now as I need
> to spend more time on it for the battery empty interrupts. The driver
> works just fine without the interrupts too.
...
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/cpcap-battery.txt
> @@ -0,0 +1,27 @@
> +Motorola CPCAP PMIC battery driver binding
> +
> +Required properties:
> +- compatible: Shall be "motorola,cpcap-battery"
> +- interrupts: Interrupt specifier for each name in interrupt-names
> +- interrupt-names: Should contain the following entries:
> +		   "lowbph", "lowbpl", "chrgcurr1", "battdetb"
> +- io-channels: IIO ADC channel specifier for each name in io-channel-names
> +- io-channel-names: Should contain the following entries:
> +		    "battdetb", "battp"
> +
> +Example:
> +
> +cpcap_battery: battery {
> +	compatible = "motorola,cpcap-battery";
> +	interrupts-extended = <
> +		&cpcap 5 0 &cpcap 3 0
> +		&cpcap 20 0 &cpcap 54 0
> +	>;
> +	interrupt-names =
> +		"lowbph", "lowbpl",
> +		"chrgcurr1", "battdetb";
> +	io-channels = <&cpcap_adc 0 &cpcap_adc 1
> +		       &cpcap_adc 5 &cpcap_adc 6>;
> +	io-channel-names = "battdetb", "battp",
> +			   "chg_isense", "batti";
> +};

I guess we should leave out the interrupts in the binding for now
too. Or at least move them to optional properties.

Anyways, below is the related dts patch I've been using.

Regards,

Tony

8< -------------------------
>From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Fri, 19 May 2017 14:23:25 -0700
Subject: [PATCH] ARM: dts: omap4-droid4: Configure CPCAP battery driver

Configure CPCAP battery driver.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
--- a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
+++ b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
@@ -26,6 +26,21 @@
 			#io-channel-cells = <1>;
 		};
 
+		cpcap_battery: battery {
+			compatible = "motorola,cpcap-battery";
+			interrupts-extended = <
+				&cpcap 5 0 &cpcap 3 0
+				&cpcap 20 0 &cpcap 54 0
+			>;
+			interrupt-names =
+				"lowbph", "lowbpl",
+				"chrgcurr1", "battdetb";
+			io-channels = <&cpcap_adc 0 &cpcap_adc 1
+				       &cpcap_adc 5 &cpcap_adc 6>;
+			io-channel-names = "battdetb", "battp",
+					   "chg_isense", "batti";
+		};
+
 		cpcap_charger: charger {
 			compatible = "motorola,mapphone-cpcap-charger";
 			interrupts-extended = <
-- 
2.13.0

  reply	other threads:[~2017-05-20 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19  5:51 [PATCH] power: supply: cpcap-battery: Add a battery driver Tony Lindgren
2017-05-20 17:05 ` Tony Lindgren [this message]
     [not found]   ` <20170520170533.GN10472-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-05-23  0:38     ` Tony Lindgren
2017-06-08 21:26     ` Sebastian Reichel
2017-06-12  7:10       ` Tony Lindgren

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=20170520170533.GN10472@atomide.com \
    --to=tony@atomide.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=michael.scott@linaro.org \
    --cc=mpartap@gmx.net \
    --cc=robh@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).