[alsa-devel] question on snd_soc_jack_report

Harsha, Priya priya.harsha at intel.com
Fri Jan 14 12:40:01 CET 2011


I am using snd_soc_jack_report and I send the parameter as follows to report

struct snd_soc_jack *soc_jack;
snd_soc_jack_report (soc_jack, SND_JACK_HEADPHONE, SND_JACK_HEADPHONE);

I don't find the reporting to be happening. When I looked at the snd_jack_report 
code, I found that jack->type needs to be set and that was not being set.
So when I added the following line in my code, it started reporting.
soc_jack->jack->type = SND_JACK_HEADPHONE;

Is it expected that the driver sets the 'type' of the instance of 'snd_jack' inside 
snd_soc_jack structure. I was actually thinking that snd_soc_jack_report would 
need to do this.

I did not find any other drivers doing that. Is there something that I am 

Also, to report button press events, I had to add the following line of code
soc_jack->jack->key[0] = BTN_0;
Is this also an expected thing to be set.


More information about the Alsa-devel mailing list