From: Brian Masney <masneyb@onstation.org>
To: AngeloGioacchino Del Regno <kholk11@gmail.com>
Cc: MSM <linux-arm-msm@vger.kernel.org>,
devicetree@vger.kernel.org, ccross@android.com,
Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
marijns95@gmail.com, Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v2 3/5] arm64: dts: qcom: Add configuration for PM8950 and PMI8950 peripherals
Date: Tue, 5 Nov 2019 07:47:52 -0500 [thread overview]
Message-ID: <20191105124752.GA10725@onstation.org> (raw)
In-Reply-To: <CAK7fi1ZZq6=J_5E5QUSqecVXRdMztNDE57zGECf1dE8ZvrWaqQ@mail.gmail.com>
On Tue, Nov 05, 2019 at 12:18:45PM +0100, AngeloGioacchino Del Regno wrote:
> Il giorno gio 31 ott 2019 alle ore 20:58 Brian Masney
> <masneyb@onstation.org> ha scritto:
> >
> > Thanks for the patches. Good to see the progress!
> >
> > On Thu, Oct 31, 2019 at 12:16:43PM +0100, kholk11@gmail.com wrote:
> > > From: AngeloGioacchino Del Regno <kholk11@gmail.com>
> > >
> > > The PM(I)8950 feature integrated peripherals like ADC, GPIO
> > > controller, MPPs, PON keys and others.
> > > Add them to DT files that will be imported on boards having
> > > this PMIC combo (or one of them, anyways).
> > >
> > > Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
> > > ---
> > > arch/arm64/boot/dts/qcom/pm8950.dtsi | 187 ++++++++++++++++++++++++++
> > > arch/arm64/boot/dts/qcom/pmi8950.dtsi | 98 ++++++++++++++
> > > 2 files changed, 285 insertions(+)
> > > create mode 100644 arch/arm64/boot/dts/qcom/pm8950.dtsi
> > > create mode 100644 arch/arm64/boot/dts/qcom/pmi8950.dtsi
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/pm8950.dtsi b/arch/arm64/boot/dts/qcom/pm8950.dtsi
> > > new file mode 100644
> > > index 000000000000..a349a8dd867e
> > > --- /dev/null
> > > +++ b/arch/arm64/boot/dts/qcom/pm8950.dtsi
> > > @@ -0,0 +1,187 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +// Copyright (c) 2019, AngeloGioacchino Del Regno <kholk11@gmail.com>
> > > +
> > > +#include <dt-bindings/iio/qcom,spmi-vadc.h>
> > > +#include <dt-bindings/input/linux-event-codes.h>
> > > +#include <dt-bindings/interrupt-controller/irq.h>
> > > +#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
> > > +#include <dt-bindings/spmi/spmi.h>
> > > +
> > > +&spmi_bus {
> > > + pm8950_lsid0: pm8950@0 {
> > > + compatible = "qcom,pm8950", "qcom,spmi-pmic";
> > > + reg = <0x0 SPMI_USID>;
> > > + #address-cells = <1>;
> > > + #size-cells = <0>;
> > > +
> > > + pon@800 {
> > > + compatible = "qcom,pm8916-pon";
> > > + reg = <0x0800>;
> > > + mode-bootloader = <0x2>;
> > > + mode-recovery = <0x1>;
> > > +
> > > + pwrkey {
> > > + compatible = "qcom,pm8941-pwrkey";
> > > + interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> > > + debounce = <15625>;
> > > + bias-pull-up;
> > > + linux,code = <KEY_POWER>;
> > > + };
> > > + };
> > > +
> > > + pm8950_mpps: mpps@a000 {
> > > + compatible = "qcom,pm8950-mpp", "qcom,spmi-mpp";
> > > + reg = <0xa000>;
> > > + gpio-controller;
> > > + #gpio-cells = <2>;
> > > + interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
> > > + <0 0xa1 0 IRQ_TYPE_NONE>,
> > > + <0 0xa2 0 IRQ_TYPE_NONE>,
> > > + <0 0xa3 0 IRQ_TYPE_NONE>;
> > > +
> > > + /* MPP_2: PA_THERM1 */
> > > + pa_therm {
> > > + pm8950_mpp2_def: pa_therm1_default {
> > > + pins = "mpp2";
> > > + function = "analog";
> > > + input-enable;
> > > + qcom,amux-route =
> > > + <PMIC_MPP_AMUX_ROUTE_CH6>;
> > > + };
> > > + };
> > > +
> > > + /* MPP_4: QUIET_THERM */
> > > + case_therm {
> > > + pm8950_mpp4_def: case_therm_default {
> > > + pins = "mpp4";
> > > + function = "analog";
> > > + input-enable;
> > > + qcom,amux-route =
> > > + <PMIC_MPP_AMUX_ROUTE_CH8>;
> > > + };
> > > + };
> > > + };
> > > +
> > > + pm8950_gpios: gpio@c000 {
> > > + compatible = "qcom,pm8950-gpio", "qcom,spmi-gpio";
> > > + reg = <0xc000>;
> > > + gpio-controller;
> > > + #gpio-cells = <2>;
> > > + interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
> > > + <0 0xc1 0 IRQ_TYPE_NONE>,
> > > + <0 0xc3 0 IRQ_TYPE_NONE>,
> > > + <0 0xc4 0 IRQ_TYPE_NONE>,
> > > + <0 0xc5 0 IRQ_TYPE_NONE>,
> > > + <0 0xc6 0 IRQ_TYPE_NONE>,
> > > + <0 0xc7 0 IRQ_TYPE_NONE>;
> > > + };
> >
> > Please add gpio-ranges so that gpio-hogging will work properly. See
> > commits for pm8941 and spmi-gpio that describes the problem and how
> > to fix it:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=149a96047237574b756d872007c006acd0cc6687
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cdd3d64d843a2a4c658a182b744bfefbd021d542
> >
> > Please drop the interrupts property and configure this to be a
> > hierarchical IRQ chip. See these two commits for more details:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca69e2d165eb3d060cc9ad70a745e27a2cf4310b
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f540fb4821a5444350ab3311fff60013d755d8f
> >
> > There is some kind of mask that you'll need to add to omit 0xc2 that
> > Linus Walleij told me about before. I don't have the property handy
> > right now, but can look it up later if needed.
> >
> > Brian
>
> That looks cleaner! Didn't know about it... Anyway, the only way that I know
> to exclude the 0xc2 is something like
>
> gpio-ranges = <&pm8950_gpios 0 0 8>;
> gpio-reserved-ranges = <2 1>;
>
> ...but you're talking about a mask? Is there a different way of doing it, or
> were you referring to the gpio-reserved-ranges property?
Yes, it looks like gpio-reserved-ranges property is what you need.
Brian
next prev parent reply other threads:[~2019-11-05 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-31 11:16 [PATCH v2 0/5] MSM8976/56 Sony Xperia Loire (X/XCompact) smartphones kholk11
2019-10-31 11:16 ` [PATCH v2 1/5] dt-bindings: iio: spmi-vadc: Add definitions for USB DP/DM VADCs kholk11
2019-11-05 18:42 ` Rob Herring
2019-11-06 17:54 ` AngeloGioacchino Del Regno
2019-10-31 11:16 ` [PATCH v2 2/5] arm64: dts: pm8004: Add SPMI regulator and add phandles to lsids kholk11
2019-10-31 11:16 ` [PATCH v2 3/5] arm64: dts: qcom: Add configuration for PM8950 and PMI8950 peripherals kholk11
2019-10-31 19:58 ` Brian Masney
2019-11-05 11:18 ` AngeloGioacchino Del Regno
2019-11-05 12:47 ` Brian Masney [this message]
2019-10-31 11:16 ` [PATCH v2 4/5] arm64: dts: qcom: Add MSM8976 SoC support dts files kholk11
2019-12-10 18:12 ` Amit Kucheria
2019-10-31 11:16 ` [PATCH v2 5/5] arm64: dts: qcom: Add Sony Xperia (Loire) X and X Compact support kholk11
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191105124752.GA10725@onstation.org \
--to=masneyb@onstation.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=ccross@android.com \
--cc=devicetree@vger.kernel.org \
--cc=kholk11@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=marijns95@gmail.com \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).