linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: omap4-droid4: Enable hdq for droid4 ds250x 1-wire battery nvmem
@ 2020-01-19 19:56 Tony Lindgren
       [not found] ` <20200119195659.18273-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2020-01-19 19:56 UTC (permalink / raw)
  To: linux-omap; +Cc: Benoît Cousson, devicetree, Merlijn Wajer, Pavel Machek

With "[PATCHv3] w1: omap-hdq: Simplify driver with PM runtime autosuspend"
we can read the droid4 battery information over 1-wire with this patch
with something like:

# modprobe omap_hdq
# hd /sys/bus/w1/devices/89-*/89-*/nvmem
...

Unfortunately the format of the battery data seems to be Motorola specific
and is currently unusable for battery charger unless somebody figures out
what it means.

Note that currently keeping omap_hdq module loaded will cause extra power
consumption as it seems to scan devices periodically.

Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/motorola-mapphone-common.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
--- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi
+++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
@@ -259,6 +259,13 @@
 	};
 };
 
+/* Battery NVRAM on 1-wire handled by w1_ds250x driver */
+&hdqw1w {
+	pinctrl-0 = <&hdq_pins>;
+	pinctrl-names = "default";
+	ti,mode = "1w";
+};
+
 &i2c1 {
 	tmp105@48 {
 		compatible = "ti,tmp105";
@@ -449,6 +456,13 @@
 		>;
 	};
 
+	hdq_pins: pinmux_hdq_pins {
+		pinctrl-single,pins = <
+		/* 0x4a100120 hdq_sio.hdq_sio aa27 */
+		OMAP4_IOPAD(0x120, PIN_INPUT | MUX_MODE0)
+		>;
+	};
+
 	/* hdmi_cec.hdmi_cec, hdmi_scl.hdmi_scl, hdmi_sda.hdmi_sda */
 	dss_hdmi_pins: pinmux_dss_hdmi_pins {
 		pinctrl-single,pins = <
-- 
2.24.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: dts: omap4-droid4: Enable hdq for droid4 ds250x 1-wire battery nvmem
       [not found] ` <20200119195659.18273-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2020-01-21  9:17   ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2020-01-21  9:17 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Merlijn Wajer

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

On Sun 2020-01-19 11:56:59, Tony Lindgren wrote:
> With "[PATCHv3] w1: omap-hdq: Simplify driver with PM runtime autosuspend"
> we can read the droid4 battery information over 1-wire with this patch
> with something like:
> 
> # modprobe omap_hdq
> # hd /sys/bus/w1/devices/89-*/89-*/nvmem
> ...
> 
> Unfortunately the format of the battery data seems to be Motorola specific
> and is currently unusable for battery charger unless somebody figures out
> what it means.
> 
> Note that currently keeping omap_hdq module loaded will cause extra power
> consumption as it seems to scan devices periodically.
> 
> Cc: Merlijn Wajer <merlijn-tF0PIh4TN3odnm+yROfE0A@public.gmane.org>

Acked-by: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>

Not for stable.
								Pavel
								
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-21  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19 19:56 [PATCH] ARM: dts: omap4-droid4: Enable hdq for droid4 ds250x 1-wire battery nvmem Tony Lindgren
     [not found] ` <20200119195659.18273-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2020-01-21  9:17   ` Pavel Machek

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).