aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/ab8500-codec.c4
-rw-r--r--sound/soc/codecs/ad1980.c1
-rw-r--r--sound/soc/codecs/mc13783.c2
-rw-r--r--sound/soc/codecs/sgtl5000.c3
-rw-r--r--sound/soc/codecs/stac9766.c1
-rw-r--r--sound/soc/codecs/wm8962.c3
-rw-r--r--sound/soc/codecs/wm8994.c15
-rw-r--r--sound/soc/codecs/wm9712.c1
-rw-r--r--sound/soc/codecs/wm9713.c1
9 files changed, 28 insertions, 3 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c
index 3c795921c5f6..23b40186f9b8 100644
--- a/sound/soc/codecs/ab8500-codec.c
+++ b/sound/soc/codecs/ab8500-codec.c
@@ -2406,6 +2406,10 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
2406 2406
2407 /* Setup AB8500 according to board-settings */ 2407 /* Setup AB8500 according to board-settings */
2408 pdata = (struct ab8500_platform_data *)dev_get_platdata(dev->parent); 2408 pdata = (struct ab8500_platform_data *)dev_get_platdata(dev->parent);
2409
2410 /* Inform SoC Core that we have our own I/O arrangements. */
2411 codec->control_data = (void *)true;
2412
2409 status = ab8500_audio_setup_mics(codec, &pdata->codec->amics); 2413 status = ab8500_audio_setup_mics(codec, &pdata->codec->amics);
2410 if (status < 0) { 2414 if (status < 0) {
2411 pr_err("%s: Failed to setup mics (%d)!\n", __func__, status); 2415 pr_err("%s: Failed to setup mics (%d)!\n", __func__, status);
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 8c39dddd7d00..11b1b714b8b5 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -186,6 +186,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
186 186
187 printk(KERN_INFO "AD1980 SoC Audio Codec\n"); 187 printk(KERN_INFO "AD1980 SoC Audio Codec\n");
188 188
189 codec->control_data = codec; /* we don't use regmap! */
189 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); 190 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
190 if (ret < 0) { 191 if (ret < 0) {
191 printk(KERN_ERR "ad1980: failed to register AC97 codec\n"); 192 printk(KERN_ERR "ad1980: failed to register AC97 codec\n");
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 6276e352125f..8f726c063f42 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -581,6 +581,8 @@ static int mc13783_probe(struct snd_soc_codec *codec)
581{ 581{
582 struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); 582 struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
583 583
584 codec->control_data = priv->mc13xxx;
585
584 mc13xxx_lock(priv->mc13xxx); 586 mc13xxx_lock(priv->mc13xxx);
585 587
586 /* these are the reset values */ 588 /* these are the reset values */
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 8af6a5245b18..df2f99d1d428 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -239,6 +239,7 @@ static const struct snd_soc_dapm_route sgtl5000_dapm_routes[] = {
239 {"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */ 239 {"Headphone Mux", "DAC", "DAC"}, /* dac --> hp_mux */
240 {"LO", NULL, "DAC"}, /* dac --> line_out */ 240 {"LO", NULL, "DAC"}, /* dac --> line_out */
241 241
242 {"LINE_IN", NULL, "VAG_POWER"},
242 {"Headphone Mux", "LINE_IN", "LINE_IN"},/* line_in --> hp_mux */ 243 {"Headphone Mux", "LINE_IN", "LINE_IN"},/* line_in --> hp_mux */
243 {"HP", NULL, "Headphone Mux"}, /* hp_mux --> hp */ 244 {"HP", NULL, "Headphone Mux"}, /* hp_mux --> hp */
244 245
@@ -1357,8 +1358,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
1357 if (ret) 1358 if (ret)
1358 goto err; 1359 goto err;
1359 1360
1360 snd_soc_dapm_new_widgets(&codec->dapm);
1361
1362 return 0; 1361 return 0;
1363 1362
1364err: 1363err:
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index 982e437799a8..33c0f3d39c87 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -340,6 +340,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec)
340 340
341 printk(KERN_INFO "STAC9766 SoC Audio Codec %s\n", STAC9766_VERSION); 341 printk(KERN_INFO "STAC9766 SoC Audio Codec %s\n", STAC9766_VERSION);
342 342
343 codec->control_data = codec; /* we don't use regmap! */
343 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); 344 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
344 if (ret < 0) 345 if (ret < 0)
345 goto codec_err; 346 goto codec_err;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index eaf65863ec21..aa9ce9dd7d8a 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2501,6 +2501,9 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
2501 /* VMID 2*250k */ 2501 /* VMID 2*250k */
2502 snd_soc_update_bits(codec, WM8962_PWR_MGMT_1, 2502 snd_soc_update_bits(codec, WM8962_PWR_MGMT_1,
2503 WM8962_VMID_SEL_MASK, 0x100); 2503 WM8962_VMID_SEL_MASK, 0x100);
2504
2505 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
2506 msleep(100);
2504 break; 2507 break;
2505 2508
2506 case SND_SOC_BIAS_OFF: 2509 case SND_SOC_BIAS_OFF:
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index bb62f4b3d563..04ef03175c51 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -2649,7 +2649,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream,
2649 return -EINVAL; 2649 return -EINVAL;
2650 } 2650 }
2651 2651
2652 bclk_rate = params_rate(params) * 2; 2652 bclk_rate = params_rate(params) * 4;
2653 switch (params_format(params)) { 2653 switch (params_format(params)) {
2654 case SNDRV_PCM_FORMAT_S16_LE: 2654 case SNDRV_PCM_FORMAT_S16_LE:
2655 bclk_rate *= 16; 2655 bclk_rate *= 16;
@@ -3253,10 +3253,13 @@ static void wm8994_mic_work(struct work_struct *work)
3253 int ret; 3253 int ret;
3254 int report; 3254 int report;
3255 3255
3256 pm_runtime_get_sync(dev);
3257
3256 ret = regmap_read(regmap, WM8994_INTERRUPT_RAW_STATUS_2, &reg); 3258 ret = regmap_read(regmap, WM8994_INTERRUPT_RAW_STATUS_2, &reg);
3257 if (ret < 0) { 3259 if (ret < 0) {
3258 dev_err(dev, "Failed to read microphone status: %d\n", 3260 dev_err(dev, "Failed to read microphone status: %d\n",
3259 ret); 3261 ret);
3262 pm_runtime_put(dev);
3260 return; 3263 return;
3261 } 3264 }
3262 3265
@@ -3299,6 +3302,8 @@ static void wm8994_mic_work(struct work_struct *work)
3299 3302
3300 snd_soc_jack_report(priv->micdet[1].jack, report, 3303 snd_soc_jack_report(priv->micdet[1].jack, report,
3301 SND_JACK_HEADSET | SND_JACK_BTN_0); 3304 SND_JACK_HEADSET | SND_JACK_BTN_0);
3305
3306 pm_runtime_put(dev);
3302} 3307}
3303 3308
3304static irqreturn_t wm8994_mic_irq(int irq, void *data) 3309static irqreturn_t wm8994_mic_irq(int irq, void *data)
@@ -3421,12 +3426,15 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
3421 int reg; 3426 int reg;
3422 bool present; 3427 bool present;
3423 3428
3429 pm_runtime_get_sync(codec->dev);
3430
3424 mutex_lock(&wm8994->accdet_lock); 3431 mutex_lock(&wm8994->accdet_lock);
3425 3432
3426 reg = snd_soc_read(codec, WM1811_JACKDET_CTRL); 3433 reg = snd_soc_read(codec, WM1811_JACKDET_CTRL);
3427 if (reg < 0) { 3434 if (reg < 0) {
3428 dev_err(codec->dev, "Failed to read jack status: %d\n", reg); 3435 dev_err(codec->dev, "Failed to read jack status: %d\n", reg);
3429 mutex_unlock(&wm8994->accdet_lock); 3436 mutex_unlock(&wm8994->accdet_lock);
3437 pm_runtime_put(codec->dev);
3430 return IRQ_NONE; 3438 return IRQ_NONE;
3431 } 3439 }
3432 3440
@@ -3491,6 +3499,7 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data)
3491 SND_JACK_MECHANICAL | SND_JACK_HEADSET | 3499 SND_JACK_MECHANICAL | SND_JACK_HEADSET |
3492 wm8994->btn_mask); 3500 wm8994->btn_mask);
3493 3501
3502 pm_runtime_put(codec->dev);
3494 return IRQ_HANDLED; 3503 return IRQ_HANDLED;
3495} 3504}
3496 3505
@@ -3602,6 +3611,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
3602 if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) 3611 if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA))
3603 return IRQ_HANDLED; 3612 return IRQ_HANDLED;
3604 3613
3614 pm_runtime_get_sync(codec->dev);
3615
3605 /* We may occasionally read a detection without an impedence 3616 /* We may occasionally read a detection without an impedence
3606 * range being provided - if that happens loop again. 3617 * range being provided - if that happens loop again.
3607 */ 3618 */
@@ -3612,6 +3623,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
3612 dev_err(codec->dev, 3623 dev_err(codec->dev,
3613 "Failed to read mic detect status: %d\n", 3624 "Failed to read mic detect status: %d\n",
3614 reg); 3625 reg);
3626 pm_runtime_put(codec->dev);
3615 return IRQ_NONE; 3627 return IRQ_NONE;
3616 } 3628 }
3617 3629
@@ -3639,6 +3651,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
3639 dev_warn(codec->dev, "Accessory detection with no callback\n"); 3651 dev_warn(codec->dev, "Accessory detection with no callback\n");
3640 3652
3641out: 3653out:
3654 pm_runtime_put(codec->dev);
3642 return IRQ_HANDLED; 3655 return IRQ_HANDLED;
3643} 3656}
3644 3657
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 099e6ec32125..f16fb361a4eb 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -619,6 +619,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
619{ 619{
620 int ret = 0; 620 int ret = 0;
621 621
622 codec->control_data = codec; /* we don't use regmap! */
622 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); 623 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
623 if (ret < 0) { 624 if (ret < 0) {
624 printk(KERN_ERR "wm9712: failed to register AC97 codec\n"); 625 printk(KERN_ERR "wm9712: failed to register AC97 codec\n");
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 3eb19fb71d17..d0b8a3287a85 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1196,6 +1196,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
1196 if (wm9713 == NULL) 1196 if (wm9713 == NULL)
1197 return -ENOMEM; 1197 return -ENOMEM;
1198 snd_soc_codec_set_drvdata(codec, wm9713); 1198 snd_soc_codec_set_drvdata(codec, wm9713);
1199 codec->control_data = wm9713; /* we don't use regmap! */
1199 1200
1200 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); 1201 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
1201 if (ret < 0) 1202 if (ret < 0)