Skip to content

Commit d2aee8a

Browse files
joevtdingusdev
authored andcommitted
awacs: Fix "Add stubs for missing AWACS regs".
1 parent 3da972d commit d2aee8a

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

devices/sound/awacs.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,28 +185,34 @@ int AwacsScreamer::device_postinit() {
185185
}
186186

187187
uint32_t AwacsScreamer::snd_ctrl_read(uint32_t offset, int size) {
188-
uint32_t return_val = 0;
188+
uint32_t value;
189189

190190
switch (offset) {
191191
case AWAC_SOUND_CTRL_REG:
192-
return this->snd_ctrl_reg;
192+
value = this->snd_ctrl_reg;
193+
break;
193194
case AWAC_CODEC_CTRL_REG:
194-
return this->is_busy;
195+
value = this->is_busy;
196+
break;
195197
case AWAC_CODEC_STATUS_REG:
196-
return (AWAC_AVAILABLE << 8) | (AWAC_MAKER_CRYSTAL << 16) | (AWAC_REV_SCREAMER << 20);
198+
value = (AWAC_AVAILABLE << 8) | (AWAC_MAKER_CRYSTAL << 16) | (AWAC_REV_SCREAMER << 20);
199+
break;
197200
case AWAC_CLIP_COUNT:
198-
return_val = this->clip_count;
199-
this->clip_count = 0;
200-
return return_val;
201+
value = this->clip_count;
202+
this->clip_count = 0;
203+
break;
201204
case AWAC_BYTE_SWAP:
202-
return this->byte_swap ? 0 : 1;
205+
value = this->byte_swap ? 0 : 1;
206+
break;
203207
case AWAC_FRAME_COUNT:
204-
return this->frame_count;
208+
value = this->frame_count;
209+
break;
205210
default:
206211
LOG_F(ERROR, "%s: unsupported register at offset 0x%X", this->name.c_str(), offset);
212+
value = 0;
207213
}
208214

209-
return 0;
215+
return value;
210216
}
211217

212218
void AwacsScreamer::snd_ctrl_write(uint32_t offset, uint32_t value, int size) {
@@ -229,10 +235,13 @@ void AwacsScreamer::snd_ctrl_write(uint32_t offset, uint32_t value, int size) {
229235
break;
230236
case AWAC_CLIP_COUNT:
231237
this->clip_count = BYTESWAP_32(value);
238+
break;
232239
case AWAC_BYTE_SWAP:
233240
this->byte_swap = BYTESWAP_32(value);
241+
break;
234242
case AWAC_FRAME_COUNT:
235243
this->frame_count = BYTESWAP_32(value);
244+
break;
236245
default:
237246
LOG_F(ERROR, "%s: unsupported register at offset 0x%X", this->name.c_str(),
238247
offset);

devices/sound/awacs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class AwacsScreamer : public MacioSndCodec {
188188
private:
189189
uint32_t snd_ctrl_reg = 0;
190190
uint16_t control_regs[8] = {}; // control registers, each 12-bits wide
191-
uint8_t is_busy = 0;
191+
uint8_t is_busy = 0;
192192
uint32_t clip_count = 0;
193193
uint32_t byte_swap = 0;
194194
uint32_t frame_count = 0;

0 commit comments

Comments
 (0)