1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2020 Stephan Gerhold
8 #include "msm8916-pm8916.dtsi"
9 #include "msm8916-modem-qdsp6.dtsi"
11 #include <dt-bindings/gpio/gpio.h>
12 #include <dt-bindings/input/input.h>
13 #include <dt-bindings/leds/common.h>
16 model = "Xiaomi Redmi 2 (Wingtech WT88047)";
17 compatible = "wingtech,wt88047", "qcom,msm8916";
18 chassis-type = "handset";
21 mmc0 = &sdhc_1; /* eMMC */
22 mmc1 = &sdhc_2; /* SD card */
23 serial0 = &blsp_uart2;
27 stdout-path = "serial0";
30 speaker_amp: audio-amplifier {
31 compatible = "simple-audio-amplifier";
32 enable-gpios = <&tlmm 117 GPIO_ACTIVE_HIGH>;
33 sound-name-prefix = "Speaker Amp";
34 pinctrl-0 = <&speaker_amp_default>;
35 pinctrl-names = "default";
39 * This seems to be actually an analog switch that either routes audio
40 * to the headphone jack or nowhere. Given that we need to enable a GPIO
41 * to get sound on headphones, modelling it as simple-audio-amplifier
44 headphones_switch: audio-switch {
45 compatible = "simple-audio-amplifier";
46 enable-gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
47 sound-name-prefix = "Headphones Switch";
48 pinctrl-0 = <&headphones_switch_default>;
49 pinctrl-names = "default";
52 flash-led-controller {
53 compatible = "ocs,ocp8110";
54 enable-gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
55 flash-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
57 pinctrl-names = "default";
58 pinctrl-0 = <&camera_flash_default>;
61 function = LED_FUNCTION_FLASH;
62 color = <LED_COLOR_ID_WHITE>;
67 compatible = "gpio-keys";
69 pinctrl-names = "default";
70 pinctrl-0 = <&gpio_keys_default>;
72 label = "GPIO Buttons";
76 gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
77 linux,code = <KEY_VOLUMEUP>;
82 compatible = "linux,extcon-usb-gpio";
83 id-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
84 pinctrl-names = "default";
85 pinctrl-0 = <&usb_id_default>;
93 compatible = "invensense,mpu6880";
96 interrupt-parent = <&tlmm>;
97 interrupts = <115 IRQ_TYPE_EDGE_RISING>;
99 vdd-supply = <&pm8916_l17>;
100 vddio-supply = <&pm8916_l6>;
102 pinctrl-names = "default";
103 pinctrl-0 = <&imu_default>;
105 mount-matrix = "1", "0", "0",
115 /* Likely some other model but works just fine with this one */
116 compatible = "edt,edt-ft5506";
119 interrupt-parent = <&tlmm>;
120 interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
122 reset-gpios = <&tlmm 12 GPIO_ACTIVE_LOW>;
124 vcc-supply = <&pm8916_l17>;
125 iovcc-supply = <&pm8916_l6>;
127 touchscreen-size-x = <720>;
128 touchscreen-size-y = <1280>;
130 pinctrl-names = "default";
131 pinctrl-0 = <&touchscreen_default>;
139 compatible = "awinic,aw2013";
141 #address-cells = <1>;
144 vcc-supply = <&pm8916_l16>;
145 vio-supply = <&pm8916_l5>;
149 led-max-microamp = <15000>;
150 function = LED_FUNCTION_INDICATOR;
151 color = <LED_COLOR_ID_RED>;
156 led-max-microamp = <15000>;
157 function = LED_FUNCTION_INDICATOR;
158 color = <LED_COLOR_ID_GREEN>;
163 led-max-microamp = <15000>;
164 function = LED_FUNCTION_INDICATOR;
165 color = <LED_COLOR_ID_BLUE>;
175 reg = <0x0 0x86800000 0x0 0x5100000>;
179 qcom,micbias1-ext-cap;
180 qcom,micbias-lvl = <2800>;
181 qcom,mbhc-vthreshold-low = <75 100 120 180 500>;
182 qcom,mbhc-vthreshold-high = <75 100 120 180 500>;
183 qcom,hphl-jack-type-normally-open;
188 linux,code = <KEY_VOLUMEDOWN>;
191 &pm8916_rpm_regulators {
194 * L16 is only used for AW2013 which is fine with 2.5-3.3V.
195 * Use the recommended typical voltage of 2.8V as minimum.
197 regulator-min-microvolt = <2800000>;
198 regulator-max-microvolt = <3300000>;
202 regulator-min-microvolt = <2850000>;
203 regulator-max-microvolt = <2850000>;
222 * Provide widgets/pin-switches to allow enabling speaker and headphones
223 * separately. Both are routed via the HPH_L/HPH_R pins of the codec.
227 "Speaker", "Speaker",
228 "Headphone", "Headphones";
229 pin-switches = "Speaker", "Headphones";
231 "Speaker", "Speaker Amp OUTL",
232 "Speaker", "Speaker Amp OUTR",
233 "Speaker Amp INL", "HPH_R",
234 "Speaker Amp INR", "HPH_R",
235 "Headphones", "Headphones Switch OUTL",
236 "Headphones", "Headphones Switch OUTR",
237 "Headphones Switch INL", "HPH_L",
238 "Headphones Switch INR", "HPH_R",
239 "AMIC1", "MIC BIAS External1",
240 "AMIC2", "MIC BIAS Internal2";
241 aux-devs = <&speaker_amp>, <&headphones_switch>;
246 extcon = <&usb_id>, <&usb_id>;
266 compatible = "qcom,wcn3620";
274 camera_flash_default: camera-flash-default-state {
275 pins = "gpio31", "gpio32";
278 drive-strength = <2>;
282 gpio_keys_default: gpio-keys-default-state {
286 drive-strength = <2>;
290 headphones_switch_default: headphones-switch-default-state {
293 drive-strength = <2>;
297 imu_default: imu-default-state {
301 drive-strength = <2>;
305 speaker_amp_default: speaker-amp-default-state {
308 drive-strength = <2>;
312 touchscreen_default: touchscreen-default-state {
317 drive-strength = <2>;
324 drive-strength = <2>;
329 usb_id_default: usb-id-default-state {
333 drive-strength = <8>;