All of lore.kernel.org
 help / color / mirror / Atom feed
* sys/class entry not created for jack in machine driver
@ 2009-03-12  9:54 Lopez Cruz, Misael
  2009-03-12 14:39 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Lopez Cruz, Misael @ 2009-03-12  9:54 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sys/class entry not created for jack in machine driver
  2009-03-12  9:54 sys/class entry not created for jack in machine driver Lopez Cruz, Misael
@ 2009-03-12 14:39 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2009-03-12 14:39 UTC (permalink / raw)
  To: Lopez Cruz, Misael; +Cc: alsa-devel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-12 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12  9:54 sys/class entry not created for jack in machine driver Lopez Cruz, Misael
2009-03-12 14:39 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.