aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-26 07:53:41 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-26 07:53:41 -0500
commit7533185eeefd087d5472422181ae8edf75118213 (patch)
tree6a62ccb019668215f70bcc9876a795548f57262a /sound
parentb4b33f9d64c3edcdcbea874acdc1e9626fd961f1 (diff)
parent0767e95bb96d7fdddcd590fb809e6975d93aebc5 (diff)
Merge branch 'for-linus' into for-next
Sync with the latest 3.19-rc state for applying other ALSA sequencer core fixes.
Diffstat (limited to 'sound')
-rw-r--r--sound/core/seq/seq_dummy.c31
-rw-r--r--sound/firewire/amdtp.c71
-rw-r--r--sound/firewire/amdtp.h5
-rw-r--r--sound/firewire/bebob/bebob_stream.c7
-rw-r--r--sound/firewire/fireworks/fireworks_stream.c5
-rw-r--r--sound/soc/adi/axi-i2s.c2
-rw-r--r--sound/soc/codecs/pcm512x.c2
-rw-r--r--sound/soc/codecs/rt286.c6
-rw-r--r--sound/soc/codecs/rt5677.c18
-rw-r--r--sound/soc/codecs/ts3a227e.c6
-rw-r--r--sound/soc/codecs/wm8904.c23
-rw-r--r--sound/soc/codecs/wm8960.c2
-rw-r--r--sound/soc/fsl/fsl_esai.h2
-rw-r--r--sound/soc/fsl/fsl_ssi.c4
-rw-r--r--sound/soc/fsl/imx-wm8962.c1
-rw-r--r--sound/soc/generic/simple-card.c7
-rw-r--r--sound/soc/intel/sst-firmware.c13
-rw-r--r--sound/soc/intel/sst-haswell-ipc.c30
-rw-r--r--sound/soc/omap/omap-mcbsp.c2
-rw-r--r--sound/soc/rockchip/rockchip_i2s.c1
-rw-r--r--sound/soc/soc-compress.c9
-rw-r--r--sound/usb/mixer.c1
22 files changed, 158 insertions, 90 deletions
diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c
index ec667f158f19..5d905d90d504 100644
--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -82,36 +82,6 @@ struct snd_seq_dummy_port {
82static int my_client = -1; 82static int my_client = -1;
83 83
84/* 84/*
85 * unuse callback - send ALL_SOUNDS_OFF and RESET_CONTROLLERS events
86 * to subscribers.
87 * Note: this callback is called only after all subscribers are removed.
88 */
89static int
90dummy_unuse(void *private_data, struct snd_seq_port_subscribe *info)
91{
92 struct snd_seq_dummy_port *p;
93 int i;
94 struct snd_seq_event ev;
95
96 p = private_data;
97 memset(&ev, 0, sizeof(ev));
98 if (p->duplex)
99 ev.source.port = p->connect;
100 else
101 ev.source.port = p->port;
102 ev.dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS;
103 ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
104 for (i = 0; i < 16; i++) {
105 ev.data.control.channel = i;
106 ev.data.control.param = MIDI_CTL_ALL_SOUNDS_OFF;
107 snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
108 ev.data.control.param = MIDI_CTL_RESET_CONTROLLERS;
109 snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
110 }
111 return 0;
112}
113
114/*
115 * event input callback - just redirect events to subscribers 85 * event input callback - just redirect events to subscribers
116 */ 86 */
117static int 87static int
@@ -175,7 +145,6 @@ create_port(int idx, int type)
175 | SNDRV_SEQ_PORT_TYPE_PORT; 145 | SNDRV_SEQ_PORT_TYPE_PORT;
176 memset(&pcb, 0, sizeof(pcb)); 146 memset(&pcb, 0, sizeof(pcb));
177 pcb.owner = THIS_MODULE; 147 pcb.owner = THIS_MODULE;
178 pcb.unuse = dummy_unuse;
179 pcb.event_input = dummy_input; 148 pcb.event_input = dummy_input;
180 pcb.private_free = dummy_free; 149 pcb.private_free = dummy_free;
181 pcb.private_data = rec; 150 pcb.private_data = rec;
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 3badc70124ab..0d580186ef1a 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -21,7 +21,19 @@
21#define CYCLES_PER_SECOND 8000 21#define CYCLES_PER_SECOND 8000
22#define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) 22#define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND)
23 23
24#define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ 24/*
25 * Nominally 3125 bytes/second, but the MIDI port's clock might be
26 * 1% too slow, and the bus clock 100 ppm too fast.
27 */
28#define MIDI_BYTES_PER_SECOND 3093
29
30/*
31 * Several devices look only at the first eight data blocks.
32 * In any case, this is more than enough for the MIDI data rate.
33 */
34#define MAX_MIDI_RX_BLOCKS 8
35
36#define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */
25 37
26/* isochronous header parameters */ 38/* isochronous header parameters */
27#define ISO_DATA_LENGTH_SHIFT 16 39#define ISO_DATA_LENGTH_SHIFT 16
@@ -78,8 +90,6 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
78 s->callbacked = false; 90 s->callbacked = false;
79 s->sync_slave = NULL; 91 s->sync_slave = NULL;
80 92
81 s->rx_blocks_for_midi = UINT_MAX;
82
83 return 0; 93 return 0;
84} 94}
85EXPORT_SYMBOL(amdtp_stream_init); 95EXPORT_SYMBOL(amdtp_stream_init);
@@ -222,6 +232,14 @@ sfc_found:
222 for (i = 0; i < pcm_channels; i++) 232 for (i = 0; i < pcm_channels; i++)
223 s->pcm_positions[i] = i; 233 s->pcm_positions[i] = i;
224 s->midi_position = s->pcm_channels; 234 s->midi_position = s->pcm_channels;
235
236 /*
237 * We do not know the actual MIDI FIFO size of most devices. Just
238 * assume two bytes, i.e., one byte can be received over the bus while
239 * the previous one is transmitted over MIDI.
240 * (The value here is adjusted for midi_ratelimit_per_packet().)
241 */
242 s->midi_fifo_limit = rate - MIDI_BYTES_PER_SECOND * s->syt_interval + 1;
225} 243}
226EXPORT_SYMBOL(amdtp_stream_set_parameters); 244EXPORT_SYMBOL(amdtp_stream_set_parameters);
227 245
@@ -463,6 +481,36 @@ static void amdtp_fill_pcm_silence(struct amdtp_stream *s,
463 } 481 }
464} 482}
465 483
484/*
485 * To avoid sending MIDI bytes at too high a rate, assume that the receiving
486 * device has a FIFO, and track how much it is filled. This values increases
487 * by one whenever we send one byte in a packet, but the FIFO empties at
488 * a constant rate independent of our packet rate. One packet has syt_interval
489 * samples, so the number of bytes that empty out of the FIFO, per packet(!),
490 * is MIDI_BYTES_PER_SECOND * syt_interval / sample_rate. To avoid storing
491 * fractional values, the values in midi_fifo_used[] are measured in bytes
492 * multiplied by the sample rate.
493 */
494static bool midi_ratelimit_per_packet(struct amdtp_stream *s, unsigned int port)
495{
496 int used;
497
498 used = s->midi_fifo_used[port];
499 if (used == 0) /* common shortcut */
500 return true;
501
502 used -= MIDI_BYTES_PER_SECOND * s->syt_interval;
503 used = max(used, 0);
504 s->midi_fifo_used[port] = used;
505
506 return used < s->midi_fifo_limit;
507}
508
509static void midi_rate_use_one_byte(struct amdtp_stream *s, unsigned int port)
510{
511 s->midi_fifo_used[port] += amdtp_rate_table[s->sfc];
512}
513
466static void amdtp_fill_midi(struct amdtp_stream *s, 514static void amdtp_fill_midi(struct amdtp_stream *s,
467 __be32 *buffer, unsigned int frames) 515 __be32 *buffer, unsigned int frames)
468{ 516{
@@ -470,16 +518,21 @@ static void amdtp_fill_midi(struct amdtp_stream *s,
470 u8 *b; 518 u8 *b;
471 519
472 for (f = 0; f < frames; f++) { 520 for (f = 0; f < frames; f++) {
473 buffer[s->midi_position] = 0;
474 b = (u8 *)&buffer[s->midi_position]; 521 b = (u8 *)&buffer[s->midi_position];
475 522
476 port = (s->data_block_counter + f) % 8; 523 port = (s->data_block_counter + f) % 8;
477 if ((f >= s->rx_blocks_for_midi) || 524 if (f < MAX_MIDI_RX_BLOCKS &&
478 (s->midi[port] == NULL) || 525 midi_ratelimit_per_packet(s, port) &&
479 (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) 526 s->midi[port] != NULL &&
480 b[0] = 0x80; 527 snd_rawmidi_transmit(s->midi[port], &b[1], 1) == 1) {
481 else 528 midi_rate_use_one_byte(s, port);
482 b[0] = 0x81; 529 b[0] = 0x81;
530 } else {
531 b[0] = 0x80;
532 b[1] = 0;
533 }
534 b[2] = 0;
535 b[3] = 0;
483 536
484 buffer += s->data_block_quadlets; 537 buffer += s->data_block_quadlets;
485 } 538 }
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h
index e6e8926275b0..8a03a91e728b 100644
--- a/sound/firewire/amdtp.h
+++ b/sound/firewire/amdtp.h
@@ -148,13 +148,12 @@ struct amdtp_stream {
148 bool double_pcm_frames; 148 bool double_pcm_frames;
149 149
150 struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8]; 150 struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
151 int midi_fifo_limit;
152 int midi_fifo_used[AMDTP_MAX_CHANNELS_FOR_MIDI * 8];
151 153
152 /* quirk: fixed interval of dbc between previos/current packets. */ 154 /* quirk: fixed interval of dbc between previos/current packets. */
153 unsigned int tx_dbc_interval; 155 unsigned int tx_dbc_interval;
154 156
155 /* quirk: the first count of data blocks in an rx packet for MIDI */
156 unsigned int rx_blocks_for_midi;
157
158 bool callbacked; 157 bool callbacked;
159 wait_queue_head_t callback_wait; 158 wait_queue_head_t callback_wait;
160 struct amdtp_stream *sync_slave; 159 struct amdtp_stream *sync_slave;
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index 1aab0a32870c..0ebcabfdc7ce 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -484,13 +484,6 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob)
484 amdtp_stream_destroy(&bebob->rx_stream); 484 amdtp_stream_destroy(&bebob->rx_stream);
485 destroy_both_connections(bebob); 485 destroy_both_connections(bebob);
486 } 486 }
487 /*
488 * The firmware for these devices ignore MIDI messages in more than
489 * first 8 data blocks of an received AMDTP packet.
490 */
491 if (bebob->spec == &maudio_fw410_spec ||
492 bebob->spec == &maudio_special_spec)
493 bebob->rx_stream.rx_blocks_for_midi = 8;
494end: 487end:
495 return err; 488 return err;
496} 489}
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c
index b985fc5ebdc6..4f440e163667 100644
--- a/sound/firewire/fireworks/fireworks_stream.c
+++ b/sound/firewire/fireworks/fireworks_stream.c
@@ -179,11 +179,6 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
179 destroy_stream(efw, &efw->tx_stream); 179 destroy_stream(efw, &efw->tx_stream);
180 goto end; 180 goto end;
181 } 181 }
182 /*
183 * Fireworks ignores MIDI messages in more than first 8 data
184 * blocks of an received AMDTP packet.
185 */
186 efw->rx_stream.rx_blocks_for_midi = 8;
187 182
188 /* set IEC61883 compliant mode (actually not fully compliant...) */ 183 /* set IEC61883 compliant mode (actually not fully compliant...) */
189 err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); 184 err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883);
diff --git a/sound/soc/adi/axi-i2s.c b/sound/soc/adi/axi-i2s.c
index 7752860f7230..4c23381727a1 100644
--- a/sound/soc/adi/axi-i2s.c
+++ b/sound/soc/adi/axi-i2s.c
@@ -240,6 +240,8 @@ static int axi_i2s_probe(struct platform_device *pdev)
240 if (ret) 240 if (ret)
241 goto err_clk_disable; 241 goto err_clk_disable;
242 242
243 return 0;
244
243err_clk_disable: 245err_clk_disable:
244 clk_disable_unprepare(i2s->clk); 246 clk_disable_unprepare(i2s->clk);
245 return ret; 247 return ret;
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index e5f2fb884bf3..30c673cdc12e 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -188,8 +188,8 @@ static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0);
188static const char * const pcm512x_dsp_program_texts[] = { 188static const char * const pcm512x_dsp_program_texts[] = {
189 "FIR interpolation with de-emphasis", 189 "FIR interpolation with de-emphasis",
190 "Low latency IIR with de-emphasis", 190 "Low latency IIR with de-emphasis",
191 "Fixed process flow",
192 "High attenuation with de-emphasis", 191 "High attenuation with de-emphasis",
192 "Fixed process flow",
193 "Ringing-less low latency FIR", 193 "Ringing-less low latency FIR",
194}; 194};
195 195
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 2cd4fe463102..1d1c7f8a9af2 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -861,10 +861,8 @@ static int rt286_hw_params(struct snd_pcm_substream *substream,
861 RT286_I2S_CTRL1, 0x0018, d_len_code << 3); 861 RT286_I2S_CTRL1, 0x0018, d_len_code << 3);
862 dev_dbg(codec->dev, "format val = 0x%x\n", val); 862 dev_dbg(codec->dev, "format val = 0x%x\n", val);
863 863
864 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 864 snd_soc_update_bits(codec, RT286_DAC_FORMAT, 0x407f, val);
865 snd_soc_update_bits(codec, RT286_DAC_FORMAT, 0x407f, val); 865 snd_soc_update_bits(codec, RT286_ADC_FORMAT, 0x407f, val);
866 else
867 snd_soc_update_bits(codec, RT286_ADC_FORMAT, 0x407f, val);
868 866
869 return 0; 867 return 0;
870} 868}
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 890022171359..d27630accf03 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -2174,10 +2174,14 @@ static int rt5677_set_pll1_event(struct snd_soc_dapm_widget *w,
2174 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 2174 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
2175 2175
2176 switch (event) { 2176 switch (event) {
2177 case SND_SOC_DAPM_POST_PMU: 2177 case SND_SOC_DAPM_PRE_PMU:
2178 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x2); 2178 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x2);
2179 break;
2180
2181 case SND_SOC_DAPM_POST_PMU:
2179 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x0); 2182 regmap_update_bits(rt5677->regmap, RT5677_PLL1_CTRL2, 0x2, 0x0);
2180 break; 2183 break;
2184
2181 default: 2185 default:
2182 return 0; 2186 return 0;
2183 } 2187 }
@@ -2192,10 +2196,14 @@ static int rt5677_set_pll2_event(struct snd_soc_dapm_widget *w,
2192 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); 2196 struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
2193 2197
2194 switch (event) { 2198 switch (event) {
2195 case SND_SOC_DAPM_POST_PMU: 2199 case SND_SOC_DAPM_PRE_PMU:
2196 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x2); 2200 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x2);
2201 break;
2202
2203 case SND_SOC_DAPM_POST_PMU:
2197 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x0); 2204 regmap_update_bits(rt5677->regmap, RT5677_PLL2_CTRL2, 0x2, 0x0);
2198 break; 2205 break;
2206
2199 default: 2207 default:
2200 return 0; 2208 return 0;
2201 } 2209 }
@@ -2303,9 +2311,11 @@ static int rt5677_vref_event(struct snd_soc_dapm_widget *w,
2303 2311
2304static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = { 2312static const struct snd_soc_dapm_widget rt5677_dapm_widgets[] = {
2305 SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT, 2313 SND_SOC_DAPM_SUPPLY("PLL1", RT5677_PWR_ANLG2, RT5677_PWR_PLL1_BIT,
2306 0, rt5677_set_pll1_event, SND_SOC_DAPM_POST_PMU), 2314 0, rt5677_set_pll1_event, SND_SOC_DAPM_PRE_PMU |
2315 SND_SOC_DAPM_POST_PMU),
2307 SND_SOC_DAPM_SUPPLY("PLL2", RT5677_PWR_ANLG2, RT5677_PWR_PLL2_BIT, 2316 SND_SOC_DAPM_SUPPLY("PLL2", RT5677_PWR_ANLG2, RT5677_PWR_PLL2_BIT,
2308 0, rt5677_set_pll2_event, SND_SOC_DAPM_POST_PMU), 2317 0, rt5677_set_pll2_event, SND_SOC_DAPM_PRE_PMU |
2318 SND_SOC_DAPM_POST_PMU),
2309 2319
2310 /* ASRC */ 2320 /* ASRC */
2311 SND_SOC_DAPM_SUPPLY_S("I2S1 ASRC", 1, RT5677_ASRC_1, 0, 0, NULL, 0), 2321 SND_SOC_DAPM_SUPPLY_S("I2S1 ASRC", 1, RT5677_ASRC_1, 0, 0, NULL, 0),
diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 1d1205702d23..9f2dced046de 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -254,6 +254,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
254 struct ts3a227e *ts3a227e; 254 struct ts3a227e *ts3a227e;
255 struct device *dev = &i2c->dev; 255 struct device *dev = &i2c->dev;
256 int ret; 256 int ret;
257 unsigned int acc_reg;
257 258
258 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); 259 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL);
259 if (ts3a227e == NULL) 260 if (ts3a227e == NULL)
@@ -283,6 +284,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
283 INTB_DISABLE | ADC_COMPLETE_INT_DISABLE, 284 INTB_DISABLE | ADC_COMPLETE_INT_DISABLE,
284 ADC_COMPLETE_INT_DISABLE); 285 ADC_COMPLETE_INT_DISABLE);
285 286
287 /* Read jack status because chip might not trigger interrupt at boot. */
288 regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg);
289 ts3a227e_new_jack_state(ts3a227e, acc_reg);
290 ts3a227e_jack_report(ts3a227e);
291
286 return 0; 292 return 0;
287} 293}
288 294
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 4d2d2b1380d5..75b87c5c0f04 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1076,10 +1076,13 @@ static const struct snd_soc_dapm_route adc_intercon[] = {
1076 { "Right Capture PGA", NULL, "Right Capture Mux" }, 1076 { "Right Capture PGA", NULL, "Right Capture Mux" },
1077 { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, 1077 { "Right Capture PGA", NULL, "Right Capture Inverting Mux" },
1078 1078
1079 { "AIFOUTL", "Left", "ADCL" }, 1079 { "AIFOUTL Mux", "Left", "ADCL" },
1080 { "AIFOUTL", "Right", "ADCR" }, 1080 { "AIFOUTL Mux", "Right", "ADCR" },
1081 { "AIFOUTR", "Left", "ADCL" }, 1081 { "AIFOUTR Mux", "Left", "ADCL" },
1082 { "AIFOUTR", "Right", "ADCR" }, 1082 { "AIFOUTR Mux", "Right", "ADCR" },
1083
1084 { "AIFOUTL", NULL, "AIFOUTL Mux" },
1085 { "AIFOUTR", NULL, "AIFOUTR Mux" },
1083 1086
1084 { "ADCL", NULL, "CLK_DSP" }, 1087 { "ADCL", NULL, "CLK_DSP" },
1085 { "ADCL", NULL, "Left Capture PGA" }, 1088 { "ADCL", NULL, "Left Capture PGA" },
@@ -1089,12 +1092,16 @@ static const struct snd_soc_dapm_route adc_intercon[] = {
1089}; 1092};
1090 1093
1091static const struct snd_soc_dapm_route dac_intercon[] = { 1094static const struct snd_soc_dapm_route dac_intercon[] = {
1092 { "DACL", "Right", "AIFINR" }, 1095 { "DACL Mux", "Left", "AIFINL" },
1093 { "DACL", "Left", "AIFINL" }, 1096 { "DACL Mux", "Right", "AIFINR" },
1097
1098 { "DACR Mux", "Left", "AIFINL" },
1099 { "DACR Mux", "Right", "AIFINR" },
1100
1101 { "DACL", NULL, "DACL Mux" },
1094 { "DACL", NULL, "CLK_DSP" }, 1102 { "DACL", NULL, "CLK_DSP" },
1095 1103
1096 { "DACR", "Right", "AIFINR" }, 1104 { "DACR", NULL, "DACR Mux" },
1097 { "DACR", "Left", "AIFINL" },
1098 { "DACR", NULL, "CLK_DSP" }, 1105 { "DACR", NULL, "CLK_DSP" },
1099 1106
1100 { "Charge pump", NULL, "SYSCLK" }, 1107 { "Charge pump", NULL, "SYSCLK" },
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 031a1ae71d94..a96eb497a379 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -556,7 +556,7 @@ static struct {
556 { 22050, 2 }, 556 { 22050, 2 },
557 { 24000, 2 }, 557 { 24000, 2 },
558 { 16000, 3 }, 558 { 16000, 3 },
559 { 11250, 4 }, 559 { 11025, 4 },
560 { 12000, 4 }, 560 { 12000, 4 },
561 { 8000, 5 }, 561 { 8000, 5 },
562}; 562};
diff --git a/sound/soc/fsl/fsl_esai.h b/sound/soc/fsl/fsl_esai.h
index 91a550f4a10d..5e793bbb6b02 100644
--- a/sound/soc/fsl/fsl_esai.h
+++ b/sound/soc/fsl/fsl_esai.h
@@ -302,7 +302,7 @@
302#define ESAI_xCCR_xFP_MASK (((1 << ESAI_xCCR_xFP_WIDTH) - 1) << ESAI_xCCR_xFP_SHIFT) 302#define ESAI_xCCR_xFP_MASK (((1 << ESAI_xCCR_xFP_WIDTH) - 1) << ESAI_xCCR_xFP_SHIFT)
303#define ESAI_xCCR_xFP(v) ((((v) - 1) << ESAI_xCCR_xFP_SHIFT) & ESAI_xCCR_xFP_MASK) 303#define ESAI_xCCR_xFP(v) ((((v) - 1) << ESAI_xCCR_xFP_SHIFT) & ESAI_xCCR_xFP_MASK)
304#define ESAI_xCCR_xDC_SHIFT 9 304#define ESAI_xCCR_xDC_SHIFT 9
305#define ESAI_xCCR_xDC_WIDTH 4 305#define ESAI_xCCR_xDC_WIDTH 5
306#define ESAI_xCCR_xDC_MASK (((1 << ESAI_xCCR_xDC_WIDTH) - 1) << ESAI_xCCR_xDC_SHIFT) 306#define ESAI_xCCR_xDC_MASK (((1 << ESAI_xCCR_xDC_WIDTH) - 1) << ESAI_xCCR_xDC_SHIFT)
307#define ESAI_xCCR_xDC(v) ((((v) - 1) << ESAI_xCCR_xDC_SHIFT) & ESAI_xCCR_xDC_MASK) 307#define ESAI_xCCR_xDC(v) ((((v) - 1) << ESAI_xCCR_xDC_SHIFT) & ESAI_xCCR_xDC_MASK)
308#define ESAI_xCCR_xPSR_SHIFT 8 308#define ESAI_xCCR_xPSR_SHIFT 8
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index a65f17d57ffb..059496ed9ad7 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1362,9 +1362,9 @@ static int fsl_ssi_probe(struct platform_device *pdev)
1362 } 1362 }
1363 1363
1364 ssi_private->irq = platform_get_irq(pdev, 0); 1364 ssi_private->irq = platform_get_irq(pdev, 0);
1365 if (!ssi_private->irq) { 1365 if (ssi_private->irq < 0) {
1366 dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); 1366 dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
1367 return -ENXIO; 1367 return ssi_private->irq;
1368 } 1368 }
1369 1369
1370 /* Are the RX and the TX clocks locked? */ 1370 /* Are the RX and the TX clocks locked? */
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index 4caacb05a623..cd146d4fa805 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -257,6 +257,7 @@ static int imx_wm8962_probe(struct platform_device *pdev)
257 if (ret) 257 if (ret)
258 goto clk_fail; 258 goto clk_fail;
259 data->card.num_links = 1; 259 data->card.num_links = 1;
260 data->card.owner = THIS_MODULE;
260 data->card.dai_link = &data->dai; 261 data->card.dai_link = &data->dai;
261 data->card.dapm_widgets = imx_wm8962_dapm_widgets; 262 data->card.dapm_widgets = imx_wm8962_dapm_widgets;
262 data->card.num_dapm_widgets = ARRAY_SIZE(imx_wm8962_dapm_widgets); 263 data->card.num_dapm_widgets = ARRAY_SIZE(imx_wm8962_dapm_widgets);
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fb9240fdc9b7..7fe3009b1c43 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -452,9 +452,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
452} 452}
453 453
454/* Decrease the reference count of the device nodes */ 454/* Decrease the reference count of the device nodes */
455static int asoc_simple_card_unref(struct platform_device *pdev) 455static int asoc_simple_card_unref(struct snd_soc_card *card)
456{ 456{
457 struct snd_soc_card *card = platform_get_drvdata(pdev);
458 struct snd_soc_dai_link *dai_link; 457 struct snd_soc_dai_link *dai_link;
459 int num_links; 458 int num_links;
460 459
@@ -556,7 +555,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
556 return ret; 555 return ret;
557 556
558err: 557err:
559 asoc_simple_card_unref(pdev); 558 asoc_simple_card_unref(&priv->snd_card);
560 return ret; 559 return ret;
561} 560}
562 561
@@ -572,7 +571,7 @@ static int asoc_simple_card_remove(struct platform_device *pdev)
572 snd_soc_jack_free_gpios(&simple_card_mic_jack, 1, 571 snd_soc_jack_free_gpios(&simple_card_mic_jack, 1,
573 &simple_card_mic_jack_gpio); 572 &simple_card_mic_jack_gpio);
574 573
575 return asoc_simple_card_unref(pdev); 574 return asoc_simple_card_unref(card);
576} 575}
577 576
578static const struct of_device_id asoc_simple_of_match[] = { 577static const struct of_device_id asoc_simple_of_match[] = {
diff --git a/sound/soc/intel/sst-firmware.c b/sound/soc/intel/sst-firmware.c
index 50d6925893ff..a2ae2c5f2e9f 100644
--- a/sound/soc/intel/sst-firmware.c
+++ b/sound/soc/intel/sst-firmware.c
@@ -707,6 +707,7 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
707 struct list_head *block_list) 707 struct list_head *block_list)
708{ 708{
709 struct sst_mem_block *block, *tmp; 709 struct sst_mem_block *block, *tmp;
710 struct sst_block_allocator ba_tmp = *ba;
710 u32 end = ba->offset + ba->size, block_end; 711 u32 end = ba->offset + ba->size, block_end;
711 int err; 712 int err;
712 713
@@ -731,9 +732,9 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
731 if (ba->offset >= block->offset && ba->offset < block_end) { 732 if (ba->offset >= block->offset && ba->offset < block_end) {
732 733
733 /* align ba to block boundary */ 734 /* align ba to block boundary */
734 ba->size -= block_end - ba->offset; 735 ba_tmp.size -= block_end - ba->offset;
735 ba->offset = block_end; 736 ba_tmp.offset = block_end;
736 err = block_alloc_contiguous(dsp, ba, block_list); 737 err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
737 if (err < 0) 738 if (err < 0)
738 return -ENOMEM; 739 return -ENOMEM;
739 740
@@ -768,10 +769,10 @@ static int block_alloc_fixed(struct sst_dsp *dsp, struct sst_block_allocator *ba
768 list_move(&block->list, &dsp->used_block_list); 769 list_move(&block->list, &dsp->used_block_list);
769 list_add(&block->module_list, block_list); 770 list_add(&block->module_list, block_list);
770 /* align ba to block boundary */ 771 /* align ba to block boundary */
771 ba->size -= block_end - ba->offset; 772 ba_tmp.size -= block_end - ba->offset;
772 ba->offset = block_end; 773 ba_tmp.offset = block_end;
773 774
774 err = block_alloc_contiguous(dsp, ba, block_list); 775 err = block_alloc_contiguous(dsp, &ba_tmp, block_list);
775 if (err < 0) 776 if (err < 0)
776 return -ENOMEM; 777 return -ENOMEM;
777 778
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 3f8c48231364..5bf14040c24a 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -1228,6 +1228,11 @@ int sst_hsw_stream_free(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1228 struct sst_dsp *sst = hsw->dsp; 1228 struct sst_dsp *sst = hsw->dsp;
1229 unsigned long flags; 1229 unsigned long flags;
1230 1230
1231 if (!stream) {
1232 dev_warn(hsw->dev, "warning: stream is NULL, no stream to free, ignore it.\n");
1233 return 0;
1234 }
1235
1231 /* dont free DSP streams that are not commited */ 1236 /* dont free DSP streams that are not commited */
1232 if (!stream->commited) 1237 if (!stream->commited)
1233 goto out; 1238 goto out;
@@ -1415,6 +1420,16 @@ int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1415 u32 header; 1420 u32 header;
1416 int ret; 1421 int ret;
1417 1422
1423 if (!stream) {
1424 dev_warn(hsw->dev, "warning: stream is NULL, no stream to commit, ignore it.\n");
1425 return 0;
1426 }
1427
1428 if (stream->commited) {
1429 dev_warn(hsw->dev, "warning: stream is already committed, ignore it.\n");
1430 return 0;
1431 }
1432
1418 trace_ipc_request("stream alloc", stream->host_id); 1433 trace_ipc_request("stream alloc", stream->host_id);
1419 1434
1420 header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM); 1435 header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM);
@@ -1519,6 +1534,11 @@ int sst_hsw_stream_pause(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
1519{ 1534{
1520 int ret; 1535 int ret;
1521 1536
1537 if (!stream) {
1538 dev_warn(hsw->dev, "warning: stream is NULL, no stream to pause, ignore it.\n");
1539 return 0;
1540 }
1541
1522 trace_ipc_request("stream pause", stream->reply.stream_hw_id); 1542 trace_ipc_request("stream pause", stream->reply.stream_hw_id);
1523 1543
1524 ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE, 1544 ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE,
@@ -1535,6 +1555,11 @@ int sst_hsw_stream_resume(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
1535{ 1555{
1536 int ret; 1556 int ret;
1537 1557
1558 if (!stream) {
1559 dev_warn(hsw->dev, "warning: stream is NULL, no stream to resume, ignore it.\n");
1560 return 0;
1561 }
1562
1538 trace_ipc_request("stream resume", stream->reply.stream_hw_id); 1563 trace_ipc_request("stream resume", stream->reply.stream_hw_id);
1539 1564
1540 ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME, 1565 ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME,
@@ -1550,6 +1575,11 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
1550{ 1575{
1551 int ret, tries = 10; 1576 int ret, tries = 10;
1552 1577
1578 if (!stream) {
1579 dev_warn(hsw->dev, "warning: stream is NULL, no stream to reset, ignore it.\n");
1580 return 0;
1581 }
1582
1553 /* dont reset streams that are not commited */ 1583 /* dont reset streams that are not commited */
1554 if (!stream->commited) 1584 if (!stream->commited)
1555 return 0; 1585 return 0;
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 8b79cafab1e2..c7eb9dd67f60 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -434,7 +434,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
434 case SND_SOC_DAIFMT_CBM_CFS: 434 case SND_SOC_DAIFMT_CBM_CFS:
435 /* McBSP slave. FS clock as output */ 435 /* McBSP slave. FS clock as output */
436 regs->srgr2 |= FSGM; 436 regs->srgr2 |= FSGM;
437 regs->pcr0 |= FSXM; 437 regs->pcr0 |= FSXM | FSRM;
438 break; 438 break;
439 case SND_SOC_DAIFMT_CBM_CFM: 439 case SND_SOC_DAIFMT_CBM_CFM:
440 /* McBSP slave */ 440 /* McBSP slave */
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 0a98076333ff..acb5be53bfb4 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -339,6 +339,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
339 SNDRV_PCM_FMTBIT_S24_LE), 339 SNDRV_PCM_FMTBIT_S24_LE),
340 }, 340 },
341 .ops = &rockchip_i2s_dai_ops, 341 .ops = &rockchip_i2s_dai_ops,
342 .symmetric_rates = 1,
342}; 343};
343 344
344static const struct snd_soc_component_driver rockchip_i2s_component = { 345static const struct snd_soc_component_driver rockchip_i2s_component = {
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 590a82f01d0b..025c38fbe3c0 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -659,7 +659,8 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
659 rtd->dai_link->stream_name); 659 rtd->dai_link->stream_name);
660 660
661 ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num, 661 ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
662 1, 0, &be_pcm); 662 rtd->dai_link->dpcm_playback,
663 rtd->dai_link->dpcm_capture, &be_pcm);
663 if (ret < 0) { 664 if (ret < 0) {
664 dev_err(rtd->card->dev, "ASoC: can't create compressed for %s\n", 665 dev_err(rtd->card->dev, "ASoC: can't create compressed for %s\n",
665 rtd->dai_link->name); 666 rtd->dai_link->name);
@@ -668,8 +669,10 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
668 669
669 rtd->pcm = be_pcm; 670 rtd->pcm = be_pcm;
670 rtd->fe_compr = 1; 671 rtd->fe_compr = 1;
671 be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd; 672 if (rtd->dai_link->dpcm_playback)
672 be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd; 673 be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
674 else if (rtd->dai_link->dpcm_capture)
675 be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
673 memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops)); 676 memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
674 } else 677 } else
675 memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops)); 678 memcpy(compr->ops, &soc_compr_ops, sizeof(soc_compr_ops));
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 41650d5b93b7..3e2ef61c627b 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -913,6 +913,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
913 case USB_ID(0x046d, 0x0807): /* Logitech Webcam C500 */ 913 case USB_ID(0x046d, 0x0807): /* Logitech Webcam C500 */
914 case USB_ID(0x046d, 0x0808): 914 case USB_ID(0x046d, 0x0808):
915 case USB_ID(0x046d, 0x0809): 915 case USB_ID(0x046d, 0x0809):
916 case USB_ID(0x046d, 0x0819): /* Logitech Webcam C210 */
916 case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ 917 case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */
917 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ 918 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */
918 case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ 919 case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */