MLK-19133 pinctrl: Fix select input issue in pinctrl driver

The pinctrl supports to set any bit in input register on iMX6 if
the MSB of input value is 0xff. But the driver uses signed int for
input value, so when executing the codes below, it won't meet.
Because this is arithmetic right shift.

    if (input_val >> 24 == 0xff)

Fix the issue by changing the input_val, config_val and mux_mode to u32.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit e464bbcd13d472ddf2df5b62b0002a127147e17b)
This commit is contained in:
Ye Li 2018-08-13 00:37:07 -07:00
parent 983b708fb5
commit 6069aa09d9
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,8 @@ static int imx_pinctrl_set_state(struct udevice *dev, struct udevice *config)
const struct fdt_property *prop;
u32 *pin_data;
int npins, size, pin_size;
int mux_reg, conf_reg, input_reg, input_val, mux_mode, config_val;
int mux_reg, conf_reg, input_reg;
u32 input_val, mux_mode, config_val;
u32 mux_shift = info->mux_mask ? ffs(info->mux_mask) - 1 : 0;
int i, j = 0;