1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright (C) 2021 Stephan Gerhold
6 #include "msm8916-pm8916.dtsi"
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/interrupt-controller/irq.h>
10 #include <dt-bindings/leds/common.h>
11 #include <dt-bindings/sound/apq8016-lpass.h>
14 * Note: The original firmware from Huawei can only boot 32-bit kernels.
15 * To boot this device tree using arm64 it is necessary to flash 64-bit TZ/HYP
16 * firmware (e.g. taken from the DragonBoard 410c).
17 * See https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7)
18 * for suggested installation instructions.
22 model = "Huawei Ascend G7";
23 compatible = "huawei,g7", "qcom,msm8916";
24 chassis-type = "handset";
27 serial0 = &blsp1_uart2;
31 stdout-path = "serial0";
35 compatible = "gpio-keys";
37 pinctrl-names = "default";
38 pinctrl-0 = <&gpio_keys_default>;
40 label = "GPIO Buttons";
44 gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
45 linux,code = <KEY_VOLUMEUP>;
50 compatible = "gpio-leds";
52 pinctrl-names = "default";
53 pinctrl-0 = <&gpio_leds_default>;
56 gpios = <&msmgpio 8 GPIO_ACTIVE_HIGH>;
57 color = <LED_COLOR_ID_RED>;
58 default-state = "off";
59 function = LED_FUNCTION_INDICATOR;
63 gpios = <&msmgpio 9 GPIO_ACTIVE_HIGH>;
64 color = <LED_COLOR_ID_GREEN>;
65 default-state = "off";
66 function = LED_FUNCTION_INDICATOR;
70 gpios = <&msmgpio 10 GPIO_ACTIVE_HIGH>;
71 color = <LED_COLOR_ID_BLUE>;
72 default-state = "off";
73 function = LED_FUNCTION_INDICATOR;
78 compatible = "linux,extcon-usb-gpio";
79 id-gpio = <&msmgpio 117 GPIO_ACTIVE_HIGH>;
80 pinctrl-names = "default";
81 pinctrl-0 = <&usb_id_default>;
89 compatible = "asahi-kasei,ak09911";
92 vdd-supply = <&pm8916_l17>;
93 vid-supply = <&pm8916_l6>;
95 reset-gpios = <&msmgpio 36 GPIO_ACTIVE_LOW>;
97 pinctrl-names = "default";
98 pinctrl-0 = <&mag_reset_default>;
102 compatible = "kionix,kx023-1025";
105 interrupt-parent = <&msmgpio>;
106 interrupts = <115 IRQ_TYPE_EDGE_RISING>;
108 vdd-supply = <&pm8916_l17>;
109 vddio-supply = <&pm8916_l6>;
111 pinctrl-names = "default";
112 pinctrl-0 = <&accel_irq_default>;
114 mount-matrix = "-1", "0", "0",
120 compatible = "avago,apds9930";
123 interrupt-parent = <&msmgpio>;
124 interrupts = <113 IRQ_TYPE_EDGE_FALLING>;
126 vdd-supply = <&pm8916_l17>;
127 vddio-supply = <&pm8916_l6>;
129 led-max-microamp = <100000>;
130 amstaos,proximity-diodes = <1>;
132 pinctrl-names = "default";
133 pinctrl-0 = <&prox_irq_default>;
137 compatible = "ti,tps65132";
140 pinctrl-names = "default";
141 pinctrl-0 = <®_lcd_en_default>;
144 regulator-name = "outp";
145 regulator-min-microvolt = <5400000>;
146 regulator-max-microvolt = <5400000>;
147 enable-gpios = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
148 regulator-active-discharge = <1>;
152 regulator-name = "outn";
153 regulator-min-microvolt = <5400000>;
154 regulator-max-microvolt = <5400000>;
155 enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
156 regulator-active-discharge = <1>;
165 compatible = "syna,rmi4-i2c";
167 #address-cells = <1>;
170 interrupt-parent = <&msmgpio>;
171 interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
173 vdd-supply = <&pm8916_l17>;
174 vio-supply = <&pm8916_l16>;
176 pinctrl-names = "default";
177 pinctrl-0 = <&ts_irq_default>;
179 syna,startup-delay-ms = <100>;
183 syna,nosleep-mode = <1>; /* Allow sleeping */
188 syna,sensor-type = <1>; /* Touchscreen */
197 compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
200 interrupt-parent = <&msmgpio>;
201 interrupts = <21 IRQ_TYPE_EDGE_RISING>;
203 enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
204 firmware-gpios = <&msmgpio 2 GPIO_ACTIVE_HIGH>;
206 pinctrl-names = "default";
207 pinctrl-0 = <&nfc_default>;
221 linux,code = <KEY_VOLUMEDOWN>;
235 pinctrl-names = "default", "sleep";
236 pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
237 pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
243 pinctrl-names = "default", "sleep";
244 pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdhc2_cd_default>;
245 pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdhc2_cd_default>;
248 * The Huawei device tree sets cd-gpios = <&msmgpio 38 GPIO_ACTIVE_HIGH>.
249 * However, gpio38 does not change its state when inserting/removing the
250 * SD card, it's just low all the time. The Huawei kernel seems to use
251 * polling for SD card detection instead.
253 * However, looking closer at the GPIO debug output it turns out that
254 * gpio56 switches its state when inserting/removing the SD card.
255 * It behaves just like gpio38 normally does. Usually GPIO56 is used as
256 * "UIM2_PRESENT", i.e. to check if a second SIM card is inserted.
257 * Maybe Huawei decided to replace the second SIM card slot with the
258 * SD card slot and forgot to re-route to gpio38.
260 cd-gpios = <&msmgpio 56 GPIO_ACTIVE_LOW>;
268 "AMIC1", "MIC BIAS External1",
269 "AMIC2", "MIC BIAS External2",
270 "AMIC3", "MIC BIAS External1";
272 pinctrl-names = "default", "sleep";
273 pinctrl-0 = <&cdc_pdm_lines_act>;
274 pinctrl-1 = <&cdc_pdm_lines_sus>;
279 sound-dai = <&lpass MI2S_PRIMARY>;
282 sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
287 link-name = "WCD-Capture";
289 sound-dai = <&lpass MI2S_TERTIARY>;
292 sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
299 extcon = <&usb_id>, <&usb_id>;
307 qcom,micbias-lvl = <2800>;
308 qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
309 qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
310 qcom,hphl-jack-type-normally-open;
313 &smd_rpm_regulators {
314 vdd_l1_l2_l3-supply = <&pm8916_s3>;
315 vdd_l4_l5_l6-supply = <&pm8916_s4>;
316 vdd_l7-supply = <&pm8916_s4>;
319 regulator-min-microvolt = <1200000>;
320 regulator-max-microvolt = <1300000>;
324 regulator-min-microvolt = <1800000>;
325 regulator-max-microvolt = <2100000>;
329 regulator-min-microvolt = <1225000>;
330 regulator-max-microvolt = <1225000>;
334 regulator-min-microvolt = <1200000>;
335 regulator-max-microvolt = <1200000>;
339 regulator-min-microvolt = <2050000>;
340 regulator-max-microvolt = <2050000>;
344 regulator-min-microvolt = <1800000>;
345 regulator-max-microvolt = <1800000>;
349 regulator-min-microvolt = <1800000>;
350 regulator-max-microvolt = <1800000>;
354 regulator-min-microvolt = <1800000>;
355 regulator-max-microvolt = <1800000>;
359 regulator-min-microvolt = <2950000>;
360 regulator-max-microvolt = <2950000>;
364 regulator-min-microvolt = <3300000>;
365 regulator-max-microvolt = <3300000>;
369 regulator-min-microvolt = <2700000>;
370 regulator-max-microvolt = <2800000>;
374 regulator-min-microvolt = <1800000>;
375 regulator-max-microvolt = <2950000>;
376 regulator-allow-set-load;
377 regulator-system-load = <200000>;
381 regulator-min-microvolt = <1800000>;
382 regulator-max-microvolt = <2950000>;
386 regulator-min-microvolt = <3075000>;
387 regulator-max-microvolt = <3075000>;
391 regulator-min-microvolt = <1800000>;
392 regulator-max-microvolt = <3300000>;
396 regulator-min-microvolt = <1800000>;
397 regulator-max-microvolt = <3300000>;
401 regulator-min-microvolt = <1800000>;
402 regulator-max-microvolt = <1800000>;
406 regulator-min-microvolt = <2850000>;
407 regulator-max-microvolt = <2850000>;
411 regulator-min-microvolt = <2700000>;
412 regulator-max-microvolt = <2700000>;
417 accel_irq_default: accel-irq-default {
421 drive-strength = <2>;
425 gpio_keys_default: gpio-keys-default {
429 drive-strength = <2>;
433 gpio_leds_default: gpio-leds-default {
434 pins = "gpio8", "gpio9", "gpio10";
437 drive-strength = <2>;
441 nfc_default: nfc-default {
442 pins = "gpio2", "gpio20", "gpio21";
445 drive-strength = <2>;
449 mag_reset_default: mag-reset-default {
453 drive-strength = <2>;
457 prox_irq_default: prox-irq-default {
461 drive-strength = <2>;
465 reg_lcd_en_default: reg-lcd-en-default {
466 pins = "gpio32", "gpio97";
469 drive-strength = <2>;
473 sdhc2_cd_default: sdhc2-cd-default {
477 drive-strength = <2>;
481 ts_irq_default: ts-irq-default {
485 drive-strength = <2>;
489 usb_id_default: usb-id-default {
493 drive-strength = <8>;