[ALSA] ak4114 - Fix possible Oops with callbacks

ak4114 code may trigger Oops when the parameters are changed without
call of snd_ak4114_build().  Now it checks the existence of kctl
element, and the workq is triggered after building the necessary
kcontrols.
Also, did some code clean up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
Takashi Iwai
2007-03-30 15:38:39 +02:00
committed by Jaroslav Kysela
parent a971c3d425
commit 51354ae3b8
2 changed files with 62 additions and 40 deletions

View File

@@ -160,13 +160,6 @@ static int __devinit juli_init(struct snd_ice1712 *ice)
int err;
struct snd_akm4xxx *ak;
#if 0
for (err = 0; err < 0x20; err++)
juli_ak4114_read(ice, err);
juli_ak4114_write(ice, 0, 0x0f);
juli_ak4114_read(ice, 0);
juli_ak4114_read(ice, 1);
#endif
err = snd_ak4114_create(ice->card,
juli_ak4114_read,
juli_ak4114_write,