Loading...
1/*
2 * Device Tree Source for mangOH Green Board with WP8548 Module
3 *
4 * Copyright (C) 2016 BayLibre, SAS.
5 * Author : Neil Armstrong <narmstrong@baylibre.com>
6 *
7 * This file is dual-licensed: you can use it either under the terms
8 * of the GPL or the X11 license, at your option. Note that this dual
9 * licensing only applies to this file, and not this project as a
10 * whole.
11 *
12 * a) This file is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
16 *
17 * This file is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 * b) Permission is hereby granted, free of charge, to any person
25 * obtaining a copy of this software and associated documentation
26 * files (the "Software"), to deal in the Software without
27 * restriction, including without limitation the rights to use,
28 * copy, modify, merge, publish, distribute, sublicense, and/or
29 * sell copies of the Software, and to permit persons to whom the
30 * Software is furnished to do so, subject to the following
31 * conditions:
32 *
33 * The above copyright notice and this permission notice shall be
34 * included in all copies or substantial portions of the Software.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 * OTHER DEALINGS IN THE SOFTWARE.
44 */
45
46#include <dt-bindings/input/input.h>
47
48#include "qcom-mdm9615-wp8548.dtsi"
49#include <dt-bindings/interrupt-controller/irq.h>
50#include <dt-bindings/gpio/gpio.h>
51
52/ {
53 model = "MangOH Green with WP8548 Module";
54 compatible = "swir,mangoh-green-wp8548", "swir,wp8548", "qcom,mdm9615";
55
56 aliases {
57 spi0 = &gsbi3_spi;
58 serial0 = &gsbi4_serial;
59 serial1 = &gsbi5_serial;
60 i2c0 = &gsbi5_i2c;
61 mmc0 = &sdcc1;
62 };
63
64 chosen {
65 stdout-path = "serial1:115200n8";
66 };
67};
68
69&msmgpio {
70 /* MangOH GPIO Mapping :
71 * - 2 : GPIOEXP_INT2
72 * - 7 : IOT1_GPIO2
73 * - 8 : IOT0_GPIO4
74 * - 13: IOT0_GPIO3
75 * - 21: IOT1_GPIO4
76 * - 22: IOT2_GPIO1
77 * - 23: IOT2_GPIO2
78 * - 24: IOT2_GPIO3
79 * - 25: IOT1_GPIO1
80 * - 32: IOT1_GPIO3
81 * - 33: IOT0_GPIO2
82 * - 42: IOT0_GPIO1 and SD Card Detect
83 */
84
85 gpioext1_pins: gpioext1_pins {
86 pins {
87 pins = "gpio2";
88 function = "gpio";
89 input-enable;
90 bias-disable;
91 };
92 };
93
94 sdc_cd_pins: sdc_cd_pins {
95 pins {
96 pins = "gpio42";
97 function = "gpio";
98 drive-strength = <2>;
99 bias-pull-up;
100 };
101 };
102};
103
104&gsbi3_spi {
105 spi@0 {
106 compatible = "swir,mangoh-iotport-spi", "spidev";
107 spi-max-frequency = <24000000>;
108 reg = <0>;
109 };
110};
111
112&gsbi5_i2c {
113 mux@71 {
114 compatible = "nxp,pca9548";
115 #address-cells = <1>;
116 #size-cells = <0>;
117 reg = <0x71>;
118
119 i2c_iot0: i2c@0 {
120 #address-cells = <1>;
121 #size-cells = <0>;
122 reg = <0>;
123 };
124
125 i2c_iot1: i2c@1 {
126 #address-cells = <1>;
127 #size-cells = <0>;
128 reg = <1>;
129 };
130
131 i2c_iot2: i2c@2 {
132 #address-cells = <1>;
133 #size-cells = <0>;
134 reg = <2>;
135 };
136
137 i2c@3 {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 reg = <3>;
141
142 usbhub: hub@8 {
143 compatible = "smsc,usb3503a";
144 reg = <0x8>;
145 connect-gpios = <&gpioext2 1 GPIO_ACTIVE_HIGH>;
146 intn-gpios = <&gpioext2 0 GPIO_ACTIVE_LOW>;
147 initial-mode = <1>;
148 };
149 };
150
151 i2c@4 {
152 #address-cells = <1>;
153 #size-cells = <0>;
154 reg = <4>;
155
156 gpioext0: gpio@3e {
157 /* GPIO Expander 0 Mapping :
158 * - 0: ARDUINO_RESET_Level shift
159 * - 1: BattChrgr_PG_N
160 * - 2: BattGauge_GPIO
161 * - 3: LED_ON (out active high)
162 * - 4: ATmega_reset_GPIO
163 * - 5: X
164 * - 6: PCM_ANALOG_SELECT (out active high)
165 * - 7: X
166 * - 8: Board_rev_res1 (in)
167 * - 9: Board_rev_res2 (in)
168 * - 10: UART_EXP1_ENn (out active low / pull-down)
169 * - 11: UART_EXP1_IN (out pull-down)
170 * - 12: UART_EXP2_IN (out pull-down)
171 * - 13: SDIO_SEL (out pull-down)
172 * - 14: SPI_EXP1_ENn (out active low / pull-down)
173 * - 15: SPI_EXP1_IN (out pull-down)
174 */
175 #gpio-cells = <2>;
176 #interrupt-cells = <2>;
177 compatible = "semtech,sx1509q";
178 reg = <0x3e>;
179 interrupt-parent = <&gpioext1>;
180 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
181
182 probe-reset;
183
184 gpio-controller;
185 interrupt-controller;
186 };
187 };
188
189 i2c@5 {
190 #address-cells = <1>;
191 #size-cells = <0>;
192 reg = <5>;
193
194 gpioext1: gpio@3f {
195 /* GPIO Expander 1 Mapping :
196 * - 0: GPIOEXP_INT1
197 * - 1: Battery detect
198 * - 2: GPIO_SCF3_RESET
199 * - 3: LED_CARD_DETECT_IOT0 (in)
200 * - 4: LED_CARD_DETECT_IOT1 (in)
201 * - 5: LED_CARD_DETECT_IOT2 (in)
202 * - 6: UIM2_PWM_SELECT
203 * - 7: UIM2_M2_S_SELECT
204 * - 8: TP900
205 * - 9: SENSOR_INT1 (in)
206 * - 10: SENSOR_INT2 (in)
207 * - 11: CARD_DETECT_IOT0 (in pull-up)
208 * - 12: CARD_DETECT_IOT2 (in pull-up)
209 * - 13: CARD_DETECT_IOT1 (in pull-up)
210 * - 14: GPIOEXP_INT3 (in active low / pull-up)
211 * - 15: BattChrgr_INT_N
212 */
213 pinctrl-0 = <&gpioext1_pins>;
214 pinctrl-names = "default";
215
216 #gpio-cells = <2>;
217 #interrupt-cells = <2>;
218 compatible = "semtech,sx1509q";
219 reg = <0x3f>;
220 interrupt-parent = <&msmgpio>;
221 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
222
223 probe-reset;
224
225 gpio-controller;
226 interrupt-controller;
227 };
228 };
229
230 i2c@6 {
231 #address-cells = <1>;
232 #size-cells = <0>;
233 reg = <6>;
234
235 gpioext2: gpio@70 {
236 /* GPIO Expander 2 Mapping :
237 * - 0: USB_HUB_INTn
238 * - 1: HUB_CONNECT
239 * - 2: GPIO_IOT2_RESET (out active low / pull-up)
240 * - 3: GPIO_IOT1_RESET (out active low / pull-up)
241 * - 4: GPIO_IOT0_RESET (out active low / pull-up)
242 * - 5: TP901
243 * - 6: TP902
244 * - 7: TP903
245 * - 8: UART_EXP2_ENn (out active low / pull-down)
246 * - 9: PCM_EXP1_ENn (out active low)
247 * - 10: PCM_EXP1_SEL (out)
248 * - 11: ARD_FTDI
249 * - 12: TP904
250 * - 13: TP905
251 * - 14: TP906
252 * - 15: RS232_Enable (out active high / pull-up)
253 */
254 #gpio-cells = <2>;
255 #interrupt-cells = <2>;
256 compatible = "semtech,sx1509q";
257 reg = <0x70>;
258 interrupt-parent = <&gpioext1>;
259 interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
260
261 probe-reset;
262
263 gpio-controller;
264 interrupt-controller;
265 };
266 };
267
268 i2c@7 {
269 #address-cells = <1>;
270 #size-cells = <0>;
271 reg = <7>;
272 };
273 };
274};
275
276&sdcc1 {
277 pinctrl-0 = <&sdc_cd_pins>;
278 pinctrl-names = "default";
279 disable-wp;
280 cd-gpios = <&msmgpio 42 GPIO_ACTIVE_LOW>; /* Active low CD */
281};
1// SPDX-License-Identifier: GPL-2.0+ OR MIT
2/*
3 * Device Tree Source for mangOH Green Board with WP8548 Module
4 *
5 * Copyright (C) 2016 BayLibre, SAS.
6 * Author : Neil Armstrong <narmstrong@baylibre.com>
7 */
8
9#include <dt-bindings/input/input.h>
10
11#include "qcom-mdm9615-wp8548.dtsi"
12#include <dt-bindings/interrupt-controller/irq.h>
13#include <dt-bindings/gpio/gpio.h>
14
15/ {
16 model = "MangOH Green with WP8548 Module";
17 compatible = "swir,mangoh-green-wp8548", "swir,wp8548", "qcom,mdm9615";
18
19 aliases {
20 spi0 = &gsbi3_spi;
21 serial0 = &gsbi4_serial;
22 serial1 = &gsbi5_serial;
23 i2c0 = &gsbi5_i2c;
24 mmc0 = &sdcc1;
25 };
26
27 chosen {
28 stdout-path = "serial1:115200n8";
29 };
30};
31
32&msmgpio {
33 /* MangOH GPIO Mapping :
34 * - 2 : GPIOEXP_INT2
35 * - 7 : IOT1_GPIO2
36 * - 8 : IOT0_GPIO4
37 * - 13: IOT0_GPIO3
38 * - 21: IOT1_GPIO4
39 * - 22: IOT2_GPIO1
40 * - 23: IOT2_GPIO2
41 * - 24: IOT2_GPIO3
42 * - 25: IOT1_GPIO1
43 * - 32: IOT1_GPIO3
44 * - 33: IOT0_GPIO2
45 * - 42: IOT0_GPIO1 and SD Card Detect
46 */
47
48 gpioext1_pins: gpioext1-state {
49 gpioext1-pins {
50 pins = "gpio2";
51 function = "gpio";
52 input-enable;
53 bias-disable;
54 };
55 };
56
57 sdc_cd_pins: sdc-cd-state {
58 sdc-cd-pins {
59 pins = "gpio42";
60 function = "gpio";
61 drive-strength = <2>;
62 bias-pull-up;
63 };
64 };
65};
66
67&gsbi3_spi {
68 spi@0 {
69 compatible = "swir,mangoh-iotport-spi";
70 spi-max-frequency = <24000000>;
71 reg = <0>;
72 };
73};
74
75&gsbi5_i2c {
76 mux@71 {
77 compatible = "nxp,pca9548";
78 #address-cells = <1>;
79 #size-cells = <0>;
80 reg = <0x71>;
81
82 i2c_iot0: i2c@0 {
83 #address-cells = <1>;
84 #size-cells = <0>;
85 reg = <0>;
86 };
87
88 i2c_iot1: i2c@1 {
89 #address-cells = <1>;
90 #size-cells = <0>;
91 reg = <1>;
92 };
93
94 i2c_iot2: i2c@2 {
95 #address-cells = <1>;
96 #size-cells = <0>;
97 reg = <2>;
98 };
99
100 i2c@3 {
101 #address-cells = <1>;
102 #size-cells = <0>;
103 reg = <3>;
104
105 usbhub: hub@8 {
106 compatible = "smsc,usb3503a";
107 reg = <0x8>;
108 connect-gpios = <&gpioext2 1 GPIO_ACTIVE_HIGH>;
109 intn-gpios = <&gpioext2 0 GPIO_ACTIVE_HIGH>;
110 initial-mode = <1>;
111 };
112 };
113
114 i2c@4 {
115 #address-cells = <1>;
116 #size-cells = <0>;
117 reg = <4>;
118
119 gpioext0: pinctrl@3e {
120 /* GPIO Expander 0 Mapping :
121 * - 0: ARDUINO_RESET_Level shift
122 * - 1: BattChrgr_PG_N
123 * - 2: BattGauge_GPIO
124 * - 3: LED_ON (out active high)
125 * - 4: ATmega_reset_GPIO
126 * - 5: X
127 * - 6: PCM_ANALOG_SELECT (out active high)
128 * - 7: X
129 * - 8: Board_rev_res1 (in)
130 * - 9: Board_rev_res2 (in)
131 * - 10: UART_EXP1_ENn (out active low / pull-down)
132 * - 11: UART_EXP1_IN (out pull-down)
133 * - 12: UART_EXP2_IN (out pull-down)
134 * - 13: SDIO_SEL (out pull-down)
135 * - 14: SPI_EXP1_ENn (out active low / pull-down)
136 * - 15: SPI_EXP1_IN (out pull-down)
137 */
138 #gpio-cells = <2>;
139 #interrupt-cells = <2>;
140 compatible = "semtech,sx1509q";
141 reg = <0x3e>;
142 interrupt-parent = <&gpioext1>;
143 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
144
145 semtech,probe-reset;
146
147 gpio-controller;
148 interrupt-controller;
149 };
150 };
151
152 i2c@5 {
153 #address-cells = <1>;
154 #size-cells = <0>;
155 reg = <5>;
156
157 gpioext1: pinctrl@3f {
158 /* GPIO Expander 1 Mapping :
159 * - 0: GPIOEXP_INT1
160 * - 1: Battery detect
161 * - 2: GPIO_SCF3_RESET
162 * - 3: LED_CARD_DETECT_IOT0 (in)
163 * - 4: LED_CARD_DETECT_IOT1 (in)
164 * - 5: LED_CARD_DETECT_IOT2 (in)
165 * - 6: UIM2_PWM_SELECT
166 * - 7: UIM2_M2_S_SELECT
167 * - 8: TP900
168 * - 9: SENSOR_INT1 (in)
169 * - 10: SENSOR_INT2 (in)
170 * - 11: CARD_DETECT_IOT0 (in pull-up)
171 * - 12: CARD_DETECT_IOT2 (in pull-up)
172 * - 13: CARD_DETECT_IOT1 (in pull-up)
173 * - 14: GPIOEXP_INT3 (in active low / pull-up)
174 * - 15: BattChrgr_INT_N
175 */
176 pinctrl-0 = <&gpioext1_pins>;
177 pinctrl-names = "default";
178
179 #gpio-cells = <2>;
180 #interrupt-cells = <2>;
181 compatible = "semtech,sx1509q";
182 reg = <0x3f>;
183 interrupt-parent = <&msmgpio>;
184 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
185
186 semtech,probe-reset;
187
188 gpio-controller;
189 interrupt-controller;
190 };
191 };
192
193 i2c@6 {
194 #address-cells = <1>;
195 #size-cells = <0>;
196 reg = <6>;
197
198 gpioext2: pinctrl@70 {
199 /* GPIO Expander 2 Mapping :
200 * - 0: USB_HUB_INTn
201 * - 1: HUB_CONNECT
202 * - 2: GPIO_IOT2_RESET (out active low / pull-up)
203 * - 3: GPIO_IOT1_RESET (out active low / pull-up)
204 * - 4: GPIO_IOT0_RESET (out active low / pull-up)
205 * - 5: TP901
206 * - 6: TP902
207 * - 7: TP903
208 * - 8: UART_EXP2_ENn (out active low / pull-down)
209 * - 9: PCM_EXP1_ENn (out active low)
210 * - 10: PCM_EXP1_SEL (out)
211 * - 11: ARD_FTDI
212 * - 12: TP904
213 * - 13: TP905
214 * - 14: TP906
215 * - 15: RS232_Enable (out active high / pull-up)
216 */
217 #gpio-cells = <2>;
218 #interrupt-cells = <2>;
219 compatible = "semtech,sx1509q";
220 reg = <0x70>;
221 interrupt-parent = <&gpioext1>;
222 interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
223
224 semtech,probe-reset;
225
226 gpio-controller;
227 interrupt-controller;
228 };
229 };
230
231 i2c@7 {
232 #address-cells = <1>;
233 #size-cells = <0>;
234 reg = <7>;
235 };
236 };
237};
238
239&sdcc1 {
240 pinctrl-0 = <&sdc_cd_pins>;
241 pinctrl-names = "default";
242 disable-wp;
243 cd-gpios = <&msmgpio 42 GPIO_ACTIVE_LOW>; /* Active low CD */
244};