1 From a477a6351575aa173f9f82857f5797e384fbc704 Mon Sep 17 00:00:00 2001
2 From: JinShil <slavo5150@yahoo.com>
3 Date: Tue, 28 Nov 2023 17:05:44 +0900
4 Subject: [PATCH] overlays: ADS1115: allow specification of the i2c bus
7 arch/arm/boot/dts/overlays/README | 10 +++
8 .../arm/boot/dts/overlays/ads1115-overlay.dts | 80 +++++++++++++------
9 2 files changed, 66 insertions(+), 24 deletions(-)
11 --- a/arch/arm/boot/dts/overlays/README
12 +++ b/arch/arm/boot/dts/overlays/README
13 @@ -489,6 +489,16 @@ Params: addr I2C bus
14 cha_gain Set the gain of the Programmable Gain
15 Amplifier for this channel. (Default 1 sets the
16 full scale of the channel to 4.096 Volts)
17 + i2c0 Choose the I2C0 bus on GPIOs 0&1
18 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
19 + i2c3 Choose the I2C3 bus (configure with the i2c3
20 + overlay - BCM2711 only)
21 + i2c4 Choose the I2C4 bus (configure with the i2c4
22 + overlay - BCM2711 only)
23 + i2c5 Choose the I2C5 bus (configure with the i2c5
24 + overlay - BCM2711 only)
25 + i2c6 Choose the I2C6 bus (configure with the i2c6
26 + overlay - BCM2711 only)
28 Channel parameters can be set for each enabled channel.
29 A maximum of 4 channels can be enabled (letters a thru d).
30 --- a/arch/arm/boot/dts/overlays/ads1115-overlay.dts
31 +++ b/arch/arm/boot/dts/overlays/ads1115-overlay.dts
33 compatible = "brcm,bcm2835";
36 - target = <&i2c_arm>;
38 - #address-cells = <1>;
42 - ads1115: ads1115@48 {
43 - compatible = "ti,ads1115";
45 - #address-cells = <1>;
90 + #address-cells = <1>;
94 + ads1115: ads1115@48 {
95 + compatible = "ti,ads1115";
97 + #address-cells = <1>;
104 + frag100: fragment@100 {
106 + i2cbus: __overlay__ {
112 + target = <&i2c0if>;
119 + target = <&i2c0mux>;
126 addr = <&ads1115>,"reg:0";
127 - cha_enable = <0>,"=1";
128 + cha_enable = <0>,"=0";
129 cha_cfg = <&channel_a>,"reg:0";
130 cha_gain = <&channel_a>,"ti,gain:0";
131 cha_datarate = <&channel_a>,"ti,datarate:0";
132 - chb_enable = <0>,"=2";
133 + chb_enable = <0>,"=1";
134 chb_cfg = <&channel_b>,"reg:0";
135 chb_gain = <&channel_b>,"ti,gain:0";
136 chb_datarate = <&channel_b>,"ti,datarate:0";
137 - chc_enable = <0>,"=3";
138 + chc_enable = <0>,"=2";
139 chc_cfg = <&channel_c>,"reg:0";
140 chc_gain = <&channel_c>,"ti,gain:0";
141 chc_datarate = <&channel_c>,"ti,datarate:0";
142 - chd_enable = <0>,"=4";
143 + chd_enable = <0>,"=3";
144 chd_cfg = <&channel_d>,"reg:0";
145 chd_gain = <&channel_d>,"ti,gain:0";
146 chd_datarate = <&channel_d>,"ti,datarate:0";
147 + i2c0 = <&frag100>, "target:0=",<&i2c0>;
148 + i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
150 + i2c3 = <&frag100>, "target?=0",
151 + <&frag100>, "target-path=i2c3";
152 + i2c4 = <&frag100>, "target?=0",
153 + <&frag100>, "target-path=i2c4";
154 + i2c5 = <&frag100>, "target?=0",
155 + <&frag100>, "target-path=i2c5";
156 + i2c6 = <&frag100>, "target?=0",
157 + <&frag100>, "target-path=i2c6";