pinctrl: sunxi-pinctrl: fix pin funtion can not be match correctly.
authorhao_zhang <hao5781286@gmail.com>
Tue, 9 Jan 2018 05:59:02 +0000 (13:59 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 10 Jan 2018 13:44:20 +0000 (14:44 +0100)
commit32e21f084faacc69014b4bb082db04890fad5f1b
treea14a9a23d8e58ae412375e76b9d171e6586f75ca
parenta3a093ae02e2ae81499ad9e78516dccd72906c25
pinctrl: sunxi-pinctrl: fix pin funtion can not be match correctly.

Pin function can not be match correctly when SUNXI_PIN describe with
mutiple variant and same function.

such as:
on pinctrl-sun4i-a10.c

SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 2),
SUNXI_FUNCTION(0x0, "gpio_in"),
SUNXI_FUNCTION(0x1, "gpio_out"),
SUNXI_FUNCTION_VARIANT(0x2, "pwm",    /* PWM0 */
PINCTRL_SUN4I_A10 |
PINCTRL_SUN7I_A20),
SUNXI_FUNCTION_VARIANT(0x3, "pwm",    /* PWM0 */
PINCTRL_SUN8I_R40)),

it would always match to the first variant function
(PINCTRL_SUN4I_A10, PINCTRL_SUN7I_A20)

so we should add variant compare on it.

Signed-off-by: hao_zhang <hao5781286@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sunxi/pinctrl-sunxi.c