public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: alsa-devel@alsa-project.org,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	linux-input@vger.kernel.org
Subject: Re: Can a phone hook switch follow alsa jack model?
Date: Tue, 23 Jun 2009 23:22:56 +0100	[thread overview]
Message-ID: <20090623222255.GA5617@sirena.org.uk> (raw)
In-Reply-To: <4A40D896.8010208@tis.icnet.pl>

On Tue, Jun 23, 2009 at 03:28:54PM +0200, Janusz Krzysztofik wrote:

> After my initial attempt to add support for the switch using gpio-keys 
> driver, I am no longer sure if it is a good idea to follow the keyboard 
> model, that the driver has been designed after, for driving a switch 
> that has nothing to do with keyboards and may required a different approach.

That approach was quite common in the past.

> However, I am not sure if the switch in question matches the alsa jack 
> model closely enough. I see the switch usage not as simple as turning 
> handset microphone/speaker on or off. It can be used for other purposes 
> as well, like accepting a phone call or actually dialing a number that 
> has been just typed in. Furthermore, it can be used to turn off a 
> speakerphone function, while, in turn, the related handset 
> microphone/speaker pair can be turned off not only with this switch, but 
> with a handsfree button as well, for example.

That can all be accomodated within the ASoC jack framework (I'm assuming
you'll be doing an ASoC rather than generic ALSA driver).  You get the
input device just the same as you get with gpio-keys so you can do stuff
in user space, the main difference is that you can also arrange for some
of the power management within ASoC to be hooked up with the jack
automatically as well.

With what you're describing above I'd tie the mic and speaker in the
headset to DAPM automatically.

> All that extra functionality looks like belonging to userspace rather 
> then kernel, not like other alsa jack implementations that seem to do 
> all the job of switching media paths inside the kernel. That is why I am 
> not sure if the jack model is suitable for the purpose.

The switching in kernel for ASoC should generally be confined to marking
outputs as powered or unpowered - things like marking a headphone jack
as disabled when there's nothing plugged in to it that can be done
unconditionally.  Everything else should get punted to user space.

  reply	other threads:[~2009-06-23 22:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 13:28 Can a phone hook switch follow alsa jack model? Janusz Krzysztofik
2009-06-23 22:22 ` Mark Brown [this message]
2009-06-24 13:28   ` Janusz Krzysztofik
2009-06-25 11:05     ` Mark Brown
2009-06-25 12:48       ` [alsa-devel] " Janusz Krzysztofik
2009-06-29 14:32         ` Mark Brown
2009-06-29 16:35           ` Janusz Krzysztofik

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=20090623222255.GA5617@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=jkrzyszt@tis.icnet.pl \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /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