aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/ad1848/ad1848_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/ad1848/ad1848_lib.c')
-rw-r--r--sound/isa/ad1848/ad1848_lib.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index 303861cd03c..891bacc94f6 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -109,7 +109,7 @@ void snd_ad1848_out(ad1848_t *chip,
109 udelay(100); 109 udelay(100);
110#ifdef CONFIG_SND_DEBUG 110#ifdef CONFIG_SND_DEBUG
111 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 111 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
112 snd_printk("auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 112 snd_printk(KERN_WARNING "auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value);
113#endif 113#endif
114 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL)); 114 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL));
115 outb(chip->image[reg] = value, AD1848P(chip, REG)); 115 outb(chip->image[reg] = value, AD1848P(chip, REG));
@@ -139,7 +139,7 @@ static unsigned char snd_ad1848_in(ad1848_t *chip, unsigned char reg)
139 udelay(100); 139 udelay(100);
140#ifdef CONFIG_SND_DEBUG 140#ifdef CONFIG_SND_DEBUG
141 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 141 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
142 snd_printk("auto calibration time out - reg = 0x%x\n", reg); 142 snd_printk(KERN_WARNING "auto calibration time out - reg = 0x%x\n", reg);
143#endif 143#endif
144 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL)); 144 outb(chip->mce_bit | reg, AD1848P(chip, REGSEL));
145 mb(); 145 mb();
@@ -185,13 +185,13 @@ static void snd_ad1848_mce_up(ad1848_t *chip)
185 udelay(100); 185 udelay(100);
186#ifdef CONFIG_SND_DEBUG 186#ifdef CONFIG_SND_DEBUG
187 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 187 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
188 snd_printk("mce_up - auto calibration time out (0)\n"); 188 snd_printk(KERN_WARNING "mce_up - auto calibration time out (0)\n");
189#endif 189#endif
190 spin_lock_irqsave(&chip->reg_lock, flags); 190 spin_lock_irqsave(&chip->reg_lock, flags);
191 chip->mce_bit |= AD1848_MCE; 191 chip->mce_bit |= AD1848_MCE;
192 timeout = inb(AD1848P(chip, REGSEL)); 192 timeout = inb(AD1848P(chip, REGSEL));
193 if (timeout == 0x80) 193 if (timeout == 0x80)
194 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 194 snd_printk(KERN_WARNING "mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port);
195 if (!(timeout & AD1848_MCE)) 195 if (!(timeout & AD1848_MCE))
196 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL)); 196 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL));
197 spin_unlock_irqrestore(&chip->reg_lock, flags); 197 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -214,13 +214,13 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
214#endif 214#endif
215#ifdef CONFIG_SND_DEBUG 215#ifdef CONFIG_SND_DEBUG
216 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) 216 if (inb(AD1848P(chip, REGSEL)) & AD1848_INIT)
217 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", AD1848P(chip, REGSEL)); 217 snd_printk(KERN_WARNING "mce_down [0x%lx] - auto calibration time out (0)\n", AD1848P(chip, REGSEL));
218#endif 218#endif
219 chip->mce_bit &= ~AD1848_MCE; 219 chip->mce_bit &= ~AD1848_MCE;
220 timeout = inb(AD1848P(chip, REGSEL)); 220 timeout = inb(AD1848P(chip, REGSEL));
221 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL)); 221 outb(chip->mce_bit | (timeout & 0x1f), AD1848P(chip, REGSEL));
222 if (timeout == 0x80) 222 if (timeout == 0x80)
223 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); 223 snd_printk(KERN_WARNING "mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port);
224 if ((timeout & AD1848_MCE) == 0) { 224 if ((timeout & AD1848_MCE) == 0) {
225 spin_unlock_irqrestore(&chip->reg_lock, flags); 225 spin_unlock_irqrestore(&chip->reg_lock, flags);
226 return; 226 return;
@@ -240,11 +240,10 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
240 while (snd_ad1848_in(chip, AD1848_TEST_INIT) & AD1848_CALIB_IN_PROGRESS) { 240 while (snd_ad1848_in(chip, AD1848_TEST_INIT) & AD1848_CALIB_IN_PROGRESS) {
241 spin_unlock_irqrestore(&chip->reg_lock, flags); 241 spin_unlock_irqrestore(&chip->reg_lock, flags);
242 if (time <= 0) { 242 if (time <= 0) {
243 snd_printk("mce_down - auto calibration time out (2)\n"); 243 snd_printk(KERN_ERR "mce_down - auto calibration time out (2)\n");
244 return; 244 return;
245 } 245 }
246 set_current_state(TASK_INTERRUPTIBLE); 246 time = schedule_timeout_interruptible(time);
247 time = schedule_timeout(time);
248 spin_lock_irqsave(&chip->reg_lock, flags); 247 spin_lock_irqsave(&chip->reg_lock, flags);
249 } 248 }
250#if 0 249#if 0
@@ -254,11 +253,10 @@ static void snd_ad1848_mce_down(ad1848_t *chip)
254 while (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) { 253 while (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) {
255 spin_unlock_irqrestore(&chip->reg_lock, flags); 254 spin_unlock_irqrestore(&chip->reg_lock, flags);
256 if (time <= 0) { 255 if (time <= 0) {
257 snd_printk("mce_down - auto calibration time out (3)\n"); 256 snd_printk(KERN_ERR "mce_down - auto calibration time out (3)\n");
258 return; 257 return;
259 } 258 }
260 set_current_state(TASK_INTERRUPTIBLE); 259 time = schedule_timeout_interruptible(time);
261 time = schedule_timeout(time);
262 spin_lock_irqsave(&chip->reg_lock, flags); 260 spin_lock_irqsave(&chip->reg_lock, flags);
263 } 261 }
264 spin_unlock_irqrestore(&chip->reg_lock, flags); 262 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -846,10 +844,7 @@ static int snd_ad1848_capture_close(snd_pcm_substream_t * substream)
846 844
847static int snd_ad1848_free(ad1848_t *chip) 845static int snd_ad1848_free(ad1848_t *chip)
848{ 846{
849 if (chip->res_port) { 847 release_and_free_resource(chip->res_port);
850 release_resource(chip->res_port);
851 kfree_nocheck(chip->res_port);
852 }
853 if (chip->irq >= 0) 848 if (chip->irq >= 0)
854 free_irq(chip->irq, (void *) chip); 849 free_irq(chip->irq, (void *) chip);
855 if (chip->dma >= 0) { 850 if (chip->dma >= 0) {