1 From 585ea300fa44cdf3c3259af68c49518bb85e4af2 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 1 May 2018 09:35:56 +0100
4 Subject: [PATCH 289/454] overlays: Add ltc294x (battery gauge)
6 Support the LTC294x range of I2C-connected battery monitors.
8 See: https://github.com/raspberrypi/linux/issues/2537
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 25 ++++++
14 .../arm/boot/dts/overlays/ltc294x-overlay.dts | 86 +++++++++++++++++++
15 3 files changed, 112 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/ltc294x-overlay.dts
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -60,6 +60,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -1020,6 +1020,31 @@ Params: gpio_out_pin GPIO for
35 +Info: Adds support for the ltc294x family of battery gauges
36 +Load: dtoverlay=ltc294x,<param>=<val>
37 +Params: ltc2941 Select the ltc2941 device
39 + ltc2942 Select the ltc2942 device
41 + ltc2943 Select the ltc2943 device
43 + ltc2944 Select the ltc2944 device
45 + resistor-sense The sense resistor value in milli-ohms.
46 + Can be a 32-bit negative value when the battery
47 + has been connected to the wrong end of the
50 + prescaler-exponent Range and accuracy of the gauge. The value is
51 + programmed into the chip only if it differs
52 + from the current setting.
54 + - Default value is 128
55 + - the exponent is in the range 0-7 (default 7)
56 + See the datasheet for more information.
60 Info: Configures the mbed AudioCODEC (TLV320AIC23B)
61 Load: dtoverlay=mbed-dac
63 +++ b/arch/arm/boot/dts/overlays/ltc294x-overlay.dts
70 + compatible = "brcm,bcm2835";
73 + target = <&i2c_arm>;
75 + #address-cells = <1>;
79 + ltc2941: ltc2941@64 {
80 + compatible = "lltc,ltc2941";
82 + lltc,resistor-sense = <50>;
83 + lltc,prescaler-exponent = <7>;
89 + target = <&i2c_arm>;
91 + #address-cells = <1>;
95 + ltc2942: ltc2942@64 {
96 + compatible = "lltc,ltc2942";
98 + lltc,resistor-sense = <50>;
99 + lltc,prescaler-exponent = <7>;
105 + target = <&i2c_arm>;
107 + #address-cells = <1>;
111 + ltc2943: ltc2943@64 {
112 + compatible = "lltc,ltc2943";
114 + lltc,resistor-sense = <50>;
115 + lltc,prescaler-exponent = <7>;
121 + target = <&i2c_arm>;
123 + #address-cells = <1>;
127 + ltc2944: ltc2944@64 {
128 + compatible = "lltc,ltc2944";
130 + lltc,resistor-sense = <50>;
131 + lltc,prescaler-exponent = <7>;
137 + ltc2941 = <0>,"+0";
138 + ltc2942 = <0>,"+1";
139 + ltc2943 = <0>,"+2";
140 + ltc2944 = <0>,"+3";
141 + resistor-sense = <<c2941>, "lltc,resistor-sense:0",
142 + <<c2942>, "lltc,resistor-sense:0",
143 + <<c2943>, "lltc,resistor-sense:0",
144 + <<c2944>, "lltc,resistor-sense:0";
145 + prescaler-exponent = <<c2941>, "lltc,prescaler-exponent:0",
146 + <<c2942>, "lltc,prescaler-exponent:0",
147 + <<c2943>, "lltc,prescaler-exponent:0",
148 + <<c2944>, "lltc,prescaler-exponent:0";