OSDN Git Service

ASoC: ams_delta: use GPIO lookup table
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Fri, 18 May 2018 21:09:51 +0000 (23:09 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 23 May 2018 18:47:32 +0000 (11:47 -0700)
commitd65777d1a2cd0009a57222262c49fd829d15fe70
treee36fdf14ea18c6766c4b5067dd7310e565399def
parent0486738928bf06380dd108454fb75544430cd4bb
ASoC: ams_delta: use GPIO lookup table

Now as the Amstrad Delta board provides GPIO lookup tables, switch from
GPIO numbers to GPIO descriptors and use the table to locate required
GPIO pins.

The card uses two pins, one for jack and the other for voice modem
codec DAI control.

For jack pin, remove hardcoded GPIO number and use GPIO descriptor
based variant of jack GPIO initialization.

For modem_codec pin, declare static variable for storing its GPIO
descriptor, obtain it on card initialization and replace obsolete
ams_delta_latch2_write() with gpiod_set_value().  For that to work,
don't request the modem_codec pin from the board init code anymore.

If the modem_codec GPIO lookup fails, skip initialization of
functionality of the card which depends on its availability.

Pin naming used by the driver should be followed while respective GPIO
lookup table is initialized by a board init code.

Created and tested against linux-4.17-rc3, on top of patch 1/6 "ARM:
OMAP1: ams-delta: add GPIO lookup tables"

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/board-ams-delta.c
sound/soc/omap/ams-delta.c