1// SPDX-License-Identifier: GPL-2.0-only 2 3/dts-v1/; 4 5#include "msm8939-pm8916.dtsi" 6#include "msm8916-modem-qdsp6.dtsi" 7 8#include <dt-bindings/gpio/gpio.h> 9#include <dt-bindings/input/input.h> 10#include <dt-bindings/interrupt-controller/irq.h> 11#include <dt-bindings/sound/apq8016-lpass.h> 12 13/ { 14 model = "Samsung Galaxy A7 (2015)"; 15 compatible = "samsung,a7", "qcom,msm8939"; 16 chassis-type = "handset"; 17 18 aliases { 19 mmc0 = &sdhc_1; /* SDC1 eMMC slot */ 20 mmc1 = &sdhc_2; /* SDC2 SD card slot */ 21 serial0 = &blsp_uart2; 22 }; 23 24 chosen { 25 stdout-path = "serial0"; 26 }; 27 28 reserved-memory { 29 /* Additional memory used by Samsung firmware modifications */ 30 tz-apps@85500000 { 31 reg = <0x0 0x85500000 0x0 0xb00000>; 32 no-map; 33 }; 34 }; 35 36 gpio-hall-sensor { 37 compatible = "gpio-keys"; 38 39 pinctrl-0 = <&gpio_hall_sensor_default>; 40 pinctrl-names = "default"; 41 42 label = "GPIO Hall Effect Sensor"; 43 44 event-hall-sensor { 45 label = "Hall Effect Sensor"; 46 gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; 47 linux,input-type = <EV_SW>; 48 linux,code = <SW_LID>; 49 linux,can-disable; 50 }; 51 }; 52 53 gpio-keys { 54 compatible = "gpio-keys"; 55 56 pinctrl-0 = <&gpio_keys_default>; 57 pinctrl-names = "default"; 58 59 label = "GPIO Buttons"; 60 61 button-volume-up { 62 label = "Volume Up"; 63 gpios = <&tlmm 107 GPIO_ACTIVE_LOW>; 64 linux,code = <KEY_VOLUMEUP>; 65 }; 66 67 button-home { 68 label = "Home"; 69 gpios = <&tlmm 109 GPIO_ACTIVE_LOW>; 70 linux,code = <KEY_HOMEPAGE>; 71 }; 72 }; 73 74 i2c-fg { 75 compatible = "i2c-gpio"; 76 sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 77 scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 78 79 pinctrl-0 = <&fg_i2c_default>; 80 pinctrl-names = "default"; 81 82 #address-cells = <1>; 83 #size-cells = <0>; 84 85 battery@35 { 86 compatible = "richtek,rt5033-battery"; 87 reg = <0x35>; 88 89 interrupt-parent = <&tlmm>; 90 interrupts = <121 IRQ_TYPE_EDGE_BOTH>; 91 92 pinctrl-0 = <&fg_alert_default>; 93 pinctrl-names = "default"; 94 }; 95 }; 96 97 i2c-nfc { 98 compatible = "i2c-gpio"; 99 sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 100 scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 101 102 pinctrl-0 = <&nfc_i2c_default>; 103 pinctrl-names = "default"; 104 105 #address-cells = <1>; 106 #size-cells = <0>; 107 108 nfc@2b { 109 compatible = "nxp,pn547", "nxp,nxp-nci-i2c"; 110 reg = <0x2b>; 111 112 interrupt-parent = <&tlmm>; 113 interrupts = <21 IRQ_TYPE_EDGE_RISING>; 114 115 enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>; 116 firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; 117 118 pinctrl-0 = <&nfc_default>; 119 pinctrl-names = "default"; 120 }; 121 }; 122 123 i2c-sensor { 124 compatible = "i2c-gpio"; 125 sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 126 scl-gpios = <&tlmm 85 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 127 128 pinctrl-0 = <&sensor_i2c_default>; 129 pinctrl-names = "default"; 130 131 #address-cells = <1>; 132 #size-cells = <0>; 133 134 accelerometer: accelerometer@10 { 135 compatible = "bosch,bmc150_accel"; 136 reg = <0x10>; 137 interrupt-parent = <&tlmm>; 138 interrupts = <115 IRQ_TYPE_EDGE_RISING>; 139 140 vdd-supply = <&pm8916_l17>; 141 vddio-supply = <&pm8916_l5>; 142 143 pinctrl-0 = <&accel_int_default>; 144 pinctrl-names = "default"; 145 146 mount-matrix = "-1", "0", "0", 147 "0", "-1", "0", 148 "0", "0", "1"; 149 }; 150 151 magnetometer@12 { 152 compatible = "bosch,bmc150_magn"; 153 reg = <0x12>; 154 155 vdd-supply = <&pm8916_l17>; 156 vddio-supply = <&pm8916_l5>; 157 }; 158 }; 159 160 i2c-tkey { 161 compatible = "i2c-gpio"; 162 sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 163 scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 164 165 pinctrl-0 = <&tkey_i2c_default>; 166 pinctrl-names = "default"; 167 168 #address-cells = <1>; 169 #size-cells = <0>; 170 171 touchkey@20 { 172 /* Note: Actually an ABOV MCU that implements same interface */ 173 compatible = "coreriver,tc360-touchkey"; 174 reg = <0x20>; 175 176 interrupt-parent = <&tlmm>; 177 interrupts = <20 IRQ_TYPE_EDGE_FALLING>; 178 179 vcc-supply = <®_touch_key>; 180 vdd-supply = <®_keyled>; 181 vddio-supply = <&pm8916_l6>; 182 183 linux,keycodes = <KEY_APPSELECT KEY_BACK>; 184 185 pinctrl-0 = <&tkey_default>; 186 pinctrl-names = "default"; 187 }; 188 }; 189 190 pwm_vibrator: pwm-vibrator { 191 compatible = "clk-pwm"; 192 #pwm-cells = <2>; 193 194 clocks = <&gcc GCC_GP2_CLK>; 195 196 pinctrl-0 = <&motor_pwm_default>; 197 pinctrl-names = "default"; 198 }; 199 200 reg_keyled: regulator-keyled { 201 compatible = "regulator-fixed"; 202 regulator-name = "keyled"; 203 regulator-min-microvolt = <3300000>; 204 regulator-max-microvolt = <3300000>; 205 206 /* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */ 207 gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>; 208 enable-active-high; 209 210 pinctrl-0 = <&tkey_led_en_default>; 211 pinctrl-names = "default"; 212 }; 213 214 reg_touch_key: regulator-touch-key { 215 compatible = "regulator-fixed"; 216 regulator-name = "touch_key"; 217 regulator-min-microvolt = <2800000>; 218 regulator-max-microvolt = <2800000>; 219 220 gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>; 221 enable-active-high; 222 223 pinctrl-0 = <&tkey_en_default>; 224 pinctrl-names = "default"; 225 }; 226 227 reg_tsp_vdd: regulator-tsp-vdd { 228 compatible = "regulator-fixed"; 229 regulator-name = "tsp_vdd"; 230 regulator-min-microvolt = <1800000>; 231 regulator-max-microvolt = <1800000>; 232 vin-supply = <&pm8916_s4>; 233 234 gpio = <&tlmm 8 GPIO_ACTIVE_HIGH>; 235 enable-active-high; 236 237 pinctrl-0 = <®_tsp_io_en_default>; 238 pinctrl-names = "default"; 239 }; 240 241 reg_vdd_tsp: regulator-vdd-tsp { 242 compatible = "regulator-fixed"; 243 regulator-name = "vdd_tsp"; 244 regulator-min-microvolt = <3300000>; 245 regulator-max-microvolt = <3300000>; 246 247 gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>; 248 enable-active-high; 249 250 pinctrl-0 = <®_tsp_en_default>; 251 pinctrl-names = "default"; 252 }; 253 254 reg_vibrator: regulator-vibrator { 255 compatible = "regulator-fixed"; 256 regulator-name = "motor_en"; 257 regulator-min-microvolt = <3000000>; 258 regulator-max-microvolt = <3000000>; 259 260 gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>; 261 enable-active-high; 262 263 pinctrl-0 = <&motor_en_default>; 264 pinctrl-names = "default"; 265 }; 266 267 vibrator { 268 compatible = "pwm-vibrator"; 269 270 pwms = <&pwm_vibrator 0 100000>; 271 pwm-names = "enable"; 272 273 vcc-supply = <®_vibrator>; 274 }; 275}; 276 277&blsp_i2c1 { 278 status = "okay"; 279 280 muic: extcon@25 { 281 compatible = "siliconmitus,sm5502-muic"; 282 reg = <0x25>; 283 284 interrupt-parent = <&tlmm>; 285 interrupts = <12 IRQ_TYPE_EDGE_FALLING>; 286 287 pinctrl-0 = <&muic_int_default>; 288 pinctrl-names = "default"; 289 290 usb_con: connector { 291 compatible = "usb-b-connector"; 292 label = "micro-USB"; 293 type = "micro"; 294 }; 295 }; 296}; 297 298&blsp_i2c2 { 299 status = "okay"; 300 301 speaker_codec: audio-codec@34 { 302 compatible = "nxp,tfa9895"; 303 reg = <0x34>; 304 vddd-supply = <&pm8916_l5>; 305 sound-name-prefix = "Speaker"; 306 #sound-dai-cells = <0>; 307 }; 308}; 309 310&blsp_i2c5 { 311 status = "okay"; 312 313 touchscreen@24 { 314 compatible = "cypress,tt21000"; 315 316 reg = <0x24>; 317 interrupt-parent = <&tlmm>; 318 interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 319 320 vdd-supply = <®_vdd_tsp>; 321 vddio-supply = <®_tsp_vdd>; 322 323 pinctrl-0 = <&tsp_int_default>; 324 pinctrl-names = "default"; 325 }; 326}; 327 328&blsp_uart2 { 329 status = "okay"; 330}; 331 332/* 333 * For some reason the speaker amplifier is connected to the second SD line 334 * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the 335 * device tree, otherwise audio will seemingly play fine on the wrong SD line 336 * but the speaker stays silent. 337 * 338 * When routing audio via QDSP6 (the default) the &lpass node is reserved and 339 * the definitions from &q6afedai are used. When the modem is disabled audio can 340 * be alternatively routed directly to the LPASS hardware with reduced latency. 341 * The definitions for &lpass are here for completeness to simplify changing the 342 * setup with minor changes to the DT (either manually or with DT overlays). 343 */ 344&lpass { 345 dai-link@3 { 346 reg = <MI2S_QUATERNARY>; 347 qcom,playback-sd-lines = <1>; 348 }; 349}; 350 351&mpss_mem { 352 reg = <0x0 0x86800000 0x0 0x5800000>; 353}; 354 355&pm8916_resin { 356 linux,code = <KEY_VOLUMEDOWN>; 357 status = "okay"; 358}; 359 360&pm8916_rpm_regulators { 361 pm8916_l17: l17 { 362 regulator-min-microvolt = <2850000>; 363 regulator-max-microvolt = <2850000>; 364 }; 365}; 366 367&q6afedai { 368 dai@22 { 369 reg = <QUATERNARY_MI2S_RX>; 370 qcom,sd-lines = <1>; 371 }; 372}; 373 374&sdhc_1 { 375 status = "okay"; 376}; 377 378&sdhc_2 { 379 pinctrl-0 = <&sdc2_default &sdc2_cd_default>; 380 pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>; 381 pinctrl-names = "default", "sleep"; 382 383 cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; 384 385 status = "okay"; 386}; 387 388&sound { 389 model = "samsung-a2015"; 390 audio-routing = 391 "AMIC1", "MIC BIAS External1", 392 "AMIC2", "MIC BIAS Internal2", 393 "AMIC3", "MIC BIAS External1"; 394 395 pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>; 396 pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>; 397 pinctrl-names = "default", "sleep"; 398 399 sound_link_backend2: backend2-dai-link { 400 link-name = "Quaternary MI2S"; 401 402 cpu { 403 sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; 404 }; 405 platform { 406 sound-dai = <&q6routing>; 407 }; 408 codec { 409 sound-dai = <&speaker_codec>; 410 }; 411 }; 412}; 413 414&usb { 415 extcon = <&muic>, <&muic>; 416 status = "okay"; 417}; 418 419&usb_hs_phy { 420 extcon = <&muic>; 421}; 422 423&wcnss { 424 status = "okay"; 425}; 426 427&wcnss_iris { 428 compatible = "qcom,wcn3660b"; 429}; 430 431&wcnss_mem { 432 status = "okay"; 433}; 434 435&tlmm { 436 accel_int_default: accel-int-default-state { 437 pins = "gpio115"; 438 function = "gpio"; 439 drive-strength = <2>; 440 bias-disable; 441 }; 442 443 fg_alert_default: fg-alert-default-state { 444 pins = "gpio121"; 445 function = "gpio"; 446 drive-strength = <2>; 447 bias-disable; 448 }; 449 450 fg_i2c_default: fg-i2c-default-state { 451 pins = "gpio105", "gpio106"; 452 function = "gpio"; 453 drive-strength = <2>; 454 bias-disable; 455 }; 456 457 gpio_hall_sensor_default: gpio-hall-sensor-default-state { 458 pins = "gpio52"; 459 function = "gpio"; 460 drive-strength = <2>; 461 bias-disable; 462 }; 463 464 gpio_keys_default: gpio-keys-default-state { 465 pins = "gpio107", "gpio109"; 466 function = "gpio"; 467 drive-strength = <2>; 468 bias-pull-up; 469 }; 470 471 motor_en_default: motor-en-default-state { 472 pins = "gpio86"; 473 function = "gpio"; 474 drive-strength = <2>; 475 bias-disable; 476 }; 477 478 motor_pwm_default: motor-pwm-default-state { 479 pins = "gpio50"; 480 function = "gcc_gp2_clk_a"; 481 }; 482 483 muic_int_default: muic-int-default-state { 484 pins = "gpio12"; 485 function = "gpio"; 486 drive-strength = <2>; 487 bias-disable; 488 }; 489 490 nfc_default: nfc-default-state { 491 irq-pins { 492 pins = "gpio21"; 493 function = "gpio"; 494 drive-strength = <2>; 495 bias-pull-down; 496 }; 497 498 nfc-pins { 499 pins = "gpio49", "gpio116"; 500 function = "gpio"; 501 drive-strength = <2>; 502 bias-disable; 503 }; 504 }; 505 506 nfc_i2c_default: nfc-i2c-default-state { 507 pins = "gpio0", "gpio1"; 508 function = "gpio"; 509 drive-strength = <2>; 510 bias-disable; 511 }; 512 513 reg_tsp_en_default: reg-tsp-en-default-state { 514 pins = "gpio73"; 515 function = "gpio"; 516 drive-strength = <2>; 517 bias-disable; 518 }; 519 520 reg_tsp_io_en_default: reg-tsp-io-en-default-state { 521 pins = "gpio8"; 522 function = "gpio"; 523 drive-strength = <2>; 524 bias-disable; 525 }; 526 527 sdc2_cd_default: sdc2-cd-default-state { 528 pins = "gpio38"; 529 function = "gpio"; 530 drive-strength = <2>; 531 bias-disable; 532 }; 533 534 sensor_i2c_default: sensor-i2c-default-state { 535 pins = "gpio84", "gpio85"; 536 function = "gpio"; 537 drive-strength = <2>; 538 bias-disable; 539 }; 540 541 tkey_default: tkey-default-state { 542 pins = "gpio20"; 543 function = "gpio"; 544 drive-strength = <2>; 545 bias-disable; 546 }; 547 548 tkey_en_default: tkey-en-default-state { 549 pins = "gpio56"; 550 function = "gpio"; 551 drive-strength = <2>; 552 bias-disable; 553 }; 554 555 tkey_i2c_default: tkey-i2c-default-state { 556 pins = "gpio16", "gpio17"; 557 function = "gpio"; 558 drive-strength = <2>; 559 bias-disable; 560 }; 561 562 tkey_led_en_default: tkey-led-en-default-state { 563 pins = "gpio100"; 564 function = "gpio"; 565 drive-strength = <2>; 566 bias-disable; 567 }; 568 569 tsp_int_default: tsp-int-default-state { 570 pins = "gpio13"; 571 function = "gpio"; 572 drive-strength = <2>; 573 bias-disable; 574 }; 575}; 576