diff options
Diffstat (limited to 'sound/isa/sb')
-rw-r--r-- | sound/isa/sb/emu8000.c | 15 | ||||
-rw-r--r-- | sound/isa/sb/emu8000_callback.c | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 71887874679c..2aae6a0efbcd 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -417,9 +417,6 @@ size_dram(struct snd_emu8000 *emu) EMU8000_SMLD_READ(emu); /* discard stale data */ if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) break; /* no memory at this address */ - - detected_size = size; - snd_emu8000_read_wait(emu); /* @@ -432,6 +429,18 @@ size_dram(struct snd_emu8000 *emu) if (EMU8000_SMLD_READ(emu) != UNIQUE_ID1) break; /* we must have wrapped around */ snd_emu8000_read_wait(emu); + + /* Otherwise, it's valid memory. */ + detected_size = size + 512 * 1024; + } + + /* Distinguish 512 KiB from 0. */ + if (detected_size == 0) { + snd_emu8000_read_wait(emu); + EMU8000_SMALR_WRITE(emu, EMU8000_DRAM_OFFSET); + EMU8000_SMLD_READ(emu); /* discard stale data */ + if (EMU8000_SMLD_READ(emu) == UNIQUE_ID1) + detected_size = 512 * 1024; } /* wait until FULL bit in SMAxW register is false */ diff --git a/sound/isa/sb/emu8000_callback.c b/sound/isa/sb/emu8000_callback.c index 344b4355be1c..72a9ac5efb40 100644 --- a/sound/isa/sb/emu8000_callback.c +++ b/sound/isa/sb/emu8000_callback.c @@ -175,7 +175,7 @@ get_voice(struct snd_emux *emu, struct snd_emux_port *port) hw = emu->hw; for (i = 0; i < END; i++) { - best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */; + best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */ best[i].voice = -1; } |