aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/adi/axi-i2s.c2
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c24
-rw-r--r--sound/soc/codecs/pcm512x.c2
-rw-r--r--sound/soc/codecs/rt286.c6
-rw-r--r--sound/soc/codecs/rt5640.c1
-rw-r--r--sound/soc/codecs/rt5677.c18
-rw-r--r--sound/soc/codecs/sgtl5000.c13
-rw-r--r--sound/soc/codecs/tlv320aic3x.c2
-rw-r--r--sound/soc/codecs/ts3a227e.c6
-rw-r--r--sound/soc/codecs/wm8731.c2
-rw-r--r--sound/soc/codecs/wm8904.c23
-rw-r--r--sound/soc/codecs/wm8960.c2
-rw-r--r--sound/soc/codecs/wm9705.c16
-rw-r--r--sound/soc/codecs/wm9712.c12
-rw-r--r--sound/soc/codecs/wm9713.c12
-rw-r--r--sound/soc/fsl/fsl_esai.h2
-rw-r--r--sound/soc/fsl/fsl_ssi.c4
-rw-r--r--sound/soc/fsl/imx-wm8962.c1
-rw-r--r--sound/soc/generic/simple-card.c7
-rw-r--r--sound/soc/intel/sst-firmware.c13
-rw-r--r--sound/soc/intel/sst-haswell-ipc.c34
-rw-r--r--sound/soc/intel/sst/sst_acpi.c2
-rw-r--r--sound/soc/omap/omap-mcbsp.c2
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c1
-rw-r--r--sound/soc/soc-ac97.c36
-rw-r--r--sound/soc/soc-compress.c9
26 files changed, 171 insertions, 81 deletions
diff --git a/sound/soc/adi/axi-i2s.c b/sound/soc/adi/axi-i2s.c
index 7752860f7230..4c23381727a1 100644
--- a/sound/soc/adi/axi-i2s.c
+++ b/sound/soc/adi/axi-i2s.c
@@ -240,6 +240,8 @@ static int axi_i2s_probe(struct platform_device *pdev)
240 if (ret) 240 if (ret)
241 goto err_clk_disable; 241 goto err_clk_disable;
242 242
243 return 0;
244
243err_clk_disable: 245err_clk_disable:
244 clk_disable_unprepare(i2s->clk); 246 clk_disable_unprepare(i2s->clk);
245 return ret; 247 return ret;
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 99ff35e2a25d..35e44e463cfe 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
348 struct atmel_pcm_dma_params *dma_params; 348 struct atmel_pcm_dma_params *dma_params;
349 int dir, channels, bits; 349 int dir, channels, bits;
350 u32 tfmr, rfmr, tcmr, rcmr; 350 u32 tfmr, rfmr, tcmr, rcmr;
351 int start_event;
352 int ret; 351 int ret;
353 int fslen, fslen_ext; 352 int fslen, fslen_ext;
354 353
@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
457 * The SSC transmit clock is obtained from the BCLK signal on 456 * The SSC transmit clock is obtained from the BCLK signal on
458 * on the TK line, and the SSC receive clock is 457 * on the TK line, and the SSC receive clock is
459 * generated from the transmit clock. 458 * generated from the transmit clock.
460 *
461 * For single channel data, one sample is transferred
462 * on the falling edge of the LRC clock.
463 * For two channel data, one sample is
464 * transferred on both edges of the LRC clock.
465 */ 459 */
466 start_event = ((channels == 1)
467 ? SSC_START_FALLING_RF
468 : SSC_START_EDGE_RF);
469
470 rcmr = SSC_BF(RCMR_PERIOD, 0) 460 rcmr = SSC_BF(RCMR_PERIOD, 0)
471 | SSC_BF(RCMR_STTDLY, START_DELAY) 461 | SSC_BF(RCMR_STTDLY, START_DELAY)
472 | SSC_BF(RCMR_START, start_event) 462 | SSC_BF(RCMR_START, SSC_START_FALLING_RF)
473 | SSC_BF(RCMR_CKI, SSC_CKI_RISING) 463 | SSC_BF(RCMR_CKI, SSC_CKI_RISING)
474 | SSC_BF(RCMR_CKO, SSC_CKO_NONE) 464 | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
475 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? 465 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
478 rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) 468 rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
479 | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) 469 | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
480 | SSC_BF(RFMR_FSLEN, 0) 470 | SSC_BF(RFMR_FSLEN, 0)
481 | SSC_BF(RFMR_DATNB, 0) 471 | SSC_BF(RFMR_DATNB, (channels - 1))
482 | SSC_BIT(RFMR_MSBF) 472 | SSC_BIT(RFMR_MSBF)
483 | SSC_BF(RFMR_LOOP, 0) 473 | SSC_BF(RFMR_LOOP, 0)
484 | SSC_BF(RFMR_DATLEN, (bits - 1)); 474 | SSC_BF(RFMR_DATLEN, (bits - 1));
485 475
486 tcmr = SSC_BF(TCMR_PERIOD, 0) 476 tcmr = SSC_BF(TCMR_PERIOD, 0)
487 | SSC_BF(TCMR_STTDLY, START_DELAY) 477 | SSC_BF(TCMR_STTDLY, START_DELAY)
488 | SSC_BF(TCMR_START, start_event) 478 | SSC_BF(TCMR_START, SSC_START_FALLING_RF)
489 | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) 479 | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
490 | SSC_BF(TCMR_CKO, SSC_CKO_NONE) 480 | SSC_BF(TCMR_CKO, SSC_CKO_NONE)
491 | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? 481 | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
495 | SSC_BF(TFMR_FSDEN, 0) 485 | SSC_BF(TFMR_FSDEN, 0)
496 | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) 486 | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
497 | SSC_BF(TFMR_FSLEN, 0) 487 | SSC_BF(TFMR_FSLEN, 0)
498 | SSC_BF(TFMR_DATNB, 0) 488 | SSC_BF(TFMR_DATNB, (channels - 1))
499 | SSC_BIT(TFMR_MSBF) 489 | SSC_BIT(TFMR_MSBF)
500 | SSC_BF(TFMR_DATDEF, 0) 490 | SSC_BF(TFMR_DATDEF, 0)
501 | SSC_BF(TFMR_DATLEN, (bits - 1)); 491 | SSC_BF(TFMR_DATLEN, (bits - 1));
@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
512 rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) 502 rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
513 | SSC_BF(RCMR_STTDLY, 1) 503 | SSC_BF(RCMR_STTDLY, 1)
514 | SSC_BF(RCMR_START, SSC_START_RISING_RF) 504 | SSC_BF(RCMR_START, SSC_START_RISING_RF)
515 | SSC_BF(RCMR_CKI, SSC_CKI_RISING) 505 | SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
516 | SSC_BF(RCMR_CKO, SSC_CKO_NONE) 506 | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
517 | SSC_BF(RCMR_CKS, SSC_CKS_DIV); 507 | SSC_BF(RCMR_CKS, SSC_CKS_DIV);
518 508
@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
527 tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) 517 tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
528 | SSC_BF(TCMR_STTDLY, 1) 518 | SSC_BF(TCMR_STTDLY, 1)
529 | SSC_BF(TCMR_START, SSC_START_RISING_RF) 519 | SSC_BF(TCMR_START, SSC_START_RISING_RF)
530 | SSC_BF(TCMR_CKI, SSC_CKI_RISING) 520 | SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
531 | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS) 521 | SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS)
532 | SSC_BF(TCMR_CKS, SSC_CKS_DIV); 522 | SSC_BF(TCMR_CKS, SSC_CKS_DIV);
533 523
@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
556 rcmr = SSC_BF(RCMR_PERIOD, 0) 546 rcmr = SSC_BF(RCMR_PERIOD, 0)
557 | SSC_BF(RCMR_STTDLY, START_DELAY) 547 | SSC_BF(RCMR_STTDLY, START_DELAY)
558 | SSC_BF(RCMR_START, SSC_START_RISING_RF) 548 | SSC_BF(RCMR_START, SSC_START_RISING_RF)
559 | SSC_BF(RCMR_CKI, SSC_CKI_RISING) 549 | SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
560 | SSC_BF(RCMR_CKO, SSC_CKO_NONE) 550 | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
561 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? 551 | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
562 SSC_CKS_PIN : SSC_CKS_CLOCK); 552 SSC_CKS_PIN : SSC_CKS_CLOCK);
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index e5f2fb884bf3..30c673cdc12e 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -188,8 +188,8 @@ static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0);
188static const char * const pcm512x_dsp_program_texts[] = { 188static const char * const pcm512x_dsp_program_texts[] = {
189 "FIR interpolation with de-emphasis", 189 "FIR interpolation with de-emphasis",
190 "Low latency IIR with de-emphasis", 190 "Low latency IIR with de-emphasis",
191 "Fixed process flow",
192 "High attenuation with de-emphasis", 191 "High attenuation with de-emphasis",
192 "Fixed process flow",
193 "Ringing-less low latency FIR", 193 "Ringing-less low latency FIR",
194}; 194};
195 195
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 2cd4fe463102..1d1c7f8a9af2 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -861,10 +861,8 @@ static int rt286_hw_params(struct snd_pcm_substream *substream,
861 RT286_I2S_CTRL1, 0x0018, d_len_code << 3); 861 RT286_I2S_CTRL1, 0x0018, d_len_code << 3);
862 dev_dbg(codec->dev, "format val = 0x%x\n", val); 862 dev_dbg(codec->dev, "format val = 0x%x\n", val);
863 863
864 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 864 snd_soc_update_bits(codec, RT286_DAC_FORMAT, 0x407f, val);
865 snd_soc_update_bits(codec, RT286_DAC_FORMAT, 0x407f, val); 865 snd_soc_update_bits(codec, RT286_ADC_FORMAT, 0x407f, val);
866 else
867 snd_soc_update_bits(codec, RT286_ADC_FORMAT, 0x407f, val);
868 866
869 return 0; 867 return 0;
870} 868}
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index c3f2decd643c..1ff726c29249 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);
2124static struct acpi_device_id rt5640_acpi_match[] = { 2124static struct acpi_device_id rt5640_acpi_match[] = {
2125 { "INT33CA", 0 }, 2125 { "INT33CA", 0 },
2126 { "10EC5640", 0 }, 2126 { "10EC5640", 0 },
2127 { "10EC5642", 0 },
2127 { }, 2128 { },
2128}; 2129};
2129MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); 2130MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index c0fbe1881439..918ada9738b0 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -2083,10 +2083,14 @@ static int rt5677_set_pll1_event(struct snd_soc_dapm_widget *w,
2083 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 2083 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
2084 2084
2085 switch (event) { 2085 switch (event) {
2086 case SND_SOC_DAPM_POST_PMU: 2086 case SND_SOC_DAPM_PRE_PMU:
2087 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x2); 2087 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x2);
2088 break;
2089
2090 case SND_SOC_DAPM_POST_PMU:
2088 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x0); 2091 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x0);
2089 break; 2092 break;
2093
2090 default: 2094 default:
2091 return 0; 2095 return 0;
2092 } 2096 }
@@ -2101,10 +2105,14 @@ static int rt5677_set_pll2_event(struct snd_soc_dapm_widget *w,
2101 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 2105 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
2102 2106
2103 switch (event) { 2107 switch (event) {
2104 case SND_SOC_DAPM_POST_PMU: 2108 case SND_SOC_DAPM_PRE_PMU:
2105 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x2); 2109 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x2);
2110 break;
2111
2112 case SND_SOC_DAPM_POST_PMU:
2106 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x0); 2113 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x0);
2107 break; 2114 break;
2115
2108 default: 2116 default:
2109 return 0; 2117 return 0;
2110 } 2118 }
@@ -2212,9 +2220,11 @@ static int rt5677_vref_event(struct snd_soc_dapm_widget *w,
2212 2220
2213static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = { 2221static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
2214 SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT, 2222 SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT,
2215 0, rt5677_set_pll1_event, SND_SOC_DAPM_POST_PMU), 2223 0, rt5677_set_pll1_event, SND_SOC_DAPM_PRE_PMU |
2224 SND_SOC_DAPM_POST_PMU),
2216 SND_SOC_DAPM_SUPPLY("PLL2", RT5677_PWR_ANLG2, RT5677_PWR_PLL2_BIT, 2225 SND_SOC_DAPM_SUPPLY("PLL2", RT5677_PWR_ANLG2, RT5677_PWR_PLL2_BIT,
2217 0, rt5677_set_pll2_event, SND_SOC_DAPM_POST_PMU), 2226 0, rt5677_set_pll2_event, SND_SOC_DAPM_PRE_PMU |
2227 SND_SOC_DAPM_POST_PMU),
2218 2228
2219 /* Input Side */ 2229 /* Input Side */
2220 /* micbias */ 2230 /* micbias */
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 29cf7ce610f4..aa98be32bb60 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
483 /* setting i2s data format */ 483 /* setting i2s data format */
484 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 484 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
485 case SND_SOC_DAIFMT_DSP_A: 485 case SND_SOC_DAIFMT_DSP_A:
486 i2sctl |= SGTL5000_I2S_MODE_PCM; 486 i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
487 break; 487 break;
488 case SND_SOC_DAIFMT_DSP_B: 488 case SND_SOC_DAIFMT_DSP_B:
489 i2sctl |= SGTL5000_I2S_MODE_PCM; 489 i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
490 i2sctl |= SGTL5000_I2S_LRALIGN; 490 i2sctl |= SGTL5000_I2S_LRALIGN;
491 break; 491 break;
492 case SND_SOC_DAIFMT_I2S: 492 case SND_SOC_DAIFMT_I2S:
493 i2sctl |= SGTL5000_I2S_MODE_I2S_LJ; 493 i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
494 break; 494 break;
495 case SND_SOC_DAIFMT_RIGHT_J: 495 case SND_SOC_DAIFMT_RIGHT_J:
496 i2sctl |= SGTL5000_I2S_MODE_RJ; 496 i2sctl |= SGTL5000_I2S_MODE_RJ << SGTL5000_I2S_MODE_SHIFT;
497 i2sctl |= SGTL5000_I2S_LRPOL; 497 i2sctl |= SGTL5000_I2S_LRPOL;
498 break; 498 break;
499 case SND_SOC_DAIFMT_LEFT_J: 499 case SND_SOC_DAIFMT_LEFT_J:
500 i2sctl |= SGTL5000_I2S_MODE_I2S_LJ; 500 i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
501 i2sctl |= SGTL5000_I2S_LRALIGN; 501 i2sctl |= SGTL5000_I2S_LRALIGN;
502 break; 502 break;
503 default: 503 default:
@@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
1462 if (ret) 1462 if (ret)
1463 return ret; 1463 return ret;
1464 1464
1465 /* Need 8 clocks before I2C accesses */
1466 udelay(1);
1467
1465 /* read chip information */ 1468 /* read chip information */
1466 ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg); 1469 ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);
1467 if (ret) 1470 if (ret)
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index b7ebce054b4e..dd222b10ce13 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream,
1046 delay += aic3x->tdm_delay; 1046 delay += aic3x->tdm_delay;
1047 1047
1048 /* Configure data delay */ 1048 /* Configure data delay */
1049 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, aic3x->tdm_delay); 1049 snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);
1050 1050
1051 return 0; 1051 return 0;
1052} 1052}
diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 1d1205702d23..9f2dced046de 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -254,6 +254,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
254 struct ts3a227e *ts3a227e; 254 struct ts3a227e *ts3a227e;
255 struct device *dev = &i2c->dev; 255 struct device *dev = &i2c->dev;
256 int ret; 256 int ret;
257 unsigned int acc_reg;
257 258
258 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); 259 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL);
259 if (ts3a227e == NULL) 260 if (ts3a227e == NULL)
@@ -283,6 +284,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
283 INTB_DISABLE | ADC_COMPLETE_INT_DISABLE, 284 INTB_DISABLE | ADC_COMPLETE_INT_DISABLE,
284 ADC_COMPLETE_INT_DISABLE); 285 ADC_COMPLETE_INT_DISABLE);
285 286
287 /* Read jack status because chip might not trigger interrupt at boot. */
288 regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg);
289 ts3a227e_new_jack_state(ts3a227e, acc_reg);
290 ts3a227e_jack_report(ts3a227e);
291
286 return 0; 292 return 0;
287} 293}
288 294
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index b9211b42f6e9..b115ed815db9 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
717 if (wm8731 == NULL) 717 if (wm8731 == NULL)
718 return -ENOMEM; 718 return -ENOMEM;
719 719
720 mutex_init(&wm8731->lock);
721
720 wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); 722 wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
721 if (IS_ERR(wm8731->regmap)) { 723 if (IS_ERR(wm8731->regmap)) {
722 ret = PTR_ERR(wm8731->regmap); 724 ret = PTR_ERR(wm8731->regmap);
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 4d2d2b1380d5..75b87c5c0f04 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1076,10 +1076,13 @@ static const struct snd_soc_dapm_route adc_intercon[] = {
1076 { "Right Capture PGA", NULL, "Right Capture Mux" }, 1076 { "Right Capture PGA", NULL, "Right Capture Mux" },
1077 { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, 1077 { "Right Capture PGA", NULL, "Right Capture Inverting Mux" },
1078 1078
1079 { "AIFOUTL", "Left", "ADCL" }, 1079 { "AIFOUTL Mux", "Left", "ADCL" },
1080 { "AIFOUTL", "Right", "ADCR" }, 1080 { "AIFOUTL Mux", "Right", "ADCR" },
1081 { "AIFOUTR", "Left", "ADCL" }, 1081 { "AIFOUTR Mux", "Left", "ADCL" },
1082 { "AIFOUTR", "Right", "ADCR" }, 1082 { "AIFOUTR Mux", "Right", "ADCR" },
1083
1084 { "AIFOUTL", NULL, "AIFOUTL Mux" },
1085 { "AIFOUTR", NULL, "AIFOUTR Mux" },
1083 1086
1084 { "ADCL", NULL, "CLK_DSP" }, 1087 { "ADCL", NULL, "CLK_DSP" },
1085 { "ADCL", NULL, "Left Capture PGA" }, 1088 { "ADCL", NULL, "Left Capture PGA" },
@@ -1089,12 +1092,16 @@ static const struct snd_soc_dapm_route adc_intercon[] = {
1089}; 1092};
1090 1093
1091static const struct snd_soc_dapm_route dac_intercon[] = { 1094static const struct snd_soc_dapm_route dac_intercon[] = {
1092 { "DACL", "Right", "AIFINR" }, 1095 { "DACL Mux", "Left", "AIFINL" },
1093 { "DACL", "Left", "AIFINL" }, 1096 { "DACL Mux", "Right", "AIFINR" },
1097
1098 { "DACR Mux", "Left", "AIFINL" },
1099 { "DACR Mux", "Right", "AIFINR" },
1100
1101 { "DACL", NULL, "DACL Mux" },
1094 { "DACL", NULL, "CLK_DSP" }, 1102 { "DACL", NULL, "CLK_DSP" },
1095 1103
1096 { "DACR", "Right", "AIFINR" }, 1104 { "DACR", NULL, "DACR Mux" },
1097 { "DACR", "Left", "AIFINL" },
1098 { "DACR", NULL, "CLK_DSP" }, 1105 { "DACR", NULL, "CLK_DSP" },
1099 1106
1100 { "Charge pump", NULL, "SYSCLK" }, 1107 { "Charge pump", NULL, "SYSCLK" },
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 031a1ae71d94..a96eb497a379 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -556,7 +556,7 @@ static struct {
556 { 22050, 2 }, 556 { 22050, 2 },
557 { 24000, 2 }, 557 { 24000, 2 },
558 { 16000, 3 }, 558 { 16000, 3 },
559 { 11250, 4 }, 559 { 11025, 4 },
560 { 12000, 4 }, 560 { 12000, 4 },
561 { 8000, 5 }, 561 { 8000, 5 },
562}; 562};
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 3eddb18fefd1..5cc457ef8894 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
344 struct snd_ac97 *ac97; 344 struct snd_ac97 *ac97;
345 int ret = 0; 345 int ret = 0;
346 346
347 ac97 = snd_soc_new_ac97_codec(codec); 347 ac97 = snd_soc_alloc_ac97_codec(codec);
348 if (IS_ERR(ac97)) { 348 if (IS_ERR(ac97)) {
349 ret = PTR_ERR(ac97); 349 ret = PTR_ERR(ac97);
350 dev_err(codec->dev, "Failed to register AC97 codec\n"); 350 dev_err(codec->dev, "Failed to register AC97 codec\n");
351 return ret; 351 return ret;
352 } 352 }
353 353
354 snd_soc_codec_set_drvdata(codec, ac97);
355
356 ret = wm9705_reset(codec); 354 ret = wm9705_reset(codec);
357 if (ret) 355 if (ret)
358 goto reset_err; 356 goto err_put_device;
357
358 ret = device_add(&ac97->dev);
359 if (ret)
360 goto err_put_device;
361
362 snd_soc_codec_set_drvdata(codec, ac97);
359 363
360 return 0; 364 return 0;
361 365
362reset_err: 366err_put_device:
363 snd_soc_free_ac97_codec(ac97); 367 put_device(&ac97->dev);
364 return ret; 368 return ret;
365} 369}
366 370
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index e04643d2bb24..9517571e820d 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
666 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); 666 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
667 int ret = 0; 667 int ret = 0;
668 668
669 wm9712->ac97 = snd_soc_new_ac97_codec(codec); 669 wm9712->ac97 = snd_soc_alloc_ac97_codec(codec);
670 if (IS_ERR(wm9712->ac97)) { 670 if (IS_ERR(wm9712->ac97)) {
671 ret = PTR_ERR(wm9712->ac97); 671 ret = PTR_ERR(wm9712->ac97);
672 dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret); 672 dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret);
@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
675 675
676 ret = wm9712_reset(codec, 0); 676 ret = wm9712_reset(codec, 0);
677 if (ret < 0) 677 if (ret < 0)
678 goto reset_err; 678 goto err_put_device;
679
680 ret = device_add(&wm9712->ac97->dev);
681 if (ret)
682 goto err_put_device;
679 683
680 /* set alc mux to none */ 684 /* set alc mux to none */
681 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); 685 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
682 686
683 return 0; 687 return 0;
684 688
685reset_err: 689err_put_device:
686 snd_soc_free_ac97_codec(wm9712->ac97); 690 put_device(&wm9712->ac97->dev);
687 return ret; 691 return ret;
688} 692}
689 693
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 71b9d5b0734d..6ab1122a3872 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
1225 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); 1225 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
1226 int ret = 0, reg; 1226 int ret = 0, reg;
1227 1227
1228 wm9713->ac97 = snd_soc_new_ac97_codec(codec); 1228 wm9713->ac97 = snd_soc_alloc_ac97_codec(codec);
1229 if (IS_ERR(wm9713->ac97)) 1229 if (IS_ERR(wm9713->ac97))
1230 return PTR_ERR(wm9713->ac97); 1230 return PTR_ERR(wm9713->ac97);
1231 1231
@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
1234 wm9713_reset(codec, 0); 1234 wm9713_reset(codec, 0);
1235 ret = wm9713_reset(codec, 1); 1235 ret = wm9713_reset(codec, 1);
1236 if (ret < 0) 1236 if (ret < 0)
1237 goto reset_err; 1237 goto err_put_device;
1238
1239 ret = device_add(&wm9713->ac97->dev);
1240 if (ret)
1241 goto err_put_device;
1238 1242
1239 /* unmute the adc - move to kcontrol */ 1243 /* unmute the adc - move to kcontrol */
1240 reg = ac97_read(codec, AC97_CD) & 0x7fff; 1244 reg = ac97_read(codec, AC97_CD) & 0x7fff;
@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
1242 1246
1243 return 0; 1247 return 0;
1244 1248
1245reset_err: 1249err_put_device:
1246 snd_soc_free_ac97_codec(wm9713->ac97); 1250 put_device(&wm9713->ac97->dev);
1247 return ret; 1251 return ret;
1248} 1252}
1249 1253
diff --git a/sound/soc/fsl/fsl_esai.h b/sound/soc/fsl/fsl_esai.h
index 91a550f4a10d..5e793bbb6b02 100644
--- a/sound/soc/fsl/fsl_esai.h
+++ b/sound/soc/fsl/fsl_esai.h
@@ -302,7 +302,7 @@
302#define ESAI_xCCR_xFP_MASK (((1 << ESAI_xCCR_xFP_WIDTH) - 1) << ESAI_xCCR_xFP_SHIFT) 302#define ESAI_xCCR_xFP_MASK (((1 << ESAI_xCCR_xFP_WIDTH) - 1) << ESAI_xCCR_xFP_SHIFT)
303#define ESAI_xCCR_xFP(v) ((((v) - 1) << ESAI_xCCR_xFP_SHIFT) & ESAI_xCCR_xFP_MASK) 303#define ESAI_xCCR_xFP(v) ((((v) - 1) << ESAI_xCCR_xFP_SHIFT) & ESAI_xCCR_xFP_MASK)
304#define ESAI_xCCR_xDC_SHIFT 9 304#define ESAI_xCCR_xDC_SHIFT 9
305#define ESAI_xCCR_xDC_WIDTH 4 305#define ESAI_xCCR_xDC_WIDTH 5
306#define ESAI_xCCR_xDC_MASK (((1 << ESAI_xCCR_xDC_WIDTH) - 1) << ESAI_xCCR_xDC_SHIFT) 306#define ESAI_xCCR_xDC_MASK (((1 << ESAI_xCCR_xDC_WIDTH) - 1) << ESAI_xCCR_xDC_SHIFT)
307#define ESAI_xCCR_xDC(v) ((((v) - 1) << ESAI_xCCR_xDC_SHIFT) & ESAI_xCCR_xDC_MASK) 307#define ESAI_xCCR_xDC(v) ((((v) - 1) << ESAI_xCCR_xDC_SHIFT) & ESAI_xCCR_xDC_MASK)
308#define ESAI_xCCR_xPSR_SHIFT 8 308#define ESAI_xCCR_xPSR_SHIFT 8
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index a65f17d57ffb..059496ed9ad7 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1362,9 +1362,9 @@ static int fsl_ssi_probe(struct platform_device *pdev)
1362 } 1362 }
1363 1363
1364 ssi_private->irq = platform_get_irq(pdev, 0); 1364 ssi_private->irq = platform_get_irq(pdev, 0);
1365 if (!ssi_private->irq) { 1365 if (ssi_private->irq < 0) {
1366 dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); 1366 dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
1367 return -ENXIO; 1367 return ssi_private->irq;
1368 } 1368 }
1369 1369
1370 /* Are the RX and the TX clocks locked? */ 1370 /* Are the RX and the TX clocks locked? */
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index 4caacb05a623..cd146d4fa805 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -257,6 +257,7 @@ static int imx_wm8962_probe(struct platform_device *pdev)
257 if (ret) 257 if (ret)
258 goto clk_fail; 258 goto clk_fail;
259 data->card.num_links = 1; 259 data->card.num_links = 1;
260 data->card.owner = THIS_MODULE;
260 data->card.dai_link = &data->dai; 261 data->card.dai_link = &data->dai;
261 data->card.dapm_widgets = imx_wm8962_dapm_widgets; 262 data->card.dapm_widgets = imx_wm8962_dapm_widgets;
262 data->card.num_dapm_widgets = ARRAY_SIZE(imx_wm8962_dapm_widgets); 263 data->card.num_dapm_widgets = ARRAY_SIZE(imx_wm8962_dapm_widgets);
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fb9240fdc9b7..7fe3009b1c43 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -452,9 +452,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
452} 452}
453 453
454/* Decrease the reference count of the device nodes */ 454/* Decrease the reference count of the device nodes */
455static int asoc_simple_card_unref(struct platform_device *pdev) 455static int asoc_simple_card_unref(struct snd_soc_card *card)
456{ 456{
457 struct snd_soc_card *card = platform_get_drvdata(pdev);
458 struct snd_soc_dai_link *dai_link; 457 struct snd_soc_dai_link *dai_link;
459 int num_links; 458 int num_links;
460 459
@@ -556,7 +555,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
556 return ret; 555 return ret;
557 556
558err: 557err:
559 asoc_simple_card_unref(pdev); 558 asoc_simple_card_unref(&priv->snd_card);
560 return ret; 559 return ret;
561} 560}
562 561
@@ -572,7 +571,7 @@ static int asoc_simple_card_remove(struct platform_device *pdev)
572 snd_soc_jack_free_gpios(&simple_card_mic_jack, 1, 571 snd_soc_jack_free_gpios(&simple_card_mic_jack, 1,
573 &simple_card_mic_jack_gpio); 572 &simple_card_mic_jack_gpio);
574 573
575 return asoc_simple_card_unref(pdev); 574 return asoc_simple_card_unref(card);
576} 575}
577 576
578static const struct of_device_id asoc_simple_of_match[] = { 577static const struct of_device_id asoc_simple_of_match[] = {
diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index ef2e8b5766a1..b3f9489794a6 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -706,6 +706,7 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
706 struct list_head *block_list) 706 struct list_head *block_list)
707{ 707{
708 struct sst_mem_block *block, *tmp; 708 struct sst_mem_block *block, *tmp;
709 struct sst_block_allocator ba_tmp = *ba;
709 u32 end = ba->offset + ba->size, block_end; 710 u32 end = ba->offset + ba->size, block_end;
710 int err; 711 int err;
711 712
@@ -730,9 +731,9 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
730 if (ba->offset >= block->offset && ba->offset < block_end) { 731 if (ba->offset >= block->offset && ba->offset < block_end) {
731 732
732 /* align ba to block boundary */ 733 /* align ba to block boundary */
733 ba->size -= block_end - ba->offset; 734 ba_tmp.size -= block_end - ba->offset;
734 ba->offset = block_end; 735 ba_tmp.offset = block_end;
735 err = block_alloc_contiguous(dsp, ba, block_list); 736 err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
736 if (err < 0) 737 if (err < 0)
737 return -ENOMEM; 738 return -ENOMEM;
738 739
@@ -767,10 +768,10 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
767 list_move(&block->list, &dsp->used_block_list); 768 list_move(&block->list, &dsp->used_block_list);
768 list_add(&block->module_list, block_list); 769 list_add(&block->module_list, block_list);
769 /* align ba to block boundary */ 770 /* align ba to block boundary */
770 ba->size -= block_end - ba->offset; 771 ba_tmp.size -= block_end - ba->offset;
771 ba->offset = block_end; 772 ba_tmp.offset = block_end;
772 773
773 err = block_alloc_contiguous(dsp, ba, block_list); 774 err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
774 if (err < 0) 775 if (err < 0)
775 return -ENOMEM; 776 return -ENOMEM;
776 777
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 3f8c48231364..8156cc1accb7 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -651,11 +651,11 @@ static void hsw_notification_work(struct work_struct *work)
651 } 651 }
652 652
653 /* tell DSP that notification has been handled */ 653 /* tell DSP that notification has been handled */
654 sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IPCD, 654 sst_dsp_shim_update_bits(hsw->dsp, SST_IPCD,
655 SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); 655 SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
656 656
657 /* unmask busy interrupt */ 657 /* unmask busy interrupt */
658 sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0); 658 sst_dsp_shim_update_bits(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
659} 659}
660 660
661static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header) 661static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header)
@@ -1228,6 +1228,11 @@ int sst_hsw_stream_free(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1228 struct sst_dsp *sst = hsw->dsp; 1228 struct sst_dsp *sst = hsw->dsp;
1229 unsigned long flags; 1229 unsigned long flags;
1230 1230
1231 if (!stream) {
1232 dev_warn(hsw->dev, "warning: stream is NULL, no stream to free, ignore it.\n");
1233 return 0;
1234 }
1235
1231 /* dont free DSP streams that are not commited */ 1236 /* dont free DSP streams that are not commited */
1232 if (!stream->commited) 1237 if (!stream->commited)
1233 goto out; 1238 goto out;
@@ -1415,6 +1420,16 @@ int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1415 u32 header; 1420 u32 header;
1416 int ret; 1421 int ret;
1417 1422
1423 if (!stream) {
1424 dev_warn(hsw->dev, "warning: stream is NULL, no stream to commit, ignore it.\n");
1425 return 0;
1426 }
1427
1428 if (stream->commited) {
1429 dev_warn(hsw->dev, "warning: stream is already committed, ignore it.\n");
1430 return 0;
1431 }
1432
1418 trace_ipc_request("stream alloc", stream->host_id); 1433 trace_ipc_request("stream alloc", stream->host_id);
1419 1434
1420 header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM); 1435 header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM);
@@ -1519,6 +1534,11 @@ int sst_hsw_stream_pause(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
1519{ 1534{
1520 int ret; 1535 int ret;
1521 1536
1537 if (!stream) {
1538 dev_warn(hsw->dev, "warning: stream is NULL, no stream to pause, ignore it.\n");
1539 return 0;
1540 }
1541
1522 trace_ipc_request("stream pause", stream->reply.stream_hw_id); 1542 trace_ipc_request("stream pause", stream->reply.stream_hw_id);
1523 1543
1524 ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE, 1544 ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE,
@@ -1535,6 +1555,11 @@ int sst_hsw_stream_resume(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
1535{ 1555{
1536 int ret; 1556 int ret;
1537 1557
1558 if (!stream) {
1559 dev_warn(hsw->dev, "warning: stream is NULL, no stream to resume, ignore it.\n");
1560 return 0;
1561 }
1562
1538 trace_ipc_request("stream resume", stream->reply.stream_hw_id); 1563 trace_ipc_request("stream resume", stream->reply.stream_hw_id);
1539 1564
1540 ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME, 1565 ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME,
@@ -1550,6 +1575,11 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1550{ 1575{
1551 int ret, tries = 10; 1576 int ret, tries = 10;
1552 1577
1578 if (!stream) {
1579 dev_warn(hsw->dev, "warning: stream is NULL, no stream to reset, ignore it.\n");
1580 return 0;
1581 }
1582
1553 /* dont reset streams that are not commited */ 1583 /* dont reset streams that are not commited */
1554 if (!stream->commited) 1584 if (!stream->commited)
1555 return 0; 1585 return 0;
diff --git a/sound/soc/intel/sst/sst_acpi.c b/sound/soc/intel/sst/sst_acpi.c
index 2ac72eb5e75d..b3360139c41a 100644
--- a/sound/soc/intel/sst/sst_acpi.c
+++ b/sound/soc/intel/sst/sst_acpi.c
@@ -350,7 +350,7 @@ static struct sst_machines sst_acpi_bytcr[] = {
350 350
351/* Cherryview-based platforms: CherryTrail and Braswell */ 351/* Cherryview-based platforms: CherryTrail and Braswell */
352static struct sst_machines sst_acpi_chv[] = { 352static struct sst_machines sst_acpi_chv[] = {
353 {"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "fw_sst_22a8.bin", 353 {"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "intel/fw_sst_22a8.bin",
354 &chv_platform_data }, 354 &chv_platform_data },
355 {}, 355 {},
356}; 356};
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 8b79cafab1e2..c7eb9dd67f60 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -434,7 +434,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
434 case SND_SOC_DAIFMT_CBM_CFS: 434 case SND_SOC_DAIFMT_CBM_CFS:
435 /* McBSP slave. FS clock as output */ 435 /* McBSP slave. FS clock as output */
436 regs->srgr2 |= FSGM; 436 regs->srgr2 |= FSGM;
437 regs->pcr0 |= FSXM; 437 regs->pcr0 |= FSXM | FSRM;
438 break; 438 break;
439 case SND_SOC_DAIFMT_CBM_CFM: 439 case SND_SOC_DAIFMT_CBM_CFM:
440 /* McBSP slave */ 440 /* McBSP slave */
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 13d8507333b8..dcc26eda0539 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -335,6 +335,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
335 SNDRV_PCM_FMTBIT_S24_LE), 335 SNDRV_PCM_FMTBIT_S24_LE),
336 }, 336 },
337 .ops = &rockchip_i2s_dai_ops, 337 .ops = &rockchip_i2s_dai_ops,
338 .symmetric_rates = 1,
338}; 339};
339 340
340static const struct snd_soc_component_driver rockchip_i2s_component = { 341static const struct snd_soc_component_driver rockchip_i2s_component = {
diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c
index 2e10e9a38376..08d7259bbaab 100644
--- a/sound/soc/soc-ac97.c
+++ b/sound/soc/soc-ac97.c
@@ -48,15 +48,18 @@ static void soc_ac97_device_release(struct device *dev)
48} 48}
49 49
50/** 50/**
51 * snd_soc_new_ac97_codec - initailise AC97 device 51 * snd_soc_alloc_ac97_codec() - Allocate new a AC'97 device
52 * @codec: audio codec 52 * @codec: The CODEC for which to create the AC'97 device
53 * 53 *
54 * Initialises AC97 codec resources for use by ad-hoc devices only. 54 * Allocated a new snd_ac97 device and intializes it, but does not yet register
55 * it. The caller is responsible to either call device_add(&ac97->dev) to
56 * register the device, or to call put_device(&ac97->dev) to free the device.
57 *
58 * Returns: A snd_ac97 device or a PTR_ERR in case of an error.
55 */ 59 */
56struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec) 60struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec)
57{ 61{
58 struct snd_ac97 *ac97; 62 struct snd_ac97 *ac97;
59 int ret;
60 63
61 ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); 64 ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL);
62 if (ac97 == NULL) 65 if (ac97 == NULL)
@@ -73,7 +76,28 @@ struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
73 codec->component.card->snd_card->number, 0, 76 codec->component.card->snd_card->number, 0,
74 codec->component.name); 77 codec->component.name);
75 78
76 ret = device_register(&ac97->dev); 79 device_initialize(&ac97->dev);
80
81 return ac97;
82}
83EXPORT_SYMBOL(snd_soc_alloc_ac97_codec);
84
85/**
86 * snd_soc_new_ac97_codec - initailise AC97 device
87 * @codec: audio codec
88 *
89 * Initialises AC97 codec resources for use by ad-hoc devices only.
90 */
91struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
92{
93 struct snd_ac97 *ac97;
94 int ret;
95
96 ac97 = snd_soc_alloc_ac97_codec(codec);
97 if (IS_ERR(ac97))
98 return ac97;
99
100 ret = device_add(&ac97->dev);
77 if (ret) { 101 if (ret) {
78 put_device(&ac97->dev); 102 put_device(&ac97->dev);
79 return ERR_PTR(ret); 103 return ERR_PTR(ret);
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 590a82f01d0b..025c38fbe3c0 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -659,7 +659,8 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
659 rtd->dai_link->stream_name); 659 rtd->dai_link->stream_name);
660 660
661 ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num, 661 ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
662 1, 0, &be_pcm); 662 rtd->dai_link->dpcm_playback,
663 rtd->dai_link->dpcm_capture, &be_pcm);
663 if (ret < 0) { 664 if (ret < 0) {
664 dev_err(rtd->card->dev, "ASoC: can't create compressed for %s\n", 665 dev_err(rtd->card->dev, "ASoC: can't create compressed for %s\n",
665 rtd->dai_link->name); 666 rtd->dai_link->name);
@@ -668,8 +669,10 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
668 669
669 rtd->pcm = be_pcm; 670 rtd->pcm = be_pcm;
670 rtd->fe_compr = 1; 671 rtd->fe_compr = 1;
671 be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd; 672 if (rtd->dai_link->dpcm_playback)
672 be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd; 673 be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
674 else if (rtd->dai_link->dpcm_capture)
675 be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
673 memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops)); 676 memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
674 } else 677 } else
675 memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops)); 678 memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));