lantiq: fix broadcasts and vlans in two iface mode
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.9 / 0193-Add-overlay-for-ads1115-ADCs-1864.patch
1 From 6d5e32067cf3f3169ec15097c175878de365d247 Mon Sep 17 00:00:00 2001
2 From: Scott Ellis <scott@jumpnowtek.com>
3 Date: Wed, 1 Mar 2017 07:22:24 -0500
4 Subject: [PATCH] Add overlay for ads1115 ADCs (#1864)
5
6 ---
7  arch/arm/boot/dts/overlays/Makefile            |   1 +
8  arch/arm/boot/dts/overlays/README              |  22 ++++++
9  arch/arm/boot/dts/overlays/ads1115-overlay.dts | 103 +++++++++++++++++++++++++
10  3 files changed, 126 insertions(+)
11  create mode 100644 arch/arm/boot/dts/overlays/ads1115-overlay.dts
12
13 --- a/arch/arm/boot/dts/overlays/Makefile
14 +++ b/arch/arm/boot/dts/overlays/Makefile
15 @@ -4,6 +4,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
16         adau1977-adc.dtbo \
17         adau7002-simple.dtbo \
18         ads1015.dtbo \
19 +       ads1115.dtbo \
20         ads7846.dtbo \
21         akkordion-iqdacplus.dtbo \
22         allo-piano-dac-pcm512x-audio.dtbo \
23 --- a/arch/arm/boot/dts/overlays/README
24 +++ b/arch/arm/boot/dts/overlays/README
25 @@ -196,6 +196,28 @@ Params: addr                    I2C bus
26          http://www.ti.com/lit/ds/symlink/ads1015.pdf
27  
28  
29 +Name:   ads1115
30 +Info:   Texas Instruments ADS1115 ADC
31 +Load:   dtoverlay=ads1115,<param>[=<val>]
32 +Params: addr                    I2C bus address of device. Set based on how the
33 +                                addr pin is wired. (default=0x48 assumes addr
34 +                                is pulled to GND)
35 +        cha_enable              Enable virtual channel a.
36 +        cha_cfg                 Set the configuration for virtual channel a.
37 +                                (default=4 configures this channel for the
38 +                                voltage at A0 with respect to GND)
39 +        cha_datarate            Set the datarate (samples/sec) for this channel.
40 +                                (default=7 sets 860 sps)
41 +        cha_gain                Set the gain of the Programmable Gain
42 +                                Amplifier for this channel. (Default 1 sets the
43 +                                full scale of the channel to 4.096 Volts)
44 +
45 +        Channel parameters can be set for each enabled channel.
46 +        A maximum of 4 channels can be enabled (letters a thru d).
47 +        For more information refer to the device datasheet at:
48 +        http://www.ti.com/lit/ds/symlink/ads1115.pdf
49 +
50 +
51  Name:   ads7846
52  Info:   ADS7846 Touch controller
53  Load:   dtoverlay=ads7846,<param>=<val>
54 --- /dev/null
55 +++ b/arch/arm/boot/dts/overlays/ads1115-overlay.dts
56 @@ -0,0 +1,103 @@
57 +/*
58 + * TI ADS1115 multi-channel ADC overlay
59 + */
60 +
61 +/dts-v1/;
62 +/plugin/;
63 +
64 +/ {
65 +       compatible = "brcm,bcm2708";
66 +
67 +       fragment@0 {
68 +               target = <&i2c_arm>;
69 +               __overlay__ {
70 +                       #address-cells = <1>;
71 +                       #size-cells = <0>;
72 +                       status = "okay";
73 +
74 +                       ads1115: ads1115 {
75 +                               compatible = "ti,ads1115";
76 +                               status = "okay";
77 +                               #address-cells = <1>;
78 +                               #size-cells = <0>;
79 +                               reg = <0x48>;
80 +                       };
81 +               };
82 +       };
83 +
84 +       fragment@1 {
85 +               target-path = "i2c_arm/ads1115";
86 +               __dormant__ {
87 +                       #address-cells = <1>;
88 +                       #size-cells = <0>;
89 +
90 +                       channel_a: channel_a {
91 +                               reg = <4>;
92 +                               ti,gain = <1>;
93 +                               ti,datarate = <7>;
94 +                       };
95 +               };
96 +       };
97 +
98 +       fragment@2 {
99 +               target-path = "i2c_arm/ads1115";
100 +               __dormant__ {
101 +                       #address-cells = <1>;
102 +                       #size-cells = <0>;
103 +
104 +                       channel_b: channel_b {
105 +                               reg = <5>;
106 +                               ti,gain = <1>;
107 +                               ti,datarate = <7>;
108 +                       };
109 +               };
110 +       };
111 +
112 +       fragment@3 {
113 +               target-path = "i2c_arm/ads1115";
114 +               __dormant__ {
115 +                       #address-cells = <1>;
116 +                       #size-cells = <0>;
117 +
118 +                       channel_c: channel_c {
119 +                               reg = <6>;
120 +                               ti,gain = <1>;
121 +                               ti,datarate = <7>;
122 +                       };
123 +               };
124 +       };
125 +
126 +       fragment@4 {
127 +               target-path = "i2c_arm/ads1115";
128 +               __dormant__ {
129 +                       #address-cells = <1>;
130 +                       #size-cells = <0>;
131 +
132 +                       channel_d: channel_d {
133 +                               reg = <7>;
134 +                               ti,gain = <1>;
135 +                               ti,datarate = <7>;
136 +                       };
137 +               };
138 +       };
139 +
140 +       __overrides__ {
141 +               addr =            <&ads1115>,"reg:0";
142 +               cha_enable =      <0>,"=1";
143 +               cha_cfg =         <&channel_a>,"reg:0";
144 +               cha_gain =        <&channel_a>,"ti,gain:0";
145 +               cha_datarate =    <&channel_a>,"ti,datarate:0";
146 +               chb_enable =      <0>,"=2";
147 +               chb_cfg =         <&channel_b>,"reg:0";
148 +               chb_gain =        <&channel_b>,"ti,gain:0";
149 +               chb_datarate =    <&channel_b>,"ti,datarate:0";
150 +               chc_enable =      <0>,"=3";
151 +               chc_cfg =         <&channel_c>,"reg:0";
152 +               chc_gain =        <&channel_c>,"ti,gain:0";
153 +               chc_datarate =    <&channel_c>,"ti,datarate:0";
154 +               chd_enable =      <0>,"=4";
155 +               chd_cfg =         <&channel_d>,"reg:0";
156 +               chd_gain =        <&channel_d>,"ti,gain:0";
157 +               chd_datarate =    <&channel_d>,"ti,datarate:0";
158 +       };
159 +};