From: Lars-Peter Clausen <lars@metafoo.de>
To: Petr Kulhavy <petr@barix.com>, alsa-devel@alsa-project.org
Subject: Re: GPIO control from ALSA
Date: Wed, 20 Apr 2016 12:39:39 +0200 [thread overview]
Message-ID: <57175C6B.6080604@metafoo.de> (raw)
In-Reply-To: <5717503A.9050000@barix.com>
On 04/20/2016 11:47 AM, Petr Kulhavy wrote:
>
>
> On 20.04.2016 11:06, Lars-Peter Clausen wrote:
>> On 04/20/2016 10:51 AM, Petr Kulhavy wrote:
>>>
>>> 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.
>> Rather than exposing the GPIO itself you'd expose the logical function of
>> the GPIO. E.g. in your case a ENUM control that allows to switch between
>> microphone and capture and in the background this sets the GPIO according to
>> the selection.
>
> I understand that, my question was more how to hook the enum to a function
> rather to a codec register?
You can use SOC_ENUM_EXT() to create the control. This macro takes a get and
a put callback where you can manipulate the state of the GPIO. And then just
register the control with the card.
prev parent reply other threads:[~2016-04-20 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 8:03 GPIO control from ALSA Petr Kulhavy
2016-04-20 8:33 ` Lars-Peter Clausen
2016-04-20 8:51 ` Petr Kulhavy
2016-04-20 9:06 ` Lars-Peter Clausen
2016-04-20 9:47 ` Petr Kulhavy
2016-04-20 10:39 ` Lars-Peter Clausen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57175C6B.6080604@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=petr@barix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).