[alsa-devel] sys/class entry not created for jack in machine driver
Hi,
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?
-Misa
On Thu, Mar 12, 2009 at 04:54:16AM -0500, Lopez Cruz, Misael wrote:
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.
Ah, you should move the jack registration to the device initialisation - it needs to happen before the card is registered. Putting it in sdp4030_twl4030_init() ought to do the job.
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?
That shouldn't be required.
BTW, when talking about code modifications you've done it's normally helpful if you post the change you've made to reduce the chances of miscommunication.
participants (2)
-
Lopez Cruz, Misael
-
Mark Brown