aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-04-12 01:16:07 -0400
committerTakashi Iwai <tiwai@suse.de>2017-04-12 01:16:07 -0400
commitb7c5ac88e8251cc3931ce00437fdd74b0dbb2e99 (patch)
treee4afa61fcc97fc24cd75dca2a362ecba9fe91669
parentc6b0b9e65f094deabc0c1d499b96ed5085b0f7db (diff)
parent3d016d57fdc5e6caa4cd67896f4b081bccad6e2c (diff)
Merge branch 'for-linus' into for-next
-rw-r--r--arch/arm/boot/dts/sun8i-a33.dtsi4
-rw-r--r--sound/core/seq/seq_clientmgr.c1
-rw-r--r--sound/core/seq/seq_fifo.c7
-rw-r--r--sound/core/seq/seq_memory.c17
-rw-r--r--sound/core/seq/seq_memory.h1
-rw-r--r--sound/firewire/oxfw/oxfw.c4
-rw-r--r--sound/pci/hda/patch_realtek.c14
-rw-r--r--sound/soc/atmel/atmel-classd.c2
-rw-r--r--sound/soc/codecs/hdac_hdmi.c16
-rw-r--r--sound/soc/codecs/rt5665.c10
-rw-r--r--sound/soc/codecs/rt5665.h2
-rw-r--r--sound/soc/codecs/wm_adsp.c9
-rw-r--r--sound/soc/generic/simple-card-utils.c1
-rw-r--r--sound/soc/intel/skylake/skl-topology.c2
-rw-r--r--sound/soc/mediatek/Kconfig2
-rw-r--r--sound/soc/sh/rcar/cmd.c36
-rw-r--r--sound/soc/sh/rcar/dma.c18
-rw-r--r--sound/soc/sh/rcar/ssiu.c6
-rw-r--r--sound/soc/soc-core.c8
-rw-r--r--sound/soc/sti/uniperif_reader.c3
-rw-r--r--sound/soc/sunxi/sun8i-codec.c67
-rw-r--r--sound/x86/Kconfig3
22 files changed, 148 insertions, 85 deletions
diff --git a/arch/arm/boot/dts/sun8i-a33.dtsi b/arch/arm/boot/dts/sun8i-a33.dtsi
index 18c174fef84f..0467fb365bfc 100644
--- a/arch/arm/boot/dts/sun8i-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a33.dtsi
@@ -113,8 +113,8 @@
113 simple-audio-card,mclk-fs = <512>; 113 simple-audio-card,mclk-fs = <512>;
114 simple-audio-card,aux-devs = <&codec_analog>; 114 simple-audio-card,aux-devs = <&codec_analog>;
115 simple-audio-card,routing = 115 simple-audio-card,routing =
116 "Left DAC", "Digital Left DAC", 116 "Left DAC", "AIF1 Slot 0 Left",
117 "Right DAC", "Digital Right DAC"; 117 "Right DAC", "AIF1 Slot 0 Right";
118 status = "disabled"; 118 status = "disabled";
119 119
120 simple-audio-card,cpu { 120 simple-audio-card,cpu {
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 4c935202ce23..f3b1d7f50b81 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1832,6 +1832,7 @@ static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client,
1832 info->output_pool != client->pool->size)) { 1832 info->output_pool != client->pool->size)) {
1833 if (snd_seq_write_pool_allocated(client)) { 1833 if (snd_seq_write_pool_allocated(client)) {
1834 /* remove all existing cells */ 1834 /* remove all existing cells */
1835 snd_seq_pool_mark_closing(client->pool);
1835 snd_seq_queue_client_leave_cells(client->number); 1836 snd_seq_queue_client_leave_cells(client->number);
1836 snd_seq_pool_done(client->pool); 1837 snd_seq_pool_done(client->pool);
1837 } 1838 }
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c
index 448efd4e980e..01c4cfe30c9f 100644
--- a/sound/core/seq/seq_fifo.c
+++ b/sound/core/seq/seq_fifo.c
@@ -72,6 +72,9 @@ void snd_seq_fifo_delete(struct snd_seq_fifo **fifo)
72 return; 72 return;
73 *fifo = NULL; 73 *fifo = NULL;
74 74
75 if (f->pool)
76 snd_seq_pool_mark_closing(f->pool);
77
75 snd_seq_fifo_clear(f); 78 snd_seq_fifo_clear(f);
76 79
77 /* wake up clients if any */ 80 /* wake up clients if any */
@@ -264,6 +267,10 @@ int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize)
264 /* NOTE: overflow flag is not cleared */ 267 /* NOTE: overflow flag is not cleared */
265 spin_unlock_irqrestore(&f->lock, flags); 268 spin_unlock_irqrestore(&f->lock, flags);
266 269
270 /* close the old pool and wait until all users are gone */
271 snd_seq_pool_mark_closing(oldpool);
272 snd_use_lock_sync(&f->use_lock);
273
267 /* release cells in old pool */ 274 /* release cells in old pool */
268 for (cell = oldhead; cell; cell = next) { 275 for (cell = oldhead; cell; cell = next) {
269 next = cell->next; 276 next = cell->next;
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index 1a1acf3ddda4..d4c61ec9be13 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -415,6 +415,18 @@ int snd_seq_pool_init(struct snd_seq_pool *pool)
415 return 0; 415 return 0;
416} 416}
417 417
418/* refuse the further insertion to the pool */
419void snd_seq_pool_mark_closing(struct snd_seq_pool *pool)
420{
421 unsigned long flags;
422
423 if (snd_BUG_ON(!pool))
424 return;
425 spin_lock_irqsave(&pool->lock, flags);
426 pool->closing = 1;
427 spin_unlock_irqrestore(&pool->lock, flags);
428}
429
418/* remove events */ 430/* remove events */
419int snd_seq_pool_done(struct snd_seq_pool *pool) 431int snd_seq_pool_done(struct snd_seq_pool *pool)
420{ 432{
@@ -425,10 +437,6 @@ int snd_seq_pool_done(struct snd_seq_pool *pool)
425 return -EINVAL; 437 return -EINVAL;
426 438
427 /* wait for closing all threads */ 439 /* wait for closing all threads */
428 spin_lock_irqsave(&pool->lock, flags);
429 pool->closing = 1;
430 spin_unlock_irqrestore(&pool->lock, flags);
431
432 if (waitqueue_active(&pool->output_sleep)) 440 if (waitqueue_active(&pool->output_sleep))
433 wake_up(&pool->output_sleep); 441 wake_up(&pool->output_sleep);
434 442
@@ -485,6 +493,7 @@ int snd_seq_pool_delete(struct snd_seq_pool **ppool)
485 *ppool = NULL; 493 *ppool = NULL;
486 if (pool == NULL) 494 if (pool == NULL)
487 return 0; 495 return 0;
496 snd_seq_pool_mark_closing(pool);
488 snd_seq_pool_done(pool); 497 snd_seq_pool_done(pool);
489 kfree(pool); 498 kfree(pool);
490 return 0; 499 return 0;
diff --git a/sound/core/seq/seq_memory.h b/sound/core/seq/seq_memory.h
index 4a2ec779b8a7..32f959c17786 100644
--- a/sound/core/seq/seq_memory.h
+++ b/sound/core/seq/seq_memory.h
@@ -84,6 +84,7 @@ static inline int snd_seq_total_cells(struct snd_seq_pool *pool)
84int snd_seq_pool_init(struct snd_seq_pool *pool); 84int snd_seq_pool_init(struct snd_seq_pool *pool);
85 85
86/* done pool - free events */ 86/* done pool - free events */
87void snd_seq_pool_mark_closing(struct snd_seq_pool *pool);
87int snd_seq_pool_done(struct snd_seq_pool *pool); 88int snd_seq_pool_done(struct snd_seq_pool *pool);
88 89
89/* create pool */ 90/* create pool */
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index 74d7fb6efce6..413ab6313bb6 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -227,11 +227,11 @@ static void do_registration(struct work_struct *work)
227 if (err < 0) 227 if (err < 0)
228 goto error; 228 goto error;
229 229
230 err = detect_quirks(oxfw); 230 err = snd_oxfw_stream_discover(oxfw);
231 if (err < 0) 231 if (err < 0)
232 goto error; 232 goto error;
233 233
234 err = snd_oxfw_stream_discover(oxfw); 234 err = detect_quirks(oxfw);
235 if (err < 0) 235 if (err < 0)
236 goto error; 236 goto error;
237 237
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c5f2489f0906..9371f1a95b33 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4860,6 +4860,7 @@ enum {
4860 ALC292_FIXUP_DISABLE_AAMIX, 4860 ALC292_FIXUP_DISABLE_AAMIX,
4861 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, 4861 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
4862 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 4862 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
4863 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
4863 ALC275_FIXUP_DELL_XPS, 4864 ALC275_FIXUP_DELL_XPS,
4864 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, 4865 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
4865 ALC293_FIXUP_LENOVO_SPK_NOISE, 4866 ALC293_FIXUP_LENOVO_SPK_NOISE,
@@ -5495,6 +5496,15 @@ static const struct hda_fixup alc269_fixups[] = {
5495 .chained = true, 5496 .chained = true,
5496 .chain_id = ALC269_FIXUP_HEADSET_MODE 5497 .chain_id = ALC269_FIXUP_HEADSET_MODE
5497 }, 5498 },
5499 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
5500 .type = HDA_FIXUP_PINS,
5501 .v.pins = (const struct hda_pintbl[]) {
5502 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5503 { }
5504 },
5505 .chained = true,
5506 .chain_id = ALC269_FIXUP_HEADSET_MODE
5507 },
5498 [ALC275_FIXUP_DELL_XPS] = { 5508 [ALC275_FIXUP_DELL_XPS] = {
5499 .type = HDA_FIXUP_VERBS, 5509 .type = HDA_FIXUP_VERBS,
5500 .v.verbs = (const struct hda_verb[]) { 5510 .v.verbs = (const struct hda_verb[]) {
@@ -5567,7 +5577,7 @@ static const struct hda_fixup alc269_fixups[] = {
5567 .type = HDA_FIXUP_FUNC, 5577 .type = HDA_FIXUP_FUNC,
5568 .v.func = alc298_fixup_speaker_volume, 5578 .v.func = alc298_fixup_speaker_volume,
5569 .chained = true, 5579 .chained = true,
5570 .chain_id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 5580 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
5571 }, 5581 },
5572 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { 5582 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
5573 .type = HDA_FIXUP_PINS, 5583 .type = HDA_FIXUP_PINS,
@@ -6203,6 +6213,8 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
6203 ALC295_STANDARD_PINS, 6213 ALC295_STANDARD_PINS,
6204 {0x17, 0x21014040}, 6214 {0x17, 0x21014040},
6205 {0x18, 0x21a19050}), 6215 {0x18, 0x21a19050}),
6216 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6217 ALC295_STANDARD_PINS),
6206 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, 6218 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6207 ALC298_STANDARD_PINS, 6219 ALC298_STANDARD_PINS,
6208 {0x17, 0x90170110}), 6220 {0x17, 0x90170110}),
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index 89ac5f5a93eb..7ae46c2647d4 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -349,7 +349,7 @@ static int atmel_classd_codec_dai_digital_mute(struct snd_soc_dai *codec_dai,
349} 349}
350 350
351#define CLASSD_ACLK_RATE_11M2896_MPY_8 (112896 * 100 * 8) 351#define CLASSD_ACLK_RATE_11M2896_MPY_8 (112896 * 100 * 8)
352#define CLASSD_ACLK_RATE_12M288_MPY_8 (12228 * 1000 * 8) 352#define CLASSD_ACLK_RATE_12M288_MPY_8 (12288 * 1000 * 8)
353 353
354static struct { 354static struct {
355 int rate; 355 int rate;
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 78fca8acd3ec..fd272a40485b 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1534,21 +1534,20 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
1534 pin->mst_capable = false; 1534 pin->mst_capable = false;
1535 /* if not MST, default is port[0] */ 1535 /* if not MST, default is port[0] */
1536 hport = &pin->ports[0]; 1536 hport = &pin->ports[0];
1537 goto out;
1538 } else { 1537 } else {
1539 for (i = 0; i < pin->num_ports; i++) { 1538 for (i = 0; i < pin->num_ports; i++) {
1540 pin->mst_capable = true; 1539 pin->mst_capable = true;
1541 if (pin->ports[i].id == pipe) { 1540 if (pin->ports[i].id == pipe) {
1542 hport = &pin->ports[i]; 1541 hport = &pin->ports[i];
1543 goto out; 1542 break;
1544 } 1543 }
1545 } 1544 }
1546 } 1545 }
1546
1547 if (hport)
1548 hdac_hdmi_present_sense(pin, hport);
1547 } 1549 }
1548 1550
1549out:
1550 if (pin && hport)
1551 hdac_hdmi_present_sense(pin, hport);
1552} 1551}
1553 1552
1554static struct i915_audio_component_audio_ops aops = { 1553static struct i915_audio_component_audio_ops aops = {
@@ -1998,7 +1997,7 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
1998 struct hdac_hdmi_pin *pin, *pin_next; 1997 struct hdac_hdmi_pin *pin, *pin_next;
1999 struct hdac_hdmi_cvt *cvt, *cvt_next; 1998 struct hdac_hdmi_cvt *cvt, *cvt_next;
2000 struct hdac_hdmi_pcm *pcm, *pcm_next; 1999 struct hdac_hdmi_pcm *pcm, *pcm_next;
2001 struct hdac_hdmi_port *port; 2000 struct hdac_hdmi_port *port, *port_next;
2002 int i; 2001 int i;
2003 2002
2004 snd_soc_unregister_codec(&edev->hdac.dev); 2003 snd_soc_unregister_codec(&edev->hdac.dev);
@@ -2008,8 +2007,9 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
2008 if (list_empty(&pcm->port_list)) 2007 if (list_empty(&pcm->port_list))
2009 continue; 2008 continue;
2010 2009
2011 list_for_each_entry(port, &pcm->port_list, head) 2010 list_for_each_entry_safe(port, port_next,
2012 port = NULL; 2011 &pcm->port_list, head)
2012 list_del(&port->head);
2013 2013
2014 list_del(&pcm->head); 2014 list_del(&pcm->head);
2015 kfree(pcm); 2015 kfree(pcm);
diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 324461e985b3..476135ec5726 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -1241,7 +1241,7 @@ static irqreturn_t rt5665_irq(int irq, void *data)
1241static void rt5665_jd_check_handler(struct work_struct *work) 1241static void rt5665_jd_check_handler(struct work_struct *work)
1242{ 1242{
1243 struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv, 1243 struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv,
1244 calibrate_work.work); 1244 jd_check_work.work);
1245 1245
1246 if (snd_soc_read(rt5665->codec, RT5665_AJD1_CTRL) & 0x0010) { 1246 if (snd_soc_read(rt5665->codec, RT5665_AJD1_CTRL) & 0x0010) {
1247 /* jack out */ 1247 /* jack out */
@@ -2252,7 +2252,7 @@ static const char * const rt5665_if2_1_adc_in_src[] = {
2252 2252
2253static const SOC_ENUM_SINGLE_DECL( 2253static const SOC_ENUM_SINGLE_DECL(
2254 rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA, 2254 rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA,
2255 RT5665_IF3_ADC_IN_SFT, rt5665_if2_1_adc_in_src); 2255 RT5665_IF2_1_ADC_IN_SFT, rt5665_if2_1_adc_in_src);
2256 2256
2257static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux = 2257static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux =
2258 SOC_DAPM_ENUM("IF2_1 ADC IN Source", rt5665_if2_1_adc_in_enum); 2258 SOC_DAPM_ENUM("IF2_1 ADC IN Source", rt5665_if2_1_adc_in_enum);
@@ -3178,6 +3178,9 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
3178 {"DAC Mono Right Filter", NULL, "DAC Mono R ASRC", is_using_asrc}, 3178 {"DAC Mono Right Filter", NULL, "DAC Mono R ASRC", is_using_asrc},
3179 {"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc}, 3179 {"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc},
3180 {"DAC Stereo2 Filter", NULL, "DAC STO2 ASRC", is_using_asrc}, 3180 {"DAC Stereo2 Filter", NULL, "DAC STO2 ASRC", is_using_asrc},
3181 {"I2S1 ASRC", NULL, "CLKDET"},
3182 {"I2S2 ASRC", NULL, "CLKDET"},
3183 {"I2S3 ASRC", NULL, "CLKDET"},
3181 3184
3182 /*Vref*/ 3185 /*Vref*/
3183 {"Mic Det Power", NULL, "Vref2"}, 3186 {"Mic Det Power", NULL, "Vref2"},
@@ -3912,6 +3915,7 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
3912 {"Mono MIX", "MONOVOL Switch", "MONOVOL"}, 3915 {"Mono MIX", "MONOVOL Switch", "MONOVOL"},
3913 {"Mono Amp", NULL, "Mono MIX"}, 3916 {"Mono Amp", NULL, "Mono MIX"},
3914 {"Mono Amp", NULL, "Vref2"}, 3917 {"Mono Amp", NULL, "Vref2"},
3918 {"Mono Amp", NULL, "Vref3"},
3915 {"Mono Amp", NULL, "CLKDET SYS"}, 3919 {"Mono Amp", NULL, "CLKDET SYS"},
3916 {"Mono Amp", NULL, "CLKDET MONO"}, 3920 {"Mono Amp", NULL, "CLKDET MONO"},
3917 {"Mono Playback", "Switch", "Mono Amp"}, 3921 {"Mono Playback", "Switch", "Mono Amp"},
@@ -4798,7 +4802,7 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
4798 /* Enhance performance*/ 4802 /* Enhance performance*/
4799 regmap_update_bits(rt5665->regmap, RT5665_PWR_ANLG_1, 4803 regmap_update_bits(rt5665->regmap, RT5665_PWR_ANLG_1,
4800 RT5665_HP_DRIVER_MASK | RT5665_LDO1_DVO_MASK, 4804 RT5665_HP_DRIVER_MASK | RT5665_LDO1_DVO_MASK,
4801 RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_09); 4805 RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_12);
4802 4806
4803 INIT_DELAYED_WORK(&rt5665->jack_detect_work, 4807 INIT_DELAYED_WORK(&rt5665->jack_detect_work,
4804 rt5665_jack_detect_handler); 4808 rt5665_jack_detect_handler);
diff --git a/sound/soc/codecs/rt5665.h b/sound/soc/codecs/rt5665.h
index 12f7080a0d3c..a30f5e6d0628 100644
--- a/sound/soc/codecs/rt5665.h
+++ b/sound/soc/codecs/rt5665.h
@@ -1106,7 +1106,7 @@
1106#define RT5665_HP_DRIVER_MASK (0x3 << 2) 1106#define RT5665_HP_DRIVER_MASK (0x3 << 2)
1107#define RT5665_HP_DRIVER_1X (0x0 << 2) 1107#define RT5665_HP_DRIVER_1X (0x0 << 2)
1108#define RT5665_HP_DRIVER_3X (0x1 << 2) 1108#define RT5665_HP_DRIVER_3X (0x1 << 2)
1109#define RT5665_HP_DRIVER_5X (0x2 << 2) 1109#define RT5665_HP_DRIVER_5X (0x3 << 2)
1110#define RT5665_LDO1_DVO_MASK (0x3) 1110#define RT5665_LDO1_DVO_MASK (0x3)
1111#define RT5665_LDO1_DVO_09 (0x0) 1111#define RT5665_LDO1_DVO_09 (0x0)
1112#define RT5665_LDO1_DVO_10 (0x1) 1112#define RT5665_LDO1_DVO_10 (0x1)
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index d151224ffcca..bbdb72f73df1 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -899,7 +899,10 @@ static int wm_coeff_put(struct snd_kcontrol *kctl,
899 899
900 mutex_lock(&ctl->dsp->pwr_lock); 900 mutex_lock(&ctl->dsp->pwr_lock);
901 901
902 memcpy(ctl->cache, p, ctl->len); 902 if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
903 ret = -EPERM;
904 else
905 memcpy(ctl->cache, p, ctl->len);
903 906
904 ctl->set = 1; 907 ctl->set = 1;
905 if (ctl->enabled && ctl->dsp->running) 908 if (ctl->enabled && ctl->dsp->running)
@@ -926,6 +929,8 @@ static int wm_coeff_tlv_put(struct snd_kcontrol *kctl,
926 ctl->set = 1; 929 ctl->set = 1;
927 if (ctl->enabled && ctl->dsp->running) 930 if (ctl->enabled && ctl->dsp->running)
928 ret = wm_coeff_write_control(ctl, ctl->cache, size); 931 ret = wm_coeff_write_control(ctl, ctl->cache, size);
932 else if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
933 ret = -EPERM;
929 } 934 }
930 935
931 mutex_unlock(&ctl->dsp->pwr_lock); 936 mutex_unlock(&ctl->dsp->pwr_lock);
@@ -947,7 +952,7 @@ static int wm_coeff_put_acked(struct snd_kcontrol *kctl,
947 952
948 mutex_lock(&ctl->dsp->pwr_lock); 953 mutex_lock(&ctl->dsp->pwr_lock);
949 954
950 if (ctl->enabled) 955 if (ctl->enabled && ctl->dsp->running)
951 ret = wm_coeff_write_acked_control(ctl, val); 956 ret = wm_coeff_write_acked_control(ctl, val);
952 else 957 else
953 ret = -EPERM; 958 ret = -EPERM;
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 4924575d2e95..343b291fc372 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -115,6 +115,7 @@ int asoc_simple_card_parse_clk(struct device *dev,
115 clk = devm_get_clk_from_child(dev, node, NULL); 115 clk = devm_get_clk_from_child(dev, node, NULL);
116 if (!IS_ERR(clk)) { 116 if (!IS_ERR(clk)) {
117 simple_dai->sysclk = clk_get_rate(clk); 117 simple_dai->sysclk = clk_get_rate(clk);
118 simple_dai->clk = clk;
118 } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { 119 } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
119 simple_dai->sysclk = val; 120 simple_dai->sysclk = val;
120 } else { 121 } else {
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index ed58b5b3555a..2dbfb1b24ef4 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -512,7 +512,7 @@ static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
512 if (bc->set_params != SKL_PARAM_INIT) 512 if (bc->set_params != SKL_PARAM_INIT)
513 continue; 513 continue;
514 514
515 mconfig->formats_config.caps = (u32 *)&bc->params; 515 mconfig->formats_config.caps = (u32 *)bc->params;
516 mconfig->formats_config.caps_size = bc->size; 516 mconfig->formats_config.caps_size = bc->size;
517 517
518 break; 518 break;
diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
index 05cf809cf9e1..d7013bde6f45 100644
--- a/sound/soc/mediatek/Kconfig
+++ b/sound/soc/mediatek/Kconfig
@@ -13,7 +13,7 @@ config SND_SOC_MT2701
13 13
14config SND_SOC_MT2701_CS42448 14config SND_SOC_MT2701_CS42448
15 tristate "ASoc Audio driver for MT2701 with CS42448 codec" 15 tristate "ASoc Audio driver for MT2701 with CS42448 codec"
16 depends on SND_SOC_MT2701 16 depends on SND_SOC_MT2701 && I2C
17 select SND_SOC_CS42XX8_I2C 17 select SND_SOC_CS42XX8_I2C
18 select SND_SOC_BT_SCO 18 select SND_SOC_BT_SCO
19 help 19 help
diff --git a/sound/soc/sh/rcar/cmd.c b/sound/soc/sh/rcar/cmd.c
index abb5eaac854a..7d92a24b7cfa 100644
--- a/sound/soc/sh/rcar/cmd.c
+++ b/sound/soc/sh/rcar/cmd.c
@@ -31,23 +31,24 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
31 struct rsnd_mod *mix = rsnd_io_to_mod_mix(io); 31 struct rsnd_mod *mix = rsnd_io_to_mod_mix(io);
32 struct device *dev = rsnd_priv_to_dev(priv); 32 struct device *dev = rsnd_priv_to_dev(priv);
33 u32 data; 33 u32 data;
34 u32 path[] = {
35 [1] = 1 << 0,
36 [5] = 1 << 8,
37 [6] = 1 << 12,
38 [9] = 1 << 15,
39 };
34 40
35 if (!mix && !dvc) 41 if (!mix && !dvc)
36 return 0; 42 return 0;
37 43
44 if (ARRAY_SIZE(path) < rsnd_mod_id(mod) + 1)
45 return -ENXIO;
46
38 if (mix) { 47 if (mix) {
39 struct rsnd_dai *rdai; 48 struct rsnd_dai *rdai;
40 struct rsnd_mod *src; 49 struct rsnd_mod *src;
41 struct rsnd_dai_stream *tio; 50 struct rsnd_dai_stream *tio;
42 int i; 51 int i;
43 u32 path[] = {
44 [0] = 0,
45 [1] = 1 << 0,
46 [2] = 0,
47 [3] = 0,
48 [4] = 0,
49 [5] = 1 << 8
50 };
51 52
52 /* 53 /*
53 * it is assuming that integrater is well understanding about 54 * it is assuming that integrater is well understanding about
@@ -70,16 +71,19 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
70 } else { 71 } else {
71 struct rsnd_mod *src = rsnd_io_to_mod_src(io); 72 struct rsnd_mod *src = rsnd_io_to_mod_src(io);
72 73
73 u32 path[] = { 74 u8 cmd_case[] = {
74 [0] = 0x30000, 75 [0] = 0x3,
75 [1] = 0x30001, 76 [1] = 0x3,
76 [2] = 0x40000, 77 [2] = 0x4,
77 [3] = 0x10000, 78 [3] = 0x1,
78 [4] = 0x20000, 79 [4] = 0x2,
79 [5] = 0x40100 80 [5] = 0x4,
81 [6] = 0x1,
82 [9] = 0x2,
80 }; 83 };
81 84
82 data = path[rsnd_mod_id(src)]; 85 data = path[rsnd_mod_id(src)] |
86 cmd_case[rsnd_mod_id(src)] << 16;
83 } 87 }
84 88
85 dev_dbg(dev, "ctu/mix path = 0x%08x", data); 89 dev_dbg(dev, "ctu/mix path = 0x%08x", data);
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 1f405c833867..241cb3b08a07 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -454,6 +454,20 @@ static u32 rsnd_dmapp_read(struct rsnd_dma *dma, u32 reg)
454 return ioread32(rsnd_dmapp_addr(dmac, dma, reg)); 454 return ioread32(rsnd_dmapp_addr(dmac, dma, reg));
455} 455}
456 456
457static void rsnd_dmapp_bset(struct rsnd_dma *dma, u32 data, u32 mask, u32 reg)
458{
459 struct rsnd_mod *mod = rsnd_mod_get(dma);
460 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
461 struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
462 void __iomem *addr = rsnd_dmapp_addr(dmac, dma, reg);
463 u32 val = ioread32(addr);
464
465 val &= ~mask;
466 val |= (data & mask);
467
468 iowrite32(val, addr);
469}
470
457static int rsnd_dmapp_stop(struct rsnd_mod *mod, 471static int rsnd_dmapp_stop(struct rsnd_mod *mod,
458 struct rsnd_dai_stream *io, 472 struct rsnd_dai_stream *io,
459 struct rsnd_priv *priv) 473 struct rsnd_priv *priv)
@@ -461,10 +475,10 @@ static int rsnd_dmapp_stop(struct rsnd_mod *mod,
461 struct rsnd_dma *dma = rsnd_mod_to_dma(mod); 475 struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
462 int i; 476 int i;
463 477
464 rsnd_dmapp_write(dma, 0, PDMACHCR); 478 rsnd_dmapp_bset(dma, 0, PDMACHCR_DE, PDMACHCR);
465 479
466 for (i = 0; i < 1024; i++) { 480 for (i = 0; i < 1024; i++) {
467 if (0 == rsnd_dmapp_read(dma, PDMACHCR)) 481 if (0 == (rsnd_dmapp_read(dma, PDMACHCR) & PDMACHCR_DE))
468 return 0; 482 return 0;
469 udelay(1); 483 udelay(1);
470 } 484 }
diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c
index 4e817c8a18c0..14fafdaf1395 100644
--- a/sound/soc/sh/rcar/ssiu.c
+++ b/sound/soc/sh/rcar/ssiu.c
@@ -64,7 +64,11 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod,
64 mask1 = (1 << 4) | (1 << 20); /* mask sync bit */ 64 mask1 = (1 << 4) | (1 << 20); /* mask sync bit */
65 mask2 = (1 << 4); /* mask sync bit */ 65 mask2 = (1 << 4); /* mask sync bit */
66 val1 = val2 = 0; 66 val1 = val2 = 0;
67 if (rsnd_ssi_is_pin_sharing(io)) { 67 if (id == 8) {
68 /*
69 * SSI8 pin is sharing with SSI7, nothing to do.
70 */
71 } else if (rsnd_ssi_is_pin_sharing(io)) {
68 int shift = -1; 72 int shift = -1;
69 73
70 switch (id) { 74 switch (id) {
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6dca408faae3..2722bb0c5573 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3326,7 +3326,10 @@ static int snd_soc_platform_drv_pcm_new(struct snd_soc_pcm_runtime *rtd)
3326{ 3326{
3327 struct snd_soc_platform *platform = rtd->platform; 3327 struct snd_soc_platform *platform = rtd->platform;
3328 3328
3329 return platform->driver->pcm_new(rtd); 3329 if (platform->driver->pcm_new)
3330 return platform->driver->pcm_new(rtd);
3331 else
3332 return 0;
3330} 3333}
3331 3334
3332static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm) 3335static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm)
@@ -3334,7 +3337,8 @@ static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm)
3334 struct snd_soc_pcm_runtime *rtd = pcm->private_data; 3337 struct snd_soc_pcm_runtime *rtd = pcm->private_data;
3335 struct snd_soc_platform *platform = rtd->platform; 3338 struct snd_soc_platform *platform = rtd->platform;
3336 3339
3337 platform->driver->pcm_free(pcm); 3340 if (platform->driver->pcm_free)
3341 platform->driver->pcm_free(pcm);
3338} 3342}
3339 3343
3340/** 3344/**
diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c
index 5992c6ab3833..93a8df6ed880 100644
--- a/sound/soc/sti/uniperif_reader.c
+++ b/sound/soc/sti/uniperif_reader.c
@@ -349,6 +349,8 @@ static int uni_reader_startup(struct snd_pcm_substream *substream,
349 struct uniperif *reader = priv->dai_data.uni; 349 struct uniperif *reader = priv->dai_data.uni;
350 int ret; 350 int ret;
351 351
352 reader->substream = substream;
353
352 if (!UNIPERIF_TYPE_IS_TDM(reader)) 354 if (!UNIPERIF_TYPE_IS_TDM(reader))
353 return 0; 355 return 0;
354 356
@@ -378,6 +380,7 @@ static void uni_reader_shutdown(struct snd_pcm_substream *substream,
378 /* Stop the reader */ 380 /* Stop the reader */
379 uni_reader_stop(reader); 381 uni_reader_stop(reader);
380 } 382 }
383 reader->substream = NULL;
381} 384}
382 385
383static const struct snd_soc_dai_ops uni_reader_dai_ops = { 386static const struct snd_soc_dai_ops uni_reader_dai_ops = {
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index b92bdc8361af..7527ba29a5a0 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -259,25 +259,20 @@ static int sun8i_codec_hw_params(struct snd_pcm_substream *substream,
259 return 0; 259 return 0;
260} 260}
261 261
262static const struct snd_kcontrol_new sun8i_output_left_mixer_controls[] = { 262static const struct snd_kcontrol_new sun8i_dac_mixer_controls[] = {
263 SOC_DAPM_SINGLE("LSlot 0", SUN8I_DAC_MXR_SRC, 263 SOC_DAPM_DOUBLE("AIF1 Slot 0 Digital DAC Playback Switch",
264 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L, 1, 0), 264 SUN8I_DAC_MXR_SRC,
265 SOC_DAPM_SINGLE("LSlot 1", SUN8I_DAC_MXR_SRC, 265 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA0L,
266 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L, 1, 0),
267 SOC_DAPM_SINGLE("DACL", SUN8I_DAC_MXR_SRC,
268 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL, 1, 0),
269 SOC_DAPM_SINGLE("ADCL", SUN8I_DAC_MXR_SRC,
270 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL, 1, 0),
271};
272
273static const struct snd_kcontrol_new sun8i_output_right_mixer_controls[] = {
274 SOC_DAPM_SINGLE("RSlot 0", SUN8I_DAC_MXR_SRC,
275 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0), 266 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA0R, 1, 0),
276 SOC_DAPM_SINGLE("RSlot 1", SUN8I_DAC_MXR_SRC, 267 SOC_DAPM_DOUBLE("AIF1 Slot 1 Digital DAC Playback Switch",
268 SUN8I_DAC_MXR_SRC,
269 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF1DA1L,
277 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0), 270 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF1DA1R, 1, 0),
278 SOC_DAPM_SINGLE("DACR", SUN8I_DAC_MXR_SRC, 271 SOC_DAPM_DOUBLE("AIF2 Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC,
272 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_AIF2DACL,
279 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0), 273 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_AIF2DACR, 1, 0),
280 SOC_DAPM_SINGLE("ADCR", SUN8I_DAC_MXR_SRC, 274 SOC_DAPM_DOUBLE("ADC Digital DAC Playback Switch", SUN8I_DAC_MXR_SRC,
275 SUN8I_DAC_MXR_SRC_DACL_MXR_SRC_ADCL,
281 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0), 276 SUN8I_DAC_MXR_SRC_DACR_MXR_SRC_ADCR, 1, 0),
282}; 277};
283 278
@@ -286,19 +281,21 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = {
286 SND_SOC_DAPM_SUPPLY("DAC", SUN8I_DAC_DIG_CTRL, SUN8I_DAC_DIG_CTRL_ENDA, 281 SND_SOC_DAPM_SUPPLY("DAC", SUN8I_DAC_DIG_CTRL, SUN8I_DAC_DIG_CTRL_ENDA,
287 0, NULL, 0), 282 0, NULL, 0),
288 283
289 /* Analog DAC */ 284 /* Analog DAC AIF */
290 SND_SOC_DAPM_DAC("Digital Left DAC", "Playback", SUN8I_AIF1_DACDAT_CTRL, 285 SND_SOC_DAPM_AIF_IN("AIF1 Slot 0 Left", "Playback", 0,
291 SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0L_ENA, 0), 286 SUN8I_AIF1_DACDAT_CTRL,
292 SND_SOC_DAPM_DAC("Digital Right DAC", "Playback", SUN8I_AIF1_DACDAT_CTRL, 287 SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0L_ENA, 0),
293 SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0), 288 SND_SOC_DAPM_AIF_IN("AIF1 Slot 0 Right", "Playback", 0,
289 SUN8I_AIF1_DACDAT_CTRL,
290 SUN8I_AIF1_DACDAT_CTRL_AIF1_DA0R_ENA, 0),
294 291
295 /* DAC Mixers */ 292 /* DAC Mixers */
296 SND_SOC_DAPM_MIXER("Left DAC Mixer", SND_SOC_NOPM, 0, 0, 293 SND_SOC_DAPM_MIXER("Left Digital DAC Mixer", SND_SOC_NOPM, 0, 0,
297 sun8i_output_left_mixer_controls, 294 sun8i_dac_mixer_controls,
298 ARRAY_SIZE(sun8i_output_left_mixer_controls)), 295 ARRAY_SIZE(sun8i_dac_mixer_controls)),
299 SND_SOC_DAPM_MIXER("Right DAC Mixer", SND_SOC_NOPM, 0, 0, 296 SND_SOC_DAPM_MIXER("Right Digital DAC Mixer", SND_SOC_NOPM, 0, 0,
300 sun8i_output_right_mixer_controls, 297 sun8i_dac_mixer_controls,
301 ARRAY_SIZE(sun8i_output_right_mixer_controls)), 298 ARRAY_SIZE(sun8i_dac_mixer_controls)),
302 299
303 /* Clocks */ 300 /* Clocks */
304 SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA, 301 SND_SOC_DAPM_SUPPLY("MODCLK AFI1", SUN8I_MOD_CLK_ENA,
@@ -321,8 +318,6 @@ static const struct snd_soc_dapm_widget sun8i_codec_dapm_widgets[] = {
321 SUN8I_MOD_RST_CTL_AIF1, 0, NULL, 0), 318 SUN8I_MOD_RST_CTL_AIF1, 0, NULL, 0),
322 SND_SOC_DAPM_SUPPLY("RST DAC", SUN8I_MOD_RST_CTL, 319 SND_SOC_DAPM_SUPPLY("RST DAC", SUN8I_MOD_RST_CTL,
323 SUN8I_MOD_RST_CTL_DAC, 0, NULL, 0), 320 SUN8I_MOD_RST_CTL_DAC, 0, NULL, 0),
324
325 SND_SOC_DAPM_OUTPUT("HP"),
326}; 321};
327 322
328static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { 323static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = {
@@ -338,16 +333,14 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = {
338 { "DAC", NULL, "MODCLK DAC" }, 333 { "DAC", NULL, "MODCLK DAC" },
339 334
340 /* DAC Routes */ 335 /* DAC Routes */
341 { "Digital Left DAC", NULL, "DAC" }, 336 { "AIF1 Slot 0 Right", NULL, "DAC" },
342 { "Digital Right DAC", NULL, "DAC" }, 337 { "AIF1 Slot 0 Left", NULL, "DAC" },
343 338
344 /* DAC Mixer Routes */ 339 /* DAC Mixer Routes */
345 { "Left DAC Mixer", "LSlot 0", "Digital Left DAC"}, 340 { "Left Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch",
346 { "Right DAC Mixer", "RSlot 0", "Digital Right DAC"}, 341 "AIF1 Slot 0 Left"},
347 342 { "Right Digital DAC Mixer", "AIF1 Slot 0 Digital DAC Playback Switch",
348 /* End of route : HP out */ 343 "AIF1 Slot 0 Right"},
349 { "HP", NULL, "Left DAC Mixer" },
350 { "HP", NULL, "Right DAC Mixer" },
351}; 344};
352 345
353static struct snd_soc_dai_ops sun8i_codec_dai_ops = { 346static struct snd_soc_dai_ops sun8i_codec_dai_ops = {
diff --git a/sound/x86/Kconfig b/sound/x86/Kconfig
index 84c8f8fc597c..8adf4d1bd46e 100644
--- a/sound/x86/Kconfig
+++ b/sound/x86/Kconfig
@@ -1,6 +1,7 @@
1menuconfig SND_X86 1menuconfig SND_X86
2 tristate "X86 sound devices" 2 bool "X86 sound devices"
3 depends on X86 3 depends on X86
4 default y
4 ---help--- 5 ---help---
5 X86 sound devices that don't fall under SoC or PCI categories 6 X86 sound devices that don't fall under SoC or PCI categories
6 7