[alsa-devel] [PATCH 2/3] ASoC: mfld_machine: Add support for jack detection
Koul, Vinod
vinod.koul at intel.com
Wed Feb 9 15:38:39 CET 2011
> > + sn95031_jack_detection(&jack_data);
> > + /* If american headest, program the gpio control registers */
> > + if (jack_data.micbias_vol >= MFLD_MV_HP &&
> > + jack_data.micbias_vol < MFLD_MV_HS)
> > + snd_soc_update_bits(mfld_jack.codec, SN95031_AUDIO_GPIO_CTRL,
> > + BIT(1), BIT(1));
> > + else
> > + snd_soc_update_bits(mfld_jack.codec, SN95031_AUDIO_GPIO_CTRL,
> > + BIT(1), BIT(0));
>
> This looks like the CODEC driver should be exporting gpiolib support -
> that'd make it much easier for others to reuse the GPIOs in their
> designs (eg, powering external amplifiers).
The GPIOs in this chip can be programmed using a codec
register read/write. Anyone can use the soc_read/write or
scu_ipc_read/writes to program the GPIO.
Would putting one more wrapper over these APIs make it look better?
~Vinod
More information about the Alsa-devel
mailing list