Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: tegra: Display pin function in pinconf-groups

The function that a pin is muxed to can be read from the top-level
pinctrl-maps debugfs file. However, this only reflects the values that
were specified in device tree, so they will only show deviations from
the hardware default setting. Display the current pinmux setting in the
per-controller pinconf-groups debugfs file along with the rest of the
per-pin configuration settings.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20230929122101.466266-1-thierry.reding@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Thierry Reding and committed by
Linus Walleij
bf800ca4 b85ea95d

+8
+8
drivers/pinctrl/tegra/pinctrl-tegra.c
··· 636 636 seq_printf(s, "\n\t%s=%u", 637 637 strip_prefix(cfg_params[i].property), val); 638 638 } 639 + 640 + if (g->mux_reg >= 0) { 641 + /* read pinmux function and dump to seq_file */ 642 + val = pmx_readl(pmx, g->mux_bank, g->mux_reg); 643 + val = g->funcs[(val >> g->mux_bit) & 0x3]; 644 + 645 + seq_printf(s, "\n\tfunction=%s", pmx->functions[val].name); 646 + } 639 647 } 640 648 641 649 static void tegra_pinconf_config_dbg_show(struct pinctrl_dev *pctldev,