[alsa-devel] sys/class entry not created for jack in machine driver

Lopez Cruz, Misael x0052729 at ti.com
Thu Mar 12 10:54:16 CET 2009


I just noticed that the sys/class entry for the jack is not being created,
in my case for headset jack in sdp3430 machine driver.

When creating the SoC jack, the soc-jack mechanism creates a new generic
jack by calling snd_jack_new function. In that function, a new sound
device is created representing the jack device. But in the particular
case of jacks not belonging to a codec, they never get registered. A jack
device in a codec driver gets registered because codec when initializing
the SoC card (snd_soc_init_card) registers the sound card, and the sound
card registers all sound devices added to it, among them the jack device.

In the machine driver, the soc jack is created after the codec has been
initialized and consequently all sound devices attached to the card (till
that point) are already registered. Because of that, the jack device is
created but not registered.

I'm registering the jack device after it's created (in function
snd_jack_new) and now I get the sys/class entry for the headset jack in
my machine driver. What do you think about that solution?


More information about the Alsa-devel mailing list