diff options
author | David Lechner <david@lechnology.com> | 2017-04-11 23:05:23 +0200 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2017-05-17 12:59:38 +0200 |
commit | b8a46eea52fce1de30b2c4d0c9438d2a011a86ba (patch) | |
tree | 60ef7bba5ba4cd195c0bc3c5358a5ca34b7a1f0b /arch/arm/boot/dts/da850-lego-ev3.dts | |
parent | Linux 4.12-rc1 (diff) | |
download | linux-b8a46eea52fce1de30b2c4d0c9438d2a011a86ba.tar.xz linux-b8a46eea52fce1de30b2c4d0c9438d2a011a86ba.zip |
ARM: dts: da850-lego-ev3: Add node for LEGO MINDSTORMS EV3 Battery
This adds a new node to the LEGO MINDSTORMS EV3 device tree for the battery.
Signed-off-by: David Lechner <david@lechnology.com>
[nsekhar@ti.com: minor headline fix]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm/boot/dts/da850-lego-ev3.dts')
-rw-r--r-- | arch/arm/boot/dts/da850-lego-ev3.dts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts index 512604ad8b71..45983c04a8a7 100644 --- a/arch/arm/boot/dts/da850-lego-ev3.dts +++ b/arch/arm/boot/dts/da850-lego-ev3.dts @@ -172,6 +172,18 @@ gpio = <&gpio 111 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + /* + * The EV3 can use 6-AA batteries or a rechargeable Li-ion battery pack. + */ + battery { + pinctrl-names = "default"; + pintctrl-0 = <&battery_pins>; + compatible = "lego,ev3-battery"; + io-channels = <&adc 4>, <&adc 3>; + io-channel-names = "voltage", "current"; + rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>; + }; }; &pmx_core { @@ -228,6 +240,15 @@ 0x34 0x00000008 0x0000000f >; }; + + battery_pins: pinmux_battery_pins { + pinctrl-single,bits = < + /* GP0[6] */ + 0x04 0x00000080 0x000000f0 + /* GP8[8] */ + 0x4c 0x00000080 0x000000f0 + >; + }; }; &pinconf { @@ -342,6 +363,13 @@ &gpio { status = "okay"; + + /* Don't pull down battery voltage adc io channel */ + batt_volt_en { + gpio-hog; + gpios = <6 GPIO_ACTIVE_HIGH>; + output-low; + }; }; &usb_phy { |