aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 12:25:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-27 12:25:15 -0400
commit75623437167d9d1ef14acaf6b3fb4ccd38fcbc84 (patch)
treeb7136121995cc6c2b5211a5393b1ad7c179a2f3b /sound/soc
parent70a3eff5768350c0313a9ae70a15da113171d0ab (diff)
parent636f78581dbd5529a52057973fe2bdfc1c2f528e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (22 commits) ALSA: hda - Cirrus Logic CS421x support ALSA: Make pcm.h self-contained ALSA: hda - Allow codec-specific set_power_state ops ALSA: hda - Add post_suspend patch ops ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM ALSA: hda - Make sure mute led reflects master mute state ALSA: hda - Fix invalid mute led state on resume of IDT codecs ASoC: Revert "ASoC: SAMSUNG: Add I2S0 internal dma driver" ALSA: hda - Add support of the 4 internal speakers on certain HP laptops ALSA: Make snd_pcm_debug_name usable outside pcm_lib ALSA: hda - Fix DAC filling for multi-connection pins in Realtek parser ASoC: dapm - Add methods to retrieve snd_card and soc_card from dapm context. ASoC: SAMSUNG: Add I2S0 internal dma driver ASoC: SAMSUNG: Modify I2S driver to support idma ASoC: davinci: add missing break statement ASoC: davinci: fix codec start and stop functions ASoC: dapm - add DAPM macro for external enum widgets ASoC: Acknowledge WM8962 interrupts before acting on them ASoC: sgtl5000: guide user when regulator support is needed ASoC: sgtl5000: refactor registering internal ldo ...
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/sgtl5000.c70
-rw-r--r--sound/soc/codecs/wm8962.c6
-rw-r--r--sound/soc/davinci/davinci-vcif.c9
-rw-r--r--sound/soc/samsung/i2s.c7
-rw-r--r--sound/soc/soc-core.c5
-rw-r--r--sound/soc/soc-dapm.c30
6 files changed, 80 insertions, 47 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index ff29380c9ed3..76258f2a2ffb 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -907,6 +907,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
907 struct regulator_init_data *init_data, 907 struct regulator_init_data *init_data,
908 int voltage) 908 int voltage)
909{ 909{
910 dev_err(codec->dev, "this setup needs regulator support in the kernel\n");
910 return -EINVAL; 911 return -EINVAL;
911} 912}
912 913
@@ -1218,6 +1219,34 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
1218 return 0; 1219 return 0;
1219} 1220}
1220 1221
1222static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec)
1223{
1224 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
1225 int ret;
1226
1227 /* set internal ldo to 1.2v */
1228 ret = ldo_regulator_register(codec, &ldo_init_data, LDO_VOLTAGE);
1229 if (ret) {
1230 dev_err(codec->dev,
1231 "Failed to register vddd internal supplies: %d\n", ret);
1232 return ret;
1233 }
1234
1235 sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;
1236
1237 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
1238 sgtl5000->supplies);
1239
1240 if (ret) {
1241 ldo_regulator_remove(codec);
1242 dev_err(codec->dev, "Failed to request supplies: %d\n", ret);
1243 return ret;
1244 }
1245
1246 dev_info(codec->dev, "Using internal LDO instead of VDDD\n");
1247 return 0;
1248}
1249
1221static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) 1250static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
1222{ 1251{
1223 u16 reg; 1252 u16 reg;
@@ -1235,30 +1264,9 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
1235 if (!ret) 1264 if (!ret)
1236 external_vddd = 1; 1265 external_vddd = 1;
1237 else { 1266 else {
1238 /* set internal ldo to 1.2v */ 1267 ret = sgtl5000_replace_vddd_with_ldo(codec);
1239 int voltage = LDO_VOLTAGE; 1268 if (ret)
1240
1241 ret = ldo_regulator_register(codec, &ldo_init_data, voltage);
1242 if (ret) {
1243 dev_err(codec->dev,
1244 "Failed to register vddd internal supplies: %d\n",
1245 ret);
1246 return ret;
1247 }
1248
1249 sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;
1250
1251 ret = regulator_bulk_get(codec->dev,
1252 ARRAY_SIZE(sgtl5000->supplies),
1253 sgtl5000->supplies);
1254
1255 if (ret) {
1256 ldo_regulator_remove(codec);
1257 dev_err(codec->dev,
1258 "Failed to request supplies: %d\n", ret);
1259
1260 return ret; 1269 return ret;
1261 }
1262 } 1270 }
1263 1271
1264 ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), 1272 ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
@@ -1287,7 +1295,6 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
1287 * roll back to use internal LDO 1295 * roll back to use internal LDO
1288 */ 1296 */
1289 if (external_vddd && rev >= 0x11) { 1297 if (external_vddd && rev >= 0x11) {
1290 int voltage = LDO_VOLTAGE;
1291 /* disable all regulator first */ 1298 /* disable all regulator first */
1292 regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), 1299 regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies),
1293 sgtl5000->supplies); 1300 sgtl5000->supplies);
@@ -1295,23 +1302,10 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
1295 regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), 1302 regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies),
1296 sgtl5000->supplies); 1303 sgtl5000->supplies);
1297 1304
1298 ret = ldo_regulator_register(codec, &ldo_init_data, voltage); 1305 ret = sgtl5000_replace_vddd_with_ldo(codec);
1299 if (ret) 1306 if (ret)
1300 return ret; 1307 return ret;
1301 1308
1302 sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME;
1303
1304 ret = regulator_bulk_get(codec->dev,
1305 ARRAY_SIZE(sgtl5000->supplies),
1306 sgtl5000->supplies);
1307 if (ret) {
1308 ldo_regulator_remove(codec);
1309 dev_err(codec->dev,
1310 "Failed to request supplies: %d\n", ret);
1311
1312 return ret;
1313 }
1314
1315 ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), 1309 ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies),
1316 sgtl5000->supplies); 1310 sgtl5000->supplies);
1317 if (ret) 1311 if (ret)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 8499c563a9b5..60d740ebeb5b 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3409,6 +3409,9 @@ static irqreturn_t wm8962_irq(int irq, void *data)
3409 active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); 3409 active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2);
3410 active &= ~mask; 3410 active &= ~mask;
3411 3411
3412 /* Acknowledge the interrupts */
3413 snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);
3414
3412 if (active & WM8962_FLL_LOCK_EINT) { 3415 if (active & WM8962_FLL_LOCK_EINT) {
3413 dev_dbg(codec->dev, "FLL locked\n"); 3416 dev_dbg(codec->dev, "FLL locked\n");
3414 complete(&wm8962->fll_lock); 3417 complete(&wm8962->fll_lock);
@@ -3433,9 +3436,6 @@ static irqreturn_t wm8962_irq(int irq, void *data)
3433 msecs_to_jiffies(250)); 3436 msecs_to_jiffies(250));
3434 } 3437 }
3435 3438
3436 /* Acknowledge the interrupts */
3437 snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);
3438
3439 return IRQ_HANDLED; 3439 return IRQ_HANDLED;
3440} 3440}
3441 3441
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index 9259f1f34899..1f11525d97e8 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -62,9 +62,9 @@ static void davinci_vcif_start(struct snd_pcm_substream *substream)
62 w = readl(davinci_vc->base + DAVINCI_VC_CTRL); 62 w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
63 63
64 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 64 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
65 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1); 65 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
66 else 66 else
67 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1); 67 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
68 68
69 writel(w, davinci_vc->base + DAVINCI_VC_CTRL); 69 writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
70} 70}
@@ -80,9 +80,9 @@ static void davinci_vcif_stop(struct snd_pcm_substream *substream)
80 /* Reset transmitter/receiver and sample rate/frame sync generators */ 80 /* Reset transmitter/receiver and sample rate/frame sync generators */
81 w = readl(davinci_vc->base + DAVINCI_VC_CTRL); 81 w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
82 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 82 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
83 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0); 83 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
84 else 84 else
85 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0); 85 MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
86 86
87 writel(w, davinci_vc->base + DAVINCI_VC_CTRL); 87 writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
88} 88}
@@ -159,6 +159,7 @@ static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
159 case SNDRV_PCM_TRIGGER_RESUME: 159 case SNDRV_PCM_TRIGGER_RESUME:
160 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 160 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
161 davinci_vcif_start(substream); 161 davinci_vcif_start(substream);
162 break;
162 case SNDRV_PCM_TRIGGER_STOP: 163 case SNDRV_PCM_TRIGGER_STOP:
163 case SNDRV_PCM_TRIGGER_SUSPEND: 164 case SNDRV_PCM_TRIGGER_SUSPEND:
164 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 165 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 1568eea31f41..c086b78539ee 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -21,6 +21,7 @@
21#include <plat/audio.h> 21#include <plat/audio.h>
22 22
23#include "dma.h" 23#include "dma.h"
24#include "idma.h"
24#include "i2s.h" 25#include "i2s.h"
25#include "i2s-regs.h" 26#include "i2s-regs.h"
26 27
@@ -60,6 +61,7 @@ struct i2s_dai {
60 /* DMA parameters */ 61 /* DMA parameters */
61 struct s3c_dma_params dma_playback; 62 struct s3c_dma_params dma_playback;
62 struct s3c_dma_params dma_capture; 63 struct s3c_dma_params dma_capture;
64 struct s3c_dma_params idma_playback;
63 u32 quirks; 65 u32 quirks;
64 u32 suspend_i2smod; 66 u32 suspend_i2smod;
65 u32 suspend_i2scon; 67 u32 suspend_i2scon;
@@ -877,6 +879,10 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
877 if (i2s->quirks & QUIRK_NEED_RSTCLR) 879 if (i2s->quirks & QUIRK_NEED_RSTCLR)
878 writel(CON_RSTCLR, i2s->addr + I2SCON); 880 writel(CON_RSTCLR, i2s->addr + I2SCON);
879 881
882 if (i2s->quirks & QUIRK_SEC_DAI)
883 idma_reg_addr_init((void *)i2s->addr,
884 i2s->sec_dai->idma_playback.dma_addr);
885
880probe_exit: 886probe_exit:
881 /* Reset any constraint on RFS and BFS */ 887 /* Reset any constraint on RFS and BFS */
882 i2s->rfs = 0; 888 i2s->rfs = 0;
@@ -1077,6 +1083,7 @@ static __devinit int samsung_i2s_probe(struct platform_device *pdev)
1077 sec_dai->dma_playback.dma_size = 4; 1083 sec_dai->dma_playback.dma_size = 4;
1078 sec_dai->base = regs_base; 1084 sec_dai->base = regs_base;
1079 sec_dai->quirks = quirks; 1085 sec_dai->quirks = quirks;
1086 sec_dai->idma_playback.dma_addr = i2s_cfg->idma_addr;
1080 sec_dai->pri_dai = pri_dai; 1087 sec_dai->pri_dai = pri_dai;
1081 pri_dai->sec_dai = sec_dai; 1088 pri_dai->sec_dai = sec_dai;
1082 } 1089 }
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e44267f66216..83ad8ca27490 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -577,6 +577,7 @@ int snd_soc_suspend(struct device *dev)
577 case SND_SOC_BIAS_OFF: 577 case SND_SOC_BIAS_OFF:
578 codec->driver->suspend(codec, PMSG_SUSPEND); 578 codec->driver->suspend(codec, PMSG_SUSPEND);
579 codec->suspended = 1; 579 codec->suspended = 1;
580 codec->cache_sync = 1;
580 break; 581 break;
581 default: 582 default:
582 dev_dbg(codec->dev, "CODEC is on over suspend\n"); 583 dev_dbg(codec->dev, "CODEC is on over suspend\n");
@@ -1140,7 +1141,7 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
1140 } 1141 }
1141 } 1142 }
1142 cpu_dai->probed = 1; 1143 cpu_dai->probed = 1;
1143 /* mark cpu_dai as probed and add to card cpu_dai list */ 1144 /* mark cpu_dai as probed and add to card dai list */
1144 list_add(&cpu_dai->card_list, &card->dai_dev_list); 1145 list_add(&cpu_dai->card_list, &card->dai_dev_list);
1145 } 1146 }
1146 1147
@@ -1171,7 +1172,7 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
1171 } 1172 }
1172 } 1173 }
1173 1174
1174 /* mark cpu_dai as probed and add to card cpu_dai list */ 1175 /* mark codec_dai as probed and add to card dai list */
1175 codec_dai->probed = 1; 1176 codec_dai->probed = 1;
1176 list_add(&codec_dai->card_list, &card->dai_dev_list); 1177 list_add(&codec_dai->card_list, &card->dai_dev_list);
1177 } 1178 }
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index fbfcda062839..7e15914b3633 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -124,6 +124,36 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
124 return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); 124 return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
125} 125}
126 126
127/* get snd_card from DAPM context */
128static inline struct snd_card *dapm_get_snd_card(
129 struct snd_soc_dapm_context *dapm)
130{
131 if (dapm->codec)
132 return dapm->codec->card->snd_card;
133 else if (dapm->platform)
134 return dapm->platform->card->snd_card;
135 else
136 BUG();
137
138 /* unreachable */
139 return NULL;
140}
141
142/* get soc_card from DAPM context */
143static inline struct snd_soc_card *dapm_get_soc_card(
144 struct snd_soc_dapm_context *dapm)
145{
146 if (dapm->codec)
147 return dapm->codec->card;
148 else if (dapm->platform)
149 return dapm->platform->card;
150 else
151 BUG();
152
153 /* unreachable */
154 return NULL;
155}
156
127static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) 157static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg)
128{ 158{
129 if (w->codec) 159 if (w->codec)