1a9ff4e16SStephan Gerhold// SPDX-License-Identifier: GPL-2.0-only 24bb376f6SKonrad Dybcio/* 34bb376f6SKonrad Dybcio * Copyright (C) 2020 Stephan Gerhold 44bb376f6SKonrad Dybcio */ 5a9ff4e16SStephan Gerhold 6a9ff4e16SStephan Gerhold/dts-v1/; 7a9ff4e16SStephan Gerhold 8a9ff4e16SStephan Gerhold#include "msm8916-pm8916.dtsi" 95db767aeSStephan Gerhold#include "msm8916-modem-qdsp6.dtsi" 105db767aeSStephan Gerhold 11a9ff4e16SStephan Gerhold#include <dt-bindings/gpio/gpio.h> 12a9ff4e16SStephan Gerhold#include <dt-bindings/input/input.h> 13f9af9f61SStephan Gerhold#include <dt-bindings/leds/common.h> 14a9ff4e16SStephan Gerhold 15a9ff4e16SStephan Gerhold/ { 16a9ff4e16SStephan Gerhold model = "Xiaomi Redmi 2 (Wingtech WT88047)"; 17a9ff4e16SStephan Gerhold compatible = "wingtech,wt88047", "qcom,msm8916"; 18eaa744b1SArnaud Ferraris chassis-type = "handset"; 19a9ff4e16SStephan Gerhold 20a9ff4e16SStephan Gerhold aliases { 21154f23a8SStephan Gerhold mmc0 = &sdhc_1; /* eMMC */ 22154f23a8SStephan Gerhold mmc1 = &sdhc_2; /* SD card */ 23c310ca82SStephan Gerhold serial0 = &blsp_uart2; 24a9ff4e16SStephan Gerhold }; 25a9ff4e16SStephan Gerhold 26a9ff4e16SStephan Gerhold chosen { 27a9ff4e16SStephan Gerhold stdout-path = "serial0"; 28a9ff4e16SStephan Gerhold }; 29a9ff4e16SStephan Gerhold 305db767aeSStephan Gerhold speaker_amp: audio-amplifier { 315db767aeSStephan Gerhold compatible = "simple-audio-amplifier"; 325db767aeSStephan Gerhold enable-gpios = <&tlmm 117 GPIO_ACTIVE_HIGH>; 335db767aeSStephan Gerhold sound-name-prefix = "Speaker Amp"; 345db767aeSStephan Gerhold pinctrl-0 = <&speaker_amp_default>; 355db767aeSStephan Gerhold pinctrl-names = "default"; 365db767aeSStephan Gerhold }; 375db767aeSStephan Gerhold 385db767aeSStephan Gerhold /* 395db767aeSStephan Gerhold * This seems to be actually an analog switch that either routes audio 405db767aeSStephan Gerhold * to the headphone jack or nowhere. Given that we need to enable a GPIO 415db767aeSStephan Gerhold * to get sound on headphones, modelling it as simple-audio-amplifier 425db767aeSStephan Gerhold * works just fine. 435db767aeSStephan Gerhold */ 445db767aeSStephan Gerhold headphones_switch: audio-switch { 455db767aeSStephan Gerhold compatible = "simple-audio-amplifier"; 465db767aeSStephan Gerhold enable-gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; 475db767aeSStephan Gerhold sound-name-prefix = "Headphones Switch"; 485db767aeSStephan Gerhold pinctrl-0 = <&headphones_switch_default>; 495db767aeSStephan Gerhold pinctrl-names = "default"; 505db767aeSStephan Gerhold }; 515db767aeSStephan Gerhold 528b607c57SLin, Meng-Bo flash-led-controller { 538b607c57SLin, Meng-Bo compatible = "ocs,ocp8110"; 5441e22c2fSStephan Gerhold enable-gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; 5541e22c2fSStephan Gerhold flash-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; 568b607c57SLin, Meng-Bo 578b607c57SLin, Meng-Bo pinctrl-names = "default"; 588b607c57SLin, Meng-Bo pinctrl-0 = <&camera_flash_default>; 598b607c57SLin, Meng-Bo 608b607c57SLin, Meng-Bo flash_led: led { 618b607c57SLin, Meng-Bo function = LED_FUNCTION_FLASH; 628b607c57SLin, Meng-Bo color = <LED_COLOR_ID_WHITE>; 638b607c57SLin, Meng-Bo }; 648b607c57SLin, Meng-Bo }; 658b607c57SLin, Meng-Bo 66a9ff4e16SStephan Gerhold gpio-keys { 67a9ff4e16SStephan Gerhold compatible = "gpio-keys"; 68a9ff4e16SStephan Gerhold 69a9ff4e16SStephan Gerhold pinctrl-names = "default"; 70a9ff4e16SStephan Gerhold pinctrl-0 = <&gpio_keys_default>; 71a9ff4e16SStephan Gerhold 72a9ff4e16SStephan Gerhold label = "GPIO Buttons"; 73a9ff4e16SStephan Gerhold 74b08f5cbdSKrzysztof Kozlowski button-volume-up { 75a9ff4e16SStephan Gerhold label = "Volume Up"; 7641e22c2fSStephan Gerhold gpios = <&tlmm 107 GPIO_ACTIVE_LOW>; 77a9ff4e16SStephan Gerhold linux,code = <KEY_VOLUMEUP>; 78a9ff4e16SStephan Gerhold }; 79a9ff4e16SStephan Gerhold }; 80a9ff4e16SStephan Gerhold 81a9ff4e16SStephan Gerhold usb_id: usb-id { 82a9ff4e16SStephan Gerhold compatible = "linux,extcon-usb-gpio"; 83f6485041SAlexander Stein id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>; 84a9ff4e16SStephan Gerhold pinctrl-names = "default"; 85a9ff4e16SStephan Gerhold pinctrl-0 = <&usb_id_default>; 86a9ff4e16SStephan Gerhold }; 87a9ff4e16SStephan Gerhold}; 88a9ff4e16SStephan Gerhold 89b7d97502SStephan Gerhold&blsp_i2c2 { 90b7d97502SStephan Gerhold status = "okay"; 91b7d97502SStephan Gerhold 92b7d97502SStephan Gerhold imu@68 { 93b7d97502SStephan Gerhold compatible = "invensense,mpu6880"; 94b7d97502SStephan Gerhold reg = <0x68>; 95b7d97502SStephan Gerhold 9641e22c2fSStephan Gerhold interrupt-parent = <&tlmm>; 97b7d97502SStephan Gerhold interrupts = <115 IRQ_TYPE_EDGE_RISING>; 98b7d97502SStephan Gerhold 99b7d97502SStephan Gerhold vdd-supply = <&pm8916_l17>; 100b7d97502SStephan Gerhold vddio-supply = <&pm8916_l6>; 101b7d97502SStephan Gerhold 102b7d97502SStephan Gerhold pinctrl-names = "default"; 103b7d97502SStephan Gerhold pinctrl-0 = <&imu_default>; 104b7d97502SStephan Gerhold 105b7d97502SStephan Gerhold mount-matrix = "1", "0", "0", 106b7d97502SStephan Gerhold "0", "-1", "0", 107b7d97502SStephan Gerhold "0", "0", "1"; 108b7d97502SStephan Gerhold }; 109b7d97502SStephan Gerhold}; 110b7d97502SStephan Gerhold 111678b0fccSStephan Gerhold&blsp_i2c5 { 112678b0fccSStephan Gerhold status = "okay"; 113678b0fccSStephan Gerhold 114678b0fccSStephan Gerhold touchscreen@38 { 115678b0fccSStephan Gerhold /* Likely some other model but works just fine with this one */ 116678b0fccSStephan Gerhold compatible = "edt,edt-ft5506"; 117678b0fccSStephan Gerhold reg = <0x38>; 118678b0fccSStephan Gerhold 11941e22c2fSStephan Gerhold interrupt-parent = <&tlmm>; 120678b0fccSStephan Gerhold interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 121678b0fccSStephan Gerhold 12241e22c2fSStephan Gerhold reset-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>; 123678b0fccSStephan Gerhold 124678b0fccSStephan Gerhold vcc-supply = <&pm8916_l17>; 125678b0fccSStephan Gerhold iovcc-supply = <&pm8916_l6>; 126678b0fccSStephan Gerhold 127678b0fccSStephan Gerhold touchscreen-size-x = <720>; 128678b0fccSStephan Gerhold touchscreen-size-y = <1280>; 129678b0fccSStephan Gerhold 130678b0fccSStephan Gerhold pinctrl-names = "default"; 131678b0fccSStephan Gerhold pinctrl-0 = <&touchscreen_default>; 132678b0fccSStephan Gerhold }; 133678b0fccSStephan Gerhold}; 134678b0fccSStephan Gerhold 135f9af9f61SStephan Gerhold&blsp_i2c6 { 136f9af9f61SStephan Gerhold status = "okay"; 137f9af9f61SStephan Gerhold 138f9af9f61SStephan Gerhold led-controller@45 { 139f9af9f61SStephan Gerhold compatible = "awinic,aw2013"; 140f9af9f61SStephan Gerhold reg = <0x45>; 141f9af9f61SStephan Gerhold #address-cells = <1>; 142f9af9f61SStephan Gerhold #size-cells = <0>; 143f9af9f61SStephan Gerhold 144f9af9f61SStephan Gerhold vcc-supply = <&pm8916_l16>; 145cc1ec484SStephan Gerhold vio-supply = <&pm8916_l5>; 146f9af9f61SStephan Gerhold 147f9af9f61SStephan Gerhold led@0 { 148f9af9f61SStephan Gerhold reg = <0>; 149f9af9f61SStephan Gerhold led-max-microamp = <15000>; 150f9af9f61SStephan Gerhold function = LED_FUNCTION_INDICATOR; 151f9af9f61SStephan Gerhold color = <LED_COLOR_ID_RED>; 152f9af9f61SStephan Gerhold }; 153f9af9f61SStephan Gerhold 154f9af9f61SStephan Gerhold led@1 { 155f9af9f61SStephan Gerhold reg = <1>; 156f9af9f61SStephan Gerhold led-max-microamp = <15000>; 157f9af9f61SStephan Gerhold function = LED_FUNCTION_INDICATOR; 158f9af9f61SStephan Gerhold color = <LED_COLOR_ID_GREEN>; 159f9af9f61SStephan Gerhold }; 160f9af9f61SStephan Gerhold 161f9af9f61SStephan Gerhold led@2 { 162f9af9f61SStephan Gerhold reg = <2>; 163f9af9f61SStephan Gerhold led-max-microamp = <15000>; 164f9af9f61SStephan Gerhold function = LED_FUNCTION_INDICATOR; 165f9af9f61SStephan Gerhold color = <LED_COLOR_ID_BLUE>; 166f9af9f61SStephan Gerhold }; 167f9af9f61SStephan Gerhold }; 168f9af9f61SStephan Gerhold}; 169f9af9f61SStephan Gerhold 170c310ca82SStephan Gerhold&blsp_uart2 { 171a9ff4e16SStephan Gerhold status = "okay"; 172*2b8d22efSStephan Gerhold pinctrl-0 = <&blsp_uart2_console_default>; 173*2b8d22efSStephan Gerhold pinctrl-1 = <&blsp_uart2_console_sleep>; 1748d88f6c9SStephan Gerhold pinctrl-names = "default", "sleep"; 175a9ff4e16SStephan Gerhold}; 176a9ff4e16SStephan Gerhold 1775db767aeSStephan Gerhold&mpss_mem { 1785db767aeSStephan Gerhold reg = <0x0 0x86800000 0x0 0x5100000>; 1795db767aeSStephan Gerhold}; 1805db767aeSStephan Gerhold 1815db767aeSStephan Gerhold&pm8916_codec { 1825db767aeSStephan Gerhold qcom,micbias1-ext-cap; 1835db767aeSStephan Gerhold qcom,micbias-lvl = <2800>; 1845db767aeSStephan Gerhold qcom,mbhc-vthreshold-low = <75 100 120 180 500>; 1855db767aeSStephan Gerhold qcom,mbhc-vthreshold-high = <75 100 120 180 500>; 1865db767aeSStephan Gerhold qcom,hphl-jack-type-normally-open; 1875db767aeSStephan Gerhold}; 1885db767aeSStephan Gerhold 189a9ff4e16SStephan Gerhold&pm8916_resin { 190a9ff4e16SStephan Gerhold status = "okay"; 191a9ff4e16SStephan Gerhold linux,code = <KEY_VOLUMEDOWN>; 192a9ff4e16SStephan Gerhold}; 193a9ff4e16SStephan Gerhold 194b0a8f16aSStephan Gerhold&pm8916_rpm_regulators { 195b0a8f16aSStephan Gerhold pm8916_l16: l16 { 196b0a8f16aSStephan Gerhold /* 197b0a8f16aSStephan Gerhold * L16 is only used for AW2013 which is fine with 2.5-3.3V. 198b0a8f16aSStephan Gerhold * Use the recommended typical voltage of 2.8V as minimum. 199b0a8f16aSStephan Gerhold */ 200b0a8f16aSStephan Gerhold regulator-min-microvolt = <2800000>; 201b0a8f16aSStephan Gerhold regulator-max-microvolt = <3300000>; 202b0a8f16aSStephan Gerhold }; 203b0a8f16aSStephan Gerhold 204b0a8f16aSStephan Gerhold pm8916_l17: l17 { 205b0a8f16aSStephan Gerhold regulator-min-microvolt = <2850000>; 206b0a8f16aSStephan Gerhold regulator-max-microvolt = <2850000>; 207b0a8f16aSStephan Gerhold }; 208b0a8f16aSStephan Gerhold}; 209b0a8f16aSStephan Gerhold 210a9ff4e16SStephan Gerhold&pm8916_vib { 211a9ff4e16SStephan Gerhold status = "okay"; 212a9ff4e16SStephan Gerhold}; 213a9ff4e16SStephan Gerhold 214a9ff4e16SStephan Gerhold&sdhc_1 { 215a9ff4e16SStephan Gerhold status = "okay"; 216a9ff4e16SStephan Gerhold}; 217a9ff4e16SStephan Gerhold 218a9ff4e16SStephan Gerhold&sdhc_2 { 219a9ff4e16SStephan Gerhold status = "okay"; 220a9ff4e16SStephan Gerhold non-removable; 221a9ff4e16SStephan Gerhold}; 222a9ff4e16SStephan Gerhold 2235db767aeSStephan Gerhold&sound { 2245db767aeSStephan Gerhold /* 2255db767aeSStephan Gerhold * Provide widgets/pin-switches to allow enabling speaker and headphones 2265db767aeSStephan Gerhold * separately. Both are routed via the HPH_L/HPH_R pins of the codec. 2275db767aeSStephan Gerhold */ 2285db767aeSStephan Gerhold model = "wt88047"; 2295db767aeSStephan Gerhold widgets = 2305db767aeSStephan Gerhold "Speaker", "Speaker", 2315db767aeSStephan Gerhold "Headphone", "Headphones"; 2325db767aeSStephan Gerhold pin-switches = "Speaker", "Headphones"; 2335db767aeSStephan Gerhold audio-routing = 2345db767aeSStephan Gerhold "Speaker", "Speaker Amp OUTL", 2355db767aeSStephan Gerhold "Speaker", "Speaker Amp OUTR", 2365db767aeSStephan Gerhold "Speaker Amp INL", "HPH_R", 2375db767aeSStephan Gerhold "Speaker Amp INR", "HPH_R", 2385db767aeSStephan Gerhold "Headphones", "Headphones Switch OUTL", 2395db767aeSStephan Gerhold "Headphones", "Headphones Switch OUTR", 2405db767aeSStephan Gerhold "Headphones Switch INL", "HPH_L", 2415db767aeSStephan Gerhold "Headphones Switch INR", "HPH_R", 2425db767aeSStephan Gerhold "AMIC1", "MIC BIAS External1", 2435db767aeSStephan Gerhold "AMIC2", "MIC BIAS Internal2"; 2445db767aeSStephan Gerhold aux-devs = <&speaker_amp>, <&headphones_switch>; 2455db767aeSStephan Gerhold}; 2465db767aeSStephan Gerhold 247a9ff4e16SStephan Gerhold&usb { 248a9ff4e16SStephan Gerhold status = "okay"; 249a9ff4e16SStephan Gerhold extcon = <&usb_id>, <&usb_id>; 250a9ff4e16SStephan Gerhold}; 251a9ff4e16SStephan Gerhold 252a9ff4e16SStephan Gerhold&usb_hs_phy { 253a9ff4e16SStephan Gerhold extcon = <&usb_id>; 254a9ff4e16SStephan Gerhold}; 255a9ff4e16SStephan Gerhold 25629589248SStephan Gerhold&venus { 25729589248SStephan Gerhold status = "okay"; 25829589248SStephan Gerhold}; 25929589248SStephan Gerhold 2600ece6438SStephan Gerhold&venus_mem { 2610ece6438SStephan Gerhold status = "okay"; 2620ece6438SStephan Gerhold}; 2630ece6438SStephan Gerhold 26432444424SStephan Gerhold&wcnss { 26532444424SStephan Gerhold status = "okay"; 26632444424SStephan Gerhold}; 26732444424SStephan Gerhold 26832444424SStephan Gerhold&wcnss_iris { 26932444424SStephan Gerhold compatible = "qcom,wcn3620"; 27032444424SStephan Gerhold}; 27132444424SStephan Gerhold 2720ece6438SStephan Gerhold&wcnss_mem { 2730ece6438SStephan Gerhold status = "okay"; 2740ece6438SStephan Gerhold}; 2750ece6438SStephan Gerhold 27641e22c2fSStephan Gerhold&tlmm { 2778b607c57SLin, Meng-Bo camera_flash_default: camera-flash-default-state { 2788b607c57SLin, Meng-Bo pins = "gpio31", "gpio32"; 2798b607c57SLin, Meng-Bo function = "gpio"; 2808b607c57SLin, Meng-Bo 2818b607c57SLin, Meng-Bo drive-strength = <2>; 2828b607c57SLin, Meng-Bo bias-disable; 2838b607c57SLin, Meng-Bo }; 2848b607c57SLin, Meng-Bo 2858b276ca0SKrzysztof Kozlowski gpio_keys_default: gpio-keys-default-state { 286a9ff4e16SStephan Gerhold pins = "gpio107"; 287a9ff4e16SStephan Gerhold function = "gpio"; 288a9ff4e16SStephan Gerhold 289a9ff4e16SStephan Gerhold drive-strength = <2>; 290a9ff4e16SStephan Gerhold bias-pull-up; 291a9ff4e16SStephan Gerhold }; 292a9ff4e16SStephan Gerhold 2935db767aeSStephan Gerhold headphones_switch_default: headphones-switch-default-state { 2945db767aeSStephan Gerhold pins = "gpio8"; 2955db767aeSStephan Gerhold function = "gpio"; 2965db767aeSStephan Gerhold drive-strength = <2>; 2975db767aeSStephan Gerhold bias-disable; 2985db767aeSStephan Gerhold }; 2995db767aeSStephan Gerhold 3008b276ca0SKrzysztof Kozlowski imu_default: imu-default-state { 301b7d97502SStephan Gerhold pins = "gpio115"; 302b7d97502SStephan Gerhold function = "gpio"; 303b7d97502SStephan Gerhold 304b7d97502SStephan Gerhold drive-strength = <2>; 305b7d97502SStephan Gerhold bias-disable; 306b7d97502SStephan Gerhold }; 307b7d97502SStephan Gerhold 3085db767aeSStephan Gerhold speaker_amp_default: speaker-amp-default-state { 3095db767aeSStephan Gerhold pins = "gpio117"; 3105db767aeSStephan Gerhold function = "gpio"; 3115db767aeSStephan Gerhold drive-strength = <2>; 3125db767aeSStephan Gerhold bias-disable; 3135db767aeSStephan Gerhold }; 3145db767aeSStephan Gerhold 3158b276ca0SKrzysztof Kozlowski touchscreen_default: touchscreen-default-state { 3168b276ca0SKrzysztof Kozlowski touchscreen-pins { 317678b0fccSStephan Gerhold pins = "gpio13"; 318678b0fccSStephan Gerhold function = "gpio"; 319678b0fccSStephan Gerhold 320678b0fccSStephan Gerhold drive-strength = <2>; 321678b0fccSStephan Gerhold bias-pull-up; 3228b276ca0SKrzysztof Kozlowski }; 3238b276ca0SKrzysztof Kozlowski reset-pins { 324678b0fccSStephan Gerhold pins = "gpio12"; 325678b0fccSStephan Gerhold function = "gpio"; 326678b0fccSStephan Gerhold 327678b0fccSStephan Gerhold drive-strength = <2>; 328678b0fccSStephan Gerhold bias-disable; 329678b0fccSStephan Gerhold }; 330678b0fccSStephan Gerhold }; 331678b0fccSStephan Gerhold 3328b276ca0SKrzysztof Kozlowski usb_id_default: usb-id-default-state { 333a9ff4e16SStephan Gerhold pins = "gpio110"; 334a9ff4e16SStephan Gerhold function = "gpio"; 335a9ff4e16SStephan Gerhold 336a9ff4e16SStephan Gerhold drive-strength = <8>; 337a9ff4e16SStephan Gerhold bias-pull-up; 338a9ff4e16SStephan Gerhold }; 339a9ff4e16SStephan Gerhold}; 340