[alsa-devel] GPIO control from ALSA

Petr Kulhavy petr at barix.com
Wed Apr 20 10:51:23 CEST 2016


On 20.04.2016 10:33, Lars-Peter Clausen wrote:
> On 04/20/2016 10:03 AM, Petr Kulhavy wrote:
>> Hello,
>>
>> I'm writing a driver for ASoC "sound card" hardware which uses CPU GPIO to
>> mute/unmute an analogue amplifier and another GPIO to control an analogue
>> switch for line/mic switching. Is there an abstraction in ALSA to model this
>> kind of hardware?
> There is no abstraction. Use controls and/or DAPM and the standard GPIO API,
> if you grep the sources you'll find a few examples of drivers using GPIOs to
> mute amplifiers and similar (e.g. qi_lb60).
>
> - Lars

Thanks, Lars, for the good pointers! I will check that out.

Is there also a way to map GPIO to a control which then appears e.g. in 
alsamixer? That would be useful for the mic/line selection.

Regards
Petr



More information about the Alsa-devel mailing list