Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b959167 authored by Ondrej Zary's avatar Ondrej Zary Committed by Takashi Iwai
Browse files

ALSA: cmi8330: find OPL3 port automatically



My CMI8329 had OPL3 port specified in SB16 resources. But now I found out that
it was my modification of the card's PnP EEPROM a couple of years ago (can be
done using C9SETROM.EXE utility). I did it because the OPL3 port was
completely missing from PnP data. It seems to be hardwired to 0x388 on
CMI8329.

Find OPL3 port automatically by searching in WSS and SB16 resources. If not
found, assume that it's hardwired to 0x388.

Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 69eb8882
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
	wssport[dev] = pnp_port_start(pdev, 0);
	wssdma[dev] = pnp_dma(pdev, 0);
	wssirq[dev] = pnp_irq(pdev, 0);
	if (acard->type == CMI8330)
	if (pnp_port_start(pdev, 1))
		fmport[dev] = pnp_port_start(pdev, 1);

	/* allocate SB16 resources */
@@ -377,8 +377,13 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
	sbdma8[dev] = pnp_dma(pdev, 0);
	sbdma16[dev] = pnp_dma(pdev, 1);
	sbirq[dev] = pnp_irq(pdev, 0);
	if (acard->type == CMI8329)
	/* On CMI8239, the OPL3 port might be present in SB16 PnP resources */
	if (fmport[dev] == SNDRV_AUTO_PORT) {
		if (pnp_port_start(pdev, 1))
			fmport[dev] = pnp_port_start(pdev, 1);
		else
			fmport[dev] = 0x388;	/* Or hardwired */
	}

	/* allocate MPU-401 resources */
	pdev = acard->mpu;