Skip to content

Commit bdbae7e

Browse files
tiwaiJaroslav Kysela
authored andcommitted
[ALSA] Remove snd_vx_delay() function
Replace snd_vx_delay() with appropriate delay/sleep functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c8eb6ba commit bdbae7e

4 files changed

Lines changed: 15 additions & 30 deletions

File tree

‎include/sound/vx_core.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val)
274274
#define vx_inl(chip,reg) snd_vx_inl(chip, VX_##reg)
275275
#define vx_outl(chip,reg,val) snd_vx_outl(chip, VX_##reg,val)
276276

277-
void snd_vx_delay(vx_core_t *chip, int msec);
278-
279277
static inline void vx_reset_dsp(vx_core_t *chip)
280278
{
281279
snd_assert(chip->ops->reset_dsp, return);

‎sound/drivers/vx/vx_core.c‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ MODULE_DESCRIPTION("Common routines for Digigram VX drivers");
4040
MODULE_LICENSE("GPL");
4141

4242

43-
/*
44-
* snd_vx_delay - delay for the specified time
45-
* @xmsec: the time to delay in msec
46-
*/
47-
void snd_vx_delay(vx_core_t *chip, int xmsec)
48-
{
49-
if (! in_interrupt() && xmsec >= 1000 / HZ)
50-
msleep(xmsec);
51-
else
52-
mdelay(xmsec);
53-
}
54-
5543
/*
5644
* vx_check_reg_bit - wait for the specified bit is set/reset on a register
5745
* @reg: register to check
@@ -76,7 +64,7 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time)
7664
do {
7765
if ((snd_vx_inb(chip, reg) & mask) == bit)
7866
return 0;
79-
//snd_vx_delay(chip, 10);
67+
//msleep(10);
8068
} while (time_after_eq(end_time, jiffies));
8169
snd_printd(KERN_DEBUG "vx_check_reg_bit: timeout, reg=%s, mask=0x%x, val=0x%x\n", reg_names[reg], mask, snd_vx_inb(chip, reg));
8270
return -EIO;
@@ -664,7 +652,7 @@ int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot)
664652

665653
if ((err = snd_vx_load_boot_image(chip, boot)) < 0)
666654
return err;
667-
snd_vx_delay(chip, 10);
655+
msleep(10);
668656

669657
return 0;
670658
}
@@ -704,7 +692,7 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp)
704692
}
705693
snd_printdd(KERN_DEBUG "checksum = 0x%08x\n", csum);
706694

707-
snd_vx_delay(chip, 200);
695+
msleep(200);
708696

709697
if ((err = vx_wait_isr_bit(chip, ISR_CHK)) < 0)
710698
return err;
@@ -831,7 +819,6 @@ EXPORT_SYMBOL(snd_vx_create);
831819
EXPORT_SYMBOL(snd_vx_setup_firmware);
832820
EXPORT_SYMBOL(snd_vx_free_firmware);
833821
EXPORT_SYMBOL(snd_vx_irq_handler);
834-
EXPORT_SYMBOL(snd_vx_delay);
835822
EXPORT_SYMBOL(snd_vx_dsp_boot);
836823
EXPORT_SYMBOL(snd_vx_dsp_load);
837824
EXPORT_SYMBOL(snd_vx_load_boot_image);

‎sound/pci/vx222/vx222_ops.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void vx2_reset_dsp(vx_core_t *_chip)
154154
/* set the reset dsp bit to 0 */
155155
vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_DSP_RESET_MASK);
156156

157-
snd_vx_delay(_chip, XX_DSP_RESET_WAIT_TIME);
157+
mdelay(XX_DSP_RESET_WAIT_TIME);
158158

159159
chip->regCDSP |= VX_CDSP_DSP_RESET_MASK;
160160
/* set the reset dsp bit to 1 */
@@ -362,10 +362,10 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx
362362
/* XILINX reset (wait at least 1 milisecond between reset on and off). */
363363
vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE | VX_XILINX_RESET_MASK);
364364
vx_inl(chip, CNTRL);
365-
snd_vx_delay(chip, 10);
365+
msleep(10);
366366
vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE);
367367
vx_inl(chip, CNTRL);
368-
snd_vx_delay(chip, 10);
368+
msleep(10);
369369

