CS423x: CS4235 only supports PCM 8 and 16LE formats

This commit is contained in:
RichardG867
2022-03-07 21:39:31 -03:00
parent d0cf4bc157
commit 00a0a0c981
2 changed files with 7 additions and 3 deletions

View File

@@ -262,7 +262,8 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv)
break;
case 17:
if (ad1848->type >= AD1848_TYPE_CS4231) /* enable additional data formats on modes 2 and 3 */
/* Enable additional data formats on modes 2 and 3 where supported. */
if ((ad1848->type == AD1848_TYPE_CS4231) || (ad1848->type == AD1848_TYPE_CS4236))
ad1848->fmt_mask = (val & 0x40) ? 0xf0 : 0x70;
break;
@@ -659,7 +660,10 @@ ad1848_init(ad1848_t *ad1848, uint8_t type)
ad1848->out_l = ad1848->out_r = 0;
ad1848->fm_vol_l = ad1848->fm_vol_r = 65536;
ad1848_updatevolmask(ad1848);
ad1848->fmt_mask = 0x70;
if (type == AD1848_TYPE_CS4235)
ad1848->fmt_mask = 0x50;
else
ad1848->fmt_mask = 0x70;
for (c = 0; c < 128; c++) {
attenuation = 0.0;

View File

@@ -727,7 +727,7 @@ cs423x_init(const device_t *info)
case CRYSTAL_CS4237B:
case CRYSTAL_CS4238B:
/* Same WSS codec and EEPROM structure. */
dev->ad1848_type = AD1848_TYPE_CS4236;
dev->ad1848_type = (dev->type == CRYSTAL_CS4235) ? AD1848_TYPE_CS4235 : AD1848_TYPE_CS4236;
dev->pnp_offset = 0x4013;
/* Different Chip Version and ID registers, which shouldn't be reset by ad1848_init */