Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bca748c authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent f92e8f81
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;