[PATCH v2 9/9] pinctrl: single: dump pinmux register value
Tony Lindgren
tony at atomide.com
Tue Oct 23 09:27:44 EST 2012
* Haojian Zhuang <haojian.zhuang at gmail.com> [121022 09:13]:
> Dump pinmux register value, not only function part in the pinmux
> register.
This makes sense, but should be done using pcs_read, not pcs_readl,
see below.
> Also fix the issue on caluclating pin offset. The last parameter
> should be pin number, not register offset.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang at gmail.com>
> ---
> drivers/pinctrl/pinctrl-single.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index a20da78..6ba2a5d 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -284,15 +284,15 @@ static int pcs_get_group_pins(struct pinctrl_dev *pctldev,
>
> static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev,
> struct seq_file *s,
> - unsigned offset)
> + unsigned pin)
> {
> struct pcs_device *pcs;
> - unsigned val;
> + unsigned val, mux_bytes;
>
> pcs = pinctrl_dev_get_drvdata(pctldev);
>
> - val = pcs->read(pcs->base + offset);
> - val &= pcs->fmask;
> + mux_bytes = pcs->width / BITS_PER_BYTE;
> + val = pcs_readl(pcs->base + pin * mux_bytes);
>
> seq_printf(s, "%08x %s " , val, DRIVER_NAME);
> }
You should not use pcs_readl here directly as the register
width can vary. Can you please update the patch for that and
make it independent from the rest of the series? That way we
can merge the fix for v3.7-rc series.
Regards,
Tony
More information about the devicetree-discuss
mailing list