[alsa-devel] [PATCH] ASoC: rt5640: add headset detection function

Bard Liao bardliao at realtek.com
Thu Jul 25 05:36:42 CEST 2013


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Tuesday, July 23, 2013 9:00 PM
> To: Bard Liao
> Cc: lgirdwood at gmail.com; alsa-devel at alsa-project.org; Flove; Oder Chiou
> Subject: Re: [PATCH] ASoC: rt5640: add headset detection function
> 
> On Tue, Jul 23, 2013 at 02:54:29PM +0800, bardliao at realtek.com wrote:
> 
> > + * @codec: SoC audio codec device.
> > + * @jack_insert: Jack insert or not.
> > + *
> > + * Detect whether is headset or not when jack inserted.
> > + *
> > + * Returns detect status.
> > + */
> > +int rt5640_headset_detect(struct snd_soc_codec *codec,
> > +				struct snd_soc_jack *jack, int jack_insert)
> 
> This doesn't look like it implements jack detection, it looks like it's some sort of
> callback.  I'd expect to see some sort of interrupt for example...
> 
> What's going on here?

Usually, our customers use cpu's gpio as the interrupt pin of jack insert/remove.
So we assume they will handle the interrupt event in machine driver.
When machine driver get a jack insert/remove event, it will call this function to know the jack type(headset or headphone).
Should I handle the interrupt event in codec driver?


> 
> ------Please consider the environment before printing this e-mail.


More information about the Alsa-devel mailing list