mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
7f32d37009
commit
03d9eca7d4
|
@ -297,10 +297,33 @@ static int lp_get_group_pins(struct pinctrl_dev *pctldev,
|
||||||
return 0;
|
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 = {
|
static const struct pinctrl_ops lptlp_pinctrl_ops = {
|
||||||
.get_groups_count = lp_get_groups_count,
|
.get_groups_count = lp_get_groups_count,
|
||||||
.get_group_name = lp_get_group_name,
|
.get_group_name = lp_get_group_name,
|
||||||
.get_group_pins = lp_get_group_pins,
|
.get_group_pins = lp_get_group_pins,
|
||||||
|
.pin_dbg_show = lp_pin_dbg_show,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int lp_get_functions_count(struct pinctrl_dev *pctldev)
|
static int lp_get_functions_count(struct pinctrl_dev *pctldev)
|
||||||
|
|
Loading…
Reference in New Issue