aboutsummaryrefslogtreecommitdiff
path: root/hw/marvell_88w8618_audio.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-09-18 20:51:23 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:43 -0500
commit49fedd0d64b702d4fce8fe8c545197270b6f28dd (patch)
tree8e28caa62384681acee3baf4e23d0c0f8caf094f /hw/marvell_88w8618_audio.c
parent243cd13ca99858aacbaa401771ca77b00bd3082f (diff)
musicpal: Coding style fixes
Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/marvell_88w8618_audio.c')
-rw-r--r--hw/marvell_88w8618_audio.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/hw/marvell_88w8618_audio.c b/hw/marvell_88w8618_audio.c
index 1c68da3c7b..d6c14c62cd 100644
--- a/hw/marvell_88w8618_audio.c
+++ b/hw/marvell_88w8618_audio.c
@@ -58,22 +58,22 @@ static void mv88w8618_audio_callback(void *opaque, int free_out, int free_in)
int8_t *mem_buffer;
int pos, block_size;
- if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN))
+ if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN)) {
return;
-
- if (s->playback_mode & MP_AUDIO_16BIT_SAMPLE)
+ }
+ if (s->playback_mode & MP_AUDIO_16BIT_SAMPLE) {
free_out <<= 1;
-
- if (!(s->playback_mode & MP_AUDIO_MONO))
+ }
+ if (!(s->playback_mode & MP_AUDIO_MONO)) {
free_out <<= 1;
-
+ }
block_size = s->threshold / 2;
- if (free_out - s->last_free < block_size)
+ if (free_out - s->last_free < block_size) {
return;
-
- if (block_size > 4096)
+ }
+ if (block_size > 4096) {
return;
-
+ }
cpu_physical_memory_read(s->target_buffer + s->play_pos, (void *)buf,
block_size);
mem_buffer = buf;
@@ -85,9 +85,10 @@ static void mv88w8618_audio_callback(void *opaque, int free_out, int free_in)
*codec_buffer++ = *(int16_t *)mem_buffer;
mem_buffer += 2;
}
- } else
+ } else {
memcpy(wm8750_dac_buffer(s->wm, block_size >> 2),
(uint32_t *)mem_buffer, block_size);
+ }
} else {
if (s->playback_mode & MP_AUDIO_MONO) {
codec_buffer = wm8750_dac_buffer(s->wm, block_size);
@@ -115,19 +116,20 @@ static void mv88w8618_audio_callback(void *opaque, int free_out, int free_in)
s->play_pos = 0;
}
- if (s->status & s->irq_enable)
+ if (s->status & s->irq_enable) {
qemu_irq_raise(s->irq);
+ }
}
static void mv88w8618_audio_clock_update(mv88w8618_audio_state *s)
{
int rate;
- if (s->playback_mode & MP_AUDIO_CLOCK_24MHZ)
+ if (s->playback_mode & MP_AUDIO_CLOCK_24MHZ) {
rate = 24576000 / 64; /* 24.576MHz */
- else
+ } else {
rate = 11289600 / 64; /* 11.2896MHz */
-
+ }
rate /= ((s->clock_div >> 8) & 0xff) + 1;
wm8750_set_bclk_in(s->wm, rate);
@@ -188,8 +190,9 @@ static void mv88w8618_audio_write(void *opaque, target_phys_addr_t offset,
case MP_AUDIO_IRQ_ENABLE:
s->irq_enable = value;
- if (s->status & s->irq_enable)
+ if (s->status & s->irq_enable) {
qemu_irq_raise(s->irq);
+ }
break;
case MP_AUDIO_TX_START_LO: