From: Linus Walleij <linus.walleij@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
Stephen Boyd <swboyd@chromium.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 3/3] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() to be compliant
Date: Mon, 9 Jul 2018 13:17:01 +0200 [thread overview]
Message-ID: <CACRpkdbGejz1a1doN_LuBNgYeHo9Hdz54vRYU=inQZfyiJEmaA@mail.gmail.com> (raw)
In-Reply-To: <20180702225939.109169-3-dianders@chromium.org>
On Tue, Jul 3, 2018 at 1:00 AM Douglas Anderson <dianders@chromium.org> wrote:
> If you do this on an sdm845 board:
> grep "" /sys/kernel/debug/pinctrl/*spmi:pmic*/pinconf-groups
>
> ...it looks like nonsense. For every pin you see listed:
> input bias disabled, input bias high impedance, input bias pull down, input bias pull up, ...
>
> That's because pmic_gpio_config_get() isn't complying with the rules
> that pinconf_generic_dump_one() expects. Specifically for boolean
> parameters (anything with a "struct pin_config_item" where has_arg is
> false) the function expects that the function should return its value
> not through the "config" parameter but should return "0" if the value
> is set and "-EINVAL" if the value isn't set.
>
> Let's fix this.
>
> From a quick sample of other pinctrl drivers, it appears to be
> tradition to also return 1 through the config parameter for these
> boolean parameters when they exist. I'm not one to knock tradition,
> so I'll follow tradition and return 1 in these cases. While I'm at
> it, I'll also continue searching for four leaf clovers, kocking on
> wood three times, and trying not to break mirrors.
>
> NOTE: This also fixes an apparent typo for reading
> PIN_CONFIG_BIAS_DISABLE where the old driver was accidentally
> using "=" instead of "==" and thus was setting some internal
> state when you tried to query PIN_CONFIG_BIAS_DISABLE. Oops.
>
> Fixes: eadff3024472 ("pinctrl: Qualcomm SPMI PMIC GPIO pin controller driver")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
Patch applied, same thing. Stays in unless Bjorn has some
objections.
Yours,
Linus Walleij
next prev parent reply other threads:[~2018-07-09 11:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 22:59 [PATCH 1/3] pinctrl: Document pin_config_group_get() return codes like pin_config_get() Douglas Anderson
2018-07-02 22:59 ` [PATCH 2/3] pinctrl: msm: Fix msm_config_group_get() to be compliant Douglas Anderson
2018-07-09 11:15 ` Linus Walleij
2018-07-02 22:59 ` [PATCH 3/3] pinctrl: qcom: spmi-gpio: Fix pmic_gpio_config_get() " Douglas Anderson
2018-07-03 6:09 ` Stephen Boyd
2018-07-09 11:17 ` Linus Walleij
2018-08-30 15:28 ` Doug Anderson
2018-07-09 11:17 ` Linus Walleij [this message]
2018-07-09 11:09 ` [PATCH 1/3] pinctrl: Document pin_config_group_get() return codes like pin_config_get() Linus Walleij
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='CACRpkdbGejz1a1doN_LuBNgYeHo9Hdz54vRYU=inQZfyiJEmaA@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.org \
--cc=iivanov@mm-sol.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swboyd@chromium.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).