Update of /cvsroot/alsa/alsa-kernel/isa/opti9xx
In directory sc8-pr-cvs1:/tmp/cvs-serv27027/isa/opti9xx
Modified Files:
opti92x-ad1848.c
Log Message:
Clemens Ladisch <[EMAIL PROTECTED]>
This adds support for the mixer and wavetable synthesizer of OPL4 chips.
The OPL4 can be used with OPTi 82C928/Mozart, 82C929 and 82C924 cards
(82C925 and 82C93x have an integrated OPL3 and don't support an external
OPLx chip).
The changes in alsa-kernel/.../opti92x-ad1848.c are protected by the
USE_OPL4 symbol which is defined in alsa-driver/.../opti92x-ad1848.c.
The changes in alsa-kernel/drivers/opl3/*.c involve modifications of the
OPL3's mode register which would clear the NEW2 bit (which enables OPL4
registers). Those register writes had been used to restrict the OPL3 to
OPL2 compatibility, which IMHO isn't necessary, so I removed them. :)
Index: opti92x-ad1848.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/isa/opti9xx/opti92x-ad1848.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- opti92x-ad1848.c 13 Mar 2003 09:24:03 -0000 1.22
+++ opti92x-ad1848.c 24 Mar 2003 10:34:39 -0000 1.23
@@ -47,6 +47,11 @@
#endif /* CS4231 */
#include <sound/mpu401.h>
#include <sound/opl3.h>
+#ifdef USE_OPL4
+#ifndef OPTi93X
+#include "opl4.h" /* <sound/opl4.h> */
+#endif
+#endif
#define SNDRV_LEGACY_FIND_FREE_IRQ
#define SNDRV_LEGACY_FIND_FREE_DMA
#define SNDRV_GET_ID
@@ -267,14 +272,6 @@
long mpu_port;
int mpu_irq;
-#if defined(OPTi93X)
- opti93x_t *opti93x;
-#elif defined(CS4231)
- cs4231_t *cs4231;
-#else
- ad1848_t *ad1848;
-#endif /* AD1848 */
- snd_rawmidi_t *rmidi;
#ifdef __ISAPNP__
struct isapnp_dev *dev;
struct isapnp_dev *devmpu;
@@ -2127,14 +2124,35 @@
snd_printk("no MPU-401 device at 0x%lx?\n", chip->mpu_port);
if (chip->fm_port > 0) {
- opl3_t *opl3;
- if (snd_opl3_create(card,
- chip->fm_port,
- chip->fm_port + 2,
- OPL3_HW_AUTO, 0, &opl3) < 0) {
+ opl3_t *opl3 = NULL;
+#ifdef USE_OPL4
+#ifndef OPTi93X
+ if (chip->hardware == OPTi9XX_HW_82C928 ||
+ chip->hardware == OPTi9XX_HW_82C929 ||
+ chip->hardware == OPTi9XX_HW_82C924) {
+ opl4_t *opl4;
+ /* assume we have an OPL4 */
+ snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2),
+ 0x20, 0x20);
+ if (snd_opl4_create(card,
+ chip->fm_port,
+ chip->fm_port - 8,
+ 2, &opl3, &opl4) < 0) {
+ /* no luck, use OPL3 instead */
+ snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(2),
+ 0x00, 0x20);
+ }
+ }
+#endif /* !OPTi93X */
+#endif
+ if (!opl3 && snd_opl3_create(card,
+ chip->fm_port,
+ chip->fm_port + 2,
+ OPL3_HW_AUTO, 0, &opl3) < 0) {
snd_printk("no OPL device at 0x%lx-0x%lx\n",
- chip->fm_port, chip->fm_port + 4 - 1);
- } else {
+ chip->fm_port, chip->fm_port + 4 - 1);
+ }
+ if (opl3) {
if ((error = snd_opl3_timer_new(opl3,
#ifdef CS4231
1, 2)) < 0) {
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog