ALSA: do not create OPL3 timers if there is no OPL3 irq wired
Most cards have OPL3 FM synthetiser but they do not have OPL3 interrupt wired to a sound chip or CPU. Do not create OPL3 timers for such cards as the timers are useless witthout interrupt. This patch removes OPL3 timers for following alsa drivers: snd-ad1816a, snd-opti93x, snd-opti92x, snd-sc6000, snd-cmi8330. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
48972cc510
commit
aa9c293ae4
|
@ -207,11 +207,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
|
||||||
OPL3_HW_AUTO, 0, &opl3) < 0) {
|
OPL3_HW_AUTO, 0, &opl3) < 0) {
|
||||||
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2);
|
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx.\n", fm_port[dev], fm_port[dev] + 2);
|
||||||
} else {
|
} else {
|
||||||
if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) {
|
error = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
|
||||||
snd_card_free(card);
|
if (error < 0) {
|
||||||
return error;
|
|
||||||
}
|
|
||||||
if ((error = snd_opl3_hwdep_new(opl3, 0, 1, NULL)) < 0) {
|
|
||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -546,10 +546,6 @@ static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
|
||||||
"no OPL device at 0x%lx-0x%lx ?\n",
|
"no OPL device at 0x%lx-0x%lx ?\n",
|
||||||
fmport[dev], fmport[dev] + 2);
|
fmport[dev], fmport[dev] + 2);
|
||||||
} else {
|
} else {
|
||||||
err = snd_opl3_timer_new(opl3, 0, 1);
|
|
||||||
if (err < 0)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
|
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -815,14 +815,8 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
|
||||||
chip->fm_port, chip->fm_port + 4 - 1);
|
chip->fm_port, chip->fm_port + 4 - 1);
|
||||||
}
|
}
|
||||||
if (opl3) {
|
if (opl3) {
|
||||||
#ifdef CS4231
|
error = snd_opl3_hwdep_new(opl3, 0, 1, &synth);
|
||||||
const int t1dev = 1;
|
if (error < 0)
|
||||||
#else
|
|
||||||
const int t1dev = 0;
|
|
||||||
#endif
|
|
||||||
if ((error = snd_opl3_timer_new(opl3, t1dev, t1dev+1)) < 0)
|
|
||||||
return error;
|
|
||||||
if ((error = snd_opl3_hwdep_new(opl3, 0, 1, &synth)) < 0)
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -576,10 +576,6 @@ static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev)
|
||||||
snd_printk(KERN_ERR PFX "no OPL device at 0x%x-0x%x ?\n",
|
snd_printk(KERN_ERR PFX "no OPL device at 0x%x-0x%x ?\n",
|
||||||
0x388, 0x388 + 2);
|
0x388, 0x388 + 2);
|
||||||
} else {
|
} else {
|
||||||
err = snd_opl3_timer_new(opl3, 0, 1);
|
|
||||||
if (err < 0)
|
|
||||||
goto err_unmap2;
|
|
||||||
|
|
||||||
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
|
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_unmap2;
|
goto err_unmap2;
|
||||||
|
|
Loading…
Reference in New Issue