aboutsummaryrefslogtreecommitdiff
path: root/hw/audio/es1370.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-08-24 17:03:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-10-02 18:47:55 +0200
commitcf9270e5220671f49cc238deaf6136669cc07ae1 (patch)
tree9fae4fb599fa03e18052627372a658d2391c69c5 /hw/audio/es1370.c
parent07d66672e7035dd24dbe8ee009847a8ceae1178d (diff)
es1370: fix ADC_FRAMEADR and ADC_FRAMECNT
They are not consecutive with DAC1_FRAME* and DAC2_FRAME*. Fixes: 154c1d1f960c5147a3f8ef00907504112f271cd8 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/audio/es1370.c')
-rw-r--r--hw/audio/es1370.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index dd75c9e8f5..4f980a598b 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -506,10 +506,13 @@ static void es1370_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
d - &s->chan[0], val >> 16, (val & 0xffff));
break;
+ case ES1370_REG_ADC_FRAMEADR:
+ d += 2;
+ goto frameadr;
case ES1370_REG_DAC1_FRAMEADR:
case ES1370_REG_DAC2_FRAMEADR:
- case ES1370_REG_ADC_FRAMEADR:
d += (addr - ES1370_REG_DAC1_FRAMEADR) >> 3;
+ frameadr:
d->frame_addr = val;
ldebug ("chan %td frame address %#x\n", d - &s->chan[0], val);
break;
@@ -521,10 +524,13 @@ static void es1370_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
lwarn ("writing to phantom frame address %#x\n", val);
break;
+ case ES1370_REG_ADC_FRAMECNT:
+ d += 2;
+ goto framecnt;
case ES1370_REG_DAC1_FRAMECNT:
case ES1370_REG_DAC2_FRAMECNT:
- case ES1370_REG_ADC_FRAMECNT:
d += (addr - ES1370_REG_DAC1_FRAMECNT) >> 3;
+ framecnt:
d->frame_cnt = val;
d->leftover = 0;
ldebug ("chan %td frame count %d, buffer size %d\n",