• Jarkko Nikula's avatar
    ASoC: jack: Add support for GPIO descriptor defined jack pins · f025d3b9
    Jarkko Nikula authored
    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: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
    Signed-off-by: default avatarMark Brown <broonie@linaro.org>
    f025d3b9
soc-jack.c 10.7 KB