Ignore:
Timestamp:
Apr 21, 2025, 7:17:25 PM (6 months ago)
Author:
David Azarewicz
Message:

Merge from uniaud32-exp branch

Location:
GPL/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_lib.c

    r703 r777  
    9393        signature = stat1 = inb(opl3->l_port);  /* Status register */
    9494        if ((stat1 & 0xe0) != 0x00) {   /* Should be 0x00 */
    95                 snd_printd("OPL3: stat1 = 0x%x\n", stat1);
     95                dev_dbg(opl3->card->dev, "OPL3: stat1 = 0x%x\n", stat1);
    9696                return -ENODEV;
    9797        }
     
    109109        opl3->command(opl3, OPL3_LEFT | OPL3_REG_TIMER_CONTROL, OPL3_IRQ_RESET);
    110110        if ((stat2 & 0xe0) != 0xc0) {   /* There is no YM3812 */
    111                 snd_printd("OPL3: stat2 = 0x%x\n", stat2);
     111                dev_dbg(opl3->card->dev, "OPL3: stat2 = 0x%x\n", stat2);
    112112                return -ENODEV;
    113113        }
     
    290290        opl3 = hw->private_data;
    291291        status = inb(opl3->l_port);
    292 #if 0
    293         snd_printk(KERN_DEBUG "AdLib IRQ status = 0x%x\n", status);
    294 #endif
    295292        if (!(status & 0x80))
    296293                return;
     
    366363{
    367364        if (! opl3->command) {
    368                 printk(KERN_ERR "snd_opl3_init: command not defined!\n");
     365                dev_err(opl3->card->dev,
     366                        "snd_opl3_init: command not defined!\n");
    369367                return -EINVAL;
    370368        }
     
    406404                opl3->res_l_port = request_region(l_port, 2, "OPL2/3 (left)");
    407405                if (!opl3->res_l_port) {
    408                         snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port);
     406                        dev_err(card->dev, "opl3: can't grab left port 0x%lx\n", l_port);
    409407                        snd_device_free(card, opl3);
    410408                        return -EBUSY;
     
    413411                        opl3->res_r_port = request_region(r_port, 2, "OPL2/3 (right)");
    414412                        if (!opl3->res_r_port) {
    415                                 snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port);
     413                                dev_err(card->dev, "opl3: can't grab right port 0x%lx\n", r_port);
    416414                                snd_device_free(card, opl3);
    417415                                return -EBUSY;
     
    433431                err = snd_opl3_detect(opl3);
    434432                if (err < 0) {
    435                         snd_printd("OPL2/3 chip not detected at 0x%lx/0x%lx\n",
     433                        dev_dbg(card->dev, "OPL2/3 chip not detected at 0x%lx/0x%lx\n",
    436434                                   opl3->l_port, opl3->r_port);
    437435                        snd_device_free(card, opl3);
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_midi.c

    r717 r777  
    1111#include "opl3_voice.h"
    1212#include <sound/asoundef.h>
     13
     14#ifdef DEBUG_MIDI
     15#define opl3_dbg(opl3, fmt, ...) \
     16        dev_dbg(((struct snd_opl3 *)(opl3))->card->dev, fmt, ##__VA_ARGS__)
     17#else
     18#define opl3_dbg(opl3, fmt, ...) do {} while (0)
     19#endif
    1320
    1421static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
     
    108115
    109116#ifdef DEBUG_ALLOC
    110 static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
     117static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice)
     118{
    111119        int i;
    112         char *str = "x.24";
    113 
    114         printk(KERN_DEBUG "time %.5i: %s [%.2i]: ", opl3->use_time, s, voice);
     120        const char *str = "x.24";
     121        char buf[MAX_OPL3_VOICES + 1];
     122
    115123        for (i = 0; i < opl3->max_voices; i++)
    116                 printk(KERN_CONT "%c", *(str + opl3->voices[i].state + 1));
    117         printk(KERN_CONT "\n");
     124                buf[i] = str[opl3->voices[i].state + 1];
     125        buf[i] = 0;
     126        dev_dbg(opl3->card->dev, "time %.5i: %s [%.2i]: %s\n",
     127                opl3->use_time, s, voice, buf);
    118128}
    119129#endif
     
    204214                if (best[i].voice >= 0) {
    205215#ifdef DEBUG_ALLOC
    206                         printk(KERN_DEBUG "%s %iop allocation on voice %i\n",
     216                        dev_dbg(opl3->card->dev,
     217                                "%s %iop allocation on voice %i\n",
    207218                               alloc_type[i], instr_4op ? 4 : 2,
    208219                               best[i].voice);
     
    306317        opl3 = p;
    307318
    308 #ifdef DEBUG_MIDI
    309         snd_printk(KERN_DEBUG "Note on, ch %i, inst %i, note %i, vel %i\n",
     319        opl3_dbg(opl3, "Note on, ch %i, inst %i, note %i, vel %i\n",
    310320                   chan->number, chan->midi_program, note, vel);
    311 #endif
    312321
    313322        /* in SYNTH mode, application takes care of voices */
     
    362371                return;
    363372        }
    364 #ifdef DEBUG_MIDI
    365         snd_printk(KERN_DEBUG "  --> OPL%i instrument: %s\n",
     373        opl3_dbg(opl3, "  --> OPL%i instrument: %s\n",
    366374                   instr_4op ? 3 : 2, patch->name);
    367 #endif
    368375        /* in SYNTH mode, application takes care of voices */
    369376        /* in SEQ mode, allocate voice on free OPL3 channel */
     
    426433        }
    427434
    428 #ifdef DEBUG_MIDI
    429         snd_printk(KERN_DEBUG "  --> setting OPL3 connection: 0x%x\n",
     435        opl3_dbg(opl3, "  --> setting OPL3 connection: 0x%x\n",
    430436                   opl3->connection_reg);
    431 #endif
    432437        /*
    433438         * calculate volume depending on connection
     
    461466        /* Program the FM voice characteristics */
    462467        for (i = 0; i < (instr_4op ? 4 : 2); i++) {
    463 #ifdef DEBUG_MIDI
    464                 snd_printk(KERN_DEBUG "  --> programming operator %i\n", i);
    465 #endif
     468                opl3_dbg(opl3, "  --> programming operator %i\n", i);
    466469                op_offset = snd_opl3_regmap[voice_offset][i];
    467470
     
    541544        blocknum |= OPL3_KEYON_BIT;
    542545
    543 #ifdef DEBUG_MIDI
    544         snd_printk(KERN_DEBUG "  --> trigger voice %i\n", voice);
    545 #endif
     546        opl3_dbg(opl3, "  --> trigger voice %i\n", voice);
    546547        /* Set OPL3 KEYON_BLOCK register of requested voice */
    547548        opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);
     
    597598                        prg = extra_prg - 1;
    598599                }
    599 #ifdef DEBUG_MIDI
    600                 snd_printk(KERN_DEBUG " *** allocating extra program\n");
    601 #endif
     600                opl3_dbg(opl3, " *** allocating extra program\n");
    602601                goto __extra_prg;
    603602        }
     
    628627
    629628        /* kill voice */
    630 #ifdef DEBUG_MIDI
    631         snd_printk(KERN_DEBUG "  --> kill voice %i\n", voice);
    632 #endif
     629        opl3_dbg(opl3, "  --> kill voice %i\n", voice);
    633630        opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK + voice_offset);
    634631        /* clear Key ON bit */
     
    664661        opl3 = p;
    665662
    666 #ifdef DEBUG_MIDI
    667         snd_printk(KERN_DEBUG "Note off, ch %i, inst %i, note %i\n",
     663        opl3_dbg(opl3, "Note off, ch %i, inst %i, note %i\n",
    668664                   chan->number, chan->midi_program, note);
    669 #endif
    670665
    671666        if (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {
     
    707702void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
    708703{
    709 #ifdef DEBUG_MIDI
    710         snd_printk(KERN_DEBUG "Key pressure, ch#: %i, inst#: %i\n",
     704        opl3_dbg(p, "Key pressure, ch#: %i, inst#: %i\n",
    711705                   chan->number, chan->midi_program);
    712 #endif
    713706}
    714707
     
    718711void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)
    719712{
    720 #ifdef DEBUG_MIDI
    721         snd_printk(KERN_DEBUG "Terminate note, ch#: %i, inst#: %i\n",
     713        opl3_dbg(p, "Terminate note, ch#: %i, inst#: %i\n",
    722714                   chan->number, chan->midi_program);
    723 #endif
    724715}
    725716
     
    807798
    808799        opl3 = p;
    809 #ifdef DEBUG_MIDI
    810         snd_printk(KERN_DEBUG "Controller, TYPE = %i, ch#: %i, inst#: %i\n",
     800        opl3_dbg(opl3, "Controller, TYPE = %i, ch#: %i, inst#: %i\n",
    811801                   type, chan->number, chan->midi_program);
    812 #endif
    813802
    814803        switch (type) {
     
    841830                   struct snd_midi_channel_set *chset)
    842831{
    843 #ifdef DEBUG_MIDI
    844         snd_printk(KERN_DEBUG "NRPN, ch#: %i, inst#: %i\n",
     832        opl3_dbg(p, "NRPN, ch#: %i, inst#: %i\n",
    845833                   chan->number, chan->midi_program);
    846 #endif
    847834}
    848835
     
    853840                    int parsed, struct snd_midi_channel_set *chset)
    854841{
    855 #ifdef DEBUG_MIDI
    856         snd_printk(KERN_DEBUG "SYSEX\n");
    857 #endif
    858 }
     842        opl3_dbg(p, "SYSEX\n");
     843}
  • GPL/trunk/alsa-kernel/drivers/opl3/opl3_synth.c

    r695 r777  
    159159#endif
    160160
    161 #ifdef CONFIG_SND_DEBUG
    162161        default:
    163                 snd_printk(KERN_WARNING "unknown IOCTL: 0x%x\n", cmd);
    164 #endif
     162                dev_dbg(opl3->card->dev, "unknown IOCTL: 0x%x\n", cmd);
    165163        }
    166164        return -ENOTTY;
Note: See TracChangeset for help on using the changeset viewer.