]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: jack: Add support for GPIO descriptor defined jack pins
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Mon, 26 May 2014 11:34:37 +0000 (14:34 +0300)
committerMark Brown <broonie@linaro.org>
Mon, 26 May 2014 14:26:00 +0000 (15:26 +0100)
commit1546e3d326134b5604e425369f6db0f8c8ec3b97
tree819909f51afd408c50379e69c55d29337365d02c
parentf78b62572767d71e128f0462240ead3ba99ca555
ASoC: jack: Add support for GPIO descriptor defined jack pins

Allow jack GPIO pins be defined also using GPIO descriptor-based interface
in addition to legacy GPIO numbers. This is done by adding two new fields to
struct snd_soc_jack_gpio: idx and gpiod_dev.

Legacy GPIO numbers are used only when GPIO consumer device gpiod_dev is
NULL and otherwise idx is the descriptor index within the GPIO consumer
device.

New function snd_soc_jack_add_gpiods() is added for typical cases where all
GPIO descriptor jack pins belong to same GPIO consumer device. For other
cases the caller must set the gpiod_dev in struct snd_soc_jack_gpio before
calling snd_soc_jack_add_gpios().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/sound/soc.h
sound/soc/soc-jack.c