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