Update of /cvsroot/alsa/alsa-kernel/drivers/opl3 In directory sc8-pr-cvs1:/tmp/cvs-serv27027/drivers/opl3
Modified Files: opl3_lib.c opl3_seq.c opl3_synth.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: opl3_lib.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/drivers/opl3/opl3_lib.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- opl3_lib.c 4 Nov 2002 14:42:54 -0000 1.14 +++ opl3_lib.c 24 Mar 2003 10:34:37 -0000 1.15 @@ -470,7 +470,7 @@ case OPL3_HW_OPL4: opl3->max_voices = MAX_OPL3_VOICES; snd_assert(opl3->r_port != 0, snd_opl3_free(opl3); return -ENODEV); - opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */ + opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE); /* Enter OPL3 mode */ } if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl3, &ops)) < 0) { snd_opl3_free(opl3); Index: opl3_seq.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/drivers/opl3/opl3_seq.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- opl3_seq.c 28 Feb 2003 15:08:23 -0000 1.11 +++ opl3_seq.c 24 Mar 2003 10:34:38 -0000 1.12 @@ -70,8 +70,6 @@ opl3->use_time = 0; opl3->connection_reg = 0x00; if (opl3->hardware >= OPL3_HW_OPL3) { - /* Enter OPL3 mode */ - opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE); /* Clear 4-op connections */ opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, opl3->connection_reg); @@ -197,7 +195,7 @@ callbacks.private_data = opl3; opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; - sprintf(name, "OPL%i Port", opl_ver); + sprintf(name, "OPL%i FM Port", opl_ver); opl3->chset->client = opl3->seq_client; opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks, Index: opl3_synth.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/drivers/opl3/opl3_synth.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- opl3_synth.c 12 Aug 2002 08:43:46 -0000 1.4 +++ opl3_synth.c 24 Mar 2003 10:34:38 -0000 1.5 @@ -220,9 +220,6 @@ opl3->command(opl3, opl3_reg, 0x00); /* Note off */ } - if (opl3->hardware >= OPL3_HW_OPL3) - opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */ - opl3->max_voices = MAX_OPL2_VOICES; opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2; @@ -426,14 +423,9 @@ if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3)) return -EINVAL; - if (mode == SNDRV_DM_FM_MODE_OPL3) { - opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE); /* Enter OPL3 mode */ - opl3->fm_mode = SNDRV_DM_FM_MODE_OPL3; + opl3->fm_mode = mode; + if (opl3->hardware >= OPL3_HW_OPL3) opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */ - } else { - opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */ - opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2; - } return 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