Skip to contentSkip to conversation

pinctrl: tegra: Display pin function in pinconf-groups

PATCH In review Thierry Reding 3 participants 3 messages Sep 29, 2023 – Nov 6, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: tegra: Display pin function in pinconf-groups

From: Thierry Reding <[email protected]>

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.

---
 drivers/pinctrl/tegra/pinctrl-tegra.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/pinctrl/tegra/pinctrl-tegra.c +8 -0
index a4002b430f0a..c9fd3910bb3b 100644
@@ -639,6 +639,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,
Signature · 1 line
2.42.0
Tested-by on v1 1/1
#1 lore raw

Hello Thierry,

Quoted 10 lines · On Fri, 29 Sep 2023 14:21:01 +0200 Thierry Reding <[email protected]>…

From: Thierry Reding <[email protected]>

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.

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
In reply to Thierry Reding
Quoted 10 lines · Thierry Reding

From: Thierry Reding <[email protected]>

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.

Patch queued for v6.8, will appear in next when the v6.7-rc1 is released.

Yours,
Linus Walleij