0001 /*
0002 * Device Tree Source for mangOH Green Board with WP8548 Module
0003 *
0004 * Copyright (C) 2016 BayLibre, SAS.
0005 * Author : Neil Armstrong <narmstrong@baylibre.com>
0006 *
0007 * This file is dual-licensed: you can use it either under the terms
0008 * of the GPL or the X11 license, at your option. Note that this dual
0009 * licensing only applies to this file, and not this project as a
0010 * whole.
0011 *
0012 * a) This file is free software; you can redistribute it and/or
0013 * modify it under the terms of the GNU General Public License as
0014 * published by the Free Software Foundation; either version 2 of the
0015 * License, or (at your option) any later version.
0016 *
0017 * This file is distributed in the hope that it will be useful,
0018 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020 * GNU General Public License for more details.
0021 *
0022 * Or, alternatively,
0023 *
0024 * b) Permission is hereby granted, free of charge, to any person
0025 * obtaining a copy of this software and associated documentation
0026 * files (the "Software"), to deal in the Software without
0027 * restriction, including without limitation the rights to use,
0028 * copy, modify, merge, publish, distribute, sublicense, and/or
0029 * sell copies of the Software, and to permit persons to whom the
0030 * Software is furnished to do so, subject to the following
0031 * conditions:
0032 *
0033 * The above copyright notice and this permission notice shall be
0034 * included in all copies or substantial portions of the Software.
0035 *
0036 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0037 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0038 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0039 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0040 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0041 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0042 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0043 * OTHER DEALINGS IN THE SOFTWARE.
0044 */
0045
0046 #include <dt-bindings/input/input.h>
0047
0048 #include "qcom-mdm9615-wp8548.dtsi"
0049 #include <dt-bindings/interrupt-controller/irq.h>
0050 #include <dt-bindings/gpio/gpio.h>
0051
0052 / {
0053 model = "MangOH Green with WP8548 Module";
0054 compatible = "swir,mangoh-green-wp8548", "swir,wp8548", "qcom,mdm9615";
0055
0056 aliases {
0057 spi0 = &gsbi3_spi;
0058 serial0 = &gsbi4_serial;
0059 serial1 = &gsbi5_serial;
0060 i2c0 = &gsbi5_i2c;
0061 mmc0 = &sdcc1;
0062 };
0063
0064 chosen {
0065 stdout-path = "serial1:115200n8";
0066 };
0067 };
0068
0069 &msmgpio {
0070 /* MangOH GPIO Mapping :
0071 * - 2 : GPIOEXP_INT2
0072 * - 7 : IOT1_GPIO2
0073 * - 8 : IOT0_GPIO4
0074 * - 13: IOT0_GPIO3
0075 * - 21: IOT1_GPIO4
0076 * - 22: IOT2_GPIO1
0077 * - 23: IOT2_GPIO2
0078 * - 24: IOT2_GPIO3
0079 * - 25: IOT1_GPIO1
0080 * - 32: IOT1_GPIO3
0081 * - 33: IOT0_GPIO2
0082 * - 42: IOT0_GPIO1 and SD Card Detect
0083 */
0084
0085 gpioext1_pins: gpioext1_pins {
0086 pins {
0087 pins = "gpio2";
0088 function = "gpio";
0089 input-enable;
0090 bias-disable;
0091 };
0092 };
0093
0094 sdc_cd_pins: sdc_cd_pins {
0095 pins {
0096 pins = "gpio42";
0097 function = "gpio";
0098 drive-strength = <2>;
0099 bias-pull-up;
0100 };
0101 };
0102 };
0103
0104 &gsbi3_spi {
0105 spi@0 {
0106 compatible = "swir,mangoh-iotport-spi";
0107 spi-max-frequency = <24000000>;
0108 reg = <0>;
0109 };
0110 };
0111
0112 &gsbi5_i2c {
0113 mux@71 {
0114 compatible = "nxp,pca9548";
0115 #address-cells = <1>;
0116 #size-cells = <0>;
0117 reg = <0x71>;
0118
0119 i2c_iot0: i2c@0 {
0120 #address-cells = <1>;
0121 #size-cells = <0>;
0122 reg = <0>;
0123 };
0124
0125 i2c_iot1: i2c@1 {
0126 #address-cells = <1>;
0127 #size-cells = <0>;
0128 reg = <1>;
0129 };
0130
0131 i2c_iot2: i2c@2 {
0132 #address-cells = <1>;
0133 #size-cells = <0>;
0134 reg = <2>;
0135 };
0136
0137 i2c@3 {
0138 #address-cells = <1>;
0139 #size-cells = <0>;
0140 reg = <3>;
0141
0142 usbhub: hub@8 {
0143 compatible = "smsc,usb3503a";
0144 reg = <0x8>;
0145 connect-gpios = <&gpioext2 1 GPIO_ACTIVE_HIGH>;
0146 intn-gpios = <&gpioext2 0 GPIO_ACTIVE_HIGH>;
0147 initial-mode = <1>;
0148 };
0149 };
0150
0151 i2c@4 {
0152 #address-cells = <1>;
0153 #size-cells = <0>;
0154 reg = <4>;
0155
0156 gpioext0: gpio@3e {
0157 /* GPIO Expander 0 Mapping :
0158 * - 0: ARDUINO_RESET_Level shift
0159 * - 1: BattChrgr_PG_N
0160 * - 2: BattGauge_GPIO
0161 * - 3: LED_ON (out active high)
0162 * - 4: ATmega_reset_GPIO
0163 * - 5: X
0164 * - 6: PCM_ANALOG_SELECT (out active high)
0165 * - 7: X
0166 * - 8: Board_rev_res1 (in)
0167 * - 9: Board_rev_res2 (in)
0168 * - 10: UART_EXP1_ENn (out active low / pull-down)
0169 * - 11: UART_EXP1_IN (out pull-down)
0170 * - 12: UART_EXP2_IN (out pull-down)
0171 * - 13: SDIO_SEL (out pull-down)
0172 * - 14: SPI_EXP1_ENn (out active low / pull-down)
0173 * - 15: SPI_EXP1_IN (out pull-down)
0174 */
0175 #gpio-cells = <2>;
0176 #interrupt-cells = <2>;
0177 compatible = "semtech,sx1509q";
0178 reg = <0x3e>;
0179 interrupt-parent = <&gpioext1>;
0180 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
0181
0182 probe-reset;
0183
0184 gpio-controller;
0185 interrupt-controller;
0186 };
0187 };
0188
0189 i2c@5 {
0190 #address-cells = <1>;
0191 #size-cells = <0>;
0192 reg = <5>;
0193
0194 gpioext1: gpio@3f {
0195 /* GPIO Expander 1 Mapping :
0196 * - 0: GPIOEXP_INT1
0197 * - 1: Battery detect
0198 * - 2: GPIO_SCF3_RESET
0199 * - 3: LED_CARD_DETECT_IOT0 (in)
0200 * - 4: LED_CARD_DETECT_IOT1 (in)
0201 * - 5: LED_CARD_DETECT_IOT2 (in)
0202 * - 6: UIM2_PWM_SELECT
0203 * - 7: UIM2_M2_S_SELECT
0204 * - 8: TP900
0205 * - 9: SENSOR_INT1 (in)
0206 * - 10: SENSOR_INT2 (in)
0207 * - 11: CARD_DETECT_IOT0 (in pull-up)
0208 * - 12: CARD_DETECT_IOT2 (in pull-up)
0209 * - 13: CARD_DETECT_IOT1 (in pull-up)
0210 * - 14: GPIOEXP_INT3 (in active low / pull-up)
0211 * - 15: BattChrgr_INT_N
0212 */
0213 pinctrl-0 = <&gpioext1_pins>;
0214 pinctrl-names = "default";
0215
0216 #gpio-cells = <2>;
0217 #interrupt-cells = <2>;
0218 compatible = "semtech,sx1509q";
0219 reg = <0x3f>;
0220 interrupt-parent = <&msmgpio>;
0221 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
0222
0223 probe-reset;
0224
0225 gpio-controller;
0226 interrupt-controller;
0227 };
0228 };
0229
0230 i2c@6 {
0231 #address-cells = <1>;
0232 #size-cells = <0>;
0233 reg = <6>;
0234
0235 gpioext2: gpio@70 {
0236 /* GPIO Expander 2 Mapping :
0237 * - 0: USB_HUB_INTn
0238 * - 1: HUB_CONNECT
0239 * - 2: GPIO_IOT2_RESET (out active low / pull-up)
0240 * - 3: GPIO_IOT1_RESET (out active low / pull-up)
0241 * - 4: GPIO_IOT0_RESET (out active low / pull-up)
0242 * - 5: TP901
0243 * - 6: TP902
0244 * - 7: TP903
0245 * - 8: UART_EXP2_ENn (out active low / pull-down)
0246 * - 9: PCM_EXP1_ENn (out active low)
0247 * - 10: PCM_EXP1_SEL (out)
0248 * - 11: ARD_FTDI
0249 * - 12: TP904
0250 * - 13: TP905
0251 * - 14: TP906
0252 * - 15: RS232_Enable (out active high / pull-up)
0253 */
0254 #gpio-cells = <2>;
0255 #interrupt-cells = <2>;
0256 compatible = "semtech,sx1509q";
0257 reg = <0x70>;
0258 interrupt-parent = <&gpioext1>;
0259 interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
0260
0261 probe-reset;
0262
0263 gpio-controller;
0264 interrupt-controller;
0265 };
0266 };
0267
0268 i2c@7 {
0269 #address-cells = <1>;
0270 #size-cells = <0>;
0271 reg = <7>;
0272 };
0273 };
0274 };
0275
0276 &sdcc1 {
0277 pinctrl-0 = <&sdc_cd_pins>;
0278 pinctrl-names = "default";
0279 disable-wp;
0280 cd-gpios = <&msmgpio 42 GPIO_ACTIVE_LOW>; /* Active low CD */
0281 };