Skip to content

Commit

Permalink
pinctrl: tegra: Display pin function in pinconf-groups
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Luca Ceresoli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
thierryreding authored and linusw committed Nov 13, 2023
1 parent b85ea95 commit bf800ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/pinctrl/tegra/pinctrl-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ static void tegra_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
seq_printf(s, "\n\t%s=%u",
strip_prefix(cfg_params[i].property), val);
}

if (g->mux_reg >= 0) {
/* read pinmux function and dump to seq_file */
val = pmx_readl(pmx, g->mux_bank, g->mux_reg);
val = g->funcs[(val >> g->mux_bit) & 0x3];

seq_printf(s, "\n\tfunction=%s", pmx->functions[val].name);
}
}

static void tegra_pinconf_config_dbg_show(struct pinctrl_dev *pctldev,
Expand Down

0 comments on commit bf800ca

Please sign in to comment.