9 Feb
2011
9 Feb
'11
3:38 p.m.
- 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