diff mbox series

[7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)

Message ID 20210525200246.118323-7-konrad.dybcio@somainline.org
State Superseded
Headers show
Series [1/7] arm64: dts: qcom: Add PMI8996 DTSI file | expand

Commit Message

Konrad Dybcio May 25, 2021, 8:02 p.m. UTC
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>

Add support for following boards:

- Xperia X Performance (dora)
- Xperia XZ (kagura)
- Xperia XZs (keyaki)

They are all based on the SONY Tone platform and feature largely similar hardware
with the most obvious differences being lack of USB-C and ToF sensor on Dora and
different camera sensor on Keyaki.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/Makefile             |   6 +
 .../msm8996-pmi8996-sony-xperia-tone-dora.dts |  11 +
 ...sm8996-pmi8996-sony-xperia-tone-kagura.dts |  11 +
 ...sm8996-pmi8996-sony-xperia-tone-keyaki.dts |  11 +
 .../qcom/msm8996-sony-xperia-tone-dora.dts    |  27 +
 .../qcom/msm8996-sony-xperia-tone-kagura.dts  |  15 +
 .../qcom/msm8996-sony-xperia-tone-keyaki.dts  |  26 +
 .../dts/qcom/msm8996-sony-xperia-tone.dtsi    | 980 ++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8996.dtsi         |  12 +-
 9 files changed, 1093 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi

Comments

Bjorn Andersson May 26, 2021, 3:38 a.m. UTC | #1
On Tue 25 May 15:02 CDT 2021, Konrad Dybcio wrote:

> From: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>

> 

> Add support for following boards:

> 

> - Xperia X Performance (dora)

> - Xperia XZ (kagura)

> - Xperia XZs (keyaki)

> 

> They are all based on the SONY Tone platform and feature largely similar hardware

> with the most obvious differences being lack of USB-C and ToF sensor on Dora and

> different camera sensor on Keyaki.

> 

> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>

> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>

> ---

>  arch/arm64/boot/dts/qcom/Makefile             |   6 +

>  .../msm8996-pmi8996-sony-xperia-tone-dora.dts |  11 +

>  ...sm8996-pmi8996-sony-xperia-tone-kagura.dts |  11 +

>  ...sm8996-pmi8996-sony-xperia-tone-keyaki.dts |  11 +

>  .../qcom/msm8996-sony-xperia-tone-dora.dts    |  27 +

>  .../qcom/msm8996-sony-xperia-tone-kagura.dts  |  15 +

>  .../qcom/msm8996-sony-xperia-tone-keyaki.dts  |  26 +

>  .../dts/qcom/msm8996-sony-xperia-tone.dtsi    | 980 ++++++++++++++++++

>  arch/arm64/boot/dts/qcom/msm8996.dtsi         |  12 +-

>  9 files changed, 1093 insertions(+), 6 deletions(-)

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts

>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi

> 

> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile

> index ca4a7819d2c4..d079dc33d833 100644

> --- a/arch/arm64/boot/dts/qcom/Makefile

> +++ b/arch/arm64/boot/dts/qcom/Makefile

> @@ -25,6 +25,12 @@ dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-satsuki.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-sumire.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-suzuran.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-mtp.dtb

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-dora.dtb

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-kagura.dtb

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-keyaki.dtb


's' > 'p', please keep them sorted alphabetically.

That said, perhaps it would look better to move the "pmi8996" part later
in the name?

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-dora.dtb

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-kagura.dtb

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-keyaki.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-asus-novago-tp370ql.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-hp-envy-x2.dtb

>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-lenovo-miix-630.dtb

> diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts

> new file mode 100644

> index 000000000000..b57ea0824ea5

> --- /dev/null

> +++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts

> @@ -0,0 +1,11 @@

> +// SPDX-License-Identifier: GPL-2.0


BSD license in all the files please.

> +/*

> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>

> + */

> +

> +#include "msm8996-sony-xperia-tone-dora.dts"

> +#include "pmi8996.dtsi"

> +

> +/ {

> +	model = "Sony Xperia X Performance (PMI8996)";

> +};

> \ No newline at end of file

[..]
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi

> new file mode 100644

> index 000000000000..4644d5f9d1a6

> --- /dev/null

> +++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi

> @@ -0,0 +1,980 @@

> +// SPDX-License-Identifier: GPL-2.0

> +/*

> + * Copyright (c) 2021, AngeloGioacchino Del Regno

> + *                     <angelogioacchino.delregno@somainline.org>

> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>

> + */

> +

> +#include "msm8996.dtsi"

> +#include "pm8994.dtsi"

> +#include "pmi8994.dtsi"

> +#include <dt-bindings/input/input.h>

> +#include <dt-bindings/input/gpio-keys.h>


This seems to be unused for now.

> +#include <dt-bindings/gpio/gpio.h>

> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

> +#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>

> +

> +/delete-node/ &hdmi;

> +/delete-node/ &hdmi_phy;

> +/delete-node/ &mdp5_intf3_out;

> +/delete-node/ &slpi_region;

> +/delete-node/ &venus_region;

> +/delete-node/ &zap_shader_region;

> +

> +/ {

> +	qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */

> +	qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */

> +	qcom,board-id = <8 0>;

> +

> +	chosen {

> +		/*

> +		 * Due to an unknown-for-a-few-years regression,

> +		 * SDHCI only works on MSM8996 in PIO (lame) mode.

> +		 */

> +		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";


What's up with maxcpus=2? Is this simply because the last 2 are really
really slow?

> +	};

> +

> +	reserved-memory {

> +		ramoops@a7f00000 {

> +			compatible = "ramoops";

> +			reg = <0 0xa7f00000 0 0x100000>;

> +			record-size = <0x20000>;

> +			console-size = <0x40000>;

> +			ftrace-size = <0x20000>;

> +			pmsg-size = <0x20000>;

> +			ecc-size = <16>;

> +		};

> +

> +		cont_splash_mem: memory@83401000 {

> +			reg = <0 0x83401000 0 0x23ff000>;

> +			no-map;

> +		};

> +

> +		zap_shader_region: gpu@90400000 {

> +			compatible = "shared-dma-pool";

> +			reg = <0x0 0x90400000 0x0 0x2000>;

> +			no-map;

> +		};

> +

> +		slpi_region: memory@90500000 {

> +			reg = <0 0x90500000 0 0xa00000>;

> +			no-map;

> +		};

> +

> +		venus_region: memory@90f00000 {

> +			reg = <0 0x90f00000 0 0x500000>;

> +			no-map;

> +		};

> +	};

> +

> +	panel_tvdd: tvdd-regulator {

> +		compatible = "regulator-fixed";

> +		regulator-name = "panel_tvdd";

> +		gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;

> +		pinctrl-0 = <&tp_vddio_en>;

> +		pinctrl-names = "default";

> +	};

> +

> +	usb3_id: usb3-id {

> +		compatible = "linux,extcon-usb-gpio";

> +		id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;

> +		pinctrl-names = "default";

> +		pinctrl-0 = <&usb_detect>;

> +	};

> +

> +	vph_pwr: vph-pwr-regulator {

> +		compatible = "regulator-fixed";

> +		regulator-min-microvolt = <3700000>;

> +		regulator-max-microvolt = <3700000>;

> +		regulator-name = "vph_pwr";

> +		regulator-always-on;

> +		regulator-boot-on;

> +	};

> +

> +	wlan_en: wlan-en-1-8v {

> +		compatible = "regulator-fixed";

> +		regulator-name = "wlan-en-regulator";

> +		regulator-min-microvolt = <1800000>;

> +		regulator-max-microvolt = <1800000>;

> +		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;

> +		pinctrl-names = "default";

> +		pinctrl-0 = <&wl_reg_on>;

> +

> +		/* WLAN card specific delay */

> +		startup-delay-us = <70000>;

> +		enable-active-high;

> +	};

> +};

> +

> +&blsp1_i2c3 {

> +	status = "okay";

> +	clock-frequency = <355000>;

> +

> +	tof_sensor: vl53l0x@29 {

> +		compatible = "st,vl53l0x";

> +		reg = <0x29>;

> +	};

> +};

> +

> +&blsp1_uart2 {

> +	status = "okay";

> +};

> +

> +&blsp2_i2c5 {

> +	status = "okay";

> +	clock-frequency = <355000>;

> +

> +	/* FUSB301 USB-C controller */

> +};

> +

> +&blsp2_i2c6 {

> +	status = "okay";

> +	clock-frequency = <355000>;

> +

> +	synaptics@2c {

> +		compatible = "syna,rmi4-i2c";

> +		reg = <0x2c>;

> +		interrupt-parent = <&tlmm>;

> +		interrupts = <125 IRQ_TYPE_EDGE_FALLING>;

> +		vdd-supply = <&panel_tvdd>;

> +

> +		syna,reset-delay-ms = <220>;

> +		syna,startup-delay-ms = <220>;

> +		#address-cells = <1>;

> +		#size-cells = <0>;

> +

> +		rmi4-f01@1 {

> +			reg = <0x1>;

> +			syna,nosleep-mode = <1>;

> +		};

> +

> +		rmi4-f11@11 {

> +			reg = <0x11>;

> +			syna,sensor-type = <1>;

> +		};

> +	};

> +};

> +

> +&blsp2_uart2 {

> +	status = "okay";

> +};

> +

> +&camera0_mclk {

> +	drive-strength = <2>;

> +	output-low;

> +};

> +

> +&camera0_pwdn {

> +	drive-strength = <2>;

> +	output-low;

> +};

> +

> +&camera0_rst {

> +	pins = "gpio30";

> +	drive-strength = <2>;

> +	output-low;

> +};

> +

> +&camera2_mclk {

> +	drive-strength = <2>;

> +	output-low;

> +};

> +

> +&camera2_rst {

> +	drive-strength = <2>;

> +	output-low;

> +};

> +

> +&CPU0 {

> +	cpu-supply = <&pmi8994_s11>;


Isn't this the supply to the CPU-subsystem-internal LDO that actually
feeds the CPU? Is there a benefit to describing this here?

> +};

> +

> +&CPU1 {

> +	cpu-supply = <&pmi8994_s11>;

> +};

> +

> +&CPU2 {

> +	cpu-supply = <&pmi8994_s11>;

> +};

> +

> +&CPU3 {

> +	cpu-supply = <&pmi8994_s11>;

> +};

> +

> +&hsusb_phy1 {

> +	status = "okay";

> +

> +	vdda-pll-supply = <&pm8994_l12>;

> +	vdda-phy-dpdm-supply = <&pm8994_l24>;

> +};

> +

> +&mmcc {

> +	vdd-gfx-supply = <&vdd_gfx>;

> +};

> +

> +&pcie0 {

> +	status = "okay";

> +	perst-gpio = <&tlmm 35 GPIO_ACTIVE_LOW>;

> +	wake-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;

> +	vddpe-3v3-supply = <&wlan_en>;

> +	vdda-supply = <&pm8994_l28>;

> +};

> +

> +&pcie_phy {

> +	status = "okay";

> +

> +	vdda-phy-supply = <&pm8994_l28>;

> +	vdda-pll-supply = <&pm8994_l12>;

> +};

> +

> +&pm8994_gpios {

> +	pinctrl-names = "default";

> +	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n

> +		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6

> +		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9

> +		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12

> +		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1

> +		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep

> +		     &pm8994_gpio_19 &pm8994_gpio_22>;


Shouldn't several of these reference be done from the relevant nodes?

For the ones that isn't, and that you're not going to ever change I
think it would look better to have a single:

pm8994_gpios_defaults: default-state {
	nc {
		nc pins...
	};

	vol-up {
		...
	};

	...
};

> +

> +	gpio-line-names =

> +		"NC",

> +		"VOL_DOWN_N",

> +		"VOL_UP_N",

> +		"SNAPSHOT_N",

> +		"FOCUS_N",

> +		"NC",

> +		"NFC_VEN",

> +		"NC",

> +		"NC",

> +		"NC",

> +		"NC",

> +		"NC",

> +		"EAR_EN",

> +		"NC",

> +		"PM_DIVCLK1",

> +		"PMI_CLK",

> +		"NC",

> +		"WL_SLEEP_CLK",

> +		"NC",

> +		"PMIC_SPON",

> +		"UIM_BATT_ALARM",

> +		"PMK_SLEEP_CLK";

> +

> +	pm8994_gpio_1: pm-gpio1-nc {

> +		pins = "gpio1";

> +		function = PMIC_GPIO_FUNC_NORMAL;

> +		drive-push-pull;

> +		bias-high-impedance;

> +	};

> +

> +	pm8994_vol_down_n: vol-down-n {

> +		pins = "gpio2";

> +		function = PMIC_GPIO_FUNC_NORMAL;

> +		drive-push-pull;

> +		input-enable;

> +		bias-pull-up;

> +		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;

> +		power-source = <PM8994_GPIO_S4>;

> +	};

> +

[..]
> +/*

> + * For reasons that are currently unknown

> + * (but probably related to fusb301), USB

> + * takes about 6 minutes to wake up (nothing

> + * interesting in kernel logs), but then it

> + * works as it should.


This is funny (but please make it ~80 chars wide).

Regards,
Bjorn

> + */

> +&usb3 {

> +	status = "okay";

> +	qcom,select-utmi-as-pipe-clk;

> +};

> +

> +&usb3_dwc3 {

> +	extcon = <&usb3_id>;

> +	dr_mode = "peripheral";

> +	phys = <&hsusb_phy1>;

> +	phy-names = "usb2-phy";

> +	snps,hird-threshold = /bits/ 8 <0>;

> +};
Bjorn Andersson May 27, 2021, 3:48 p.m. UTC | #2
On Wed 26 May 04:21 CDT 2021, Konrad Dybcio wrote:

> Hi,
> 
> 
> > BSD license in all the files please.
> 
> msm8996.dtsi is gpl2-only, so I wasn't sure I can include it..
> 

Very good question, I think it's fine, would prefer it that way and will
be merge it, but ianal.

> 
> >> +};
> >> \ No newline at end of file
> > [..]
> 
> Yikes... my mistake
> 
> 
> >> +#include "pmi8994.dtsi"
> >> +#include <dt-bindings/input/input.h>
> >> +#include <dt-bindings/input/gpio-keys.h>
> > This seems to be unused for now.
> 
> Right. I will add the keys in a separate patch, this one is plenty big already.
> 
> 
> >> +		/*
> >> +		 * Due to an unknown-for-a-few-years regression,
> >> +		 * SDHCI only works on MSM8996 in PIO (lame) mode.
> >> +		 */
> >> +		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
> > What's up with maxcpus=2? Is this simply because the last 2 are really
> > really slow?
> 
> Yeah, I think the L2 and cci being stuck at bl clocks are to blame
> again.. there was a lot of msm8996 cpufreq work but I am not sure if
> anybody got it to *actually* work in the end, I'll try to look into
> this soon(tm)..
> 

Right, we have some lingering patches on our side for this as well,
unfortunately I have one db82c0 that gets unstable when we bring the
last 2 CPUs up to speed.

I started looking at this and found that some care needs to be taken
when switching between the lower half and higher half of the frequencies
(or perhaps it was voltages?) Unfortunately I didn't conclude anything
in this area, but I would be happy to see this resolved.

> 
> >> +};
> >> +
> >> +&CPU0 {
> >> +	cpu-supply = <&pmi8994_s11>;
> > Isn't this the supply to the CPU-subsystem-internal LDO that actually
> > feeds the CPU? Is there a benefit to describing this here?
> 
> I believe it was related to the cpufreq-dt madness, I will remove this.
> 
> 
> >> +
> >> +&pm8994_gpios {
> >> +	pinctrl-names = "default";
> >> +	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
> >> +		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
> >> +		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
> >> +		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
> >> +		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
> >> +		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
> >> +		     &pm8994_gpio_19 &pm8994_gpio_22>;
> > Shouldn't several of these reference be done from the relevant nodes?
> 
> Certainly, but not all peripherals have drivers upstream, and other ones
> 
> are hardcoded to their state downstream, and knowing what shady stuff
> 
> some vendors do, I'm reluctant to trust the bootloader-default state with
> 
> my expensive toys..
> 

I'm in agreement with you that we should vote for these somewhere, so
I'm fine with us agreeing that they are voted for here for now.

> 
> 
> > For the ones that isn't, and that you're not going to ever change I
> > think it would look better to have a single:
> >
> > pm8994_gpios_defaults: default-state {
> > 	nc {
> > 		nc pins...
> > 	};
> >
> > 	vol-up {
> > 		...
> > 	};
> >
> > 	...
> > };
> 
> That does look like a good idea, but I also think it would become a big
> 
> mess if any of these pins turned out required for some obscure peripheral,
> 
> and then I'd have to dig it out of there, re-create the pin definition outside
> 
> and I think you know where this is going..
> 

But if this happens you need to override the giant pinctrl-0 in such
device dts and hope that you don't miss any of the entries anyways.

> 
> > +/*
> > + * For reasons that are currently unknown
> > + * (but probably related to fusb301), USB
> > + * takes about 6 minutes to wake up (nothing
> > + * interesting in kernel logs), but then it
> > + * works as it should.
> > This is funny (but please make it ~80 chars wide).
> 
> Eh, Torvalds said 100 is fine :P
> 

Right, 100 is the new "limit", but 80 is still a good target. What I'm
opposing is that you wrap at 44.

Thanks,
Bjorn
Konrad Dybcio May 27, 2021, 3:55 p.m. UTC | #3
Hi,


>> Very good question, I think it's fine, would prefer it that way and will
>> be merge it, but ianal.

Wikipedia says that 2- and 3- clause BSD and GPLv2 are compatible, so let's trust random folks from the interwebz and go with BSD.


>> Yeah, I think the L2 and cci being stuck at bl clocks are to blame
>> again.. there was a lot of msm8996 cpufreq work but I am not sure if
>> anybody got it to *actually* work in the end, I'll try to look into
>> this soon(tm)..
>>
> Right, we have some lingering patches on our side for this as well,
> unfortunately I have one db82c0 that gets unstable when we bring the
> last 2 CPUs up to speed.
>
> I started looking at this and found that some care needs to be taken
> when switching between the lower half and higher half of the frequencies
> (or perhaps it was voltages?) Unfortunately I didn't conclude anything
> in this area, but I would be happy to see this resolved.

Yeah.. as if 96 didn't have enough problems already.. :/



>> That does look like a good idea, but I also think it would become a big
>>
>> mess if any of these pins turned out required for some obscure peripheral,
>>
>> and then I'd have to dig it out of there, re-create the pin definition outside
>>
>> and I think you know where this is going..
>>
> But if this happens you need to override the giant pinctrl-0 in such
> device dts and hope that you don't miss any of the entries anyways.

Ok, you convinced me.



>> Eh, Torvalds said 100 is fine :P
>>
> Right, 100 is the new "limit", but 80 is still a good target. What I'm
> opposing is that you wrap at 44.

That's what I get when I skip supper and don't feed my brain.. Ofc I can make it longer per-line, heh. V2 should hit your inbox soon.


Konrad
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index ca4a7819d2c4..d079dc33d833 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -25,6 +25,12 @@  dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-satsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-sumire.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-suzuran.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-mtp.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-dora.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-kagura.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-keyaki.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-dora.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-kagura.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-keyaki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-asus-novago-tp370ql.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-hp-envy-x2.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-lenovo-miix-630.dtb
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
new file mode 100644
index 000000000000..b57ea0824ea5
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
@@ -0,0 +1,11 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-dora.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia X Performance (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
new file mode 100644
index 000000000000..dd3dc8860ce1
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
@@ -0,0 +1,11 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-kagura.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia XZ (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
new file mode 100644
index 000000000000..95e04287126d
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
@@ -0,0 +1,11 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-keyaki.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia XZs (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
new file mode 100644
index 000000000000..4e44d6f32345
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
@@ -0,0 +1,27 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia X Performance";
+	compatible = "sony,dora-row", "qcom,msm8996";
+};
+
+/delete-node/ &tof_sensor;
+/delete-node/ &pm8994_l11;
+/delete-node/ &pm8994_l14;
+
+&usb_detect {
+	pins = "gpio24";
+};
+
+&usb3_id {
+	id-gpio = <&tlmm 24 GPIO_ACTIVE_LOW>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
new file mode 100644
index 000000000000..38caa1ee371e
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
@@ -0,0 +1,15 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia XZ";
+	compatible = "sony,kagura-row", "qcom,msm8996";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
new file mode 100644
index 000000000000..df61b16a2905
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
@@ -0,0 +1,26 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia XZs";
+	compatible = "sony,keyaki-row", "qcom,msm8996";
+};
+
+&pm8994_l19 {
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <2700000>;
+};
+
+&pm8994_l30 {
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-pull-down;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
new file mode 100644
index 000000000000..4644d5f9d1a6
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
@@ -0,0 +1,980 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996.dtsi"
+#include "pm8994.dtsi"
+#include "pmi8994.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
+
+/delete-node/ &hdmi;
+/delete-node/ &hdmi_phy;
+/delete-node/ &mdp5_intf3_out;
+/delete-node/ &slpi_region;
+/delete-node/ &venus_region;
+/delete-node/ &zap_shader_region;
+
+/ {
+	qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
+	qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */
+	qcom,board-id = <8 0>;
+
+	chosen {
+		/*
+		 * Due to an unknown-for-a-few-years regression,
+		 * SDHCI only works on MSM8996 in PIO (lame) mode.
+		 */
+		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
+	};
+
+	reserved-memory {
+		ramoops@a7f00000 {
+			compatible = "ramoops";
+			reg = <0 0xa7f00000 0 0x100000>;
+			record-size = <0x20000>;
+			console-size = <0x40000>;
+			ftrace-size = <0x20000>;
+			pmsg-size = <0x20000>;
+			ecc-size = <16>;
+		};
+
+		cont_splash_mem: memory@83401000 {
+			reg = <0 0x83401000 0 0x23ff000>;
+			no-map;
+		};
+
+		zap_shader_region: gpu@90400000 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x90400000 0x0 0x2000>;
+			no-map;
+		};
+
+		slpi_region: memory@90500000 {
+			reg = <0 0x90500000 0 0xa00000>;
+			no-map;
+		};
+
+		venus_region: memory@90f00000 {
+			reg = <0 0x90f00000 0 0x500000>;
+			no-map;
+		};
+	};
+
+	panel_tvdd: tvdd-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "panel_tvdd";
+		gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&tp_vddio_en>;
+		pinctrl-names = "default";
+	};
+
+	usb3_id: usb3-id {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb_detect>;
+	};
+
+	vph_pwr: vph-pwr-regulator {
+		compatible = "regulator-fixed";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-name = "vph_pwr";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	wlan_en: wlan-en-1-8v {
+		compatible = "regulator-fixed";
+		regulator-name = "wlan-en-regulator";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl_reg_on>;
+
+		/* WLAN card specific delay */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+};
+
+&blsp1_i2c3 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	tof_sensor: vl53l0x@29 {
+		compatible = "st,vl53l0x";
+		reg = <0x29>;
+	};
+};
+
+&blsp1_uart2 {
+	status = "okay";
+};
+
+&blsp2_i2c5 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	/* FUSB301 USB-C controller */
+};
+
+&blsp2_i2c6 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	synaptics@2c {
+		compatible = "syna,rmi4-i2c";
+		reg = <0x2c>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
+		vdd-supply = <&panel_tvdd>;
+
+		syna,reset-delay-ms = <220>;
+		syna,startup-delay-ms = <220>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		rmi4-f01@1 {
+			reg = <0x1>;
+			syna,nosleep-mode = <1>;
+		};
+
+		rmi4-f11@11 {
+			reg = <0x11>;
+			syna,sensor-type = <1>;
+		};
+	};
+};
+
+&blsp2_uart2 {
+	status = "okay";
+};
+
+&camera0_mclk {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera0_pwdn {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera0_rst {
+	pins = "gpio30";
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera2_mclk {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera2_rst {
+	drive-strength = <2>;
+	output-low;
+};
+
+&CPU0 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU1 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU2 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU3 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&hsusb_phy1 {
+	status = "okay";
+
+	vdda-pll-supply = <&pm8994_l12>;
+	vdda-phy-dpdm-supply = <&pm8994_l24>;
+};
+
+&mmcc {
+	vdd-gfx-supply = <&vdd_gfx>;
+};
+
+&pcie0 {
+	status = "okay";
+	perst-gpio = <&tlmm 35 GPIO_ACTIVE_LOW>;
+	wake-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+	vddpe-3v3-supply = <&wlan_en>;
+	vdda-supply = <&pm8994_l28>;
+};
+
+&pcie_phy {
+	status = "okay";
+
+	vdda-phy-supply = <&pm8994_l28>;
+	vdda-pll-supply = <&pm8994_l12>;
+};
+
+&pm8994_gpios {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
+		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
+		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
+		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
+		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
+		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
+		     &pm8994_gpio_19 &pm8994_gpio_22>;
+
+	gpio-line-names =
+		"NC",
+		"VOL_DOWN_N",
+		"VOL_UP_N",
+		"SNAPSHOT_N",
+		"FOCUS_N",
+		"NC",
+		"NFC_VEN",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"EAR_EN",
+		"NC",
+		"PM_DIVCLK1",
+		"PMI_CLK",
+		"NC",
+		"WL_SLEEP_CLK",
+		"NC",
+		"PMIC_SPON",
+		"UIM_BATT_ALARM",
+		"PMK_SLEEP_CLK";
+
+	pm8994_gpio_1: pm-gpio1-nc {
+		pins = "gpio1";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+	};
+
+	pm8994_vol_down_n: vol-down-n {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_vol_up_n: vol-up-n {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_cam_snap_n: camera-snapshot-n {
+		pins = "gpio4";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_cam_focus_n: camera-focus-n {
+		pins = "gpio5";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_6: pm-gpio6-nc {
+		pins = "gpio6";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_nfc_dload: nfc-download {
+		pins = "gpio7";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_8: pm-gpio8-nc {
+		pins = "gpio8";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_9: pm-gpio9-nc {
+		pins = "gpio9";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-high;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_nfc_clk: nfc-clock {
+		pins = "gpio10";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		input-enable;
+		drive-push-pull;
+		bias-pull-down;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_11: pm-gpio11-nc {
+		pins = "gpio11";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_12: pm-gpio12-nc {
+		pins = "gpio12";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_ear_en: ear-enable {
+		pins = "gpio13";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-high;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_14: pm-gpio14-nc {
+		pins = "gpio14";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_pm_divclk1: pm-divclk1-gpio {
+		pins = "gpio15";
+		function = "func1";
+		output-high;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_pmi_clk: pmi-clk-gpio {
+		pins = "gpio16";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+	};
+
+	pm8994_gpio_17: pm-gpio17-nc {
+		pins = "gpio17";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_rome_sleep: rome-sleep {
+		pins = "gpio18";
+		function = PMIC_GPIO_FUNC_FUNC2;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_19: pm-gpio19-nc {
+		pins = "gpio19";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_22: pm-gpio22-nc {
+		pins = "gpio22";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+};
+
+&pm8994_mpps {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pm8994_mpp_lcd_id_adc &pm8994_mpp4
+			&pm8994_mpp_flash_th &pm8994_mpp6_def
+			&pm8994_mpp_rf_id>;
+
+	gpio-line-names =
+		"SDC_UIM_VBIAS",
+		"LCD_ID_ADC",
+		"VREF_DACX",
+		"NC",
+		"FLASH_THERM",
+		"NC",
+		"NC",
+		"RF_ID";
+
+	pm8994_mpp_lcd_id_adc: lcd-id_adc-mpp {
+		pins = "mpp2";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
+	};
+
+	pm8994_mpp4: pm-mpp4-nc {
+		pins = "mpp4";
+		function = PMIC_MPP_FUNC_DIGITAL;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_mpp_flash_th: flash-therm-mpp {
+		pins = "mpp5";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
+	};
+
+	pm8994_mpp6_def: mpp6-nc {
+		pins = "mpp6";
+		function = PMIC_MPP_FUNC_DIGITAL;
+		bias-high-impedance;
+	};
+
+	pm8994_mpp_rf_id: rf-id-mpp {
+		pins = "mpp8";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH8>;
+	};
+};
+
+&pm8994_resin {
+	status = "okay";
+	linux,code = <KEY_VOLUMEUP>;
+};
+
+&pmi8994_gpios {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmi8994_vib_ldo_en &pmi8994_gpio_2 &pmi8994_gpio_3
+		     &pmi8994_gpio_4 &pmi8994_gpio_5 &pmi8994_gpio_6
+		     &pmi8994_gpio_7 &pmi8994_gpio_8 &pmi8994_usb_switch_sel
+		     &pmi8994_gpio_10>;
+
+	gpio-line-names =
+		"VIB_LDO_EN",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"USB_SWITCH_SEL",
+		"NC";
+
+	pmi8994_vib_ldo_en: vib-ldo-en-gpio {
+		pins = "gpio1";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-low;
+		bias-disable;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_2: pmi-gpio2-nc {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pmi8994_gpio_3: pmi-gpio3-nc {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pmi8994_gpio_4: pmi-gpio4-nc {
+		pins = "gpio4";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_5: pmi-gpio5-nc {
+		pins = "gpio5";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_6: pmi-gpio6-nc {
+		pins = "gpio6";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_7: pmi-gpio7-nc {
+		pins = "gpio7";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_8: pmi-gpio8-nc {
+		pins = "gpio8";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_usb_switch_sel: usb-switch-sel {
+		pins = "gpio9";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+	};
+
+	pmi8994_gpio_10: pmi-gpio10-nc {
+		pins = "gpio10";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+};
+
+&pmi8994_spmi_regulators {
+	qcom,saw-reg = <&saw3>;
+
+	vdd_gfx:
+	pmi8994_s2: s2 {
+		/* Pinned to a high value for now to avoid random crashes. */
+		regulator-min-microvolt = <1015000>;
+		regulator-max-microvolt = <1015000>;
+		regulator-name = "vdd_gfx";
+		regulator-always-on;
+	};
+
+	pmi8994_s9: s9 {
+		qcom,saw-slave;
+	};
+
+	pmi8994_s10: s10 {
+		qcom,saw-slave;
+	};
+
+	pmi8994_s11: s11 {
+		qcom,saw-leader;
+		regulator-always-on;
+		regulator-min-microvolt = <470000>;
+		regulator-max-microvolt = <1140000>;
+	};
+};
+
+&pmi8994_wled {
+	status = "okay";
+	default-brightness = <512>;
+};
+
+&rpm_requests {
+	pm8994-regulators {
+		compatible = "qcom,rpm-pm8994-regulators";
+
+		vdd_s1-supply = <&vph_pwr>;
+		vdd_s2-supply = <&vph_pwr>;
+		vdd_s3-supply = <&vph_pwr>;
+		vdd_s4-supply = <&vph_pwr>;
+		vdd_s5-supply = <&vph_pwr>;
+		vdd_s6-supply = <&vph_pwr>;
+		vdd_s7-supply = <&vph_pwr>;
+		vdd_s8-supply = <&vph_pwr>;
+		vdd_s9-supply = <&vph_pwr>;
+		vdd_s10-supply = <&vph_pwr>;
+		vdd_s11-supply = <&vph_pwr>;
+		vdd_s12-supply = <&vph_pwr>;
+		vdd_l1-supply = <&pm8994_s3>;
+		vdd_l2_l26_l28-supply = <&pm8994_s3>;
+		vdd_l3_l11-supply = <&pm8994_s3>;
+		vdd_l4_l27_l31-supply = <&pm8994_s3>;
+		vdd_l5_l7-supply = <&pm8994_s5>;
+		vdd_l6_l12_l32-supply = <&pm8994_s5>;
+		vdd_l8_l16_l30-supply = <&vph_pwr>;
+		vdd_l14_l15-supply = <&pm8994_s5>;
+		vdd_l20_l21-supply = <&pm8994_s5>;
+		vdd_l25-supply = <&pm8994_s3>;
+		vdd_lvs1_2-supply = <&pm8994_s4>;
+
+		pm8994_s3: s3 {
+			regulator-min-microvolt = <1300000>;
+			regulator-max-microvolt = <1300000>;
+		};
+
+		pm8994_s4: s4 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-system-load = <325000>;
+			regulator-always-on;
+		};
+
+		pm8994_s5: s5 {
+			regulator-min-microvolt = <2150000>;
+			regulator-max-microvolt = <2150000>;
+		};
+
+		pm8994_s7: s7 {
+			regulator-min-microvolt = <800000>;
+			regulator-max-microvolt = <800000>;
+		};
+
+		pm8994_l1: l1 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1000000>;
+		};
+
+		pm8994_l2: l2 {
+			regulator-min-microvolt = <1250000>;
+			regulator-max-microvolt = <1250000>;
+		};
+
+		pm8994_l3: l3 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1100000>;
+		};
+
+		pm8994_l4: l4 {
+			regulator-min-microvolt = <1225000>;
+			regulator-max-microvolt = <1225000>;
+		};
+
+		/* L6 and L7 seem unused. */
+
+		pm8994_l8: l8 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l9: l9 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l10: l10 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l11: l11 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1100000>;
+		};
+
+		pm8994_l12: l12 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l13: l13 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <22000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l14: l14 {
+			regulator-min-microvolt = <1700000>;
+			regulator-max-microvolt = <1900000>;
+		};
+
+		pm8994_l15: l15 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l16: l16 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l17: l17 {
+			regulator-min-microvolt = <2200000>;
+			regulator-max-microvolt = <2500000>;
+		};
+
+		pm8994_l18: l18 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l19: l19 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+		};
+
+		pm8994_l20: l20 {
+			regulator-min-microvolt = <2950000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <570000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l21: l21 {
+			regulator-min-microvolt = <2950000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <800000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l22: l22 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+		};
+
+		pm8994_l23: l23 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l24: l24 {
+			regulator-min-microvolt = <3075000>;
+			regulator-max-microvolt = <3075000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l25: l25 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l27: l27 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1200000>;
+		};
+
+		pm8994_l28: l28 {
+			regulator-min-microvolt = <925000>;
+			regulator-max-microvolt = <925000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l29: l29 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l30: l30 { };
+
+		pm8994_l32: l32 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+	};
+};
+
+&sdhc1 {
+	/* eMMC doesn't seem to cooperate even in PIO mode.. */
+	status = "disabled";
+
+	vmmc-supply = <&pm8994_l20>;
+	vqmmc-supply = <&pm8994_s4>;
+	mmc-hs400-1_8v;
+	mmc-hs200-1_8v;
+};
+
+&sdhc2 {
+	status = "okay";
+
+	cd-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
+	vmmc-supply = <&pm8994_l21>;
+	vqmmc-supply = <&pm8994_l13>;
+};
+
+&tlmm {
+	gpio-reserved-ranges = <0 4>;
+	pinctrl-0 = <&sw_service_gpio>;
+	pinctrl-names = "default";
+
+	disp_reset_n_gpio: disp-reset-n {
+		pins = "gpio8";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	mdp_vsync_p_gpio: mdp-vsync-p {
+		pins = "gpio10";
+		function = "mdp_vsync";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	sw_service_gpio: sw-service-gpio {
+		pins = "gpio16";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	usb_detect: usb-detect {
+		pins = "gpio25";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	uim_detect_en: uim-detect-en {
+		pins = "gpio29";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	tray_det_pin: tray-det {
+		pins = "gpio40";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	tp_vddio_en: tp-vddio-en {
+		pins = "gpio50";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	lcd_vddio_en: lcd-vddio-en {
+		pins = "gpio51";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-low;
+	};
+
+	wl_host_wake: wl-host-wake {
+		pins = "gpio79";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-down;
+		input-high;
+	};
+
+	wl_reg_on: wl-reg-on {
+		pins = "gpio84";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-low;
+	};
+
+	ts_reset_n: ts-rst-n {
+		pins = "gpio89";
+		function = "gpio";
+		drive-strength = <2>;
+	};
+
+	touch_int_n: touch-int-n {
+		pins = "gpio125";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	touch_int_sleep: touch-int-sleep {
+		pins = "gpio125";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-down;
+	};
+};
+
+/*
+ * For reasons that are currently unknown
+ * (but probably related to fusb301), USB
+ * takes about 6 minutes to wake up (nothing
+ * interesting in kernel logs), but then it
+ * works as it should.
+ */
+&usb3 {
+	status = "okay";
+	qcom,select-utmi-as-pipe-clk;
+};
+
+&usb3_dwc3 {
+	extcon = <&usb3_id>;
+	dr_mode = "peripheral";
+	phys = <&hsusb_phy1>;
+	phy-names = "usb2-phy";
+	snps,hird-threshold = /bits/ 8 <0>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 57f32e0aa4a3..78477a550eba 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -847,21 +847,21 @@  cci0_default: cci0-default {
 
 			camera0_state_on:
 			camera_rear_default: camera-rear-default {
-				mclk0 {
+				camera0_mclk: mclk0 {
 					pins = "gpio13";
 					function = "cam_mclk";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				rst {
+				camera0_rst: rst {
 					pins = "gpio25";
 					function = "gpio";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				pwdn {
+				camera0_pwdn: pwdn {
 					pins = "gpio26";
 					function = "gpio";
 					drive-strength = <16>;
@@ -902,14 +902,14 @@  rst {
 
 			camera2_state_on:
 			camera_front_default: camera-front-default {
-				mclk2 {
+				camera2_mclk: mclk2 {
 					pins = "gpio15";
 					function = "cam_mclk";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				rst {
+				camera2_rst: rst {
 					pins = "gpio23";
 					function = "gpio";
 					drive-strength = <16>;
@@ -2322,7 +2322,7 @@  usb3: usb@6af8800 {
 			power-domains = <&gcc USB30_GDSC>;
 			status = "disabled";
 
-			dwc3@6a00000 {
+			usb3_dwc3: dwc3@6a00000 {
 				compatible = "snps,dwc3";
 				reg = <0x06a00000 0xcc00>;
 				interrupts = <0 131 IRQ_TYPE_LEVEL_HIGH>;