ASoC: tlv320aic32x4: Fix mono playback

Playback of a mono stream should output the same stream on both
channels. At the moment only the left analog signal is valid, the right
one is just noise.

This patch maps the left digital channel onto both DACs when receiving a
mono stream.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by Markus Pargmann and committed by Mark Brown b44aa40f 7552f34a

+12 -7
+11 -7
sound/soc/codecs/tlv320aic32x4.c
··· 450 450 } 451 451 snd_soc_write(codec, AIC32X4_IFACE1, data); 452 452 453 + if (params_channels(params) == 1) { 454 + data = AIC32X4_RDAC2LCHN | AIC32X4_LDAC2LCHN; 455 + } else { 456 + if (aic32x4->swapdacs) 457 + data = AIC32X4_RDAC2LCHN | AIC32X4_LDAC2RCHN; 458 + else 459 + data = AIC32X4_LDAC2LCHN | AIC32X4_RDAC2RCHN; 460 + } 461 + snd_soc_update_bits(codec, AIC32X4_DACSETUP, AIC32X4_DAC_CHAN_MASK, 462 + data); 463 + 453 464 return 0; 454 465 } 455 466 ··· 616 605 tmp_reg |= AIC32X4_LDOIN2HP; 617 606 } 618 607 snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg); 619 - 620 - /* Do DACs need to be swapped? */ 621 - if (aic32x4->swapdacs) { 622 - snd_soc_write(codec, AIC32X4_DACSETUP, AIC32X4_LDAC2RCHN | AIC32X4_RDAC2LCHN); 623 - } else { 624 - snd_soc_write(codec, AIC32X4_DACSETUP, AIC32X4_LDAC2LCHN | AIC32X4_RDAC2RCHN); 625 - } 626 608 627 609 /* Mic PGA routing */ 628 610 if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K) {
+1
sound/soc/codecs/tlv320aic32x4.h
··· 138 138 #define AIC32X4_LDAC2RCHN (0x02 << 4) 139 139 #define AIC32X4_LDAC2LCHN (0x01 << 4) 140 140 #define AIC32X4_RDAC2RCHN (0x01 << 2) 141 + #define AIC32X4_DAC_CHAN_MASK 0x3c 141 142 142 143 #define AIC32X4_SSTEP2WCLK 0x01 143 144 #define AIC32X4_MUTEON 0x0C