2020-04-17 18:36:11

by Martin Blumenstingl

[permalink] [raw]
Subject: [PATCH RESEND v2 0/2] pinctrl-meson: two small improvements

While playing with audio output on Meson8b I found out that the
vendor kernel uses a custom version of the GPIO_PULL_UP flag. I
suspect that we will need this for audio support on Meson8b and/or
Meson8m2 but I don't see it hurt other platforms.

Also while comparing the register bits with the GPIO direction (of
GPIOs exported to sysfs) I sometimes had a mismatch. This also wires
up gpio_chip.get_direction to have sysfs and the actual registers in
sync.


Changes since v1 from [0]:
- re-send as non-"RFC" because I only got one comment in the past week
for patch #2. Jerome pointed out an alternative way to GPIO_PULL_UP
and GPIO_PULL_DOWN. However, this doesn't invalidate the patch, it
just means that there are two ways to achieve the same goal.


[0] https://patchwork.kernel.org/cover/11484185/


Martin Blumenstingl (2):
pinctrl: meson: implement the gpio_chip get_direction callback
pinctrl: meson: wire up the gpio_chip's set_config callback

drivers/pinctrl/meson/pinctrl-meson.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

--
2.26.1


2020-04-17 18:36:31

by Martin Blumenstingl

[permalink] [raw]
Subject: [PATCH RESEND v2 2/2] pinctrl: meson: wire up the gpio_chip's set_config callback

Use gpiochip_generic_config for the gpio_chip's set_config callback so
GPIO flags like GPIO_PULL_UP or GPIO_PULL_DOWN can be used in the board
.dts descriptions.
This is required for some Meson8m2 boards where GPIO_BSD_EN provides the
"MUTE" signal and requires enabling the internal pull-up resistor.

Signed-off-by: Martin Blumenstingl <[email protected]>
---
drivers/pinctrl/meson/pinctrl-meson.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 291f3078e7c7..079f8ee8d353 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -603,6 +603,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
pc->chip.parent = pc->dev;
pc->chip.request = gpiochip_generic_request;
pc->chip.free = gpiochip_generic_free;
+ pc->chip.set_config = gpiochip_generic_config;
pc->chip.get_direction = meson_gpio_get_direction;
pc->chip.direction_input = meson_gpio_direction_input;
pc->chip.direction_output = meson_gpio_direction_output;
--
2.26.1

2020-04-28 10:03:19

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH RESEND v2 0/2] pinctrl-meson: two small improvements

On Fri, Apr 17, 2020 at 8:34 PM Martin Blumenstingl
<[email protected]> wrote:

> While playing with audio output on Meson8b I found out that the
> vendor kernel uses a custom version of the GPIO_PULL_UP flag. I
> suspect that we will need this for audio support on Meson8b and/or
> Meson8m2 but I don't see it hurt other platforms.
>
> Also while comparing the register bits with the GPIO direction (of
> GPIOs exported to sysfs) I sometimes had a mismatch. This also wires
> up gpio_chip.get_direction to have sysfs and the actual registers in
> sync.

Patches applied.

Yours,
Linus Walleij