1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2021 Stephan Gerhold
8 #include "msm8916-pm8916.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/interrupt-controller/irq.h>
12 #include <dt-bindings/leds/common.h>
13 #include <dt-bindings/sound/apq8016-lpass.h>
16 * Note: The original firmware from Huawei can only boot 32-bit kernels.
17 * To boot this device tree using arm64 it is necessary to flash 64-bit TZ/HYP
18 * firmware (e.g. taken from the DragonBoard 410c).
19 * See https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7)
20 * for suggested installation instructions.
24 model = "Huawei Ascend G7";
25 compatible = "huawei,g7", "qcom,msm8916";
26 chassis-type = "handset";
29 serial0 = &blsp1_uart2;
33 stdout-path = "serial0";
37 compatible = "gpio-keys";
39 pinctrl-names = "default";
40 pinctrl-0 = <&gpio_keys_default>;
42 label = "GPIO Buttons";
46 gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_VOLUMEUP>;
52 compatible = "gpio-leds";
54 pinctrl-names = "default";
55 pinctrl-0 = <&gpio_leds_default>;
58 gpios = <&msmgpio 8 GPIO_ACTIVE_HIGH>;
59 color = <LED_COLOR_ID_RED>;
60 default-state = "off";
61 function = LED_FUNCTION_INDICATOR;
65 gpios = <&msmgpio 9 GPIO_ACTIVE_HIGH>;
66 color = <LED_COLOR_ID_GREEN>;
67 default-state = "off";
68 function = LED_FUNCTION_INDICATOR;
72 gpios = <&msmgpio 10 GPIO_ACTIVE_HIGH>;
73 color = <LED_COLOR_ID_BLUE>;
74 default-state = "off";
75 function = LED_FUNCTION_INDICATOR;
80 compatible = "linux,extcon-usb-gpio";
81 id-gpio = <&msmgpio 117 GPIO_ACTIVE_HIGH>;
82 pinctrl-names = "default";
83 pinctrl-0 = <&usb_id_default>;
91 compatible = "asahi-kasei,ak09911";
94 vdd-supply = <&pm8916_l17>;
95 vid-supply = <&pm8916_l6>;
97 reset-gpios = <&msmgpio 36 GPIO_ACTIVE_LOW>;
99 pinctrl-names = "default";
100 pinctrl-0 = <&mag_reset_default>;
104 compatible = "kionix,kx023-1025";
107 interrupt-parent = <&msmgpio>;
108 interrupts = <115 IRQ_TYPE_EDGE_RISING>;
110 vdd-supply = <&pm8916_l17>;
111 vddio-supply = <&pm8916_l6>;
113 pinctrl-names = "default";
114 pinctrl-0 = <&accel_irq_default>;
116 mount-matrix = "-1", "0", "0",
122 compatible = "avago,apds9930";
125 interrupt-parent = <&msmgpio>;
126 interrupts = <113 IRQ_TYPE_EDGE_FALLING>;
128 vdd-supply = <&pm8916_l17>;
129 vddio-supply = <&pm8916_l6>;
131 led-max-microamp = <100000>;
132 amstaos,proximity-diodes = <1>;
134 pinctrl-names = "default";
135 pinctrl-0 = <&prox_irq_default>;
139 compatible = "ti,tps65132";
142 pinctrl-names = "default";
143 pinctrl-0 = <®_lcd_en_default>;
146 regulator-name = "outp";
147 regulator-min-microvolt = <5400000>;
148 regulator-max-microvolt = <5400000>;
149 enable-gpios = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
150 regulator-active-discharge = <1>;
154 regulator-name = "outn";
155 regulator-min-microvolt = <5400000>;
156 regulator-max-microvolt = <5400000>;
157 enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
158 regulator-active-discharge = <1>;
167 compatible = "syna,rmi4-i2c";
169 #address-cells = <1>;
172 interrupt-parent = <&msmgpio>;
173 interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
175 vdd-supply = <&pm8916_l17>;
176 vio-supply = <&pm8916_l16>;
178 pinctrl-names = "default";
179 pinctrl-0 = <&ts_irq_default>;
181 syna,startup-delay-ms = <100>;
185 syna,nosleep-mode = <1>; /* Allow sleeping */
190 syna,sensor-type = <1>; /* Touchscreen */
199 compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
202 interrupt-parent = <&msmgpio>;
203 interrupts = <21 IRQ_TYPE_EDGE_RISING>;
205 enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
206 firmware-gpios = <&msmgpio 2 GPIO_ACTIVE_HIGH>;
208 pinctrl-names = "default";
209 pinctrl-0 = <&nfc_default>;
223 linux,code = <KEY_VOLUMEDOWN>;
233 pinctrl-names = "default", "sleep";
234 pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
235 pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
241 pinctrl-names = "default", "sleep";
242 pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdhc2_cd_default>;
243 pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdhc2_cd_default>;
246 * The Huawei device tree sets cd-gpios = <&msmgpio 38 GPIO_ACTIVE_HIGH>.
247 * However, gpio38 does not change its state when inserting/removing the
248 * SD card, it's just low all the time. The Huawei kernel seems to use
249 * polling for SD card detection instead.
251 * However, looking closer at the GPIO debug output it turns out that
252 * gpio56 switches its state when inserting/removing the SD card.
253 * It behaves just like gpio38 normally does. Usually GPIO56 is used as
254 * "UIM2_PRESENT", i.e. to check if a second SIM card is inserted.
255 * Maybe Huawei decided to replace the second SIM card slot with the
256 * SD card slot and forgot to re-route to gpio38.
258 cd-gpios = <&msmgpio 56 GPIO_ACTIVE_LOW>;
266 "AMIC1", "MIC BIAS External1",
267 "AMIC2", "MIC BIAS External2",
268 "AMIC3", "MIC BIAS External1";
270 pinctrl-names = "default", "sleep";
271 pinctrl-0 = <&cdc_pdm_lines_act>;
272 pinctrl-1 = <&cdc_pdm_lines_sus>;
277 sound-dai = <&lpass MI2S_PRIMARY>;
280 sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
285 link-name = "WCD-Capture";
287 sound-dai = <&lpass MI2S_TERTIARY>;
290 sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
297 extcon = <&usb_id>, <&usb_id>;
305 qcom,micbias-lvl = <2800>;
306 qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
307 qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
308 qcom,hphl-jack-type-normally-open;
316 compatible = "qcom,wcn3620";
319 &smd_rpm_regulators {
320 vdd_l1_l2_l3-supply = <&pm8916_s3>;
321 vdd_l4_l5_l6-supply = <&pm8916_s4>;
322 vdd_l7-supply = <&pm8916_s4>;
325 regulator-min-microvolt = <1200000>;
326 regulator-max-microvolt = <1300000>;
330 regulator-min-microvolt = <1800000>;
331 regulator-max-microvolt = <2100000>;
335 regulator-min-microvolt = <1225000>;
336 regulator-max-microvolt = <1225000>;
340 regulator-min-microvolt = <1200000>;
341 regulator-max-microvolt = <1200000>;
345 regulator-min-microvolt = <2050000>;
346 regulator-max-microvolt = <2050000>;
350 regulator-min-microvolt = <1800000>;
351 regulator-max-microvolt = <1800000>;
355 regulator-min-microvolt = <1800000>;
356 regulator-max-microvolt = <1800000>;
360 regulator-min-microvolt = <1800000>;
361 regulator-max-microvolt = <1800000>;
365 regulator-min-microvolt = <2950000>;
366 regulator-max-microvolt = <2950000>;
370 regulator-min-microvolt = <3300000>;
371 regulator-max-microvolt = <3300000>;
375 regulator-min-microvolt = <2700000>;
376 regulator-max-microvolt = <2800000>;
380 regulator-min-microvolt = <1800000>;
381 regulator-max-microvolt = <2950000>;
382 regulator-allow-set-load;
383 regulator-system-load = <200000>;
387 regulator-min-microvolt = <1800000>;
388 regulator-max-microvolt = <2950000>;
392 regulator-min-microvolt = <3075000>;
393 regulator-max-microvolt = <3075000>;
397 regulator-min-microvolt = <1800000>;
398 regulator-max-microvolt = <3300000>;
402 regulator-min-microvolt = <1800000>;
403 regulator-max-microvolt = <3300000>;
407 regulator-min-microvolt = <1800000>;
408 regulator-max-microvolt = <1800000>;
412 regulator-min-microvolt = <2850000>;
413 regulator-max-microvolt = <2850000>;
417 regulator-min-microvolt = <2700000>;
418 regulator-max-microvolt = <2700000>;
423 accel_irq_default: accel-irq-default-state {
427 drive-strength = <2>;
431 gpio_keys_default: gpio-keys-default-state {
435 drive-strength = <2>;
439 gpio_leds_default: gpio-leds-default-state {
440 pins = "gpio8", "gpio9", "gpio10";
443 drive-strength = <2>;
447 nfc_default: nfc-default-state {
448 pins = "gpio2", "gpio20", "gpio21";
451 drive-strength = <2>;
455 mag_reset_default: mag-reset-default-state {
459 drive-strength = <2>;
463 prox_irq_default: prox-irq-default-state {
467 drive-strength = <2>;
471 reg_lcd_en_default: reg-lcd-en-default-state {
472 pins = "gpio32", "gpio97";
475 drive-strength = <2>;
479 sdhc2_cd_default: sdhc2-cd-default-state {
483 drive-strength = <2>;
487 ts_irq_default: ts-irq-default-state {
491 drive-strength = <2>;
495 usb_id_default: usb-id-default-state {
499 drive-strength = <8>;