aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-09-17 12:59:21 -0400
committerTakashi Iwai <tiwai@suse.de>2018-09-17 12:59:21 -0400
commit196f4eeeb78f53e0a598db8f9408b6f8b270c355 (patch)
treee86b90621b6693954b5314e622a2980789b879e3
parentc3b55e2ec9c76e7a0de2a0b1dc851fdc9440385b (diff)
parent75383f8d39d4c0fb96083dd460b7b139fbdac492 (diff)
Merge tag 'asoc-v4.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.19 This is the usual set of small fixes scatterd around various drivers, plus one fix for DAPM and a UAPI build fix. There's not a huge amount that stands out here relative to anything else.
-rw-r--r--MAINTAINERS3
-rw-r--r--include/sound/hdaudio.h1
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/uapi/sound/skl-tplg-interface.h106
-rw-r--r--sound/hda/hdac_controller.c15
-rw-r--r--sound/soc/amd/acp-pcm-dma.c21
-rw-r--r--sound/soc/codecs/cs4265.c4
-rw-r--r--sound/soc/codecs/max98373.c3
-rw-r--r--sound/soc/codecs/rt5514.c8
-rw-r--r--sound/soc/codecs/rt5682.c8
-rw-r--r--sound/soc/codecs/sigmadsp.c3
-rw-r--r--sound/soc/codecs/tas6424.c12
-rw-r--r--sound/soc/codecs/wm8804-i2c.c15
-rw-r--r--sound/soc/codecs/wm9712.c2
-rw-r--r--sound/soc/intel/boards/bytcr_rt5640.c26
-rw-r--r--sound/soc/intel/skylake/skl.c2
-rw-r--r--sound/soc/qcom/qdsp6/q6routing.c4
-rw-r--r--sound/soc/sh/rcar/adg.c5
-rw-r--r--sound/soc/sh/rcar/core.c21
-rw-r--r--sound/soc/sh/rcar/dma.c4
-rw-r--r--sound/soc/sh/rcar/rsnd.h7
-rw-r--r--sound/soc/sh/rcar/ssi.c16
-rw-r--r--sound/soc/soc-core.c4
-rw-r--r--sound/soc/soc-dapm.c4
24 files changed, 208 insertions, 87 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index a5b256b25905..ca44d86882f3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13432,9 +13432,8 @@ F: drivers/i2c/busses/i2c-synquacer.c
13432F: Documentation/devicetree/bindings/i2c/i2c-synquacer.txt 13432F: Documentation/devicetree/bindings/i2c/i2c-synquacer.txt
13433 13433
13434SOCIONEXT UNIPHIER SOUND DRIVER 13434SOCIONEXT UNIPHIER SOUND DRIVER
13435M: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
13436L: alsa-devel@alsa-project.org (moderated for non-subscribers) 13435L: alsa-devel@alsa-project.org (moderated for non-subscribers)
13437S: Maintained 13436S: Orphan
13438F: sound/soc/uniphier/ 13437F: sound/soc/uniphier/
13439 13438
13440SOEKRIS NET48XX LED SUPPORT 13439SOEKRIS NET48XX LED SUPPORT
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 6f1e1f3b3063..cd1773d0e08f 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -412,6 +412,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus);
412void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus); 412void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
413void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus); 413void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
414void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus); 414void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
415int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
415 416
416void snd_hdac_bus_update_rirb(struct hdac_bus *bus); 417void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
417int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status, 418int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index af9ef16cc34d..fdaaafdc7a00 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -407,6 +407,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
407int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 407int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
408void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); 408void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
409int snd_soc_dapm_new_pcm(struct snd_soc_card *card, 409int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
410 struct snd_soc_pcm_runtime *rtd,
410 const struct snd_soc_pcm_stream *params, 411 const struct snd_soc_pcm_stream *params,
411 unsigned int num_params, 412 unsigned int num_params,
412 struct snd_soc_dapm_widget *source, 413 struct snd_soc_dapm_widget *source,
diff --git a/include/uapi/sound/skl-tplg-interface.h b/include/uapi/sound/skl-tplg-interface.h
index f58cafa42f18..f39352cef382 100644
--- a/include/uapi/sound/skl-tplg-interface.h
+++ b/include/uapi/sound/skl-tplg-interface.h
@@ -10,6 +10,8 @@
10#ifndef __HDA_TPLG_INTERFACE_H__ 10#ifndef __HDA_TPLG_INTERFACE_H__
11#define __HDA_TPLG_INTERFACE_H__ 11#define __HDA_TPLG_INTERFACE_H__
12 12
13#include <linux/types.h>
14
13/* 15/*
14 * Default types range from 0~12. type can range from 0 to 0xff 16 * Default types range from 0~12. type can range from 0 to 0xff
15 * SST types start at higher to avoid any overlapping in future 17 * SST types start at higher to avoid any overlapping in future
@@ -143,10 +145,10 @@ enum skl_module_param_type {
143}; 145};
144 146
145struct skl_dfw_algo_data { 147struct skl_dfw_algo_data {
146 u32 set_params:2; 148 __u32 set_params:2;
147 u32 rsvd:30; 149 __u32 rsvd:30;
148 u32 param_id; 150 __u32 param_id;
149 u32 max; 151 __u32 max;
150 char params[0]; 152 char params[0];
151} __packed; 153} __packed;
152 154
@@ -163,68 +165,68 @@ enum skl_tuple_type {
163/* v4 configuration data */ 165/* v4 configuration data */
164 166
165struct skl_dfw_v4_module_pin { 167struct skl_dfw_v4_module_pin {
166 u16 module_id; 168 __u16 module_id;
167 u16 instance_id; 169 __u16 instance_id;
168} __packed; 170} __packed;
169 171
170struct skl_dfw_v4_module_fmt { 172struct skl_dfw_v4_module_fmt {
171 u32 channels; 173 __u32 channels;
172 u32 freq; 174 __u32 freq;
173 u32 bit_depth; 175 __u32 bit_depth;
174 u32 valid_bit_depth; 176 __u32 valid_bit_depth;
175 u32 ch_cfg; 177 __u32 ch_cfg;
176 u32 interleaving_style; 178 __u32 interleaving_style;
177 u32 sample_type; 179 __u32 sample_type;
178 u32 ch_map; 180 __u32 ch_map;
179} __packed; 181} __packed;
180 182
181struct skl_dfw_v4_module_caps { 183struct skl_dfw_v4_module_caps {
182 u32 set_params:2; 184 __u32 set_params:2;
183 u32 rsvd:30; 185 __u32 rsvd:30;
184 u32 param_id; 186 __u32 param_id;
185 u32 caps_size; 187 __u32 caps_size;
186 u32 caps[HDA_SST_CFG_MAX]; 188 __u32 caps[HDA_SST_CFG_MAX];
187} __packed; 189} __packed;
188 190
189struct skl_dfw_v4_pipe { 191struct skl_dfw_v4_pipe {
190 u8 pipe_id; 192 __u8 pipe_id;
191 u8 pipe_priority; 193 __u8 pipe_priority;
192 u16 conn_type:4; 194 __u16 conn_type:4;
193 u16 rsvd:4; 195 __u16 rsvd:4;
194 u16 memory_pages:8; 196 __u16 memory_pages:8;
195} __packed; 197} __packed;
196 198
197struct skl_dfw_v4_module { 199struct skl_dfw_v4_module {
198 char uuid[SKL_UUID_STR_SZ]; 200 char uuid[SKL_UUID_STR_SZ];
199 201
200 u16 module_id; 202 __u16 module_id;
201 u16 instance_id; 203 __u16 instance_id;
202 u32 max_mcps; 204 __u32 max_mcps;
203 u32 mem_pages; 205 __u32 mem_pages;
204 u32 obs; 206 __u32 obs;
205 u32 ibs; 207 __u32 ibs;
206 u32 vbus_id; 208 __u32 vbus_id;
207 209
208 u32 max_in_queue:8; 210 __u32 max_in_queue:8;
209 u32 max_out_queue:8; 211 __u32 max_out_queue:8;
210 u32 time_slot:8; 212 __u32 time_slot:8;
211 u32 core_id:4; 213 __u32 core_id:4;
212 u32 rsvd1:4; 214 __u32 rsvd1:4;
213 215
214 u32 module_type:8; 216 __u32 module_type:8;
215 u32 conn_type:4; 217 __u32 conn_type:4;
216 u32 dev_type:4; 218 __u32 dev_type:4;
217 u32 hw_conn_type:4; 219 __u32 hw_conn_type:4;
218 u32 rsvd2:12; 220 __u32 rsvd2:12;
219 221
220 u32 params_fixup:8; 222 __u32 params_fixup:8;
221 u32 converter:8; 223 __u32 converter:8;
222 u32 input_pin_type:1; 224 __u32 input_pin_type:1;
223 u32 output_pin_type:1; 225 __u32 output_pin_type:1;
224 u32 is_dynamic_in_pin:1; 226 __u32 is_dynamic_in_pin:1;
225 u32 is_dynamic_out_pin:1; 227 __u32 is_dynamic_out_pin:1;
226 u32 is_loadable:1; 228 __u32 is_loadable:1;
227 u32 rsvd3:11; 229 __u32 rsvd3:11;
228 230
229 struct skl_dfw_v4_pipe pipe; 231 struct skl_dfw_v4_pipe pipe;
230 struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE]; 232 struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index 560ec0986e1a..74244d8e2909 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -40,6 +40,8 @@ static void azx_clear_corbrp(struct hdac_bus *bus)
40 */ 40 */
41void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus) 41void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
42{ 42{
43 WARN_ON_ONCE(!bus->rb.area);
44
43 spin_lock_irq(&bus->reg_lock); 45 spin_lock_irq(&bus->reg_lock);
44 /* CORB set up */ 46 /* CORB set up */
45 bus->corb.addr = bus->rb.addr; 47 bus->corb.addr = bus->rb.addr;
@@ -383,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus)
383EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset); 385EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset);
384 386
385/* reset codec link */ 387/* reset codec link */
386static int azx_reset(struct hdac_bus *bus, bool full_reset) 388int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset)
387{ 389{
388 if (!full_reset) 390 if (!full_reset)
389 goto skip_reset; 391 goto skip_reset;
@@ -408,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
408 skip_reset: 410 skip_reset:
409 /* check to see if controller is ready */ 411 /* check to see if controller is ready */
410 if (!snd_hdac_chip_readb(bus, GCTL)) { 412 if (!snd_hdac_chip_readb(bus, GCTL)) {
411 dev_dbg(bus->dev, "azx_reset: controller not ready!\n"); 413 dev_dbg(bus->dev, "controller not ready!\n");
412 return -EBUSY; 414 return -EBUSY;
413 } 415 }
414 416
@@ -423,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
423 425
424 return 0; 426 return 0;
425} 427}
428EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link);
426 429
427/* enable interrupts */ 430/* enable interrupts */
428static void azx_int_enable(struct hdac_bus *bus) 431static void azx_int_enable(struct hdac_bus *bus)
@@ -477,15 +480,17 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
477 return false; 480 return false;
478 481
479 /* reset controller */ 482 /* reset controller */
480 azx_reset(bus, full_reset); 483 snd_hdac_bus_reset_link(bus, full_reset);
481 484
482 /* initialize interrupts */ 485 /* clear interrupts */
483 azx_int_clear(bus); 486 azx_int_clear(bus);
484 azx_int_enable(bus);
485 487
486 /* initialize the codec command I/O */ 488 /* initialize the codec command I/O */
487 snd_hdac_bus_init_cmd_io(bus); 489 snd_hdac_bus_init_cmd_io(bus);
488 490
491 /* enable interrupts after CORB/RIRB buffers are initialized above */
492 azx_int_enable(bus);
493
489 /* program the position buffer */ 494 /* program the position buffer */
490 if (bus->use_posbuf && bus->posbuf.addr) { 495 if (bus->use_posbuf && bus->posbuf.addr) {
491 snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr); 496 snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr);
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index e359938e3d7e..77b265bd0505 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -16,6 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/iopoll.h>
19#include <linux/sizes.h> 20#include <linux/sizes.h>
20#include <linux/pm_runtime.h> 21#include <linux/pm_runtime.h>
21 22
@@ -184,6 +185,24 @@ static void config_dma_descriptor_in_sram(void __iomem *acp_mmio,
184 acp_reg_write(descr_info->xfer_val, acp_mmio, mmACP_SRBM_Targ_Idx_Data); 185 acp_reg_write(descr_info->xfer_val, acp_mmio, mmACP_SRBM_Targ_Idx_Data);
185} 186}
186 187
188static void pre_config_reset(void __iomem *acp_mmio, u16 ch_num)
189{
190 u32 dma_ctrl;
191 int ret;
192
193 /* clear the reset bit */
194 dma_ctrl = acp_reg_read(acp_mmio, mmACP_DMA_CNTL_0 + ch_num);
195 dma_ctrl &= ~ACP_DMA_CNTL_0__DMAChRst_MASK;
196 acp_reg_write(dma_ctrl, acp_mmio, mmACP_DMA_CNTL_0 + ch_num);
197 /* check the reset bit before programming configuration registers */
198 ret = readl_poll_timeout(acp_mmio + ((mmACP_DMA_CNTL_0 + ch_num) * 4),
199 dma_ctrl,
200 !(dma_ctrl & ACP_DMA_CNTL_0__DMAChRst_MASK),
201 100, ACP_DMA_RESET_TIME);
202 if (ret < 0)
203 pr_err("Failed to clear reset of channel : %d\n", ch_num);
204}
205
187/* 206/*
188 * Initialize the DMA descriptor information for transfer between 207 * Initialize the DMA descriptor information for transfer between
189 * system memory <-> ACP SRAM 208 * system memory <-> ACP SRAM
@@ -236,6 +255,7 @@ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio,
236 config_dma_descriptor_in_sram(acp_mmio, dma_dscr_idx, 255 config_dma_descriptor_in_sram(acp_mmio, dma_dscr_idx,
237 &dmadscr[i]); 256 &dmadscr[i]);
238 } 257 }
258 pre_config_reset(acp_mmio, ch);
239 config_acp_dma_channel(acp_mmio, ch, 259 config_acp_dma_channel(acp_mmio, ch,
240 dma_dscr_idx - 1, 260 dma_dscr_idx - 1,
241 NUM_DSCRS_PER_CHANNEL, 261 NUM_DSCRS_PER_CHANNEL,
@@ -275,6 +295,7 @@ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, u32 size,
275 config_dma_descriptor_in_sram(acp_mmio, dma_dscr_idx, 295 config_dma_descriptor_in_sram(acp_mmio, dma_dscr_idx,
276 &dmadscr[i]); 296 &dmadscr[i]);
277 } 297 }
298 pre_config_reset(acp_mmio, ch);
278 /* Configure the DMA channel with the above descriptore */ 299 /* Configure the DMA channel with the above descriptore */
279 config_acp_dma_channel(acp_mmio, ch, dma_dscr_idx - 1, 300 config_acp_dma_channel(acp_mmio, ch, dma_dscr_idx - 1,
280 NUM_DSCRS_PER_CHANNEL, 301 NUM_DSCRS_PER_CHANNEL,
diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
index 275677de669f..407554175282 100644
--- a/sound/soc/codecs/cs4265.c
+++ b/sound/soc/codecs/cs4265.c
@@ -157,8 +157,8 @@ static const struct snd_kcontrol_new cs4265_snd_controls[] = {
157 SOC_SINGLE("Validity Bit Control Switch", CS4265_SPDIF_CTL2, 157 SOC_SINGLE("Validity Bit Control Switch", CS4265_SPDIF_CTL2,
158 3, 1, 0), 158 3, 1, 0),
159 SOC_ENUM("SPDIF Mono/Stereo", spdif_mono_stereo_enum), 159 SOC_ENUM("SPDIF Mono/Stereo", spdif_mono_stereo_enum),
160 SOC_SINGLE("MMTLR Data Switch", 0, 160 SOC_SINGLE("MMTLR Data Switch", CS4265_SPDIF_CTL2,
161 1, 1, 0), 161 0, 1, 0),
162 SOC_ENUM("Mono Channel Select", spdif_mono_select_enum), 162 SOC_ENUM("Mono Channel Select", spdif_mono_select_enum),
163 SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24), 163 SND_SOC_BYTES("C Data Buffer", CS4265_C_DATA_BUFF, 24),
164}; 164};
diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c
index 92b7125ea169..1093f766d0d2 100644
--- a/sound/soc/codecs/max98373.c
+++ b/sound/soc/codecs/max98373.c
@@ -520,6 +520,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg)
520{ 520{
521 switch (reg) { 521 switch (reg) {
522 case MAX98373_R2000_SW_RESET ... MAX98373_R2009_INT_FLAG3: 522 case MAX98373_R2000_SW_RESET ... MAX98373_R2009_INT_FLAG3:
523 case MAX98373_R203E_AMP_PATH_GAIN:
523 case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK: 524 case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK:
524 case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK: 525 case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK:
525 case MAX98373_R20B6_BDE_CUR_STATE_READBACK: 526 case MAX98373_R20B6_BDE_CUR_STATE_READBACK:
@@ -729,6 +730,7 @@ static int max98373_probe(struct snd_soc_component *component)
729 /* Software Reset */ 730 /* Software Reset */
730 regmap_write(max98373->regmap, 731 regmap_write(max98373->regmap,
731 MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET); 732 MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
733 usleep_range(10000, 11000);
732 734
733 /* IV default slot configuration */ 735 /* IV default slot configuration */
734 regmap_write(max98373->regmap, 736 regmap_write(max98373->regmap,
@@ -817,6 +819,7 @@ static int max98373_resume(struct device *dev)
817 819
818 regmap_write(max98373->regmap, 820 regmap_write(max98373->regmap,
819 MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET); 821 MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
822 usleep_range(10000, 11000);
820 regcache_cache_only(max98373->regmap, false); 823 regcache_cache_only(max98373->regmap, false);
821 regcache_sync(max98373->regmap); 824 regcache_sync(max98373->regmap);
822 return 0; 825 return 0;
diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c
index dca82dd6e3bf..32fe76c3134a 100644
--- a/sound/soc/codecs/rt5514.c
+++ b/sound/soc/codecs/rt5514.c
@@ -64,8 +64,8 @@ static const struct reg_sequence rt5514_patch[] = {
64 {RT5514_ANA_CTRL_LDO10, 0x00028604}, 64 {RT5514_ANA_CTRL_LDO10, 0x00028604},
65 {RT5514_ANA_CTRL_ADCFED, 0x00000800}, 65 {RT5514_ANA_CTRL_ADCFED, 0x00000800},
66 {RT5514_ASRC_IN_CTRL1, 0x00000003}, 66 {RT5514_ASRC_IN_CTRL1, 0x00000003},
67 {RT5514_DOWNFILTER0_CTRL3, 0x10000352}, 67 {RT5514_DOWNFILTER0_CTRL3, 0x10000342},
68 {RT5514_DOWNFILTER1_CTRL3, 0x10000352}, 68 {RT5514_DOWNFILTER1_CTRL3, 0x10000342},
69}; 69};
70 70
71static const struct reg_default rt5514_reg[] = { 71static const struct reg_default rt5514_reg[] = {
@@ -92,10 +92,10 @@ static const struct reg_default rt5514_reg[] = {
92 {RT5514_ASRC_IN_CTRL1, 0x00000003}, 92 {RT5514_ASRC_IN_CTRL1, 0x00000003},
93 {RT5514_DOWNFILTER0_CTRL1, 0x00020c2f}, 93 {RT5514_DOWNFILTER0_CTRL1, 0x00020c2f},
94 {RT5514_DOWNFILTER0_CTRL2, 0x00020c2f}, 94 {RT5514_DOWNFILTER0_CTRL2, 0x00020c2f},
95 {RT5514_DOWNFILTER0_CTRL3, 0x10000352}, 95 {RT5514_DOWNFILTER0_CTRL3, 0x10000342},
96 {RT5514_DOWNFILTER1_CTRL1, 0x00020c2f}, 96 {RT5514_DOWNFILTER1_CTRL1, 0x00020c2f},
97 {RT5514_DOWNFILTER1_CTRL2, 0x00020c2f}, 97 {RT5514_DOWNFILTER1_CTRL2, 0x00020c2f},
98 {RT5514_DOWNFILTER1_CTRL3, 0x10000352}, 98 {RT5514_DOWNFILTER1_CTRL3, 0x10000342},
99 {RT5514_ANA_CTRL_LDO10, 0x00028604}, 99 {RT5514_ANA_CTRL_LDO10, 0x00028604},
100 {RT5514_ANA_CTRL_LDO18_16, 0x02000345}, 100 {RT5514_ANA_CTRL_LDO18_16, 0x02000345},
101 {RT5514_ANA_CTRL_ADC12, 0x0000a2a8}, 101 {RT5514_ANA_CTRL_ADC12, 0x0000a2a8},
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index 640d400ca013..afe7d5b19313 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -750,8 +750,8 @@ static bool rt5682_readable_register(struct device *dev, unsigned int reg)
750} 750}
751 751
752static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -2250, 150, 0); 752static const DECLARE_TLV_DB_SCALE(hp_vol_tlv, -2250, 150, 0);
753static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); 753static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -6525, 75, 0);
754static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); 754static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -1725, 75, 0);
755static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); 755static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0);
756 756
757/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ 757/* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */
@@ -1114,7 +1114,7 @@ static const struct snd_kcontrol_new rt5682_snd_controls[] = {
1114 1114
1115 /* DAC Digital Volume */ 1115 /* DAC Digital Volume */
1116 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL, 1116 SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL,
1117 RT5682_L_VOL_SFT, RT5682_R_VOL_SFT, 175, 0, dac_vol_tlv), 1117 RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 86, 0, dac_vol_tlv),
1118 1118
1119 /* IN Boost Volume */ 1119 /* IN Boost Volume */
1120 SOC_SINGLE_TLV("CBJ Boost Volume", RT5682_CBJ_BST_CTRL, 1120 SOC_SINGLE_TLV("CBJ Boost Volume", RT5682_CBJ_BST_CTRL,
@@ -1124,7 +1124,7 @@ static const struct snd_kcontrol_new rt5682_snd_controls[] = {
1124 SOC_DOUBLE("STO1 ADC Capture Switch", RT5682_STO1_ADC_DIG_VOL, 1124 SOC_DOUBLE("STO1 ADC Capture Switch", RT5682_STO1_ADC_DIG_VOL,
1125 RT5682_L_MUTE_SFT, RT5682_R_MUTE_SFT, 1, 1), 1125 RT5682_L_MUTE_SFT, RT5682_R_MUTE_SFT, 1, 1),
1126 SOC_DOUBLE_TLV("STO1 ADC Capture Volume", RT5682_STO1_ADC_DIG_VOL, 1126 SOC_DOUBLE_TLV("STO1 ADC Capture Volume", RT5682_STO1_ADC_DIG_VOL,
1127 RT5682_L_VOL_SFT, RT5682_R_VOL_SFT, 127, 0, adc_vol_tlv), 1127 RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 63, 0, adc_vol_tlv),
1128 1128
1129 /* ADC Boost Volume Control */ 1129 /* ADC Boost Volume Control */
1130 SOC_DOUBLE_TLV("STO1 ADC Boost Gain Volume", RT5682_STO1_ADC_BOOST, 1130 SOC_DOUBLE_TLV("STO1 ADC Boost Gain Volume", RT5682_STO1_ADC_BOOST,
diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c
index d53680ac78e4..6df158669420 100644
--- a/sound/soc/codecs/sigmadsp.c
+++ b/sound/soc/codecs/sigmadsp.c
@@ -117,8 +117,7 @@ static int sigmadsp_ctrl_write(struct sigmadsp *sigmadsp,
117 struct sigmadsp_control *ctrl, void *data) 117 struct sigmadsp_control *ctrl, void *data)
118{ 118{
119 /* safeload loads up to 20 bytes in a atomic operation */ 119 /* safeload loads up to 20 bytes in a atomic operation */
120 if (ctrl->num_bytes > 4 && ctrl->num_bytes <= 20 && sigmadsp->ops && 120 if (ctrl->num_bytes <= 20 && sigmadsp->ops && sigmadsp->ops->safeload)
121 sigmadsp->ops->safeload)
122 return sigmadsp->ops->safeload(sigmadsp, ctrl->addr, data, 121 return sigmadsp->ops->safeload(sigmadsp, ctrl->addr, data,
123 ctrl->num_bytes); 122 ctrl->num_bytes);
124 else 123 else
diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c
index 14999b999fd3..0d6145549a98 100644
--- a/sound/soc/codecs/tas6424.c
+++ b/sound/soc/codecs/tas6424.c
@@ -424,8 +424,10 @@ static void tas6424_fault_check_work(struct work_struct *work)
424 TAS6424_FAULT_PVDD_UV | 424 TAS6424_FAULT_PVDD_UV |
425 TAS6424_FAULT_VBAT_UV; 425 TAS6424_FAULT_VBAT_UV;
426 426
427 if (reg) 427 if (!reg) {
428 tas6424->last_fault1 = reg;
428 goto check_global_fault2_reg; 429 goto check_global_fault2_reg;
430 }
429 431
430 /* 432 /*
431 * Only flag errors once for a given occurrence. This is needed as 433 * Only flag errors once for a given occurrence. This is needed as
@@ -461,8 +463,10 @@ check_global_fault2_reg:
461 TAS6424_FAULT_OTSD_CH3 | 463 TAS6424_FAULT_OTSD_CH3 |
462 TAS6424_FAULT_OTSD_CH4; 464 TAS6424_FAULT_OTSD_CH4;
463 465
464 if (!reg) 466 if (!reg) {
467 tas6424->last_fault2 = reg;
465 goto check_warn_reg; 468 goto check_warn_reg;
469 }
466 470
467 if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD)) 471 if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD))
468 dev_crit(dev, "experienced a global overtemp shutdown\n"); 472 dev_crit(dev, "experienced a global overtemp shutdown\n");
@@ -497,8 +501,10 @@ check_warn_reg:
497 TAS6424_WARN_VDD_OTW_CH3 | 501 TAS6424_WARN_VDD_OTW_CH3 |
498 TAS6424_WARN_VDD_OTW_CH4; 502 TAS6424_WARN_VDD_OTW_CH4;
499 503
500 if (!reg) 504 if (!reg) {
505 tas6424->last_warn = reg;
501 goto out; 506 goto out;
507 }
502 508
503 if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV)) 509 if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV))
504 dev_warn(dev, "experienced a VDD under voltage condition\n"); 510 dev_warn(dev, "experienced a VDD under voltage condition\n");
diff --git a/sound/soc/codecs/wm8804-i2c.c b/sound/soc/codecs/wm8804-i2c.c
index f27464c2c5ba..79541960f45d 100644
--- a/sound/soc/codecs/wm8804-i2c.c
+++ b/sound/soc/codecs/wm8804-i2c.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/acpi.h>
16 17
17#include "wm8804.h" 18#include "wm8804.h"
18 19
@@ -40,17 +41,29 @@ static const struct i2c_device_id wm8804_i2c_id[] = {
40}; 41};
41MODULE_DEVICE_TABLE(i2c, wm8804_i2c_id); 42MODULE_DEVICE_TABLE(i2c, wm8804_i2c_id);
42 43
44#if defined(CONFIG_OF)
43static const struct of_device_id wm8804_of_match[] = { 45static const struct of_device_id wm8804_of_match[] = {
44 { .compatible = "wlf,wm8804", }, 46 { .compatible = "wlf,wm8804", },
45 { } 47 { }
46}; 48};
47MODULE_DEVICE_TABLE(of, wm8804_of_match); 49MODULE_DEVICE_TABLE(of, wm8804_of_match);
50#endif
51
52#ifdef CONFIG_ACPI
53static const struct acpi_device_id wm8804_acpi_match[] = {
54 { "1AEC8804", 0 }, /* Wolfson PCI ID + part ID */
55 { "10138804", 0 }, /* Cirrus Logic PCI ID + part ID */
56 { },
57};
58MODULE_DEVICE_TABLE(acpi, wm8804_acpi_match);
59#endif
48 60
49static struct i2c_driver wm8804_i2c_driver = { 61static struct i2c_driver wm8804_i2c_driver = {
50 .driver = { 62 .driver = {
51 .name = "wm8804", 63 .name = "wm8804",
52 .pm = &wm8804_pm, 64 .pm = &wm8804_pm,
53 .of_match_table = wm8804_of_match, 65 .of_match_table = of_match_ptr(wm8804_of_match),
66 .acpi_match_table = ACPI_PTR(wm8804_acpi_match),
54 }, 67 },
55 .probe = wm8804_i2c_probe, 68 .probe = wm8804_i2c_probe,
56 .remove = wm8804_i2c_remove, 69 .remove = wm8804_i2c_remove,
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 953d94d50586..ade34c26ad2f 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -719,7 +719,7 @@ static int wm9712_probe(struct platform_device *pdev)
719 719
720static struct platform_driver wm9712_component_driver = { 720static struct platform_driver wm9712_component_driver = {
721 .driver = { 721 .driver = {
722 .name = "wm9712-component", 722 .name = "wm9712-codec",
723 }, 723 },
724 724
725 .probe = wm9712_probe, 725 .probe = wm9712_probe,
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index d32844f94d74..b6dc524830b2 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -575,6 +575,17 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
575 BYT_RT5640_MONO_SPEAKER | 575 BYT_RT5640_MONO_SPEAKER |
576 BYT_RT5640_MCLK_EN), 576 BYT_RT5640_MCLK_EN),
577 }, 577 },
578 { /* Linx Linx7 tablet */
579 .matches = {
580 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LINX"),
581 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LINX7"),
582 },
583 .driver_data = (void *)(BYTCR_INPUT_DEFAULTS |
584 BYT_RT5640_MONO_SPEAKER |
585 BYT_RT5640_JD_NOT_INV |
586 BYT_RT5640_SSP0_AIF1 |
587 BYT_RT5640_MCLK_EN),
588 },
578 { /* MSI S100 tablet */ 589 { /* MSI S100 tablet */
579 .matches = { 590 .matches = {
580 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."), 591 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."),
@@ -602,6 +613,21 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
602 BYT_RT5640_SSP0_AIF1 | 613 BYT_RT5640_SSP0_AIF1 |
603 BYT_RT5640_MCLK_EN), 614 BYT_RT5640_MCLK_EN),
604 }, 615 },
616 { /* Onda v975w */
617 .matches = {
618 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
619 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
620 /* The above are too generic, also match BIOS info */
621 DMI_EXACT_MATCH(DMI_BIOS_VERSION, "5.6.5"),
622 DMI_EXACT_MATCH(DMI_BIOS_DATE, "07/25/2014"),
623 },
624 .driver_data = (void *)(BYT_RT5640_IN1_MAP |
625 BYT_RT5640_JD_SRC_JD2_IN4N |
626 BYT_RT5640_OVCD_TH_2000UA |
627 BYT_RT5640_OVCD_SF_0P75 |
628 BYT_RT5640_DIFF_MIC |
629 BYT_RT5640_MCLK_EN),
630 },
605 { /* Pipo W4 */ 631 { /* Pipo W4 */
606 .matches = { 632 .matches = {
607 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 633 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index dce649485649..1d17be0f78a0 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -834,7 +834,7 @@ static int skl_first_init(struct hdac_bus *bus)
834 return -ENXIO; 834 return -ENXIO;
835 } 835 }
836 836
837 skl_init_chip(bus, true); 837 snd_hdac_bus_reset_link(bus, true);
838 838
839 snd_hdac_bus_parse_capabilities(bus); 839 snd_hdac_bus_parse_capabilities(bus);
840 840
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index dc94c5c53788..c6b51571be94 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -960,8 +960,10 @@ static int msm_routing_probe(struct snd_soc_component *c)
960{ 960{
961 int i; 961 int i;
962 962
963 for (i = 0; i < MAX_SESSIONS; i++) 963 for (i = 0; i < MAX_SESSIONS; i++) {
964 routing_data->sessions[i].port_id = -1; 964 routing_data->sessions[i].port_id = -1;
965 routing_data->sessions[i].fedai_id = -1;
966 }
965 967
966 return 0; 968 return 0;
967} 969}
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 3a3064dda57f..051f96405346 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -462,6 +462,11 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
462 goto rsnd_adg_get_clkout_end; 462 goto rsnd_adg_get_clkout_end;
463 463
464 req_size = prop->length / sizeof(u32); 464 req_size = prop->length / sizeof(u32);
465 if (req_size > REQ_SIZE) {
466 dev_err(dev,
467 "too many clock-frequency, use top %d\n", REQ_SIZE);
468 req_size = REQ_SIZE;
469 }
465 470
466 of_property_read_u32_array(np, "clock-frequency", req_rate, req_size); 471 of_property_read_u32_array(np, "clock-frequency", req_rate, req_size);
467 req_48kHz_rate = 0; 472 req_48kHz_rate = 0;
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index f8425d8b44d2..d23c2bbff0cf 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -478,7 +478,7 @@ static int rsnd_status_update(u32 *status,
478 (func_call && (mod)->ops->fn) ? #fn : ""); \ 478 (func_call && (mod)->ops->fn) ? #fn : ""); \
479 if (func_call && (mod)->ops->fn) \ 479 if (func_call && (mod)->ops->fn) \
480 tmp = (mod)->ops->fn(mod, io, param); \ 480 tmp = (mod)->ops->fn(mod, io, param); \
481 if (tmp) \ 481 if (tmp && (tmp != -EPROBE_DEFER)) \
482 dev_err(dev, "%s[%d] : %s error %d\n", \ 482 dev_err(dev, "%s[%d] : %s error %d\n", \
483 rsnd_mod_name(mod), rsnd_mod_id(mod), \ 483 rsnd_mod_name(mod), rsnd_mod_id(mod), \
484 #fn, tmp); \ 484 #fn, tmp); \
@@ -958,12 +958,23 @@ static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
958 rsnd_dai_stream_quit(io); 958 rsnd_dai_stream_quit(io);
959} 959}
960 960
961static int rsnd_soc_dai_prepare(struct snd_pcm_substream *substream,
962 struct snd_soc_dai *dai)
963{
964 struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
965 struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
966 struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
967
968 return rsnd_dai_call(prepare, io, priv);
969}
970
961static const struct snd_soc_dai_ops rsnd_soc_dai_ops = { 971static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
962 .startup = rsnd_soc_dai_startup, 972 .startup = rsnd_soc_dai_startup,
963 .shutdown = rsnd_soc_dai_shutdown, 973 .shutdown = rsnd_soc_dai_shutdown,
964 .trigger = rsnd_soc_dai_trigger, 974 .trigger = rsnd_soc_dai_trigger,
965 .set_fmt = rsnd_soc_dai_set_fmt, 975 .set_fmt = rsnd_soc_dai_set_fmt,
966 .set_tdm_slot = rsnd_soc_set_dai_tdm_slot, 976 .set_tdm_slot = rsnd_soc_set_dai_tdm_slot,
977 .prepare = rsnd_soc_dai_prepare,
967}; 978};
968 979
969void rsnd_parse_connect_common(struct rsnd_dai *rdai, 980void rsnd_parse_connect_common(struct rsnd_dai *rdai,
@@ -1550,6 +1561,14 @@ exit_snd_probe:
1550 rsnd_dai_call(remove, &rdai->capture, priv); 1561 rsnd_dai_call(remove, &rdai->capture, priv);
1551 } 1562 }
1552 1563
1564 /*
1565 * adg is very special mod which can't use rsnd_dai_call(remove),
1566 * and it registers ADG clock on probe.
1567 * It should be unregister if probe failed.
1568 * Mainly it is assuming -EPROBE_DEFER case
1569 */
1570 rsnd_adg_remove(priv);
1571
1553 return ret; 1572 return ret;
1554} 1573}
1555 1574
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index fe63ef8600d0..d65ea7bc4dac 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
241 /* try to get DMAEngine channel */ 241 /* try to get DMAEngine channel */
242 chan = rsnd_dmaen_request_channel(io, mod_from, mod_to); 242 chan = rsnd_dmaen_request_channel(io, mod_from, mod_to);
243 if (IS_ERR_OR_NULL(chan)) { 243 if (IS_ERR_OR_NULL(chan)) {
244 /* Let's follow when -EPROBE_DEFER case */
245 if (PTR_ERR(chan) == -EPROBE_DEFER)
246 return PTR_ERR(chan);
247
244 /* 248 /*
245 * DMA failed. try to PIO mode 249 * DMA failed. try to PIO mode
246 * see 250 * see
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 96d93330b1e1..8f7a0abfa751 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -280,6 +280,9 @@ struct rsnd_mod_ops {
280 int (*nolock_stop)(struct rsnd_mod *mod, 280 int (*nolock_stop)(struct rsnd_mod *mod,
281 struct rsnd_dai_stream *io, 281 struct rsnd_dai_stream *io,
282 struct rsnd_priv *priv); 282 struct rsnd_priv *priv);
283 int (*prepare)(struct rsnd_mod *mod,
284 struct rsnd_dai_stream *io,
285 struct rsnd_priv *priv);
283}; 286};
284 287
285struct rsnd_dai_stream; 288struct rsnd_dai_stream;
@@ -309,6 +312,7 @@ struct rsnd_mod {
309 * H 0: fallback 312 * H 0: fallback
310 * H 0: hw_params 313 * H 0: hw_params
311 * H 0: pointer 314 * H 0: pointer
315 * H 0: prepare
312 */ 316 */
313#define __rsnd_mod_shift_nolock_start 0 317#define __rsnd_mod_shift_nolock_start 0
314#define __rsnd_mod_shift_nolock_stop 0 318#define __rsnd_mod_shift_nolock_stop 0
@@ -323,6 +327,7 @@ struct rsnd_mod {
323#define __rsnd_mod_shift_fallback 28 /* always called */ 327#define __rsnd_mod_shift_fallback 28 /* always called */
324#define __rsnd_mod_shift_hw_params 28 /* always called */ 328#define __rsnd_mod_shift_hw_params 28 /* always called */
325#define __rsnd_mod_shift_pointer 28 /* always called */ 329#define __rsnd_mod_shift_pointer 28 /* always called */
330#define __rsnd_mod_shift_prepare 28 /* always called */
326 331
327#define __rsnd_mod_add_probe 0 332#define __rsnd_mod_add_probe 0
328#define __rsnd_mod_add_remove 0 333#define __rsnd_mod_add_remove 0
@@ -337,6 +342,7 @@ struct rsnd_mod {
337#define __rsnd_mod_add_fallback 0 342#define __rsnd_mod_add_fallback 0
338#define __rsnd_mod_add_hw_params 0 343#define __rsnd_mod_add_hw_params 0
339#define __rsnd_mod_add_pointer 0 344#define __rsnd_mod_add_pointer 0
345#define __rsnd_mod_add_prepare 0
340 346
341#define __rsnd_mod_call_probe 0 347#define __rsnd_mod_call_probe 0
342#define __rsnd_mod_call_remove 0 348#define __rsnd_mod_call_remove 0
@@ -351,6 +357,7 @@ struct rsnd_mod {
351#define __rsnd_mod_call_pointer 0 357#define __rsnd_mod_call_pointer 0
352#define __rsnd_mod_call_nolock_start 0 358#define __rsnd_mod_call_nolock_start 0
353#define __rsnd_mod_call_nolock_stop 1 359#define __rsnd_mod_call_nolock_stop 1
360#define __rsnd_mod_call_prepare 0
354 361
355#define rsnd_mod_to_priv(mod) ((mod)->priv) 362#define rsnd_mod_to_priv(mod) ((mod)->priv)
356#define rsnd_mod_name(mod) ((mod)->ops->name) 363#define rsnd_mod_name(mod) ((mod)->ops->name)
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 8304e4ec9242..3f880ec66459 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -283,7 +283,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
283 if (rsnd_ssi_is_multi_slave(mod, io)) 283 if (rsnd_ssi_is_multi_slave(mod, io))
284 return 0; 284 return 0;
285 285
286 if (ssi->usrcnt > 1) { 286 if (ssi->rate) {
287 if (ssi->rate != rate) { 287 if (ssi->rate != rate) {
288 dev_err(dev, "SSI parent/child should use same rate\n"); 288 dev_err(dev, "SSI parent/child should use same rate\n");
289 return -EINVAL; 289 return -EINVAL;
@@ -434,7 +434,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
434 struct rsnd_priv *priv) 434 struct rsnd_priv *priv)
435{ 435{
436 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod); 436 struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
437 int ret;
438 437
439 if (!rsnd_ssi_is_run_mods(mod, io)) 438 if (!rsnd_ssi_is_run_mods(mod, io))
440 return 0; 439 return 0;
@@ -443,10 +442,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
443 442
444 rsnd_mod_power_on(mod); 443 rsnd_mod_power_on(mod);
445 444
446 ret = rsnd_ssi_master_clk_start(mod, io);
447 if (ret < 0)
448 return ret;
449
450 rsnd_ssi_config_init(mod, io); 445 rsnd_ssi_config_init(mod, io);
451 446
452 rsnd_ssi_register_setup(mod); 447 rsnd_ssi_register_setup(mod);
@@ -852,6 +847,13 @@ static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
852 return 0; 847 return 0;
853} 848}
854 849
850static int rsnd_ssi_prepare(struct rsnd_mod *mod,
851 struct rsnd_dai_stream *io,
852 struct rsnd_priv *priv)
853{
854 return rsnd_ssi_master_clk_start(mod, io);
855}
856
855static struct rsnd_mod_ops rsnd_ssi_pio_ops = { 857static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
856 .name = SSI_NAME, 858 .name = SSI_NAME,
857 .probe = rsnd_ssi_common_probe, 859 .probe = rsnd_ssi_common_probe,
@@ -864,6 +866,7 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
864 .pointer = rsnd_ssi_pio_pointer, 866 .pointer = rsnd_ssi_pio_pointer,
865 .pcm_new = rsnd_ssi_pcm_new, 867 .pcm_new = rsnd_ssi_pcm_new,
866 .hw_params = rsnd_ssi_hw_params, 868 .hw_params = rsnd_ssi_hw_params,
869 .prepare = rsnd_ssi_prepare,
867}; 870};
868 871
869static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, 872static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
@@ -940,6 +943,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
940 .pcm_new = rsnd_ssi_pcm_new, 943 .pcm_new = rsnd_ssi_pcm_new,
941 .fallback = rsnd_ssi_fallback, 944 .fallback = rsnd_ssi_fallback,
942 .hw_params = rsnd_ssi_hw_params, 945 .hw_params = rsnd_ssi_hw_params,
946 .prepare = rsnd_ssi_prepare,
943}; 947};
944 948
945int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod) 949int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9cfe10d8040c..473eefe8658e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1447,7 +1447,7 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
1447 sink = codec_dai->playback_widget; 1447 sink = codec_dai->playback_widget;
1448 source = cpu_dai->capture_widget; 1448 source = cpu_dai->capture_widget;
1449 if (sink && source) { 1449 if (sink && source) {
1450 ret = snd_soc_dapm_new_pcm(card, dai_link->params, 1450 ret = snd_soc_dapm_new_pcm(card, rtd, dai_link->params,
1451 dai_link->num_params, 1451 dai_link->num_params,
1452 source, sink); 1452 source, sink);
1453 if (ret != 0) { 1453 if (ret != 0) {
@@ -1460,7 +1460,7 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
1460 sink = cpu_dai->playback_widget; 1460 sink = cpu_dai->playback_widget;
1461 source = codec_dai->capture_widget; 1461 source = codec_dai->capture_widget;
1462 if (sink && source) { 1462 if (sink && source) {
1463 ret = snd_soc_dapm_new_pcm(card, dai_link->params, 1463 ret = snd_soc_dapm_new_pcm(card, rtd, dai_link->params,
1464 dai_link->num_params, 1464 dai_link->num_params,
1465 source, sink); 1465 source, sink);
1466 if (ret != 0) { 1466 if (ret != 0) {
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7e96793050c9..461d951917c0 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3652,6 +3652,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
3652{ 3652{
3653 struct snd_soc_dapm_path *source_p, *sink_p; 3653 struct snd_soc_dapm_path *source_p, *sink_p;
3654 struct snd_soc_dai *source, *sink; 3654 struct snd_soc_dai *source, *sink;
3655 struct snd_soc_pcm_runtime *rtd = w->priv;
3655 const struct snd_soc_pcm_stream *config = w->params + w->params_select; 3656 const struct snd_soc_pcm_stream *config = w->params + w->params_select;
3656 struct snd_pcm_substream substream; 3657 struct snd_pcm_substream substream;
3657 struct snd_pcm_hw_params *params = NULL; 3658 struct snd_pcm_hw_params *params = NULL;
@@ -3711,6 +3712,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
3711 goto out; 3712 goto out;
3712 } 3713 }
3713 substream.runtime = runtime; 3714 substream.runtime = runtime;
3715 substream.private_data = rtd;
3714 3716
3715 switch (event) { 3717 switch (event) {
3716 case SND_SOC_DAPM_PRE_PMU: 3718 case SND_SOC_DAPM_PRE_PMU:
@@ -3895,6 +3897,7 @@ outfree_w_param:
3895} 3897}
3896 3898
3897int snd_soc_dapm_new_pcm(struct snd_soc_card *card, 3899int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
3900 struct snd_soc_pcm_runtime *rtd,
3898 const struct snd_soc_pcm_stream *params, 3901 const struct snd_soc_pcm_stream *params,
3899 unsigned int num_params, 3902 unsigned int num_params,
3900 struct snd_soc_dapm_widget *source, 3903 struct snd_soc_dapm_widget *source,
@@ -3963,6 +3966,7 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
3963 3966
3964 w->params = params; 3967 w->params = params;
3965 w->num_params = num_params; 3968 w->num_params = num_params;
3969 w->priv = rtd;
3966 3970
3967 ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL); 3971 ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL);
3968 if (ret) 3972 if (ret)