Skip to content

Commit

Permalink
pinctrl: freescale: imx: allow mux_reg offset zero
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Alonso authored and Linus Walleij committed Oct 2, 2015
1 parent ee16351 commit e7b37a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/pinctrl/freescale/pinctrl-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/pinctrl/freescale/pinctrl-imx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7b37a5

Please sign in to comment.