[PATCH] opti931: additional check for OPL3 device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Krzysztof Helt <krzysztof.h1@xxxxx>

This patch adds additional check for OPL3 device. I found that PNP
region returned
by the card is 0x380 - 0x38f but the OPL3 device is located at 0x388
(standard FM
device address). The driver checks start of the range (0x380) which is
incorrect.

Signed-off-by: Krzysztof Helt <krzysztof.h1@xxxxx>
---

The same problem appears on two cards I have with Opti chipset:
opti931 and opti933.
If someone can test if the opti92x PnP has the same problem I would be grateful.

Regards,
Krzysztof
diff -urp linux-2.6.22.old/sound/isa/opti9xx/opti92x-ad1848.c linux-2.6.22/sound/isa/opti9xx/opti92x-ad1848.c
--- linux-2.6.22.old/sound/isa/opti9xx/opti92x-ad1848.c	2007-09-08 13:37:59.000000000 +0200
+++ linux-2.6.22/sound/isa/opti9xx/opti92x-ad1848.c	2007-09-13 23:54:02.000000000 +0200
@@ -1890,12 +1890,26 @@ static int __devinit snd_opti9xx_probe(s
 			}
 		}
 #endif	/* !OPTi93X */
-		if (!opl3 && snd_opl3_create(card,
-					     chip->fm_port,
-					     chip->fm_port + 2,
-					     OPL3_HW_AUTO, 0, &opl3) < 0) {
-			snd_printk(KERN_WARNING "no OPL device at 0x%lx-0x%lx\n",
-				   chip->fm_port, chip->fm_port + 4 - 1);
+		if (!opl3) {
+			error = snd_opl3_create(card,
+						chip->fm_port,
+						chip->fm_port + 2,
+						OPL3_HW_AUTO, 0, &opl3);
+			if (error < 0 && chip->fm_port == 0x380) {
+				error = snd_opl3_create(card,
+							chip->fm_port + 8,
+							chip->fm_port + 10,
+							OPL3_HW_AUTO, 0, &opl3);
+			}
+			if (error < 0) {
+				snd_printk(KERN_WARNING
+					   "no OPL device at 0x%lx-0x%lx "
+					   "or 0x%lx-0x%lx\n",
+					   chip->fm_port,
+					   chip->fm_port + 4 - 1,
+					   chip->fm_port + 8,
+					   chip->fm_port + 12 - 1);
+			}
 		}
 		if (opl3) {
 #ifdef CS4231
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux