Skip to contentSkip to conversation

pinctrl: qcom: lpass-lpi: Include value in debugfs output

PATCH In review Bjorn Andersson 2 participants 2 messages Sep 16

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

PATCH 1/1 pinctrl: qcom: lpass-lpi: Include value in debugfs output

As with other pinctrl providers, it's useful to be able to inspect the current GPIO state of the LPASS LPI pins during system integration and debugging.

Extend the driver's debugfs logic to read the current value and include this in the printout.

---
 drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +5 -1
index 5fd4a4eba654..9412fd36a4aa 100644
@@ -421,6 +421,7 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,
 	struct pinctrl_pin_desc pindesc;
 	unsigned int func;
 	int is_out;
+	int value;
 	int drive;
 	int pull;
 	u32 ctl_reg;
@@ -443,7 +444,10 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,
 	drive = FIELD_GET(LPI_GPIO_OUT_STRENGTH_MASK, ctl_reg);
 	pull = FIELD_GET(LPI_GPIO_PULL_MASK, ctl_reg);
 
-	seq_printf(s, " %-8s: %-3s %d", pindesc.name, is_out ? "out" : "in", func);
+	value = lpi_gpio_get(chip, offset);
+
+	seq_printf(s, " %-8s: %-3s", pindesc.name, is_out ? "out" : "in");
+	seq_printf(s, " %-4s func%d", str_high_low(value), func);
 	seq_printf(s, " %dmA", lpi_regval_to_drive(drive));
 	seq_printf(s, " %s", pulls[pull]);
 }

---
base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
change-id: 20260915-pinctrl-lpass-debug-7aa2a92f0225

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
#1 lore raw
Quoted 8 lines · Bjorn Andersson

As with other pinctrl providers, it's useful to be able to inspect the current GPIO state of the LPASS LPI pins during system integration and debugging.

Extend the driver's debugfs logic to read the current value and include this in the printout.

[...]

Sashiko's probably right about the return value check but it's debugfs so I won't worry too much.

[1/1] pinctrl: qcom: lpass-lpi: Include value in debugfs output

      https://git.kernel.org/brgl/c/d29bfb93a19771b822dab6d7adbbbaf188cb1db5

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>