| 1 |
// SPDX-License-Identifier: GPL-2.0 |
| 2 |
/* |
| 3 |
* Copyright (c) 2015, The Linux Foundation. All rights reserved. |
| 4 |
* Copyright (c) 2020-2023, Linaro Ltd. |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
/dts-v1/; |
| 9 |
|
| 10 |
#include "msm8939.dtsi" |
| 11 |
#include "msm8939-pm8916.dtsi" |
| 12 |
#include <dt-bindings/arm/qcom,ids.h> |
| 13 |
#include <dt-bindings/gpio/gpio.h> |
| 14 |
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> |
| 15 |
#include <dt-bindings/sound/apq8016-lpass.h> |
| 16 |
|
| 17 |
/ { |
| 18 |
model = "Square, Inc. T2 Devkit"; |
| 19 |
compatible = "square,apq8039-t2", "qcom,msm8939"; |
| 20 |
|
| 21 |
qcom,board-id = <0x53 0x54>; |
| 22 |
qcom,msm-id = <QCOM_ID_APQ8039 0x30000>; |
| 23 |
|
| 24 |
aliases { |
| 25 |
mmc0 = &sdhc_1; |
| 26 |
mmc1 = &sdhc_2; |
| 27 |
serial0 = &blsp_uart1; |
| 28 |
serial1 = &blsp_uart2; |
| 29 |
}; |
| 30 |
|
| 31 |
bl: backlight { |
| 32 |
compatible = "gpio-backlight"; |
| 33 |
pinctrl-0 = <&pinctrl_backlight>; |
| 34 |
pinctrl-names = "default"; |
| 35 |
gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; |
| 36 |
}; |
| 37 |
|
| 38 |
chosen { |
| 39 |
stdout-path = "serial1:115200n8"; |
| 40 |
}; |
| 41 |
|
| 42 |
vreg_lcd_avdd_reg: lcd-avdd-regulator { |
| 43 |
compatible = "regulator-fixed"; |
| 44 |
regulator-name = "lcd_avdd"; |
| 45 |
regulator-min-microvolt = <5600000>; |
| 46 |
regulator-max-microvolt = <5600000>; |
| 47 |
pinctrl-0 = <&pinctrl_lcd_avdd_reg>; |
| 48 |
pinctrl-names = "default"; |
| 49 |
gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>; |
| 50 |
startup-delay-us = <300>; |
| 51 |
enable-active-high; |
| 52 |
}; |
| 53 |
|
| 54 |
vreg_lcd_avee_reg: lcd-avee-regulator { |
| 55 |
compatible = "regulator-fixed"; |
| 56 |
regulator-name = "lcd_avee"; |
| 57 |
regulator-min-microvolt = <5600000>; |
| 58 |
regulator-max-microvolt = <5600000>; |
| 59 |
pinctrl-0 = <&pinctrl_lcd_avee_reg>; |
| 60 |
pinctrl-names = "default"; |
| 61 |
gpio = <&tlmm 87 GPIO_ACTIVE_HIGH>; |
| 62 |
startup-delay-us = <300>; |
| 63 |
enable-active-high; |
| 64 |
}; |
| 65 |
|
| 66 |
vreg_lcd_iovcc_reg: lcd-iovcc-regulator { |
| 67 |
compatible = "regulator-fixed"; |
| 68 |
regulator-name = "lcd_iovcc"; |
| 69 |
regulator-min-microvolt = <1800000>; |
| 70 |
regulator-max-microvolt = <1800000>; |
| 71 |
pinctrl-0 = <&pinctrl_lcd_iovcc_reg>; |
| 72 |
pinctrl-names = "default"; |
| 73 |
gpio = <&tlmm 9 GPIO_ACTIVE_HIGH>; |
| 74 |
startup-delay-us = <300>; |
| 75 |
enable-active-high; |
| 76 |
}; |
| 77 |
}; |
| 78 |
|
| 79 |
&blsp_i2c1 { |
| 80 |
status = "okay"; |
| 81 |
}; |
| 82 |
|
| 83 |
&blsp_i2c2 { |
| 84 |
status = "okay"; |
| 85 |
}; |
| 86 |
|
| 87 |
&blsp_i2c3 { |
| 88 |
status = "okay"; |
| 89 |
|
| 90 |
typec_pd: usb-pd@38 { |
| 91 |
compatible = "ti,tps6598x"; |
| 92 |
reg = <0x38>; |
| 93 |
|
| 94 |
interrupt-parent = <&tlmm>; |
| 95 |
interrupts = <107 IRQ_TYPE_LEVEL_LOW>; |
| 96 |
interrupt-names = "irq"; |
| 97 |
|
| 98 |
pinctrl-names = "default"; |
| 99 |
pinctrl-0 = <&typec_irq>; |
| 100 |
|
| 101 |
typec_con: connector { |
| 102 |
compatible = "usb-c-connector"; |
| 103 |
label = "USB-C"; |
| 104 |
|
| 105 |
port { |
| 106 |
typec_ep: endpoint { |
| 107 |
remote-endpoint = <&otg_ep>; |
| 108 |
}; |
| 109 |
}; |
| 110 |
}; |
| 111 |
}; |
| 112 |
}; |
| 113 |
|
| 114 |
&blsp_i2c5 { |
| 115 |
status = "okay"; |
| 116 |
}; |
| 117 |
|
| 118 |
&blsp_uart1 { |
| 119 |
pinctrl-0 = <&blsp_uart1_default>; |
| 120 |
pinctrl-1 = <&blsp_uart1_sleep>; |
| 121 |
pinctrl-names = "default", "sleep"; |
| 122 |
status = "okay"; |
| 123 |
}; |
| 124 |
|
| 125 |
&blsp_uart2 { |
| 126 |
pinctrl-0 = <&blsp_uart2_console_default>; |
| 127 |
pinctrl-1 = <&blsp_uart2_console_sleep>; |
| 128 |
pinctrl-names = "default", "sleep"; |
| 129 |
status = "okay"; |
| 130 |
}; |
| 131 |
|
| 132 |
&gpu { |
| 133 |
status = "okay"; |
| 134 |
}; |
| 135 |
|
| 136 |
&lpass { |
| 137 |
status = "okay"; |
| 138 |
}; |
| 139 |
|
| 140 |
&lpass_codec { |
| 141 |
status = "okay"; |
| 142 |
}; |
| 143 |
|
| 144 |
&mdss { |
| 145 |
status = "okay"; |
| 146 |
}; |
| 147 |
|
| 148 |
&pm8916_codec { |
| 149 |
qcom,hphl-jack-type-normally-open; |
| 150 |
qcom,mbhc-vthreshold-low = <75 150 237 450 500>; |
| 151 |
qcom,mbhc-vthreshold-high = <75 150 237 450 500>; |
| 152 |
status = "okay"; |
| 153 |
}; |
| 154 |
|
| 155 |
&pm8916_gpios { |
| 156 |
gpio-line-names = |
| 157 |
"PM_GPIO1", /* WIFI_GPIO1_PRE */ |
| 158 |
"PM_GPIO2", /* WIFI_GPIO2_PRE */ |
| 159 |
"PM_GPIO3", |
| 160 |
"PM_GPIO4"; |
| 161 |
}; |
| 162 |
|
| 163 |
&sdhc_1 { |
| 164 |
status = "okay"; |
| 165 |
}; |
| 166 |
|
| 167 |
&sound { |
| 168 |
model = "apq8039-square-sndcard"; |
| 169 |
audio-routing = "AMIC2", "MIC BIAS Internal2"; |
| 170 |
pinctrl-names = "default", "sleep"; |
| 171 |
pinctrl-0 = <&cdc_pdm_default>; |
| 172 |
pinctrl-1 = <&cdc_pdm_sleep>; |
| 173 |
|
| 174 |
internal-codec-playback-dai-link { |
| 175 |
link-name = "WCD"; |
| 176 |
cpu { |
| 177 |
sound-dai = <&lpass MI2S_PRIMARY>; |
| 178 |
}; |
| 179 |
codec { |
| 180 |
sound-dai = <&lpass_codec 0>, <&pm8916_codec 0>; |
| 181 |
}; |
| 182 |
}; |
| 183 |
|
| 184 |
internal-codec-capture-dai-link { |
| 185 |
link-name = "WCD-Capture"; |
| 186 |
cpu { |
| 187 |
sound-dai = <&lpass MI2S_TERTIARY>; |
| 188 |
}; |
| 189 |
codec { |
| 190 |
sound-dai = <&lpass_codec 1>, <&pm8916_codec 1>; |
| 191 |
}; |
| 192 |
}; |
| 193 |
}; |
| 194 |
|
| 195 |
/* |
| 196 |
* Line names are taken from the schematic of T2, Ver X03. |
| 197 |
* July 14, 2018. Page 4 in particular. |
| 198 |
*/ |
| 199 |
&tlmm { |
| 200 |
gpio-line-names = |
| 201 |
"APQ_UART1_TX", /* GPIO_0 */ |
| 202 |
"APQ_UART1_RX", |
| 203 |
"APQ_I2C1_SDA", |
| 204 |
"APQ_I2C1_SCL", |
| 205 |
"APQ_UART2_TX_1V8", |
| 206 |
"APQ_UART2_RX_1V8", |
| 207 |
"APQ_I2C2_SDA", |
| 208 |
"APQ_I2C2_SCL", |
| 209 |
"NC", |
| 210 |
"APQ_LCD_IOVCC_EN", |
| 211 |
"APQ_I2C3_SDA", /* GPIO_10 */ |
| 212 |
"APQ_I2C3_SCL", |
| 213 |
"TOUCH_RST_1V8_L", |
| 214 |
"NC", |
| 215 |
"APQ_I2C4_SDA", |
| 216 |
"APQ_I2C4_SCL", |
| 217 |
"APQ_ID5", |
| 218 |
"USB_DISCONNECT", |
| 219 |
"APQ_I2C5_SDA", |
| 220 |
"APQ_I2C5_SCL", |
| 221 |
"APQ_USBC_SPI_MOSI", /* GPIO_20 */ |
| 222 |
"APQ_USBC_SPI_MISO", |
| 223 |
"APQ_USBC_SPI_SS_L", |
| 224 |
"APQ_USBC_SPI_CLK", |
| 225 |
"APQ_LCD_TE0", |
| 226 |
"APQ_LCD_RST_L", |
| 227 |
"NC", |
| 228 |
"NC", |
| 229 |
"ACCELEROMETER_INT1", |
| 230 |
"APQ_CAM_I2C0_SDA", |
| 231 |
"APQ_CAM_I2C0_SCL", /* GPIO_30 */ |
| 232 |
"ACCELEROMETER_INT2", |
| 233 |
"NC", |
| 234 |
"NC", |
| 235 |
"NC", |
| 236 |
"APQ_K21_RST_1V8_L", |
| 237 |
"NC", |
| 238 |
"APQ_EDL_1V8", |
| 239 |
"TP145", |
| 240 |
"BT_SSBI", |
| 241 |
"NC", /* GPIO_40 */ |
| 242 |
"NC", |
| 243 |
"NC", |
| 244 |
"NC", |
| 245 |
"NC", |
| 246 |
"NC", |
| 247 |
"NC", |
| 248 |
"BT_CTRL", |
| 249 |
"BT_DAT", |
| 250 |
"PWR_GPIO_IN", |
| 251 |
"PWR_GPIO_OUT", /* GPIO_50 */ |
| 252 |
"CARD_DET_MLB_L", |
| 253 |
"HALL_SENSOR", |
| 254 |
"TP63", |
| 255 |
"TP64", |
| 256 |
"TP65", |
| 257 |
"NC", |
| 258 |
"NC", |
| 259 |
"NC", |
| 260 |
"NC", |
| 261 |
"NC", /* GPIO_60 */ |
| 262 |
"NC", |
| 263 |
"APQ_K21_GPIO0_1V8", |
| 264 |
"CDC_PDM_CLK", |
| 265 |
"CDC_PDM_SYNC", |
| 266 |
"CDC_PDM_TX", |
| 267 |
"CDC_PDM_RX0", |
| 268 |
"CDC_PDM_RX1", |
| 269 |
"CDC_PDM_RX2", |
| 270 |
"APQ_K21_GPIO1_1V8", |
| 271 |
"NC", /* GPIO_70 */ |
| 272 |
"APQ_HUB_SEL_1V8", |
| 273 |
"APQ_K21_GPIO2_1V8", |
| 274 |
"APQ_K21_GPIO3_1V8", |
| 275 |
"APQ_ID0", |
| 276 |
"APQ_ID1", |
| 277 |
"APQ_ID2", |
| 278 |
"APQ_ID3", |
| 279 |
"APQ_ID4", |
| 280 |
"APQ_HUB_SUSP_IND", |
| 281 |
"BOOT_CONFIG_0", /* GPIO_80 */ |
| 282 |
"BOOT_CONFIG_1", |
| 283 |
"BOOT_CONFIG_2", |
| 284 |
"BOOT_CONFIG_3", |
| 285 |
"NC", |
| 286 |
"NC", |
| 287 |
"APQ_LCD_AVDD_EN", |
| 288 |
"APQ_LCD_AVEE_EN", |
| 289 |
"TP70", |
| 290 |
"NC", |
| 291 |
"APQ_DEBUG0", /* GPIO_90 */ |
| 292 |
"APQ_DEBUG1", |
| 293 |
"APQ_DEBUG2", |
| 294 |
"APQ_DEBUG3", |
| 295 |
"TP165", |
| 296 |
"NC", |
| 297 |
"APQ_LNA_PWR_EN", |
| 298 |
"NC", |
| 299 |
"APQ_LCD_BL_EN", |
| 300 |
"NC", |
| 301 |
"APQ_LCD_ID0", /* GPIO_100 */ |
| 302 |
"APQ_LCD_ID1", |
| 303 |
"USBC_GPIO5_1V8", |
| 304 |
"NC", |
| 305 |
"NC", |
| 306 |
"NC", |
| 307 |
"APQ_HUB_RST_1V8_L", |
| 308 |
"USBC_I2C_IRQ_1V8_L", |
| 309 |
"SPE_PWR_EN", |
| 310 |
"NC", |
| 311 |
"APQ_USB_ID", /* GPIO_110 */ |
| 312 |
"APQ_EXT_BUCK_VSEL", |
| 313 |
"APQ_USB_ID_OUT", |
| 314 |
"NC", |
| 315 |
"PRNT_RST_L", |
| 316 |
"APQ_CRQ_I2C_RDY_1V8", |
| 317 |
"TYPEC_RST_1V8_H", |
| 318 |
"CHG_BACKPWR_EN", |
| 319 |
"CHG_PROCHOT_L", |
| 320 |
"NC", |
| 321 |
"USBC_GPIO7_1V8", /* GPIO_120 */ |
| 322 |
"NC"; |
| 323 |
|
| 324 |
blsp_uart1_default: blsp-uart1-default-state { |
| 325 |
pins = "gpio0", "gpio1"; |
| 326 |
function = "blsp_uart1"; |
| 327 |
drive-strength = <16>; |
| 328 |
bias-disable; |
| 329 |
}; |
| 330 |
|
| 331 |
blsp_uart1_sleep: blsp-uart1-sleep-state { |
| 332 |
pins = "gpio0", "gpio1"; |
| 333 |
function = "gpio"; |
| 334 |
drive-strength = <2>; |
| 335 |
bias-pull-down; |
| 336 |
}; |
| 337 |
|
| 338 |
pinctrl_backlight: backlight-state { |
| 339 |
pins = "gpio98"; |
| 340 |
function = "gpio"; |
| 341 |
}; |
| 342 |
|
| 343 |
pinctrl_lcd_avdd_reg: lcd-avdd-reg-state { |
| 344 |
pins = "gpio86"; |
| 345 |
function = "gpio"; |
| 346 |
}; |
| 347 |
|
| 348 |
pinctrl_lcd_avee_reg: lcd-avee-reg-state { |
| 349 |
pins = "gpio87"; |
| 350 |
function = "gpio"; |
| 351 |
}; |
| 352 |
|
| 353 |
pinctrl_lcd_iovcc_reg: lcd-iovcc-reg-state { |
| 354 |
pins = "gpio9"; |
| 355 |
function = "gpio"; |
| 356 |
}; |
| 357 |
|
| 358 |
pinctrl_lcd_rst: lcd-rst-state { |
| 359 |
pins = "gpio25"; |
| 360 |
function = "gpio"; |
| 361 |
}; |
| 362 |
|
| 363 |
pinctrl_otg_default: otg-default-state { |
| 364 |
function = "gpio"; |
| 365 |
pins = "gpio17"; |
| 366 |
output-high; |
| 367 |
}; |
| 368 |
|
| 369 |
pinctrl_otg_device: otg-device-state { |
| 370 |
function = "gpio"; |
| 371 |
pins = "gpio17"; |
| 372 |
output-low; |
| 373 |
}; |
| 374 |
|
| 375 |
pinctrl_otg_host: otg-host-state { |
| 376 |
function = "gpio"; |
| 377 |
pins = "gpio17"; |
| 378 |
output-low; |
| 379 |
}; |
| 380 |
|
| 381 |
typec_irq: typec-irq-state { |
| 382 |
function = "gpio"; |
| 383 |
pins = "gpio107"; |
| 384 |
bias-pull-up; |
| 385 |
}; |
| 386 |
}; |
| 387 |
|
| 388 |
&usb { |
| 389 |
pinctrl-names = "default", "host", "device"; |
| 390 |
pinctrl-0 = <&pinctrl_otg_default>; |
| 391 |
pinctrl-1 = <&pinctrl_otg_host>; |
| 392 |
pinctrl-2 = <&pinctrl_otg_device>; |
| 393 |
usb-role-switch; |
| 394 |
status = "okay"; |
| 395 |
|
| 396 |
port { |
| 397 |
otg_ep: endpoint { |
| 398 |
remote-endpoint = <&typec_ep>; |
| 399 |
}; |
| 400 |
}; |
| 401 |
}; |
| 402 |
|
| 403 |
&wcnss { |
| 404 |
status = "okay"; |
| 405 |
}; |
| 406 |
|
| 407 |
&wcnss_iris { |
| 408 |
compatible = "qcom,wcn3680"; |
| 409 |
}; |
| 410 |
|
| 411 |
&wcnss_mem { |
| 412 |
status = "okay"; |
| 413 |
}; |