Re: [PATCH v3 2/3] pinctrl: imx: allow to configure SION with generic pinconf
From: Lucas Stach
Date: Wed Jun 20 2018 - 04:40:47 EST
Hi Abel,
as this series switches back to using the raw padcfg values in DT
instead of generic pinconf (which I think is the right move), we can
drop this patch from the series.
Regards,
Lucas
Am Mittwoch, den 20.06.2018, 10:24 +0300 schrieb Abel Vesa:
> > From: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
>
> The SION bit force enables the input buffer, overriding the configuration
> driven by the muxed module. It is not located in the pad config register,
> but in the mux register and thus needs special handling.
>
> > Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> > Signed-off-by: Abel Vesa <abel.vesa@xxxxxxx>
> ---
> Âdrivers/pinctrl/freescale/pinctrl-imx.c | 19 +++++++------------
> Âdrivers/pinctrl/freescale/pinctrl-imx.h |ÂÂ4 ++++
> Â2 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index 1c6bb15..335edc9 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -26,10 +26,6 @@
> Â#include "../pinmux.h"
> Â#include "pinctrl-imx.h"
> Â
> -/* The bits in CONFIG cell defined in binding doc*/
> > > -#define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */
> > -#define IMX_PAD_SION 0x40000000 /* set SION */
> -
> Âstatic inline const struct group_desc *imx_pinctrl_find_group_by_name(
> > Â struct pinctrl_dev *pctldev,
> > Â const char *name)
> @@ -514,18 +510,17 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
> > Â pin->mux_mode = be32_to_cpu(*list++);
> > Â pin->input_val = be32_to_cpu(*list++);
> Â
> > - if (info->generic_pinconf) {
> > + if (info->generic_pinconf)
> > Â /* generic pin config decoded */
> > Â pin->config = config;
> > - } else {
> > + else
> > Â /* legacy pin config read from devicetree */
> > - config = be32_to_cpu(*list++);
> > + pin->config = be32_to_cpu(*list++);
> Â
> > - /* SION bit is in mux register */
> > - if (config & IMX_PAD_SION)
> > - pin->mux_mode |= IOMUXC_CONFIG_SION;
> > - pin->config = config & ~IMX_PAD_SION;
> > - }
> > + /* SION bit is in mux register */
> > + if (pin->config & IMX_PAD_SION)
> > + pin->mux_mode |= IOMUXC_CONFIG_SION;
> > + pin->config = pin->config & ~IMX_PAD_SION;
> Â
> > Â dev_dbg(ipctl->dev, "%s: 0x%x 0x%08lx", info->pins[pin_id].name,
> > Â pin->mux_mode, pin->config);
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
> index 4b8225c..44567a6 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.h
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.h
> @@ -14,6 +14,10 @@
> Â#include <linux/pinctrl/pinconf-generic.h>
> Â#include <linux/pinctrl/pinmux.h>
> Â
> +/* The bits in CONFIG cell defined in binding doc*/
> > > +#define IMX_NO_PAD_CTL 0x80000000 /* no pin config need */
> > +#define IMX_PAD_SION 0x40000000 /* set SION */
> +
> Âstruct platform_device;
> Â
> Âextern struct pinmux_ops imx_pmx_ops;