From: Matt Porter Date: Wed, 26 Sep 2012 19:07:43 +0000 (-0400) Subject: pinctrl: pinctrl-single: add debugfs pin h/w state info X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d66ce7f8cf4df01a39a5abad4769df23ff59b8a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git pinctrl: pinctrl-single: add debugfs pin h/w state info Adds support for displaying the individual pin h/w config state. Signed-off-by: Matt Porter Acked-by: Tony Lindgren Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index aabecfa507b4..726a729a2ec9 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -246,7 +246,15 @@ static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, unsigned offset) { - seq_printf(s, " " DRIVER_NAME); + struct pcs_device *pcs; + unsigned val; + + pcs = pinctrl_dev_get_drvdata(pctldev); + + val = pcs->read(pcs->base + offset); + val &= pcs->fmask; + + seq_printf(s, "%08x %s " , val, DRIVER_NAME); } static void pcs_dt_free_map(struct pinctrl_dev *pctldev,