[alsa-devel] [PATCH 1/3] ASoC: Add GPIO support for jack reporting interface

Mark Brown broonie at sirena.org.uk
Mon Mar 2 23:55:29 CET 2009


On Mon, Mar 02, 2009 at 03:16:22PM -0600, Lopez Cruz, Misael wrote:

> > That sounds like adding a callback for power updates on the jack itself
> > to me (which isn't a bad idea), rather than changing the report function
> > of the jack detection method.  The need for machine-specific extra
> > actions probably isn't specific to jacks that are detected via GPIOs.

> In that situation, power updates should come only when the jack reporting
> bits are either all active (jack enabled) or none (jack disabled), is that
> correct?

No, the jack detect bits can change independently - you won't always
physically be able to get everything that can be detected to report at
once (eg, something that can distinguish between headphones and line
output) or things may not always be present together (eg, a jack could
detect headphones but no microphone even if it's possible that both may
be present simultaneously).

> If so, then machine drivers can create callbacks receiving the soc_codec
> the jack belongs to and the current state of the jack. All the power updates
> (dapm_enable_pin/damp_disable_pin) will happen in the callback in machine
> driver but the dapm sync will happen in soc jack framework (i.e. when
> reporting current status of the jack).

No.  The framework takes care of doing the power updates already, there
is no need to add that functionality since the machine drivers can just
use a simple data table.  A callback could be used to do things that
can't be coped with already or more complex updates that aren't simply
directly mirroring the status in DAPM pins.


More information about the Alsa-devel mailing list