aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2012-01-18 05:48:58 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-20 08:54:33 -0500
commit01b37e94c04bc6dae2c4837a2eb6fff6819ea82a (patch)
tree01ec6ed0b44518856b6b8537ede3eea7926250d4 /sound
parentbb362e2e4f4874f3fd4cbc2497385b9bceb3a08a (diff)
ASoC: tlv320aic32x4: always enable dividers
Dividers (such as MDAC) are always needed, independent of the codec being I2S master or slave. Needed on a custom board where the codec has to be slave. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c102
1 files changed, 46 insertions, 56 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index eb401ef021fb..3806cb6d9d4d 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -60,7 +60,6 @@ struct aic32x4_rate_divs {
60 60
61struct aic32x4_priv { 61struct aic32x4_priv {
62 u32 sysclk; 62 u32 sysclk;
63 s32 master;
64 u8 page_no; 63 u8 page_no;
65 void *control_data; 64 void *control_data;
66 u32 power_cfg; 65 u32 power_cfg;
@@ -369,7 +368,6 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
369static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 368static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
370{ 369{
371 struct snd_soc_codec *codec = codec_dai->codec; 370 struct snd_soc_codec *codec = codec_dai->codec;
372 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
373 u8 iface_reg_1; 371 u8 iface_reg_1;
374 u8 iface_reg_2; 372 u8 iface_reg_2;
375 u8 iface_reg_3; 373 u8 iface_reg_3;
@@ -384,11 +382,9 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
384 /* set master/slave audio interface */ 382 /* set master/slave audio interface */
385 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 383 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
386 case SND_SOC_DAIFMT_CBM_CFM: 384 case SND_SOC_DAIFMT_CBM_CFM:
387 aic32x4->master = 1;
388 iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER; 385 iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER;
389 break; 386 break;
390 case SND_SOC_DAIFMT_CBS_CFS: 387 case SND_SOC_DAIFMT_CBS_CFS:
391 aic32x4->master = 0;
392 break; 388 break;
393 default: 389 default:
394 printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n"); 390 printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n");
@@ -526,64 +522,58 @@ static int aic32x4_mute(struct snd_soc_dai *dai, int mute)
526static int aic32x4_set_bias_level(struct snd_soc_codec *codec, 522static int aic32x4_set_bias_level(struct snd_soc_codec *codec,
527 enum snd_soc_bias_level level) 523 enum snd_soc_bias_level level)
528{ 524{
529 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
530
531 switch (level) { 525 switch (level) {
532 case SND_SOC_BIAS_ON: 526 case SND_SOC_BIAS_ON:
533 if (aic32x4->master) { 527 /* Switch on PLL */
534 /* Switch on PLL */ 528 snd_soc_update_bits(codec, AIC32X4_PLLPR,
535 snd_soc_update_bits(codec, AIC32X4_PLLPR, 529 AIC32X4_PLLEN, AIC32X4_PLLEN);
536 AIC32X4_PLLEN, AIC32X4_PLLEN); 530
537 531 /* Switch on NDAC Divider */
538 /* Switch on NDAC Divider */ 532 snd_soc_update_bits(codec, AIC32X4_NDAC,
539 snd_soc_update_bits(codec, AIC32X4_NDAC, 533 AIC32X4_NDACEN, AIC32X4_NDACEN);
540 AIC32X4_NDACEN, AIC32X4_NDACEN); 534
541 535 /* Switch on MDAC Divider */
542 /* Switch on MDAC Divider */ 536 snd_soc_update_bits(codec, AIC32X4_MDAC,
543 snd_soc_update_bits(codec, AIC32X4_MDAC, 537 AIC32X4_MDACEN, AIC32X4_MDACEN);
544 AIC32X4_MDACEN, AIC32X4_MDACEN); 538
545 539 /* Switch on NADC Divider */
546 /* Switch on NADC Divider */ 540 snd_soc_update_bits(codec, AIC32X4_NADC,
547 snd_soc_update_bits(codec, AIC32X4_NADC, 541 AIC32X4_NADCEN, AIC32X4_NADCEN);
548 AIC32X4_NADCEN, AIC32X4_NADCEN); 542
549 543 /* Switch on MADC Divider */
550 /* Switch on MADC Divider */ 544 snd_soc_update_bits(codec, AIC32X4_MADC,
551 snd_soc_update_bits(codec, AIC32X4_MADC, 545 AIC32X4_MADCEN, AIC32X4_MADCEN);
552 AIC32X4_MADCEN, AIC32X4_MADCEN); 546
553 547 /* Switch on BCLK_N Divider */
554 /* Switch on BCLK_N Divider */ 548 snd_soc_update_bits(codec, AIC32X4_BCLKN,
555 snd_soc_update_bits(codec, AIC32X4_BCLKN, 549 AIC32X4_BCLKEN, AIC32X4_BCLKEN);
556 AIC32X4_BCLKEN, AIC32X4_BCLKEN);
557 }
558 break; 550 break;
559 case SND_SOC_BIAS_PREPARE: 551 case SND_SOC_BIAS_PREPARE:
560 break; 552 break;
561 case SND_SOC_BIAS_STANDBY: 553 case SND_SOC_BIAS_STANDBY:
562 if (aic32x4->master) { 554 /* Switch off PLL */
563 /* Switch off PLL */ 555 snd_soc_update_bits(codec, AIC32X4_PLLPR,
564 snd_soc_update_bits(codec, AIC32X4_PLLPR, 556 AIC32X4_PLLEN, 0);
565 AIC32X4_PLLEN, 0); 557
566 558 /* Switch off NDAC Divider */
567 /* Switch off NDAC Divider */ 559 snd_soc_update_bits(codec, AIC32X4_NDAC,
568 snd_soc_update_bits(codec, AIC32X4_NDAC, 560 AIC32X4_NDACEN, 0);
569 AIC32X4_NDACEN, 0); 561
570 562 /* Switch off MDAC Divider */
571 /* Switch off MDAC Divider */ 563 snd_soc_update_bits(codec, AIC32X4_MDAC,
572 snd_soc_update_bits(codec, AIC32X4_MDAC, 564 AIC32X4_MDACEN, 0);
573 AIC32X4_MDACEN, 0); 565
574 566 /* Switch off NADC Divider */
575 /* Switch off NADC Divider */ 567 snd_soc_update_bits(codec, AIC32X4_NADC,
576 snd_soc_update_bits(codec, AIC32X4_NADC, 568 AIC32X4_NADCEN, 0);
577 AIC32X4_NADCEN, 0); 569
578 570 /* Switch off MADC Divider */
579 /* Switch off MADC Divider */ 571 snd_soc_update_bits(codec, AIC32X4_MADC,
580 snd_soc_update_bits(codec, AIC32X4_MADC, 572 AIC32X4_MADCEN, 0);
581 AIC32X4_MADCEN, 0); 573
582 574 /* Switch off BCLK_N Divider */
583 /* Switch off BCLK_N Divider */ 575 snd_soc_update_bits(codec, AIC32X4_BCLKN,
584 snd_soc_update_bits(codec, AIC32X4_BCLKN, 576 AIC32X4_BCLKEN, 0);
585 AIC32X4_BCLKEN, 0);
586 }
587 break; 577 break;
588 case SND_SOC_BIAS_OFF: 578 case SND_SOC_BIAS_OFF:
589 break; 579 break;