Message ID | 20190730192805.15334-1-xnox@ubuntu.com |
---|---|
State | New |
Headers | show |
Series | [EOAN,UNSTABLE] UBUNTU: SAUCE: arm64: dts: qcom: Add support for AArch64 laptops | expand |
On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > From: AArch64 Laptops <aarch64laptops@gmail.com> > > This is squashed merged of multiple patches from > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > Note that some of these, with different names are getting upstreamed > targetted for v5.4. Once those are all merged and available, this > patch will become obsolete and will be dropped. Are they in linux-next or a maintainer tree already? If so I think it would be preferable to cherry pick the individual patches. Otherwise, adding some device trees seems pretty harmless. But one comment ... <snip> > diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c > index b2c2d01d1637..aa0272497be4 100644 > --- a/drivers/regulator/qcom-rpmh-regulator.c > +++ b/drivers/regulator/qcom-rpmh-regulator.c > @@ -207,7 +207,7 @@ static int rpmh_regulator_is_enabled(struct regulator_dev *rdev) > { > struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); > > - return vreg->enabled; > + return vreg->enabled > 0; > } This is clearly a bug in the driver. I think it should be a separate patch from the dts files, and it should be able to go into 5.3. Thanks, Seth
On Thu 08 Aug 08:10 PDT 2019, Seth Forshee wrote: > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > This is squashed merged of multiple patches from > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > Note that some of these, with different names are getting upstreamed > > targetted for v5.4. Once those are all merged and available, this > > patch will become obsolete and will be dropped. > > Are they in linux-next or a maintainer tree already? If so I think it > would be preferable to cherry pick the individual patches. > > Otherwise, adding some device trees seems pretty harmless. But one > comment ... > > <snip> > > > diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c > > index b2c2d01d1637..aa0272497be4 100644 > > --- a/drivers/regulator/qcom-rpmh-regulator.c > > +++ b/drivers/regulator/qcom-rpmh-regulator.c > > @@ -207,7 +207,7 @@ static int rpmh_regulator_is_enabled(struct regulator_dev *rdev) > > { > > struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); > > > > - return vreg->enabled; > > + return vreg->enabled > 0; > > } > > This is clearly a bug in the driver. I think it should be a separate > patch from the dts files, and it should be able to go into 5.3. > The rpmh regulator driver does not have a way to query the state of the hardware during initialization, so it has to cache the current state; with is initialized to -EINVAL. So the upstream driver returns an error here, which according to the regulator driver api seems to be the right thing to do. Then, iirc, the regulator core interprets this as the regulator being on (!0) and requests it to be turned off - which causes the display to be powered down. So this interaction needs to be investigated further to come up with a proper solution. PS. Note that the display drivers might very well be loaded way after regulator_init_complete(), where the regulator framework will turn off any unused regulators. Any lying in the driver (always returning false, like I do here) will cause unused regulators to stay on forever. Regards, Bjorn
On Thu, Aug 08, 2019 at 09:52:29AM -0700, Bjorn Andersson wrote: > On Thu 08 Aug 08:10 PDT 2019, Seth Forshee wrote: > > > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > > > This is squashed merged of multiple patches from > > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > > > Note that some of these, with different names are getting upstreamed > > > targetted for v5.4. Once those are all merged and available, this > > > patch will become obsolete and will be dropped. > > > > Are they in linux-next or a maintainer tree already? If so I think it > > would be preferable to cherry pick the individual patches. > > > > Otherwise, adding some device trees seems pretty harmless. But one > > comment ... > > > > <snip> > > > > > diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c > > > index b2c2d01d1637..aa0272497be4 100644 > > > --- a/drivers/regulator/qcom-rpmh-regulator.c > > > +++ b/drivers/regulator/qcom-rpmh-regulator.c > > > @@ -207,7 +207,7 @@ static int rpmh_regulator_is_enabled(struct regulator_dev *rdev) > > > { > > > struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); > > > > > > - return vreg->enabled; > > > + return vreg->enabled > 0; > > > } > > > > This is clearly a bug in the driver. I think it should be a separate > > patch from the dts files, and it should be able to go into 5.3. > > > > The rpmh regulator driver does not have a way to query the state of the > hardware during initialization, so it has to cache the current state; > with is initialized to -EINVAL. > > So the upstream driver returns an error here, which according to the > regulator driver api seems to be the right thing to do. Then, iirc, the > regulator core interprets this as the regulator being on (!0) and > requests it to be turned off - which causes the display to be powered > down. > > So this interaction needs to be investigated further to come up with a > proper solution. > > > PS. Note that the display drivers might very well be loaded way after > regulator_init_complete(), where the regulator framework will turn off > any unused regulators. Any lying in the driver (always returning false, > like I do here) will cause unused regulators to stay on forever. Hmm, okay. I hadn't actually looked at the documentation, which does say >0 means the regulator is enabled. But pretty much all the code treats the return as a boolean. That does complicate things. Thanks, Seth
On Thu, 8 Aug 2019 at 16:10, Seth Forshee <seth.forshee@canonical.com> wrote: > > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > This is squashed merged of multiple patches from > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > Note that some of these, with different names are getting upstreamed > > targetted for v5.4. Once those are all merged and available, this > > patch will become obsolete and will be dropped. > > Are they in linux-next or a maintainer tree already? If so I think it > would be preferable to cherry pick the individual patches. > The ones in qcom for-next ... https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/log/?h=for-next 2019-07-22 arm64: dts: qcom: Add Asus NovaGo TP370QL Jeffrey Hugo2-0/+48 2019-07-22 arm64: dts: qcom: Add HP Envy x2 Jeffrey Hugo2-0/+31 2019-07-22 arm64: dts: qcom: Add Lenovo Miix 630 Jeffrey Hugo3-0/+271 Note the lack of Yoga C630, and slightly different naming scheme. If you cherrypick above three, then this patch series should be nacked & yoga c630 dtb rebased/resubmitted. I guess cherrypicking from qcom for-next makes more sense, as those will/should land in 5.4 and auto-drop-off once we rebase onto v5.4+
On Fri, Aug 09, 2019 at 12:00:32PM +0100, Dimitri John Ledkov wrote: > On Thu, 8 Aug 2019 at 16:10, Seth Forshee <seth.forshee@canonical.com> wrote: > > > > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > > > This is squashed merged of multiple patches from > > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > > > Note that some of these, with different names are getting upstreamed > > > targetted for v5.4. Once those are all merged and available, this > > > patch will become obsolete and will be dropped. > > > > Are they in linux-next or a maintainer tree already? If so I think it > > would be preferable to cherry pick the individual patches. > > > > The ones in qcom for-next ... > https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/log/?h=for-next > > 2019-07-22 arm64: dts: qcom: Add Asus NovaGo TP370QL Jeffrey Hugo2-0/+48 > 2019-07-22 arm64: dts: qcom: Add HP Envy x2 Jeffrey Hugo2-0/+31 > 2019-07-22 arm64: dts: qcom: Add Lenovo Miix 630 Jeffrey Hugo3-0/+271 > > Note the lack of Yoga C630, and slightly different naming scheme. If > you cherrypick above three, then this patch series should be nacked & > yoga c630 dtb rebased/resubmitted. > > I guess cherrypicking from qcom for-next makes more sense, as those > will/should land in 5.4 and auto-drop-off once we rebase onto v5.4+ I was just about to cherry pick these, but I noticed there's no buglink. I'd like to have a bug for keeping track of these; could you please create one? Thanks Seth
On Thu, 22 Aug 2019 at 21:14, Seth Forshee <seth.forshee@canonical.com> wrote: > > On Fri, Aug 09, 2019 at 12:00:32PM +0100, Dimitri John Ledkov wrote: > > On Thu, 8 Aug 2019 at 16:10, Seth Forshee <seth.forshee@canonical.com> wrote: > > > > > > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > > > > > This is squashed merged of multiple patches from > > > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > > > > > Note that some of these, with different names are getting upstreamed > > > > targetted for v5.4. Once those are all merged and available, this > > > > patch will become obsolete and will be dropped. > > > > > > Are they in linux-next or a maintainer tree already? If so I think it > > > would be preferable to cherry pick the individual patches. > > > > > > > The ones in qcom for-next ... > > https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/log/?h=for-next > > > > 2019-07-22 arm64: dts: qcom: Add Asus NovaGo TP370QL Jeffrey Hugo2-0/+48 > > 2019-07-22 arm64: dts: qcom: Add HP Envy x2 Jeffrey Hugo2-0/+31 > > 2019-07-22 arm64: dts: qcom: Add Lenovo Miix 630 Jeffrey Hugo3-0/+271 > > > > Note the lack of Yoga C630, and slightly different naming scheme. If > > you cherrypick above three, then this patch series should be nacked & > > yoga c630 dtb rebased/resubmitted. > > > > I guess cherrypicking from qcom for-next makes more sense, as those > > will/should land in 5.4 and auto-drop-off once we rebase onto v5.4+ > > I was just about to cherry pick these, but I noticed there's no buglink. > I'd like to have a bug for keeping track of these; could you please > create one? > BugLink: https://bugs.launchpad.net/bugs/1842050
On Fri, Aug 30, 2019 at 11:28:08AM +0100, Dimitri John Ledkov wrote: > On Thu, 22 Aug 2019 at 21:14, Seth Forshee <seth.forshee@canonical.com> wrote: > > > > On Fri, Aug 09, 2019 at 12:00:32PM +0100, Dimitri John Ledkov wrote: > > > On Thu, 8 Aug 2019 at 16:10, Seth Forshee <seth.forshee@canonical.com> wrote: > > > > > > > > On Tue, Jul 30, 2019 at 03:28:05PM -0400, Dimitri John Ledkov wrote: > > > > > From: AArch64 Laptops <aarch64laptops@gmail.com> > > > > > > > > > > This is squashed merged of multiple patches from > > > > > https://github.com/aarch64-laptops/linux/tree/laptops-ubuntu > > > > > > > > > > Note that some of these, with different names are getting upstreamed > > > > > targetted for v5.4. Once those are all merged and available, this > > > > > patch will become obsolete and will be dropped. > > > > > > > > Are they in linux-next or a maintainer tree already? If so I think it > > > > would be preferable to cherry pick the individual patches. > > > > > > > > > > The ones in qcom for-next ... > > > https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/log/?h=for-next > > > > > > 2019-07-22 arm64: dts: qcom: Add Asus NovaGo TP370QL Jeffrey Hugo2-0/+48 > > > 2019-07-22 arm64: dts: qcom: Add HP Envy x2 Jeffrey Hugo2-0/+31 > > > 2019-07-22 arm64: dts: qcom: Add Lenovo Miix 630 Jeffrey Hugo3-0/+271 > > > > > > Note the lack of Yoga C630, and slightly different naming scheme. If > > > you cherrypick above three, then this patch series should be nacked & > > > yoga c630 dtb rebased/resubmitted. > > > > > > I guess cherrypicking from qcom for-next makes more sense, as those > > > will/should land in 5.4 and auto-drop-off once we rebase onto v5.4+ > > > > I was just about to cherry pick these, but I noticed there's no buglink. > > I'd like to have a bug for keeping track of these; could you please > > create one? > > > > BugLink: https://bugs.launchpad.net/bugs/1842050 Applied these three commits to eoan/master-next and unstable/master, thanks!
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 0a7e5dfce6f7..03452c893c94 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -2,6 +2,10 @@ dtb-$(CONFIG_ARCH_QCOM) += apq8016-sbc.dtb dtb-$(CONFIG_ARCH_QCOM) += apq8096-db820c.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq8074-hk01.dtb +dtb-$(CONFIG_ARCH_QCOM) += laptop-asus-tp370ql.dtb +dtb-$(CONFIG_ARCH_QCOM) += laptop-hp-envy-x2.dtb +dtb-$(CONFIG_ARCH_QCOM) += laptop-lenovo-mixx-630.dtb +dtb-$(CONFIG_ARCH_QCOM) += laptop-lenovo-yoga-c630.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8992-bullhead-rev-101.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8994-angler-rev-101.dtb @@ -14,3 +18,4 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-1000.dtb dtb-$(CONFIG_ARCH_QCOM) += qcs404-evb-4000.dtb +dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb diff --git a/arch/arm64/boot/dts/qcom/laptop-asus-tp370ql.dts b/arch/arm64/boot/dts/qcom/laptop-asus-tp370ql.dts new file mode 100644 index 000000000000..72b59783c964 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/laptop-asus-tp370ql.dts @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */ + +/dts-v1/; + +#include "laptop-common.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. MSM8998 v1 Asus TP370QL"; + compatible = "qcom,msm8998-asus-tp370ql"; + + qcom,board-id = <8 0>; +}; + +&tlmm { + touchpad: touchpad { + config { + pins = "gpio123"; + bias-pull-up; /* pull up */ + }; + }; +}; + +&sdhc2 { + cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>; +}; + +&blsp1_i2c6 { + status = "okay"; + + keyboard@3a { + compatible = "hid-over-i2c"; + interrupt-parent = <&tlmm>; + interrupts = <0x25 IRQ_TYPE_LEVEL_LOW>; + reg = <0x3a>; + hid-descr-addr = <0x0001>; + }; + + touchpad@15 { + compatible = "hid-over-i2c"; + interrupt-parent = <&tlmm>; + interrupts = <0x7b IRQ_TYPE_LEVEL_LOW>; + reg = <0x15>; + hid-descr-addr = <0x0001>; + + pinctrl-names = "default"; + pinctrl-0 = <&touchpad>; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/laptop-common.dtsi b/arch/arm64/boot/dts/qcom/laptop-common.dtsi new file mode 100644 index 000000000000..184b33ad8694 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/laptop-common.dtsi @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */ + +/dts-v1/; + +#include "msm8998-mtp.dtsi" + +&rpm_requests { + pm8998-regulators { + compatible = "qcom,rpm-pm8998-regulators"; + + status = "okay"; + + vdd_l9-supply = <&vph_pwr>; + vdd_l10_l23_l25-supply = <&vph_pwr>; + vdd_l13_l19_l21-supply = <&vph_pwr>; + vdd_l16_l28-supply = <&vph_pwr>; + vdd_l18_l22-supply = <&vph_pwr>; + vdd_l20_l24-supply = <&vph_pwr>; + }; + + pmi8998-regulators { + compatible = "qcom,rpm-pmi8998-regulators"; + status = "disabled"; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/laptop-hp-envy-x2.dts b/arch/arm64/boot/dts/qcom/laptop-hp-envy-x2.dts new file mode 100644 index 000000000000..4727e12c7dbf --- /dev/null +++ b/arch/arm64/boot/dts/qcom/laptop-hp-envy-x2.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */ + +/dts-v1/; + +#include "laptop-common.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. MSM8998 v1 HP Envy X2"; + compatible = "qcom,msm8998-hp-envy-x2"; + + qcom,board-id = <8 0>; +}; + +&sdhc2 { + cd-gpios = <&tlmm 95 GPIO_ACTIVE_LOW>; +}; + +&blsp1_i2c6 { + status = "okay"; + + keyboard@3a { + compatible = "hid-over-i2c"; + interrupt-parent = <&tlmm>; + interrupts = <0x79 IRQ_TYPE_LEVEL_LOW>; + reg = <0x3a>; + hid-descr-addr = <0x0001>; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/laptop-lenovo-mixx-630.dts b/arch/arm64/boot/dts/qcom/laptop-lenovo-mixx-630.dts new file mode 100644 index 000000000000..8b03cb7176ce --- /dev/null +++ b/arch/arm64/boot/dts/qcom/laptop-lenovo-mixx-630.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */ + +/dts-v1/; + +#include "laptop-common.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. MSM8998 v1 Levovo Mixx 630"; + compatible = "qcom,msm8998-lenovo-mixx-630"; + + qcom,board-id = <8 0>; +}; + +&sdhc2 { + cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>; +}; + +&blsp1_i2c6 { + status = "okay"; + + keyboard@3a { + compatible = "hid-over-i2c"; + interrupt-parent = <&tlmm>; + interrupts = <0x79 IRQ_TYPE_LEVEL_LOW>; + reg = <0x3a>; + hid-descr-addr = <0x0001>; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/laptop-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/laptop-lenovo-yoga-c630.dts new file mode 100644 index 000000000000..e75bff57cc0e --- /dev/null +++ b/arch/arm64/boot/dts/qcom/laptop-lenovo-yoga-c630.dts @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */ + +/dts-v1/; + +#include "sdm850-lenovo-yoga-c630.dts" + +/ { + model = "Lenovo Yoga C630"; + compatible = "lenovo,yoga-c630", "qcom,sdm845"; +}; diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts new file mode 100644 index 000000000000..0d9aab66ecb4 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts @@ -0,0 +1,455 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Lenovo Yoga C630 + * + * Copyright (c) 2019, Linaro Ltd. + */ + +/dts-v1/; + +#include <dt-bindings/regulator/qcom,rpmh-regulator.h> +#include "sdm845.dtsi" +#include "pm8998.dtsi" + +/ { + model = "Lenovo Yoga C630"; + compatible = "lenovo,yoga-c630", "qcom,sdm845"; + + aliases { + hsuart0 = &uart6; + }; +}; + +&apps_rsc { + pm8998-rpmh-regulators { + compatible = "qcom,pm8998-rpmh-regulators"; + qcom,pmic-id = "a"; + + vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>; + vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>; + + vreg_s2a_1p125: smps2 { + }; + + vreg_s3a_1p35: smps3 { + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_s4a_1p8: smps4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_s5a_2p04: smps5 { + regulator-min-microvolt = <2040000>; + regulator-max-microvolt = <2040000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_s7a_1p025: smps7 { + }; + + vdd_qusb_hs0: + vdda_hp_pcie_core: + vdda_mipi_csi0_0p9: + vdda_mipi_csi1_0p9: + vdda_mipi_csi2_0p9: + vdda_mipi_dsi0_pll: + vdda_mipi_dsi1_pll: + vdda_qlink_lv: + vdda_qlink_lv_ck: + vdda_qrefs_0p875: + vdda_pcie_core: + vdda_pll_cc_ebi01: + vdda_pll_cc_ebi23: + vdda_sp_sensor: + vdda_ufs1_core: + vdda_ufs2_core: + vdda_usb1_ss_core: + vdda_usb2_ss_core: + vreg_l1a_0p875: ldo1 { + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vddpx_10: + vreg_l2a_1p2: ldo2 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-always-on; + }; + + vreg_l3a_1p0: ldo3 { + }; + + vdd_wcss_cx: + vdd_wcss_mx: + vdda_wcss_pll: + vreg_l5a_0p8: ldo5 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vddpx_13: + vreg_l6a_1p8: ldo6 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l7a_1p8: ldo7 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l8a_1p2: ldo8 { + }; + + vreg_l9a_1p8: ldo9 { + }; + + vreg_l10a_1p8: ldo10 { + }; + + vreg_l11a_1p0: ldo11 { + }; + + vdd_qfprom: + vdd_qfprom_sp: + vdda_apc1_cs_1p8: + vdda_gfx_cs_1p8: + vdda_qrefs_1p8: + vdda_qusb_hs0_1p8: + vddpx_11: + vreg_l12a_1p8: ldo12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vddpx_2: + vreg_l13a_2p95: ldo13 { + }; + + vreg_l14a_1p88: ldo14 { + regulator-min-microvolt = <1880000>; + regulator-max-microvolt = <1880000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l15a_1p8: ldo15 { + }; + + vreg_l16a_2p7: ldo16 { + }; + + vreg_l17a_1p3: ldo17 { + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l18a_2p7: ldo18 { + }; + + vreg_l19a_3p0: ldo19 { + regulator-min-microvolt = <3100000>; + regulator-max-microvolt = <3108000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l20a_2p95: ldo20 { + regulator-min-microvolt = <2960000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l21a_2p95: ldo21 { + }; + + vreg_l22a_2p85: ldo22 { + }; + + vreg_l23a_3p3: ldo23 { + }; + + vdda_qusb_hs0_3p1: + vreg_l24a_3p075: ldo24 { + regulator-min-microvolt = <3075000>; + regulator-max-microvolt = <3083000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l25a_3p3: ldo25 { + regulator-min-microvolt = <3104000>; + regulator-max-microvolt = <3112000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vdda_hp_pcie_1p2: + vdda_hv_ebi0: + vdda_hv_ebi1: + vdda_hv_ebi2: + vdda_hv_ebi3: + vdda_mipi_csi_1p25: + vdda_mipi_dsi0_1p2: + vdda_mipi_dsi1_1p2: + vdda_pcie_1p2: + vdda_ufs1_1p2: + vdda_ufs2_1p2: + vdda_usb1_ss_1p2: + vdda_usb2_ss_1p2: + vreg_l26a_1p2: ldo26 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1208000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; + + vreg_l28a_3p0: ldo28 { + }; + + vreg_lvs1a_1p8: lvs1 { + }; + + vreg_lvs2a_1p8: lvs2 { + }; + }; +}; + +&apps_smmu { + /* TODO: Figure out how to survive booting with this enabled */ + status = "disabled"; +}; + +&gcc { + protected-clocks = <GCC_QSPI_CORE_CLK>, + <GCC_QSPI_CORE_CLK_SRC>, + <GCC_QSPI_CNOC_PERIPH_AHB_CLK>; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; + + battery@70 { + compatible = "some,battery"; + reg = <0x70>; + }; +}; + +&i2c3 { + status = "okay"; + clock-frequency = <400000>; + + hid@15 { + compatible = "hid-over-i2c"; + reg = <0x15>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; + +// pinctrl-names = "default"; +// pinctrl-0 = <&i2c2_hid_active>; + }; + + hid@2c { + compatible = "hid-over-i2c"; + reg = <0x2c>; + hid-descr-addr = <0x20>; + + interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_hid_active>; + }; +}; + +&i2c5 { + status = "okay"; + clock-frequency = <400000>; + + hid@10 { + compatible = "hid-over-i2c"; + reg = <0x10>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c6_hid_active>; + }; +}; + +&i2c11 { + status = "okay"; + clock-frequency = <400000>; + + hid@5c { + compatible = "hid-over-i2c"; + reg = <0x5c>; + hid-descr-addr = <0x1>; + + interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&i2c12_hid_active>; + }; +}; + +&qupv3_id_0 { + status = "okay"; +}; + +&qupv3_id_1 { + status = "okay"; +}; + +&tlmm { + gpio-reserved-ranges = <0 4>, <81 4>; + + i2c2_hid_active: i2c2-hid-active { + pins = <37>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; + + i2c6_hid_active: i2c6-hid-active { + pins = <125>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; + + i2c12_hid_active: i2c12-hid-active { + pins = <92>; + function = "gpio"; + + input-enable; + bias-pull-up; + drive-strength = <2>; + }; +}; + +&uart6 { + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3990-bt"; + + vddio-supply = <&vreg_s4a_1p8>; + vddxo-supply = <&vreg_l7a_1p8>; + vddrf-supply = <&vreg_l17a_1p3>; + vddch0-supply = <&vreg_l25a_3p3>; + max-speed = <3200000>; + }; +}; + +&ufs_mem_hc { + status = "okay"; + + vcc-supply = <&vreg_l20a_2p95>; + vcc-max-microamp = <600000>; +}; + +&ufs_mem_phy { + status = "okay"; + + vdda-phy-supply = <&vdda_ufs1_core>; + vdda-pll-supply = <&vdda_ufs1_1p2>; +}; + +&usb_1 { + status = "okay"; +}; + +&usb_1_dwc3 { + dr_mode = "host"; +}; + +&usb_1_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb1_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>; + qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>; + qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>; +}; + +&usb_1_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb1_ss_1p2>; + vdda-pll-supply = <&vdda_usb1_ss_core>; +}; + +&usb_2 { + status = "okay"; +}; + +&usb_2_dwc3 { + dr_mode = "host"; +}; + +&usb_2_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb2_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>; +}; + +&usb_2_qmpphy { + status = "okay"; + + vdda-phy-supply = <&vdda_usb2_ss_1p2>; + vdda-pll-supply = <&vdda_usb2_ss_core>; +}; + +/* PINCTRL - additions to nodes defined in sdm845.dtsi */ + +&qup_i2c12_default { + drive-strength = <2>; + bias-disable; +}; + +&qup_uart6_default { + pinmux { + pins = "gpio45", "gpio46", "gpio47", "gpio48"; + function = "qup6"; + }; + + cts { + pins = "gpio45"; + bias-pull-down; + }; + + rts-tx { + pins = "gpio46", "gpio47"; + drive-strength = <2>; + bias-disable; + }; + + rx { + pins = "gpio48"; + bias-pull-up; + }; +}; diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c index b2c2d01d1637..aa0272497be4 100644 --- a/drivers/regulator/qcom-rpmh-regulator.c +++ b/drivers/regulator/qcom-rpmh-regulator.c @@ -207,7 +207,7 @@ static int rpmh_regulator_is_enabled(struct regulator_dev *rdev) { struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); - return vreg->enabled; + return vreg->enabled > 0; } static int rpmh_regulator_set_enable_state(struct regulator_dev *rdev,