From: Mark Brown Date: Wed, 17 Feb 2010 18:45:26 +0000 (+0000) Subject: gpiolib: Force wm831x GPIOs into GPIO mode when requested X-Git-Tag: firefly_0821_release~9833^2~2831^2~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1bca748cccec1c7f30b4424882de965100744432;p=firefly-linux-kernel-4.4.55.git gpiolib: Force wm831x GPIOs into GPIO mode when requested This is the chip default but it's possible the bootloader or OTP will have been configured to a different mode (eg, to provide feedback during startup). Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c index 5b8dc098d80f..d09021f4a7d3 100644 --- a/drivers/gpio/wm831x-gpio.c +++ b/drivers/gpio/wm831x-gpio.c @@ -44,7 +44,8 @@ static int wm831x_gpio_direction_in(struct gpio_chip *chip, unsigned offset) val |= WM831X_GPN_TRI; return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, - WM831X_GPN_DIR | WM831X_GPN_TRI, val); + WM831X_GPN_DIR | WM831X_GPN_TRI | + WM831X_GPN_FN_MASK, val); } static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset) @@ -84,7 +85,8 @@ static int wm831x_gpio_direction_out(struct gpio_chip *chip, val |= WM831X_GPN_TRI; ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, - WM831X_GPN_DIR | WM831X_GPN_TRI, val); + WM831X_GPN_DIR | WM831X_GPN_TRI | + WM831X_GPN_FN_MASK, val); if (ret < 0) return ret;