diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-11-25 20:14:03 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-12-13 16:48:48 +0200 |
commit | 03d9eca7d40608197bb20c584a6da97b3399559b (patch) | |
tree | b6c9b8b2d35e7cc861f1bc2d15589bec6d245df7 /drivers/pinctrl/intel/pinctrl-lynxpoint.c | |
parent | 7f32d37009974c52323335cf8d118384fbce3572 (diff) |
pinctrl: lynxpoint: Implement ->pin_dbg_show()
The introduced callback ->pin_dbg_show() is useful for debugging.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pinctrl/intel/pinctrl-lynxpoint.c')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-lynxpoint.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index c209deff9efb..bfdd283d2c20 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -297,10 +297,33 @@ static int lp_get_group_pins(struct pinctrl_dev *pctldev, return 0; } +static void lp_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, + unsigned int pin) +{ + struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); + void __iomem *reg = lp_gpio_reg(&lg->chip, pin, LP_CONFIG1); + void __iomem *conf2 = lp_gpio_reg(&lg->chip, pin, LP_CONFIG2); + u32 value, mode; + + value = ioread32(reg); + + mode = value & USE_SEL_MASK; + if (mode == USE_SEL_GPIO) + seq_puts(s, "GPIO "); + else + seq_printf(s, "mode %d ", mode); + + seq_printf(s, "0x%08x 0x%08x", value, ioread32(conf2)); + + if (lp_gpio_acpi_use(lg, pin)) + seq_puts(s, " [ACPI]"); +} + static const struct pinctrl_ops lptlp_pinctrl_ops = { .get_groups_count = lp_get_groups_count, .get_group_name = lp_get_group_name, .get_group_pins = lp_get_group_pins, + .pin_dbg_show = lp_pin_dbg_show, }; static int lp_get_functions_count(struct pinctrl_dev *pctldev) |