diff options
author | Adrian Alonso <aalonso@freescale.com> | 2015-09-25 16:05:59 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-10-02 14:37:06 -0700 |
commit | e7b37a522aa92da5f47106aa07b6c1fc58bfd922 (patch) | |
tree | 6a874faeb1bbfa8583e95304eb02ad2304a840fb /drivers/pinctrl | |
parent | ee1635180a8437b8ea4ea2233fd3d3ab1ae95a49 (diff) | |
download | linux-e7b37a522aa92da5f47106aa07b6c1fc58bfd922.tar.gz linux-e7b37a522aa92da5f47106aa07b6c1fc58bfd922.tar.bz2 linux-e7b37a522aa92da5f47106aa07b6c1fc58bfd922.zip |
pinctrl: freescale: imx: allow mux_reg offset zero
Allow mux_reg offset zero to be a valid pin_id, on imx7d
mux_conf reg offset is zero for iomuxc-lspr controller
Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.c | 5 | ||||
-rw-r--r-- | drivers/pinctrl/freescale/pinctrl-imx.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index b9c6deb96924..151d50daeb80 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -542,6 +542,9 @@ static int imx_pinctrl_parse_groups(struct device_node *np, struct imx_pin_reg *pin_reg; struct imx_pin *pin = &grp->pins[i]; + if (!(info->flags & ZERO_OFFSET_VALID) && !mux_reg) + mux_reg = -1; + if (info->flags & SHARE_MUX_CONF_REG) { conf_reg = mux_reg; } else { @@ -550,7 +553,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np, conf_reg = -1; } - pin_id = mux_reg ? mux_reg / 4 : conf_reg / 4; + pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4; pin_reg = &info->pin_regs[pin_id]; pin->pin = pin_id; grp->pin_ids[i] = pin_id; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 2a5fe729fe06..2a592f657c18 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -85,6 +85,7 @@ struct imx_pinctrl_soc_info { }; #define SHARE_MUX_CONF_REG 0x1 +#define ZERO_OFFSET_VALID 0x2 #define NO_MUX 0x0 #define NO_PAD 0x0 |