Commit fe9c3644 authored by Andrew Halaney's avatar Andrew Halaney Committed by Linus Walleij

pinctrl: nomadik: Fix pull direction debug info

The nomadik pinctrl hardware doesn't have any way to
determine if the active pull is up or down. Reading
the bit currently used to report if the pull is up/down
indicates if the gpio input is reading high or low, it
doesn't reflect the pull state.

For this reason change the output from "pull up"/"pull down" to
"pull enabled". This avoids confusing developers who were using
the output to determine what the pull state is.
Signed-off-by: default avatarAndrew Halaney <ajhalaney@gmail.com>
Link: https://lore.kernel.org/r/20200806155322.GA25523@ola-jn9phv2.ad.garmin.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 9123e3a7
...@@ -931,11 +931,6 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s, ...@@ -931,11 +931,6 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s,
[NMK_GPIO_ALT_C+3] = "altC3", [NMK_GPIO_ALT_C+3] = "altC3",
[NMK_GPIO_ALT_C+4] = "altC4", [NMK_GPIO_ALT_C+4] = "altC4",
}; };
const char *pulls[] = {
"none ",
"pull down",
"pull up ",
};
clk_enable(nmk_chip->clk); clk_enable(nmk_chip->clk);
is_out = !!(readl(nmk_chip->addr + NMK_GPIO_DIR) & BIT(offset)); is_out = !!(readl(nmk_chip->addr + NMK_GPIO_DIR) & BIT(offset));
...@@ -946,7 +941,7 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s, ...@@ -946,7 +941,7 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s,
mode = nmk_prcm_gpiocr_get_mode(pctldev, gpio); mode = nmk_prcm_gpiocr_get_mode(pctldev, gpio);
if (is_out) { if (is_out) {
seq_printf(s, " gpio-%-3d (%-20.20s) out %s %s", seq_printf(s, " gpio-%-3d (%-20.20s) out %s %s",
gpio, gpio,
label ?: "(none)", label ?: "(none)",
data_out ? "hi" : "lo", data_out ? "hi" : "lo",
...@@ -954,11 +949,12 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s, ...@@ -954,11 +949,12 @@ static void nmk_gpio_dbg_show_one(struct seq_file *s,
} else { } else {
int irq = chip->to_irq(chip, offset); int irq = chip->to_irq(chip, offset);
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc = irq_to_desc(irq);
int pullidx = 0; const int pullidx = pull ? 1 : 0;
int val; int val;
static const char * const pulls[] = {
if (pull) "none ",
pullidx = data_out ? 2 : 1; "pull enabled",
};
seq_printf(s, " gpio-%-3d (%-20.20s) in %s %s", seq_printf(s, " gpio-%-3d (%-20.20s) in %s %s",
gpio, gpio,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment