From: Thierry Reding <thierry.reding@gmail.com>
To: Prathamesh Shete <pshete@nvidia.com>
Cc: linus.walleij@linaro.org, jonathanh@nvidia.com,
linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: tegra: Add support to display pin function
Date: Fri, 14 Jul 2023 11:47:05 +0200 [thread overview]
Message-ID: <ZLEZmX0LzwCNvf5h@orome> (raw)
In-Reply-To: <20230713082106.838-1-pshete@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 2241 bytes --]
On Thu, Jul 13, 2023 at 01:51:06PM +0530, Prathamesh Shete wrote:
> The current function for a given pin is not displayed via the debugfs.
> Add support to display the current function that is set for each pin.
>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> ---
> drivers/pinctrl/tegra/pinctrl-tegra.c | 19 +++++++++++++++++--
> drivers/pinctrl/tegra/pinctrl-tegra.h | 2 ++
> 2 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c
> index 4547cf66d03b..4da8873942cf 100644
> --- a/drivers/pinctrl/tegra/pinctrl-tegra.c
> +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
> @@ -96,6 +96,7 @@ static const struct cfg_param {
> {"nvidia,slew-rate-falling", TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING},
> {"nvidia,slew-rate-rising", TEGRA_PINCONF_PARAM_SLEW_RATE_RISING},
> {"nvidia,drive-type", TEGRA_PINCONF_PARAM_DRIVE_TYPE},
> + {"nvidia,function", TEGRA_PINCONF_PARAM_FUNCTION},
> };
>
> static int tegra_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
> @@ -470,6 +471,12 @@ static int tegra_pinconf_reg(struct tegra_pmx *pmx,
> *bit = g->drvtype_bit;
> *width = 2;
> break;
> + case TEGRA_PINCONF_PARAM_FUNCTION:
> + *bank = g->mux_bank;
> + *reg = g->mux_reg;
> + *bit = g->mux_bit;
> + *width = 2;
> + break;
> default:
> dev_err(pmx->dev, "Invalid config param %04x\n", param);
> return -ENOTSUPP;
> @@ -620,6 +627,7 @@ static void tegra_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
> s8 bank, bit, width;
> s32 reg;
> u32 val;
> + u8 idx;
This declaration could be moved into the only conditional that uses this
variable...
>
> g = &pmx->soc->groups[group];
>
> @@ -633,8 +641,15 @@ static void tegra_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
> val >>= bit;
> val &= (1 << width) - 1;
>
> - seq_printf(s, "\n\t%s=%u",
> - strip_prefix(cfg_params[i].property), val);
> + if (cfg_params[i].param == TEGRA_PINCONF_PARAM_FUNCTION) {
> + idx = pmx->soc->groups[group].funcs[val];
... so that this would become:
u8 idx = ...;
Either way:
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-07-14 9:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 13:55 [PATCH] pinctrl: tegra: Add support to display pin function Prathamesh Shete
2023-07-12 15:05 ` Thierry Reding
2023-07-13 8:21 ` [PATCH v2] " Prathamesh Shete
2023-07-14 9:47 ` Thierry Reding [this message]
2023-07-14 10:22 ` Jon Hunter
2023-07-14 11:35 ` [PATCH v3] " Prathamesh Shete
2023-07-20 19:35 ` Linus Walleij
2023-09-25 16:30 ` Luca Ceresoli
2023-09-27 8:54 ` Linus Walleij
2023-09-28 6:53 ` Luca Ceresoli
2023-09-29 12:26 ` Thierry Reding
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=ZLEZmX0LzwCNvf5h@orome \
--to=thierry.reding@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pshete@nvidia.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 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).