diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-02-17 13:45:26 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-03-07 16:17:30 -0500 |
commit | 1bca748cccec1c7f30b4424882de965100744432 (patch) | |
tree | 8f75822eec408253caf43cda53f266b949579ad5 /drivers/gpio | |
parent | f92e8f8144243a3651b2e350b706ea2d04931f8c (diff) |
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 <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/wm831x-gpio.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) | |||
44 | val |= WM831X_GPN_TRI; | 44 | val |= WM831X_GPN_TRI; |
45 | 45 | ||
46 | return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, | 46 | return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, |
47 | WM831X_GPN_DIR | WM831X_GPN_TRI, val); | 47 | WM831X_GPN_DIR | WM831X_GPN_TRI | |
48 | WM831X_GPN_FN_MASK, val); | ||
48 | } | 49 | } |
49 | 50 | ||
50 | static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset) | 51 | 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, | |||
84 | val |= WM831X_GPN_TRI; | 85 | val |= WM831X_GPN_TRI; |
85 | 86 | ||
86 | ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, | 87 | ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset, |
87 | WM831X_GPN_DIR | WM831X_GPN_TRI, val); | 88 | WM831X_GPN_DIR | WM831X_GPN_TRI | |
89 | WM831X_GPN_FN_MASK, val); | ||
88 | if (ret < 0) | 90 | if (ret < 0) |
89 | return ret; | 91 | return ret; |
90 | 92 | ||