mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
Use external clock in wm8750 slave mode.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4325 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
762abf6774
commit
af83e09e9e
3 changed files with 57 additions and 9 deletions
|
@ -298,6 +298,20 @@ static void audio_callback(void *opaque, int free_out, int free_in)
|
|||
qemu_irq_raise(s->irq);
|
||||
}
|
||||
|
||||
static void musicpal_audio_clock_update(musicpal_audio_state *s)
|
||||
{
|
||||
int rate;
|
||||
|
||||
if (s->playback_mode & MP_AUDIO_CLOCK_24MHZ)
|
||||
rate = 24576000 / 64; /* 24.576MHz */
|
||||
else
|
||||
rate = 11289600 / 64; /* 11.2896MHz */
|
||||
|
||||
rate /= ((s->clock_div >> 8) & 0xff) + 1;
|
||||
|
||||
wm8750_set_bclk_in(s->wm, rate / 2);
|
||||
}
|
||||
|
||||
static uint32_t musicpal_audio_read(void *opaque, target_phys_addr_t offset)
|
||||
{
|
||||
musicpal_audio_state *s = opaque;
|
||||
|
@ -339,12 +353,14 @@ static void musicpal_audio_write(void *opaque, target_phys_addr_t offset,
|
|||
s->play_pos = 0;
|
||||
}
|
||||
s->playback_mode = value;
|
||||
musicpal_audio_clock_update(s);
|
||||
break;
|
||||
|
||||
case MP_AUDIO_CLOCK_DIV:
|
||||
s->clock_div = value;
|
||||
s->last_free = 0;
|
||||
s->play_pos = 0;
|
||||
musicpal_audio_clock_update(s);
|
||||
break;
|
||||
|
||||
case MP_AUDIO_IRQ_STATUS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue