aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-12-19 11:13:16 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:02:41 -0500
commit4014c38bd94156c10986a11d890bdae99437dc9a (patch)
treef8d8ee3b61b6c7f70da735b8c916554a4a8fc0cd
parente250af291d6759518b574b33317eb3003012bfa2 (diff)
[ALSA] ak4114 - Use global workqueue
Use global workqueue for simplicity instead of own workqueue. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--include/sound/ak4114.h1
-rw-r--r--sound/i2c/other/ak4114.c17
2 files changed, 4 insertions, 14 deletions
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index 2ee061625fd0..85f49d464751 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -181,7 +181,6 @@ struct ak4114 {
181 unsigned long ccrc_errors; 181 unsigned long ccrc_errors;
182 unsigned char rcs0; 182 unsigned char rcs0;
183 unsigned char rcs1; 183 unsigned char rcs1;
184 struct workqueue_struct *workqueue;
185 struct delayed_work work; 184 struct delayed_work work;
186 void *change_callback_private; 185 void *change_callback_private;
187 void (*change_callback)(struct ak4114 *ak4114, unsigned char c0, unsigned char c1); 186 void (*change_callback)(struct ak4114 *ak4114, unsigned char c0, unsigned char c1);
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index d2f2c5078e65..69dcaf8ac793 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -66,10 +66,7 @@ static void snd_ak4114_free(struct ak4114 *chip)
66{ 66{
67 chip->init = 1; /* don't schedule new work */ 67 chip->init = 1; /* don't schedule new work */
68 mb(); 68 mb();
69 if (chip->workqueue != NULL) { 69 flush_scheduled_work();
70 flush_workqueue(chip->workqueue);
71 destroy_workqueue(chip->workqueue);
72 }
73 kfree(chip); 70 kfree(chip);
74} 71}
75 72
@@ -106,12 +103,6 @@ int snd_ak4114_create(struct snd_card *card,
106 for (reg = 0; reg < 5; reg++) 103 for (reg = 0; reg < 5; reg++)
107 chip->txcsb[reg] = txcsb[reg]; 104 chip->txcsb[reg] = txcsb[reg];
108 105
109 chip->workqueue = create_workqueue("snd-ak4114");
110 if (chip->workqueue == NULL) {
111 kfree(chip);
112 return -ENOMEM;
113 }
114
115 snd_ak4114_reinit(chip); 106 snd_ak4114_reinit(chip);
116 107
117 chip->rcs0 = reg_read(chip, AK4114_REG_RCS0) & ~(AK4114_QINT | AK4114_CINT); 108 chip->rcs0 = reg_read(chip, AK4114_REG_RCS0) & ~(AK4114_QINT | AK4114_CINT);
@@ -143,7 +134,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
143 134
144 chip->init = 1; 135 chip->init = 1;
145 mb(); 136 mb();
146 flush_workqueue(chip->workqueue); 137 flush_scheduled_work();
147 /* bring the chip to reset state and powerdown state */ 138 /* bring the chip to reset state and powerdown state */
148 reg_write(chip, AK4114_REG_PWRDN, old & ~(AK4114_RST|AK4114_PWN)); 139 reg_write(chip, AK4114_REG_PWRDN, old & ~(AK4114_RST|AK4114_PWN));
149 udelay(200); 140 udelay(200);
@@ -159,7 +150,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
159 /* bring up statistics / event queing */ 150 /* bring up statistics / event queing */
160 chip->init = 0; 151 chip->init = 0;
161 INIT_DELAYED_WORK(&chip->work, ak4114_stats); 152 INIT_DELAYED_WORK(&chip->work, ak4114_stats);
162 queue_delayed_work(chip->workqueue, &chip->work, HZ / 10); 153 schedule_delayed_work(&chip->work, HZ / 10);
163} 154}
164 155
165static unsigned int external_rate(unsigned char rcs1) 156static unsigned int external_rate(unsigned char rcs1)
@@ -568,7 +559,7 @@ static void ak4114_stats(struct work_struct *work)
568 if (chip->init) 559 if (chip->init)
569 return; 560 return;
570 snd_ak4114_check_rate_and_errors(chip, 0); 561 snd_ak4114_check_rate_and_errors(chip, 0);
571 queue_delayed_work(chip->workqueue, &chip->work, HZ / 10); 562 schedule_delayed_work(&chip->work, HZ / 10);
572} 563}
573 564
574EXPORT_SYMBOL(snd_ak4114_create); 565EXPORT_SYMBOL(snd_ak4114_create);