aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2017-11-10 16:30:27 -0500
committerMark Brown <broonie@kernel.org>2017-11-10 16:30:27 -0500
commit16a077e17ccf275a56fa21aa36a019ab063064f9 (patch)
tree3438412788ad43a5b094cb65b9ccc944ee66d619
parent39dae59d66acd86d1de24294bd2f343fd5e7a625 (diff)
parent0bebd2f1bfcbf954a93b65d4b2848488fd049c78 (diff)
Merge tag 'asoc-fix-v4.14-rc6' into asoc-linus
ASoC: Fixes for v4.14 I've been quite lax in sending these due to conference season but here's a fairly large collection of ASoC updates. The one thing that's not device specific is Takashi's fix for races between delayed work and PCM destruction, otherwise everything is specific to an individual device. # gpg: Signature made Thu 26 Oct 2017 15:11:23 BST # gpg: using RSA key ADE668AA675718B59FE29FEA24D68B725D5487D0 # gpg: issuer "broonie@kernel.org" # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" [unknown] # gpg: aka "Mark Brown <broonie@debian.org>" [unknown] # gpg: aka "Mark Brown <broonie@kernel.org>" [unknown] # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" [unknown] # gpg: aka "Mark Brown <broonie@linaro.org>" [unknown] # gpg: aka "Mark Brown <Mark.Brown@linaro.org>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 3F25 68AA C269 98F9 E813 A1C5 C3F4 36CA 30F5 D8EB # Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2 9FEA 24D6 8B72 5D54 87D0
-rw-r--r--sound/soc/codecs/max98090.c2
-rw-r--r--sound/soc/codecs/msm8916-wcd-analog.c7
-rw-r--r--sound/soc/codecs/msm8916-wcd-digital.c4
-rw-r--r--sound/soc/codecs/wm8998.c84
-rw-r--r--sound/soc/davinci/davinci-mcasp.c6
-rw-r--r--sound/soc/intel/boards/cht_bsw_max98090_ti.c6
-rw-r--r--sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c2
-rw-r--r--sound/soc/intel/skylake/skl-topology.c2
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c1
-rw-r--r--sound/soc/samsung/i2s.c6
-rw-r--r--sound/soc/sh/rcar/adg.c4
-rw-r--r--sound/soc/sh/rcar/ssi.c5
-rw-r--r--sound/soc/soc-pcm.c13
-rw-r--r--sound/soc/stm/stm32_sai.c2
-rw-r--r--sound/soc/stm/stm32_sai_sub.c33
15 files changed, 81 insertions, 96 deletions
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 13bcfb1ef9b4..f5075d1f79e6 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2115,7 +2115,7 @@ static void max98090_pll_work(struct work_struct *work)
2115 if (!snd_soc_codec_is_active(codec)) 2115 if (!snd_soc_codec_is_active(codec))
2116 return; 2116 return;
2117 2117
2118 dev_info(codec->dev, "PLL unlocked\n"); 2118 dev_info_ratelimited(codec->dev, "PLL unlocked\n");
2119 2119
2120 /* Toggle shutdown OFF then ON */ 2120 /* Toggle shutdown OFF then ON */
2121 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN, 2121 snd_soc_update_bits(codec, M98090_REG_DEVICE_SHUTDOWN,
diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
index 549c269acc7d..a42f8ebb9670 100644
--- a/sound/soc/codecs/msm8916-wcd-analog.c
+++ b/sound/soc/codecs/msm8916-wcd-analog.c
@@ -104,7 +104,7 @@
104#define CDC_A_MICB_1_VAL (0xf141) 104#define CDC_A_MICB_1_VAL (0xf141)
105#define MICB_MIN_VAL 1600 105#define MICB_MIN_VAL 1600
106#define MICB_STEP_SIZE 50 106#define MICB_STEP_SIZE 50
107#define MICB_VOLTAGE_REGVAL(v) ((v - MICB_MIN_VAL)/MICB_STEP_SIZE) 107#define MICB_VOLTAGE_REGVAL(v) (((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3)
108#define MICB_1_VAL_MICB_OUT_VAL_MASK GENMASK(7, 3) 108#define MICB_1_VAL_MICB_OUT_VAL_MASK GENMASK(7, 3)
109#define MICB_1_VAL_MICB_OUT_VAL_V2P70V ((0x16) << 3) 109#define MICB_1_VAL_MICB_OUT_VAL_V2P70V ((0x16) << 3)
110#define MICB_1_VAL_MICB_OUT_VAL_V1P80V ((0x4) << 3) 110#define MICB_1_VAL_MICB_OUT_VAL_V1P80V ((0x4) << 3)
@@ -349,8 +349,9 @@ static void pm8916_wcd_analog_micbias_enable(struct snd_soc_codec *codec)
349 | MICB_1_CTL_EXT_PRECHARG_EN_ENABLE); 349 | MICB_1_CTL_EXT_PRECHARG_EN_ENABLE);
350 350
351 if (wcd->micbias_mv) { 351 if (wcd->micbias_mv) {
352 snd_soc_write(codec, CDC_A_MICB_1_VAL, 352 snd_soc_update_bits(codec, CDC_A_MICB_1_VAL,
353 MICB_VOLTAGE_REGVAL(wcd->micbias_mv)); 353 MICB_1_VAL_MICB_OUT_VAL_MASK,
354 MICB_VOLTAGE_REGVAL(wcd->micbias_mv));
354 /* 355 /*
355 * Special headset needs MICBIAS as 2.7V so wait for 356 * Special headset needs MICBIAS as 2.7V so wait for
356 * 50 msec for the MICBIAS to reach 2.7 volts. 357 * 50 msec for the MICBIAS to reach 2.7 volts.
diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index 66df8f810f0d..a10a724eb448 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -238,7 +238,7 @@ static const struct soc_enum rx_mix2_inp1_chain_enum = SOC_ENUM_SINGLE(
238static const struct soc_enum rx2_mix1_inp_enum[] = { 238static const struct soc_enum rx2_mix1_inp_enum[] = {
239 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B1_CTL, 0, 6, rx_mix1_text), 239 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B1_CTL, 0, 6, rx_mix1_text),
240 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B1_CTL, 3, 6, rx_mix1_text), 240 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B1_CTL, 3, 6, rx_mix1_text),
241 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B1_CTL, 0, 6, rx_mix1_text), 241 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B2_CTL, 0, 6, rx_mix1_text),
242}; 242};
243 243
244/* RX2 MIX2 */ 244/* RX2 MIX2 */
@@ -249,7 +249,7 @@ static const struct soc_enum rx2_mix2_inp1_chain_enum = SOC_ENUM_SINGLE(
249static const struct soc_enum rx3_mix1_inp_enum[] = { 249static const struct soc_enum rx3_mix1_inp_enum[] = {
250 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B1_CTL, 0, 6, rx_mix1_text), 250 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B1_CTL, 0, 6, rx_mix1_text),
251 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B1_CTL, 3, 6, rx_mix1_text), 251 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B1_CTL, 3, 6, rx_mix1_text),
252 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B1_CTL, 0, 6, rx_mix1_text), 252 SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B2_CTL, 0, 6, rx_mix1_text),
253}; 253};
254 254
255/* DEC */ 255/* DEC */
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index 44f447136e22..4b64bb46eb21 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -101,7 +101,7 @@ static int wm8998_asrc_ev(struct snd_soc_dapm_widget *w,
101 return 0; 101 return 0;
102} 102}
103 103
104static int wm8998_in1mux_put(struct snd_kcontrol *kcontrol, 104static int wm8998_inmux_put(struct snd_kcontrol *kcontrol,
105 struct snd_ctl_elem_value *ucontrol) 105 struct snd_ctl_elem_value *ucontrol)
106{ 106{
107 struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol); 107 struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
@@ -109,84 +109,38 @@ static int wm8998_in1mux_put(struct snd_kcontrol *kcontrol,
109 struct wm8998_priv *wm8998 = snd_soc_codec_get_drvdata(codec); 109 struct wm8998_priv *wm8998 = snd_soc_codec_get_drvdata(codec);
110 struct arizona *arizona = wm8998->core.arizona; 110 struct arizona *arizona = wm8998->core.arizona;
111 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 111 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
112 unsigned int mux, inmode; 112 unsigned int mode_reg, mode_index;
113 unsigned int mode_val, src_val; 113 unsigned int mux, inmode, src_val, mode_val;
114 114
115 mux = ucontrol->value.enumerated.item[0]; 115 mux = ucontrol->value.enumerated.item[0];
116 if (mux > 1) 116 if (mux > 1)
117 return -EINVAL; 117 return -EINVAL;
118 118
119 /* L and R registers have same shift and mask */ 119 switch (e->reg) {
120 inmode = arizona->pdata.inmode[2 * mux]; 120 case ARIZONA_ADC_DIGITAL_VOLUME_2L:
121 src_val = mux << ARIZONA_IN1L_SRC_SHIFT; 121 mode_reg = ARIZONA_IN2L_CONTROL;
122 if (inmode & ARIZONA_INMODE_SE) 122 mode_index = 1 + (2 * mux);
123 src_val |= 1 << ARIZONA_IN1L_SRC_SE_SHIFT;
124
125 switch (arizona->pdata.inmode[0]) {
126 case ARIZONA_INMODE_DMIC:
127 if (mux)
128 mode_val = 0; /* B always analogue */
129 else
130 mode_val = 1 << ARIZONA_IN1_MODE_SHIFT;
131
132 snd_soc_update_bits(codec, ARIZONA_IN1L_CONTROL,
133 ARIZONA_IN1_MODE_MASK, mode_val);
134
135 /* IN1A is digital so L and R must change together */
136 /* src_val setting same for both registers */
137 snd_soc_update_bits(codec,
138 ARIZONA_ADC_DIGITAL_VOLUME_1L,
139 ARIZONA_IN1L_SRC_MASK |
140 ARIZONA_IN1L_SRC_SE_MASK, src_val);
141 snd_soc_update_bits(codec,
142 ARIZONA_ADC_DIGITAL_VOLUME_1R,
143 ARIZONA_IN1R_SRC_MASK |
144 ARIZONA_IN1R_SRC_SE_MASK, src_val);
145 break; 123 break;
146 default: 124 default:
147 /* both analogue */ 125 mode_reg = ARIZONA_IN1L_CONTROL;
148 snd_soc_update_bits(codec, 126 mode_index = (2 * mux);
149 e->reg,
150 ARIZONA_IN1L_SRC_MASK |
151 ARIZONA_IN1L_SRC_SE_MASK,
152 src_val);
153 break; 127 break;
154 } 128 }
155 129
156 return snd_soc_dapm_mux_update_power(dapm, kcontrol, 130 inmode = arizona->pdata.inmode[mode_index];
157 ucontrol->value.enumerated.item[0],
158 e, NULL);
159}
160
161static int wm8998_in2mux_put(struct snd_kcontrol *kcontrol,
162 struct snd_ctl_elem_value *ucontrol)
163{
164 struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
165 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
166 struct wm8998_priv *wm8998 = snd_soc_codec_get_drvdata(codec);
167 struct arizona *arizona = wm8998->core.arizona;
168 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
169 unsigned int mux, inmode, src_val, mode_val;
170
171 mux = ucontrol->value.enumerated.item[0];
172 if (mux > 1)
173 return -EINVAL;
174
175 inmode = arizona->pdata.inmode[1 + (2 * mux)];
176 if (inmode & ARIZONA_INMODE_DMIC) 131 if (inmode & ARIZONA_INMODE_DMIC)
177 mode_val = 1 << ARIZONA_IN2_MODE_SHIFT; 132 mode_val = 1 << ARIZONA_IN1_MODE_SHIFT;
178 else 133 else
179 mode_val = 0; 134 mode_val = 0;
180 135
181 src_val = mux << ARIZONA_IN2L_SRC_SHIFT; 136 src_val = mux << ARIZONA_IN1L_SRC_SHIFT;
182 if (inmode & ARIZONA_INMODE_SE) 137 if (inmode & ARIZONA_INMODE_SE)
183 src_val |= 1 << ARIZONA_IN2L_SRC_SE_SHIFT; 138 src_val |= 1 << ARIZONA_IN1L_SRC_SE_SHIFT;
184 139
185 snd_soc_update_bits(codec, ARIZONA_IN2L_CONTROL, 140 snd_soc_update_bits(codec, mode_reg, ARIZONA_IN1_MODE_MASK, mode_val);
186 ARIZONA_IN2_MODE_MASK, mode_val);
187 141
188 snd_soc_update_bits(codec, ARIZONA_ADC_DIGITAL_VOLUME_2L, 142 snd_soc_update_bits(codec, e->reg,
189 ARIZONA_IN2L_SRC_MASK | ARIZONA_IN2L_SRC_SE_MASK, 143 ARIZONA_IN1L_SRC_MASK | ARIZONA_IN1L_SRC_SE_MASK,
190 src_val); 144 src_val);
191 145
192 return snd_soc_dapm_mux_update_power(dapm, kcontrol, 146 return snd_soc_dapm_mux_update_power(dapm, kcontrol,
@@ -216,14 +170,14 @@ static SOC_ENUM_SINGLE_DECL(wm8998_in2mux_enum,
216 170
217static const struct snd_kcontrol_new wm8998_in1mux[2] = { 171static const struct snd_kcontrol_new wm8998_in1mux[2] = {
218 SOC_DAPM_ENUM_EXT("IN1L Mux", wm8998_in1muxl_enum, 172 SOC_DAPM_ENUM_EXT("IN1L Mux", wm8998_in1muxl_enum,
219 snd_soc_dapm_get_enum_double, wm8998_in1mux_put), 173 snd_soc_dapm_get_enum_double, wm8998_inmux_put),
220 SOC_DAPM_ENUM_EXT("IN1R Mux", wm8998_in1muxr_enum, 174 SOC_DAPM_ENUM_EXT("IN1R Mux", wm8998_in1muxr_enum,
221 snd_soc_dapm_get_enum_double, wm8998_in1mux_put), 175 snd_soc_dapm_get_enum_double, wm8998_inmux_put),
222}; 176};
223 177
224static const struct snd_kcontrol_new wm8998_in2mux = 178static const struct snd_kcontrol_new wm8998_in2mux =
225 SOC_DAPM_ENUM_EXT("IN2 Mux", wm8998_in2mux_enum, 179 SOC_DAPM_ENUM_EXT("IN2 Mux", wm8998_in2mux_enum,
226 snd_soc_dapm_get_enum_double, wm8998_in2mux_put); 180 snd_soc_dapm_get_enum_double, wm8998_inmux_put);
227 181
228static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); 182static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
229static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); 183static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index f395bbc7c354..23b0da7df1f2 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1982,8 +1982,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1982 GFP_KERNEL); 1982 GFP_KERNEL);
1983 1983
1984 if (!mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list || 1984 if (!mcasp->chconstr[SNDRV_PCM_STREAM_PLAYBACK].list ||
1985 !mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list) 1985 !mcasp->chconstr[SNDRV_PCM_STREAM_CAPTURE].list) {
1986 return -ENOMEM; 1986 ret = -ENOMEM;
1987 goto err;
1988 }
1987 1989
1988 ret = davinci_mcasp_set_ch_constraints(mcasp); 1990 ret = davinci_mcasp_set_ch_constraints(mcasp);
1989 if (ret) 1991 if (ret)
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ecc7f9e..455a55af7ad2 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -160,7 +160,7 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
160 return ret; 160 return ret;
161 } 161 }
162 162
163 fmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF 163 fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
164 | SND_SOC_DAIFMT_CBS_CFS; 164 | SND_SOC_DAIFMT_CBS_CFS;
165 165
166 ret = snd_soc_dai_set_fmt(rtd->cpu_dai, fmt); 166 ret = snd_soc_dai_set_fmt(rtd->cpu_dai, fmt);
@@ -173,8 +173,8 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
173 rate->min = rate->max = 48000; 173 rate->min = rate->max = 48000;
174 channels->min = channels->max = 2; 174 channels->min = channels->max = 2;
175 175
176 /* set SSP2 to 24-bit */ 176 /* set SSP2 to 16-bit */
177 params_set_format(params, SNDRV_PCM_FORMAT_S24_LE); 177 params_set_format(params, SNDRV_PCM_FORMAT_S16_LE);
178 return 0; 178 return 0;
179} 179}
180 180
diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
index 88ff54220007..9cd0769ccd34 100644
--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
@@ -604,6 +604,8 @@ static int kabylake_card_late_probe(struct snd_soc_card *card)
604 604
605 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { 605 list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) {
606 codec = pcm->codec_dai->codec; 606 codec = pcm->codec_dai->codec;
607 snprintf(jack_name, sizeof(jack_name),
608 "HDMI/DP, pcm=%d Jack", pcm->device);
607 err = snd_soc_card_jack_new(card, jack_name, 609 err = snd_soc_card_jack_new(card, jack_name,
608 SND_JACK_AVOUT, &ctx->kabylake_hdmi[i], 610 SND_JACK_AVOUT, &ctx->kabylake_hdmi[i],
609 NULL, 0); 611 NULL, 0);
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 22f768ca3c73..27bcb62568fb 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -2382,7 +2382,7 @@ static int skl_tplg_get_token(struct device *dev,
2382 case SKL_TKN_U32_MAX_MCPS: 2382 case SKL_TKN_U32_MAX_MCPS:
2383 case SKL_TKN_U32_OBS: 2383 case SKL_TKN_U32_OBS:
2384 case SKL_TKN_U32_IBS: 2384 case SKL_TKN_U32_IBS:
2385 ret = skl_tplg_fill_res_tkn(dev, tkn_elem, res, dir, pin_index); 2385 ret = skl_tplg_fill_res_tkn(dev, tkn_elem, res, pin_index, dir);
2386 if (ret < 0) 2386 if (ret < 0)
2387 return ret; 2387 return ret;
2388 2388
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index b6590467fd14..908211e1d6fc 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -692,7 +692,6 @@ static int rockchip_i2s_remove(struct platform_device *pdev)
692 if (!pm_runtime_status_suspended(&pdev->dev)) 692 if (!pm_runtime_status_suspended(&pdev->dev))
693 i2s_runtime_suspend(&pdev->dev); 693 i2s_runtime_suspend(&pdev->dev);
694 694
695 clk_disable_unprepare(i2s->mclk);
696 clk_disable_unprepare(i2s->hclk); 695 clk_disable_unprepare(i2s->hclk);
697 696
698 return 0; 697 return 0;
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 10a4da06c0a1..de783c6d2a70 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
552 } 552 }
553 553
554 ret = clk_prepare_enable(i2s->op_clk); 554 ret = clk_prepare_enable(i2s->op_clk);
555 if (ret) 555 if (ret) {
556 clk_put(i2s->op_clk);
557 i2s->op_clk = NULL;
556 goto err; 558 goto err;
559 }
557 i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); 560 i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);
558 561
559 /* Over-ride the other's */ 562 /* Over-ride the other's */
@@ -1285,6 +1288,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1285 } 1288 }
1286 } 1289 }
1287 } 1290 }
1291 quirks &= ~(QUIRK_SEC_DAI | QUIRK_SUPPORTS_IDMA);
1288 1292
1289 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1293 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1290 pri_dai->addr = devm_ioremap_resource(&pdev->dev, res); 1294 pri_dai->addr = devm_ioremap_resource(&pdev->dev, res);
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 938baff86ef2..e11ce5036bcf 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -479,10 +479,10 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
479 } 479 }
480 480
481 if (req_rate[0] % 48000 == 0) 481 if (req_rate[0] % 48000 == 0)
482 adg->flags = AUDIO_OUT_48; 482 adg->flags |= AUDIO_OUT_48;
483 483
484 if (of_get_property(np, "clkout-lr-asynchronous", NULL)) 484 if (of_get_property(np, "clkout-lr-asynchronous", NULL))
485 adg->flags = LRCLK_ASYNC; 485 adg->flags |= LRCLK_ASYNC;
486 486
487 /* 487 /*
488 * This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC 488 * This driver is assuming that AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index fffc07e72627..03c2a1f02643 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -1112,6 +1112,9 @@ int rsnd_ssi_probe(struct rsnd_priv *priv)
1112 1112
1113 i = 0; 1113 i = 0;
1114 for_each_child_of_node(node, np) { 1114 for_each_child_of_node(node, np) {
1115 if (!of_device_is_available(np))
1116 goto skip;
1117
1115 ssi = rsnd_ssi_get(priv, i); 1118 ssi = rsnd_ssi_get(priv, i);
1116 1119
1117 snprintf(name, RSND_SSI_NAME_SIZE, "%s.%d", 1120 snprintf(name, RSND_SSI_NAME_SIZE, "%s.%d",
@@ -1148,7 +1151,7 @@ int rsnd_ssi_probe(struct rsnd_priv *priv)
1148 of_node_put(np); 1151 of_node_put(np);
1149 goto rsnd_ssi_probe_done; 1152 goto rsnd_ssi_probe_done;
1150 } 1153 }
1151 1154skip:
1152 i++; 1155 i++;
1153 } 1156 }
1154 1157
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 94b88b897c3b..c0f0b09cb433 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2632,6 +2632,17 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
2632 return ret; 2632 return ret;
2633} 2633}
2634 2634
2635static void soc_pcm_private_free(struct snd_pcm *pcm)
2636{
2637 struct snd_soc_pcm_runtime *rtd = pcm->private_data;
2638 struct snd_soc_platform *platform = rtd->platform;
2639
2640 /* need to sync the delayed work before releasing resources */
2641 flush_delayed_work(&rtd->delayed_work);
2642 if (platform->driver->pcm_free)
2643 platform->driver->pcm_free(pcm);
2644}
2645
2635/* create a new pcm */ 2646/* create a new pcm */
2636int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) 2647int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
2637{ 2648{
@@ -2757,7 +2768,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
2757 } 2768 }
2758 } 2769 }
2759 2770
2760 pcm->private_free = platform->driver->pcm_free; 2771 pcm->private_free = soc_pcm_private_free;
2761out: 2772out:
2762 dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", 2773 dev_info(rtd->card->dev, "%s <-> %s mapping ok\n",
2763 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, 2774 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name,
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index 1258bef4dcb3..5fe878ace605 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -85,7 +85,7 @@ static int stm32_sai_probe(struct platform_device *pdev)
85 } 85 }
86 86
87 /* reset */ 87 /* reset */
88 rst = reset_control_get_exclusive(&pdev->dev, NULL); 88 rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
89 if (!IS_ERR(rst)) { 89 if (!IS_ERR(rst)) {
90 reset_control_assert(rst); 90 reset_control_assert(rst);
91 udelay(2); 91 udelay(2);
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index 90d439613899..dde8ddf9e777 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -184,7 +184,6 @@ static const struct regmap_config stm32_sai_sub_regmap_config_h7 = {
184static irqreturn_t stm32_sai_isr(int irq, void *devid) 184static irqreturn_t stm32_sai_isr(int irq, void *devid)
185{ 185{
186 struct stm32_sai_sub_data *sai = (struct stm32_sai_sub_data *)devid; 186 struct stm32_sai_sub_data *sai = (struct stm32_sai_sub_data *)devid;
187 struct snd_pcm_substream *substream = sai->substream;
188 struct platform_device *pdev = sai->pdev; 187 struct platform_device *pdev = sai->pdev;
189 unsigned int sr, imr, flags; 188 unsigned int sr, imr, flags;
190 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING; 189 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING;
@@ -199,6 +198,11 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid)
199 regmap_update_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK, 198 regmap_update_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
200 SAI_XCLRFR_MASK); 199 SAI_XCLRFR_MASK);
201 200
201 if (!sai->substream) {
202 dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr);
203 return IRQ_NONE;
204 }
205
202 if (flags & SAI_XIMR_OVRUDRIE) { 206 if (flags & SAI_XIMR_OVRUDRIE) {
203 dev_err(&pdev->dev, "IRQ %s\n", 207 dev_err(&pdev->dev, "IRQ %s\n",
204 STM_SAI_IS_PLAYBACK(sai) ? "underrun" : "overrun"); 208 STM_SAI_IS_PLAYBACK(sai) ? "underrun" : "overrun");
@@ -227,9 +231,9 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid)
227 } 231 }
228 232
229 if (status != SNDRV_PCM_STATE_RUNNING) { 233 if (status != SNDRV_PCM_STATE_RUNNING) {
230 snd_pcm_stream_lock(substream); 234 snd_pcm_stream_lock(sai->substream);
231 snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 235 snd_pcm_stop(sai->substream, SNDRV_PCM_STATE_XRUN);
232 snd_pcm_stream_unlock(substream); 236 snd_pcm_stream_unlock(sai->substream);
233 } 237 }
234 238
235 return IRQ_HANDLED; 239 return IRQ_HANDLED;
@@ -442,12 +446,16 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai,
442{ 446{
443 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); 447 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
444 int cr1, cr1_mask, ret; 448 int cr1, cr1_mask, ret;
445 int fth = STM_SAI_FIFO_TH_HALF;
446 449
447 /* FIFO config */ 450 /*
451 * DMA bursts increment is set to 4 words.
452 * SAI fifo threshold is set to half fifo, to keep enough space
453 * for DMA incoming bursts.
454 */
448 regmap_update_bits(sai->regmap, STM_SAI_CR2_REGX, 455 regmap_update_bits(sai->regmap, STM_SAI_CR2_REGX,
449 SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK, 456 SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
450 SAI_XCR2_FFLUSH | SAI_XCR2_FTH_SET(fth)); 457 SAI_XCR2_FFLUSH |
458 SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
451 459
452 /* Mode, data format and channel config */ 460 /* Mode, data format and channel config */
453 cr1 = SAI_XCR1_PRTCFG_SET(SAI_FREE_PROTOCOL); 461 cr1 = SAI_XCR1_PRTCFG_SET(SAI_FREE_PROTOCOL);
@@ -481,10 +489,6 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai,
481 return ret; 489 return ret;
482 } 490 }
483 491
484 /* DMA config */
485 sai->dma_params.maxburst = STM_SAI_FIFO_SIZE * fth / sizeof(u32);
486 snd_soc_dai_set_dma_data(cpu_dai, substream, (void *)&sai->dma_params);
487
488 return 0; 492 return 0;
489} 493}
490 494
@@ -727,7 +731,12 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai)
727 struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev); 731 struct stm32_sai_sub_data *sai = dev_get_drvdata(cpu_dai->dev);
728 732
729 sai->dma_params.addr = (dma_addr_t)(sai->phys_addr + STM_SAI_DR_REGX); 733 sai->dma_params.addr = (dma_addr_t)(sai->phys_addr + STM_SAI_DR_REGX);
730 sai->dma_params.maxburst = 1; 734 /*
735 * DMA supports 4, 8 or 16 burst sizes. Burst size 4 is the best choice,
736 * as it allows bytes, half-word and words transfers. (See DMA fifos
737 * constraints).
738 */
739 sai->dma_params.maxburst = 4;
731 /* Buswidth will be set by framework at runtime */ 740 /* Buswidth will be set by framework at runtime */
732 sai->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_UNDEFINED; 741 sai->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_UNDEFINED;
733 742