All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Fenglin Wu <fenglinw@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-soc@vger.kernel.org, collinsd@quicinc.com,
	aghayal@qti.qualcomm.com, wruan@quicinc.com,
	kgunda@qti.qualcomm.com
Subject: Re: [PATCH V1 2/3] pinctrl: qcom: spmi-gpio: Add dtest route for digital input
Date: Fri, 14 Jul 2017 11:19:51 -0700	[thread overview]
Message-ID: <20170714181951.GQ20973@minitux> (raw)
In-Reply-To: <7a958ced-910f-3304-8128-911412df6dfd@codeaurora.org>

On Wed 12 Jul 22:27 PDT 2017, Fenglin Wu wrote:

> On 7/13/2017 5:24 AM, Bjorn Andersson wrote:
> > On Mon 12 Jun 23:16 PDT 2017, fenglinw@codeaurora.org wrote:
> > 
> > > From: Fenglin Wu <fenglinw@codeaurora.org>
> > > 
> > > Add property "qcom,dtest-buffer" to specify which dtest rail to feed
> > > when the pin is configured as a digital input.
> > > 
> > > Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
> > > ---
> > >   .../devicetree/bindings/pinctrl/qcom,pmic-gpio.txt | 15 ++++++++
> > >   drivers/pinctrl/qcom/pinctrl-spmi-gpio.c           | 45 ++++++++++++++++++++++
> > >   include/dt-bindings/pinctrl/qcom,pmic-gpio.h       |  6 +++
> > >   3 files changed, 66 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> > > index 1493c0a..521c783 100644
> > > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> > > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
> > > @@ -195,6 +195,21 @@ to specify in a pin configuration subnode:
> > >   		    Valid values are 0-3 corresponding to PMIC_GPIO_AOUT_ATESTx
> > >   		    defined in <dt-bindings/pinctrl/qcom,pmic-gpio.h>.
> > > +- qcom,dtest-buffer:
> > > +	Usage: optional
> > > +	Value type: <u32>
> > > +	Definition: Selects DTEST rail to route to GPIO when it's configured
> > > +		    as a digital input.
> > > +		    For LV/MV GPIO subtypes, the valid values are 0-3
> > > +		    corresponding to PMIC_GPIO_DIN_DTESTx defined in
> > > +		    <dt-bindings/pinctrl/qcom,pmic-gpio.h>. Only one
> > > +		    DTEST rail can be selected at a time.
> > 
> > As with the analog lines, this is a natural number and I think we should
> > encode it as such in the DeviceTree.
> > 
> > > +		    For 4CH/8CH GPIO subtypes, supported values are 1-15.
> > > +		    4 DTEST rails are supported in total and more than 1 DTEST
> > > +		    rail can be selected simultaneously. Each bit of the
> > > +		    4 LSBs represent one DTEST rail, such as [3:0] = 0101
> > > +		    means both DTEST1 and DTEST3 are selected.
> > 
> > I'm not too keen on encoding this as a bitmask. I would much rather
> > encode it as multiple values - although that complicates the
> > implementation.
> > 
> > Or can we just ignore it? (Is the lack of support in the newer chips a
> > result of no-one using this?)
> 
> I am not quite sure if any real cases would route multiple DTEST line to
> single GPIO, but the register mapping uses the bit mask for 4CH/8CH
> subtypes and I think we should support it accordingly. Even if I drop
> the support, we still have the difference of the register mapping on the
> dtest selection between MV/LV subtypes and legacy 4CH/8CH subtypes,
> which means we need a place to unify the dtest definition. I put the
> complication here in dtsi which the end user would choose the right
> value according to the hardware. I am also fine with putting the
> complication in C code, but that would drop the supporting of multiple
> DTEST lines selection for 4CH/8CH subtype.
> 

I do like when the format of DT properties is obvious, so I think the
appropriate format for multiple dtest lines would be: "qcom,dtest-buffer
= <1, 2>;"

So let's punt on the multiple dtest lines for now and just support one.
If we in the future add support for arrays of lines that would still be
backwards compatible with the single case.

Regards,
Bjorn

  reply	other threads:[~2017-07-14 18:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  6:16 [PATCH V1 0/3] Add LV/MV subtypes support for QCOM PMIC GPIOs fenglinw
2017-06-13  6:16 ` [PATCH V1 1/3] pinctrl: qcom: spmi-gpio: Add support for GPIO LV/MV subtype fenglinw
2017-06-18 14:04   ` Rob Herring
2017-06-19  1:00     ` Fenglin Wu
2017-06-19  1:00       ` Fenglin Wu
2017-06-19  2:07       ` Fenglin Wu
2017-06-20 11:15   ` Linus Walleij
2017-07-05 23:51     ` Fenglin Wu
2017-07-06  5:02       ` Bjorn Andersson
     [not found]   ` <20170613061707.13892-2-fenglinw-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-12 20:55     ` Bjorn Andersson
2017-07-12 20:55       ` Bjorn Andersson
2017-07-13  3:21       ` Fenglin Wu
2017-06-13  6:16 ` [PATCH V1 2/3] pinctrl: qcom: spmi-gpio: Add dtest route for digital input fenglinw
2017-06-18 14:04   ` Rob Herring
2017-06-20 11:14   ` Linus Walleij
     [not found]   ` <20170613061707.13892-3-fenglinw-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-07-12 21:24     ` Bjorn Andersson
2017-07-12 21:24       ` Bjorn Andersson
2017-07-13  5:27       ` Fenglin Wu
2017-07-14 18:19         ` Bjorn Andersson [this message]
2017-06-13  6:16 ` [PATCH V1 3/3] pinctrl: qcom: spmi-gpio: Correct power_source range check fenglinw
2017-06-20  9:33   ` Linus Walleij
2017-07-12 21:33   ` Bjorn Andersson
2017-07-13  5:55     ` Fenglin Wu

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=20170714181951.GQ20973@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=aghayal@qti.qualcomm.com \
    --cc=andy.gross@linaro.org \
    --cc=collinsd@quicinc.com \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fenglinw@codeaurora.org \
    --cc=kgunda@qti.qualcomm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=wruan@quicinc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.