diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-09-09 11:17:20 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-15 09:52:03 -0400 |
commit | db0a5214b8d6cc7a90ce3336d24a85b90cbb4e67 (patch) | |
tree | fdfcfaee149e83613d9854a763bbe3fe95f60292 /sound/pcmcia | |
parent | e7e69265b6269763799a5de9c263fbbce32cd3a3 (diff) |
ALSA: vx: Use nonatomic PCM ops
Rewrite VXpocket and VX222 drivers to use the new PCM nonatomic ops.
The former irq tasklet is replaced with a threaded irq handler, and
the tasklet for the PCM delayed start is simply merged into the normal
PCM trigger, as well as the replacement of spinlock with mutex.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pcmcia')
-rw-r--r-- | sound/pcmcia/vx/vxp_ops.c | 10 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 13 |
2 files changed, 13 insertions, 10 deletions
diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index fe33e122e372..281972913c32 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c | |||
@@ -468,12 +468,11 @@ static void vxp_write_codec_reg(struct vx_core *chip, int codec, unsigned int da | |||
468 | void vx_set_mic_boost(struct vx_core *chip, int boost) | 468 | void vx_set_mic_boost(struct vx_core *chip, int boost) |
469 | { | 469 | { |
470 | struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; | 470 | struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; |
471 | unsigned long flags; | ||
472 | 471 | ||
473 | if (chip->chip_status & VX_STAT_IS_STALE) | 472 | if (chip->chip_status & VX_STAT_IS_STALE) |
474 | return; | 473 | return; |
475 | 474 | ||
476 | spin_lock_irqsave(&chip->lock, flags); | 475 | mutex_lock(&chip->lock); |
477 | if (pchip->regCDSP & P24_CDSP_MICS_SEL_MASK) { | 476 | if (pchip->regCDSP & P24_CDSP_MICS_SEL_MASK) { |
478 | if (boost) { | 477 | if (boost) { |
479 | /* boost: 38 dB */ | 478 | /* boost: 38 dB */ |
@@ -486,7 +485,7 @@ void vx_set_mic_boost(struct vx_core *chip, int boost) | |||
486 | } | 485 | } |
487 | vx_outb(chip, CDSP, pchip->regCDSP); | 486 | vx_outb(chip, CDSP, pchip->regCDSP); |
488 | } | 487 | } |
489 | spin_unlock_irqrestore(&chip->lock, flags); | 488 | mutex_unlock(&chip->lock); |
490 | } | 489 | } |
491 | 490 | ||
492 | /* | 491 | /* |
@@ -511,17 +510,16 @@ static int vx_compute_mic_level(int level) | |||
511 | void vx_set_mic_level(struct vx_core *chip, int level) | 510 | void vx_set_mic_level(struct vx_core *chip, int level) |
512 | { | 511 | { |
513 | struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; | 512 | struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; |
514 | unsigned long flags; | ||
515 | 513 | ||
516 | if (chip->chip_status & VX_STAT_IS_STALE) | 514 | if (chip->chip_status & VX_STAT_IS_STALE) |
517 | return; | 515 | return; |
518 | 516 | ||
519 | spin_lock_irqsave(&chip->lock, flags); | 517 | mutex_lock(&chip->lock); |
520 | if (pchip->regCDSP & VXP_CDSP_MIC_SEL_MASK) { | 518 | if (pchip->regCDSP & VXP_CDSP_MIC_SEL_MASK) { |
521 | level = vx_compute_mic_level(level); | 519 | level = vx_compute_mic_level(level); |
522 | vx_outb(chip, MICRO, level); | 520 | vx_outb(chip, MICRO, level); |
523 | } | 521 | } |
524 | spin_unlock_irqrestore(&chip->lock, flags); | 522 | mutex_unlock(&chip->lock); |
525 | } | 523 | } |
526 | 524 | ||
527 | 525 | ||
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 786e7e139c9e..92ec11456e3a 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -62,6 +62,7 @@ static unsigned int card_alloc; | |||
62 | */ | 62 | */ |
63 | static void vxpocket_release(struct pcmcia_device *link) | 63 | static void vxpocket_release(struct pcmcia_device *link) |
64 | { | 64 | { |
65 | free_irq(link->irq, link->priv); | ||
65 | pcmcia_disable_device(link); | 66 | pcmcia_disable_device(link); |
66 | } | 67 | } |
67 | 68 | ||
@@ -227,11 +228,13 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
227 | 228 | ||
228 | ret = pcmcia_request_io(link); | 229 | ret = pcmcia_request_io(link); |
229 | if (ret) | 230 | if (ret) |
230 | goto failed; | 231 | goto failed_preirq; |
231 | 232 | ||
232 | ret = pcmcia_request_irq(link, snd_vx_irq_handler); | 233 | ret = request_threaded_irq(link->irq, snd_vx_irq_handler, |
234 | snd_vx_threaded_irq_handler, | ||
235 | IRQF_SHARED, link->devname, link->priv); | ||
233 | if (ret) | 236 | if (ret) |
234 | goto failed; | 237 | goto failed_preirq; |
235 | 238 | ||
236 | ret = pcmcia_enable_device(link); | 239 | ret = pcmcia_enable_device(link); |
237 | if (ret) | 240 | if (ret) |
@@ -245,7 +248,9 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
245 | 248 | ||
246 | return 0; | 249 | return 0; |
247 | 250 | ||
248 | failed: | 251 | failed: |
252 | free_irq(link->irq, link->priv); | ||
253 | failed_preirq: | ||
249 | pcmcia_disable_device(link); | 254 | pcmcia_disable_device(link); |
250 | return -ENODEV; | 255 | return -ENODEV; |
251 | } | 256 | } |