Thread (101 messages) 101 messages, 7 authors, 2022-05-07

Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio

From: Linus Walleij <hidden>
Date: 2022-05-01 21:41:26
Also in: dri-devel, linux-arm-kernel, linux-clk, linux-ide, linux-input, linux-leds, linux-mips, linux-mmc, linux-pm, linux-rtc, linux-usb, lkml

On Tue, Apr 19, 2022 at 6:41 PM Arnd Bergmann [off-list ref] wrote:
From: Arnd Bergmann <arnd@arndb.de>

The audio driver should not use a hardwired gpio number
from the header. Change it to use a lookup table.

Cc: Philipp Zabel <redacted>
Cc: Paul Parsons <redacted>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
(...)
+static struct gpiod_lookup_table hx4700_audio_gpio_table = {
+       .dev_id = "hx4700-audio",
+       .table = {
+               GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET,
+                           "earphone-ndet", GPIO_ACTIVE_HIGH),
This looks wrong. The n in nDET in the end of the name of the GPIO line
means active low does it not?

What I usually do when I see this is to properly set it to
GPIO_ACTIVE_LOW in the descriptor table, then invert the logic
where it's getting used.

Also rename to earphone-det instead of -ndet
+               GPIO_LOOKUP("gpio-pxa", GPIO92_HX4700_HP_DRIVER,
+                           "hp-driver", GPIO_ACTIVE_HIGH),
+               GPIO_LOOKUP("gpio-pxa", GPIO107_HX4700_SPK_nSD,
+                           "spk-nsd", GPIO_ACTIVE_HIGH),
Same here. Rename spk-sd

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help