diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic32x4.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index 385dec16eb8a..688151ba309a 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -450,6 +450,17 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream, | |||
450 | } | 450 | } |
451 | snd_soc_write(codec, AIC32X4_IFACE1, data); | 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 | return 0; | 464 | return 0; |
454 | } | 465 | } |
455 | 466 | ||
@@ -606,20 +617,15 @@ static int aic32x4_probe(struct snd_soc_codec *codec) | |||
606 | } | 617 | } |
607 | snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg); | 618 | snd_soc_write(codec, AIC32X4_CMMODE, tmp_reg); |
608 | 619 | ||
609 | /* Do DACs need to be swapped? */ | ||
610 | if (aic32x4->swapdacs) { | ||
611 | snd_soc_write(codec, AIC32X4_DACSETUP, AIC32X4_LDAC2RCHN | AIC32X4_RDAC2LCHN); | ||
612 | } else { | ||
613 | snd_soc_write(codec, AIC32X4_DACSETUP, AIC32X4_LDAC2LCHN | AIC32X4_RDAC2RCHN); | ||
614 | } | ||
615 | |||
616 | /* Mic PGA routing */ | 620 | /* Mic PGA routing */ |
617 | if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K) { | 621 | if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_LMIC_IN2R_10K) |
618 | snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_IN2R_10K); | 622 | snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_IN2R_10K); |
619 | } | 623 | else |
620 | if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K) { | 624 | snd_soc_write(codec, AIC32X4_LMICPGANIN, AIC32X4_LMICPGANIN_CM1L_10K); |
625 | if (aic32x4->micpga_routing & AIC32X4_MICPGA_ROUTE_RMIC_IN1L_10K) | ||
621 | snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_IN1L_10K); | 626 | snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_IN1L_10K); |
622 | } | 627 | else |
628 | snd_soc_write(codec, AIC32X4_RMICPGANIN, AIC32X4_RMICPGANIN_CM1R_10K); | ||
623 | 629 | ||
624 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 630 | aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
625 | 631 | ||