aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/blackfin/bf5xx-tdm-pcm.c4
-rw-r--r--sound/soc/blackfin/bf5xx-tdm-pcm.h2
-rw-r--r--sound/soc/blackfin/bf5xx-tdm.h2
-rw-r--r--sound/soc/codecs/ad1938.c50
4 files changed, 37 insertions, 21 deletions
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c
index af7fa8d7ff0d..ccb5e823bd18 100644
--- a/sound/soc/blackfin/bf5xx-tdm-pcm.c
+++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c
@@ -276,7 +276,7 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
276 sport_done(sport_handle); 276 sport_done(sport_handle);
277} 277}
278 278
279static u64 bf5xx_pcm_dmamask = DMA_32BIT_MASK; 279static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
280 280
281static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai, 281static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai,
282 struct snd_pcm *pcm) 282 struct snd_pcm *pcm)
@@ -286,7 +286,7 @@ static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai,
286 if (!card->dev->dma_mask) 286 if (!card->dev->dma_mask)
287 card->dev->dma_mask = &bf5xx_pcm_dmamask; 287 card->dev->dma_mask = &bf5xx_pcm_dmamask;
288 if (!card->dev->coherent_dma_mask) 288 if (!card->dev->coherent_dma_mask)
289 card->dev->coherent_dma_mask = DMA_32BIT_MASK; 289 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
290 290
291 if (dai->playback.channels_min) { 291 if (dai->playback.channels_min) {
292 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 292 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.h b/sound/soc/blackfin/bf5xx-tdm-pcm.h
index 9e8473d1c389..ddc5047df88c 100644
--- a/sound/soc/blackfin/bf5xx-tdm-pcm.h
+++ b/sound/soc/blackfin/bf5xx-tdm-pcm.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/sound/arm/bf5xx-tdm-pcm.h -- ALSA PCM interface for the Blackfin 2 * sound/soc/blackfin/bf5xx-tdm-pcm.h -- ALSA PCM interface for the Blackfin
3 * 3 *
4 * Copyright 2009 Analog Device Inc. 4 * Copyright 2009 Analog Device Inc.
5 * 5 *
diff --git a/sound/soc/blackfin/bf5xx-tdm.h b/sound/soc/blackfin/bf5xx-tdm.h
index e5157cd81c5e..618ec3d90cd4 100644
--- a/sound/soc/blackfin/bf5xx-tdm.h
+++ b/sound/soc/blackfin/bf5xx-tdm.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/sound/arm/bf5xx-i2s.h 2 * sound/soc/blackfin/bf5xx-tdm.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
diff --git a/sound/soc/codecs/ad1938.c b/sound/soc/codecs/ad1938.c
index ffc97c9b797f..aafda743fc8f 100644
--- a/sound/soc/codecs/ad1938.c
+++ b/sound/soc/codecs/ad1938.c
@@ -72,14 +72,20 @@ static const struct snd_kcontrol_new ad1938_snd_controls[] = {
72 AD1938_DAC_R4_VOL, 0, 0xFF, 1), 72 AD1938_DAC_R4_VOL, 0, 0xFF, 1),
73 73
74 /* ADC switch control */ 74 /* ADC switch control */
75 SOC_DOUBLE("ADC1 Switch", AD1938_ADC_CTRL0, AD1938_ADCL1_MUTE, AD1938_ADCR1_MUTE, 1, 1), 75 SOC_DOUBLE("ADC1 Switch", AD1938_ADC_CTRL0, AD1938_ADCL1_MUTE,
76 SOC_DOUBLE("ADC2 Switch", AD1938_ADC_CTRL0, AD1938_ADCL2_MUTE, AD1938_ADCR2_MUTE, 1, 1), 76 AD1938_ADCR1_MUTE, 1, 1),
77 SOC_DOUBLE("ADC2 Switch", AD1938_ADC_CTRL0, AD1938_ADCL2_MUTE,
78 AD1938_ADCR2_MUTE, 1, 1),
77 79
78 /* DAC switch control */ 80 /* DAC switch control */
79 SOC_DOUBLE("DAC1 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL1_MUTE, AD1938_DACR1_MUTE, 1, 1), 81 SOC_DOUBLE("DAC1 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL1_MUTE,
80 SOC_DOUBLE("DAC2 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL2_MUTE, AD1938_DACR2_MUTE, 1, 1), 82 AD1938_DACR1_MUTE, 1, 1),
81 SOC_DOUBLE("DAC3 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL3_MUTE, AD1938_DACR3_MUTE, 1, 1), 83 SOC_DOUBLE("DAC2 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL2_MUTE,
82 SOC_DOUBLE("DAC4 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL4_MUTE, AD1938_DACR4_MUTE, 1, 1), 84 AD1938_DACR2_MUTE, 1, 1),
85 SOC_DOUBLE("DAC3 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL3_MUTE,
86 AD1938_DACR3_MUTE, 1, 1),
87 SOC_DOUBLE("DAC4 Switch", AD1938_DAC_CHNL_MUTE, AD1938_DACL4_MUTE,
88 AD1938_DACR4_MUTE, 1, 1),
83 89
84 /* ADC high-pass filter */ 90 /* ADC high-pass filter */
85 SOC_SINGLE("ADC High Pass Filter Switch", AD1938_ADC_CTRL0, 91 SOC_SINGLE("ADC High Pass Filter Switch", AD1938_ADC_CTRL0,
@@ -110,7 +116,8 @@ static int ad1938_mute(struct snd_soc_dai *dai, int mute)
110 int reg; 116 int reg;
111 117
112 reg = codec->read(codec, AD1938_DAC_CTRL2); 118 reg = codec->read(codec, AD1938_DAC_CTRL2);
113 reg = (mute > 0) ? reg | AD1938_DAC_MASTER_MUTE : reg & (~AD1938_DAC_MASTER_MUTE); 119 reg = (mute > 0) ? reg | AD1938_DAC_MASTER_MUTE : reg &
120 (~AD1938_DAC_MASTER_MUTE);
114 codec->write(codec, AD1938_DAC_CTRL2, reg); 121 codec->write(codec, AD1938_DAC_CTRL2, reg);
115 122
116 return 0; 123 return 0;
@@ -119,7 +126,8 @@ static int ad1938_mute(struct snd_soc_dai *dai, int mute)
119static inline int ad1938_pll_powerctrl(struct snd_soc_codec *codec, int cmd) 126static inline int ad1938_pll_powerctrl(struct snd_soc_codec *codec, int cmd)
120{ 127{
121 int reg = codec->read(codec, AD1938_PLL_CLK_CTRL0); 128 int reg = codec->read(codec, AD1938_PLL_CLK_CTRL0);
122 reg = (cmd > 0) ? reg & (~AD1938_PLL_POWERDOWN) : reg | AD1938_PLL_POWERDOWN; 129 reg = (cmd > 0) ? reg & (~AD1938_PLL_POWERDOWN) : reg |
130 AD1938_PLL_POWERDOWN;
123 codec->write(codec, AD1938_PLL_CLK_CTRL0, reg); 131 codec->write(codec, AD1938_PLL_CLK_CTRL0, reg);
124 132
125 return 0; 133 return 0;
@@ -171,8 +179,8 @@ static int ad1938_set_dai_fmt(struct snd_soc_dai *codec_dai,
171 adc_reg = codec->read(codec, AD1938_ADC_CTRL2); 179 adc_reg = codec->read(codec, AD1938_ADC_CTRL2);
172 dac_reg = codec->read(codec, AD1938_DAC_CTRL1); 180 dac_reg = codec->read(codec, AD1938_DAC_CTRL1);
173 181
174 /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S with TDM) 182 /* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S
175 * and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) 183 * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A)
176 */ 184 */
177 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 185 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
178 case SND_SOC_DAIFMT_I2S: 186 case SND_SOC_DAIFMT_I2S:
@@ -363,7 +371,8 @@ static unsigned int ad1938_read_reg_cache(struct snd_soc_codec *codec,
363 * read from the ad1938 register space 371 * read from the ad1938 register space
364 */ 372 */
365 373
366static unsigned int ad1938_read_reg(struct snd_soc_codec *codec, unsigned int reg) 374static unsigned int ad1938_read_reg(struct snd_soc_codec *codec,
375 unsigned int reg)
367{ 376{
368 char w_buf[AD1938_SPI_BUFLEN]; 377 char w_buf[AD1938_SPI_BUFLEN];
369 char r_buf[AD1938_SPI_BUFLEN]; 378 char r_buf[AD1938_SPI_BUFLEN];
@@ -502,12 +511,19 @@ static int ad1938_register(struct ad1938_priv *ad1938)
502 ad1938_codec = codec; 511 ad1938_codec = codec;
503 512
504 /* default setting for ad1938 */ 513 /* default setting for ad1938 */
505 codec->write(codec, AD1938_DAC_CHNL_MUTE, 0x0); /* unmute dac channels */ 514
506 codec->write(codec, AD1938_DAC_CTRL2, 0x1A); /* de-emphasis: 48kHz, powedown dac */ 515 /* unmute dac channels */
507 codec->write(codec, AD1938_DAC_CTRL0, 0x21); /* powerdown dac, dac tdm mode */ 516 codec->write(codec, AD1938_DAC_CHNL_MUTE, 0x0);
508 codec->write(codec, AD1938_ADC_CTRL0, 0x3); /* high-pass filter enable */ 517 /* de-emphasis: 48kHz, powedown dac */
509 codec->write(codec, AD1938_ADC_CTRL1, 0x43); /* sata delay=1, adc aux mode */ 518 codec->write(codec, AD1938_DAC_CTRL2, 0x1A);
510 codec->write(codec, AD1938_PLL_CLK_CTRL0, 0x9D); /* pll input:mclki/xi */ 519 /* powerdown dac, dac in tdm mode */
520 codec->write(codec, AD1938_DAC_CTRL0, 0x41);
521 /* high-pass filter enable */
522 codec->write(codec, AD1938_ADC_CTRL0, 0x3);
523 /* sata delay=1, adc aux mode */
524 codec->write(codec, AD1938_ADC_CTRL1, 0x43);
525 /* pll input: mclki/xi */
526 codec->write(codec, AD1938_PLL_CLK_CTRL0, 0x9D);
511 codec->write(codec, AD1938_PLL_CLK_CTRL1, 0x04); 527 codec->write(codec, AD1938_PLL_CLK_CTRL1, 0x04);
512 528
513 ad1938_fill_cache(codec); 529 ad1938_fill_cache(codec);