370370
if (chip->type == VX_TYPE_BOARD)
371371
port = VX_CNTRL;
@@ -381,7 +381,7 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx
381381
}
382382
put_xilinx_data(chip, port, 4, 0xff); /* end signature */
383383

384-
snd_vx_delay(chip, 200);
384+
msleep(200);
385385

386386
/* test after loading (is buggy with VX222) */
387387
if (chip->type != VX_TYPE_BOARD) {
@@ -720,17 +720,17 @@ static void vx2_reset_codec(vx_core_t *_chip)
720720
/* Set the reset CODEC bit to 0. */
721721
vx_outl(chip, CDSP, chip->regCDSP &~ VX_CDSP_CODEC_RESET_MASK);
722722
vx_inl(chip, CDSP);
723-
snd_vx_delay(_chip, 10);
723+
msleep(10);
724724
/* Set the reset CODEC bit to 1. */
725725
chip->regCDSP |= VX_CDSP_CODEC_RESET_MASK;
726726
vx_outl(chip, CDSP, chip->regCDSP);
727727
vx_inl(chip, CDSP);
728728
if (_chip->type == VX_TYPE_BOARD) {
729-
snd_vx_delay(_chip, 1);
729+
msleep(1);
730730
return;
731731
}
732732

733-
snd_vx_delay(_chip, 5); /* additionnel wait time for AKM's */
733+
msleep(5); /* additionnel wait time for AKM's */
734734

735735
vx2_write_codec_reg(_chip, AKM_CODEC_POWER_CONTROL_CMD); /* DAC power up, ADC power up, Vref power down */
736736

‎sound/pcmcia/vx/vxp_ops.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int vx_check_magic(vx_core_t *chip)
9696
c = vx_inb(chip, CDSP);
9797
if (c == CDSP_MAGIC)
9898
return 0;
99-
snd_vx_delay(chip, 10);
99+
msleep(10);
100100
} while (time_after_eq(end_time, jiffies));
101101
snd_printk(KERN_ERR "cannot find xilinx magic word (%x)\n", c);
102102
return -EIO;
@@ -134,12 +134,12 @@ static void vxp_reset_codec(vx_core_t *_chip)
134134
/* Set the reset CODEC bit to 1. */
135135
vx_outb(chip, CDSP, chip->regCDSP | VXP_CDSP_CODEC_RESET_MASK);
136136
vx_inb(chip, CDSP);
137-
snd_vx_delay(_chip, 10);
137+
msleep(10);
138138
/* Set the reset CODEC bit to 0. */
139139
chip->regCDSP &= ~VXP_CDSP_CODEC_RESET_MASK;
140140
vx_outb(chip, CDSP, chip->regCDSP);
141141
vx_inb(chip, CDSP);
142-
snd_vx_delay(_chip, 1);
142+
msleep(1);
143143
}
144144

145145
/*
@@ -207,7 +207,7 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw)
207207
vx_outb(chip, ICR, ICR_HF0);
208208

209209
/* TEMPO 250ms : wait until Xilinx is downloaded */
210-
snd_vx_delay(_chip, 300);
210+
msleep(300);
211211

212212
/* test magical word */
213213
if (vx_check_magic(_chip) < 0)
@@ -221,7 +221,7 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw)
221221
chip->regDIALOG |= VXP_DLG_XILINX_REPROG_MASK;
222222
vx_outb(chip, DIALOG, chip->regDIALOG);
223223
vx_inb(chip, DIALOG);
224-
snd_vx_delay(_chip, 10);
224+
msleep(10);
225225
chip->regDIALOG &= ~VXP_DLG_XILINX_REPROG_MASK;
226226
vx_outb(chip, DIALOG, chip->regDIALOG);
227227
vx_inb(chip, DIALOG);

0 commit comments

Comments
 (0)