aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-12 17:45:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-12 17:45:59 -0500
commit557ed56cc75e0a33c15ba438734a280bac23bd32 (patch)
tree51339e3999cab80cddff812f47ca34997fa589bf
parente28ac1fc31299d826b5dbf1d67e74720a95cda48 (diff)
parent6cf4569ce3561dec560147e6051959d6896b23d1 (diff)
Merge tag 'sound-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "This time we got a few more fixes than the previous rc's, and most of commits were about ASoC. The only significant change in the core side is the regression fix wrt the aux device list handling, and all the rest are driver-specific small / trivial fixes" * tag 'sound-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Add a quirk for Plantronics BT600 ASoC: rt5645: set sel_i2s_pre_div1 to 2 ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused ASoC: Intel: Skylake: Release FW ctx in cleanup ASoC: Intel: bytcr-rt5640: fix settings in internal clock mode ASoC: fsl_ssi: set fifo watermark to more reliable value ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL ASoC: nau8825: correct the function name of register ASoC: Intel: Skylake: Fix to fail safely if module not available in path ASoC: tlv320aic3x: Mark the RESET register as volatile ASoC: Fix binding and probing of auxiliary components ASoC: wm_adsp: Don't overrun firmware file buffer when reading region data ASoC: Intel: bytcr_rt5640: fallback mechanism if MCLK is not enabled ASoC: hdmi-codec: use unsigned type to structure members with bit-field ASoC: topology: kfree kcontrol->private_value before freeing kcontrol ASoC: rsnd: don't double free kctrl ASoC: dwc: Fix PIO mode initialization
-rw-r--r--include/sound/hdmi-codec.h8
-rw-r--r--include/sound/soc.h3
-rw-r--r--sound/soc/codecs/nau8825.c9
-rw-r--r--sound/soc/codecs/nau8825.h7
-rw-r--r--sound/soc/codecs/rt5645.c3
-rw-r--r--sound/soc/codecs/tlv320aic3x.c13
-rw-r--r--sound/soc/codecs/wm_adsp.c25
-rw-r--r--sound/soc/dwc/designware_i2s.c25
-rw-r--r--sound/soc/fsl/fsl_ssi.c74
-rw-r--r--sound/soc/intel/boards/bytcr_rt5640.c18
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c3
-rw-r--r--sound/soc/intel/skylake/skl-sst.c3
-rw-r--r--sound/soc/sh/rcar/core.c4
-rw-r--r--sound/soc/soc-core.c10
-rw-r--r--sound/soc/soc-pcm.c4
-rw-r--r--sound/soc/soc-topology.c3
-rw-r--r--sound/usb/quirks.c1
17 files changed, 151 insertions, 62 deletions
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
index 530c57bdefa0..915c4357945c 100644
--- a/include/sound/hdmi-codec.h
+++ b/include/sound/hdmi-codec.h
@@ -36,10 +36,10 @@ struct hdmi_codec_daifmt {
36 HDMI_AC97, 36 HDMI_AC97,
37 HDMI_SPDIF, 37 HDMI_SPDIF,
38 } fmt; 38 } fmt;
39 int bit_clk_inv:1; 39 unsigned int bit_clk_inv:1;
40 int frame_clk_inv:1; 40 unsigned int frame_clk_inv:1;
41 int bit_clk_master:1; 41 unsigned int bit_clk_master:1;
42 int frame_clk_master:1; 42 unsigned int frame_clk_master:1;
43}; 43};
44 44
45/* 45/*
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2b502f6cc6d0..b86168a21d56 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -813,6 +813,7 @@ struct snd_soc_component {
813 unsigned int suspended:1; /* is in suspend PM state */ 813 unsigned int suspended:1; /* is in suspend PM state */
814 814
815 struct list_head list; 815 struct list_head list;
816 struct list_head card_aux_list; /* for auxiliary bound components */
816 struct list_head card_list; 817 struct list_head card_list;
817 818
818 struct snd_soc_dai_driver *dai_drv; 819 struct snd_soc_dai_driver *dai_drv;
@@ -1152,6 +1153,7 @@ struct snd_soc_card {
1152 */ 1153 */
1153 struct snd_soc_aux_dev *aux_dev; 1154 struct snd_soc_aux_dev *aux_dev;
1154 int num_aux_devs; 1155 int num_aux_devs;
1156 struct list_head aux_comp_list;
1155 1157
1156 const struct snd_kcontrol_new *controls; 1158 const struct snd_kcontrol_new *controls;
1157 int num_controls; 1159 int num_controls;
@@ -1547,6 +1549,7 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
1547 INIT_LIST_HEAD(&card->widgets); 1549 INIT_LIST_HEAD(&card->widgets);
1548 INIT_LIST_HEAD(&card->paths); 1550 INIT_LIST_HEAD(&card->paths);
1549 INIT_LIST_HEAD(&card->dapm_list); 1551 INIT_LIST_HEAD(&card->dapm_list);
1552 INIT_LIST_HEAD(&card->aux_comp_list);
1550 INIT_LIST_HEAD(&card->component_dev_list); 1553 INIT_LIST_HEAD(&card->component_dev_list);
1551} 1554}
1552 1555
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index efe3a44658d5..4576f987a4a5 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -561,9 +561,9 @@ static void nau8825_xtalk_prepare(struct nau8825 *nau8825)
561 nau8825_xtalk_backup(nau8825); 561 nau8825_xtalk_backup(nau8825);
562 /* Config IIS as master to output signal by codec */ 562 /* Config IIS as master to output signal by codec */
563 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, 563 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2,
564 NAU8825_I2S_MS_MASK | NAU8825_I2S_DRV_MASK | 564 NAU8825_I2S_MS_MASK | NAU8825_I2S_LRC_DIV_MASK |
565 NAU8825_I2S_BLK_DIV_MASK, NAU8825_I2S_MS_MASTER | 565 NAU8825_I2S_BLK_DIV_MASK, NAU8825_I2S_MS_MASTER |
566 (0x2 << NAU8825_I2S_DRV_SFT) | 0x1); 566 (0x2 << NAU8825_I2S_LRC_DIV_SFT) | 0x1);
567 /* Ramp up headphone volume to 0dB to get better performance and 567 /* Ramp up headphone volume to 0dB to get better performance and
568 * avoid pop noise in headphone. 568 * avoid pop noise in headphone.
569 */ 569 */
@@ -657,7 +657,7 @@ static void nau8825_xtalk_clean(struct nau8825 *nau8825)
657 NAU8825_IRQ_RMS_EN, NAU8825_IRQ_RMS_EN); 657 NAU8825_IRQ_RMS_EN, NAU8825_IRQ_RMS_EN);
658 /* Recover default value for IIS */ 658 /* Recover default value for IIS */
659 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, 659 regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2,
660 NAU8825_I2S_MS_MASK | NAU8825_I2S_DRV_MASK | 660 NAU8825_I2S_MS_MASK | NAU8825_I2S_LRC_DIV_MASK |
661 NAU8825_I2S_BLK_DIV_MASK, NAU8825_I2S_MS_SLAVE); 661 NAU8825_I2S_BLK_DIV_MASK, NAU8825_I2S_MS_SLAVE);
662 /* Restore value of specific register for cross talk */ 662 /* Restore value of specific register for cross talk */
663 nau8825_xtalk_restore(nau8825); 663 nau8825_xtalk_restore(nau8825);
@@ -2006,7 +2006,8 @@ static void nau8825_fll_apply(struct nau8825 *nau8825,
2006 NAU8825_FLL_INTEGER_MASK, fll_param->fll_int); 2006 NAU8825_FLL_INTEGER_MASK, fll_param->fll_int);
2007 /* FLL pre-scaler */ 2007 /* FLL pre-scaler */
2008 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4, 2008 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4,
2009 NAU8825_FLL_REF_DIV_MASK, fll_param->clk_ref_div); 2009 NAU8825_FLL_REF_DIV_MASK,
2010 fll_param->clk_ref_div << NAU8825_FLL_REF_DIV_SFT);
2010 /* select divided VCO input */ 2011 /* select divided VCO input */
2011 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5, 2012 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5,
2012 NAU8825_FLL_CLK_SW_MASK, NAU8825_FLL_CLK_SW_REF); 2013 NAU8825_FLL_CLK_SW_MASK, NAU8825_FLL_CLK_SW_REF);
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 5d1704e73241..514fd13c2f46 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -137,7 +137,8 @@
137#define NAU8825_FLL_CLK_SRC_FS (0x3 << NAU8825_FLL_CLK_SRC_SFT) 137#define NAU8825_FLL_CLK_SRC_FS (0x3 << NAU8825_FLL_CLK_SRC_SFT)
138 138
139/* FLL4 (0x07) */ 139/* FLL4 (0x07) */
140#define NAU8825_FLL_REF_DIV_MASK (0x3 << 10) 140#define NAU8825_FLL_REF_DIV_SFT 10
141#define NAU8825_FLL_REF_DIV_MASK (0x3 << NAU8825_FLL_REF_DIV_SFT)
141 142
142/* FLL5 (0x08) */ 143/* FLL5 (0x08) */
143#define NAU8825_FLL_PDB_DAC_EN (0x1 << 15) 144#define NAU8825_FLL_PDB_DAC_EN (0x1 << 15)
@@ -247,8 +248,8 @@
247 248
248/* I2S_PCM_CTRL2 (0x1d) */ 249/* I2S_PCM_CTRL2 (0x1d) */
249#define NAU8825_I2S_TRISTATE (1 << 15) /* 0 - normal mode, 1 - Hi-Z output */ 250#define NAU8825_I2S_TRISTATE (1 << 15) /* 0 - normal mode, 1 - Hi-Z output */
250#define NAU8825_I2S_DRV_SFT 12 251#define NAU8825_I2S_LRC_DIV_SFT 12
251#define NAU8825_I2S_DRV_MASK (0x3 << NAU8825_I2S_DRV_SFT) 252#define NAU8825_I2S_LRC_DIV_MASK (0x3 << NAU8825_I2S_LRC_DIV_SFT)
252#define NAU8825_I2S_MS_SFT 3 253#define NAU8825_I2S_MS_SFT 3
253#define NAU8825_I2S_MS_MASK (1 << NAU8825_I2S_MS_SFT) 254#define NAU8825_I2S_MS_MASK (1 << NAU8825_I2S_MS_SFT)
254#define NAU8825_I2S_MS_MASTER (1 << NAU8825_I2S_MS_SFT) 255#define NAU8825_I2S_MS_MASTER (1 << NAU8825_I2S_MS_SFT)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 10c2a564a715..1ac96ef9ee20 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3833,6 +3833,9 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
3833 } 3833 }
3834 } 3834 }
3835 3835
3836 regmap_update_bits(rt5645->regmap, RT5645_ADDA_CLK1,
3837 RT5645_I2S_PD1_MASK, RT5645_I2S_PD1_2);
3838
3836 if (rt5645->pdata.jd_invert) { 3839 if (rt5645->pdata.jd_invert) {
3837 regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2, 3840 regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
3838 RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV); 3841 RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 8877b74b0510..bb94d50052d7 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -126,6 +126,16 @@ static const struct reg_default aic3x_reg[] = {
126 { 108, 0x00 }, { 109, 0x00 }, 126 { 108, 0x00 }, { 109, 0x00 },
127}; 127};
128 128
129static bool aic3x_volatile_reg(struct device *dev, unsigned int reg)
130{
131 switch (reg) {
132 case AIC3X_RESET:
133 return true;
134 default:
135 return false;
136 }
137}
138
129static const struct regmap_config aic3x_regmap = { 139static const struct regmap_config aic3x_regmap = {
130 .reg_bits = 8, 140 .reg_bits = 8,
131 .val_bits = 8, 141 .val_bits = 8,
@@ -133,6 +143,9 @@ static const struct regmap_config aic3x_regmap = {
133 .max_register = DAC_ICC_ADJ, 143 .max_register = DAC_ICC_ADJ,
134 .reg_defaults = aic3x_reg, 144 .reg_defaults = aic3x_reg,
135 .num_reg_defaults = ARRAY_SIZE(aic3x_reg), 145 .num_reg_defaults = ARRAY_SIZE(aic3x_reg),
146
147 .volatile_reg = aic3x_volatile_reg,
148
136 .cache_type = REGCACHE_RBTREE, 149 .cache_type = REGCACHE_RBTREE,
137}; 150};
138 151
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 593b7d1aed46..d72ccef9e238 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1551,7 +1551,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
1551 const struct wmfw_region *region; 1551 const struct wmfw_region *region;
1552 const struct wm_adsp_region *mem; 1552 const struct wm_adsp_region *mem;
1553 const char *region_name; 1553 const char *region_name;
1554 char *file, *text; 1554 char *file, *text = NULL;
1555 struct wm_adsp_buf *buf; 1555 struct wm_adsp_buf *buf;
1556 unsigned int reg; 1556 unsigned int reg;
1557 int regions = 0; 1557 int regions = 0;
@@ -1700,10 +1700,21 @@ static int wm_adsp_load(struct wm_adsp *dsp)
1700 regions, le32_to_cpu(region->len), offset, 1700 regions, le32_to_cpu(region->len), offset,
1701 region_name); 1701 region_name);
1702 1702
1703 if ((pos + le32_to_cpu(region->len) + sizeof(*region)) >
1704 firmware->size) {
1705 adsp_err(dsp,
1706 "%s.%d: %s region len %d bytes exceeds file length %zu\n",
1707 file, regions, region_name,
1708 le32_to_cpu(region->len), firmware->size);
1709 ret = -EINVAL;
1710 goto out_fw;
1711 }
1712
1703 if (text) { 1713 if (text) {
1704 memcpy(text, region->data, le32_to_cpu(region->len)); 1714 memcpy(text, region->data, le32_to_cpu(region->len));
1705 adsp_info(dsp, "%s: %s\n", file, text); 1715 adsp_info(dsp, "%s: %s\n", file, text);
1706 kfree(text); 1716 kfree(text);
1717 text = NULL;
1707 } 1718 }
1708 1719
1709 if (reg) { 1720 if (reg) {
@@ -1748,6 +1759,7 @@ out_fw:
1748 regmap_async_complete(regmap); 1759 regmap_async_complete(regmap);
1749 wm_adsp_buf_free(&buf_list); 1760 wm_adsp_buf_free(&buf_list);
1750 release_firmware(firmware); 1761 release_firmware(firmware);
1762 kfree(text);
1751out: 1763out:
1752 kfree(file); 1764 kfree(file);
1753 1765
@@ -2233,6 +2245,17 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
2233 } 2245 }
2234 2246
2235 if (reg) { 2247 if (reg) {
2248 if ((pos + le32_to_cpu(blk->len) + sizeof(*blk)) >
2249 firmware->size) {
2250 adsp_err(dsp,
2251 "%s.%d: %s region len %d bytes exceeds file length %zu\n",
2252 file, blocks, region_name,
2253 le32_to_cpu(blk->len),
2254 firmware->size);
2255 ret = -EINVAL;
2256 goto out_fw;
2257 }
2258
2236 buf = wm_adsp_buf_alloc(blk->data, 2259 buf = wm_adsp_buf_alloc(blk->data,
2237 le32_to_cpu(blk->len), 2260 le32_to_cpu(blk->len),
2238 &buf_list); 2261 &buf_list);
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 2998954a1c74..bdf8398cbc81 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -681,22 +681,19 @@ static int dw_i2s_probe(struct platform_device *pdev)
681 } 681 }
682 682
683 if (!pdata) { 683 if (!pdata) {
684 ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); 684 if (irq >= 0) {
685 if (ret == -EPROBE_DEFER) {
686 dev_err(&pdev->dev,
687 "failed to register PCM, deferring probe\n");
688 return ret;
689 } else if (ret) {
690 dev_err(&pdev->dev,
691 "Could not register DMA PCM: %d\n"
692 "falling back to PIO mode\n", ret);
693 ret = dw_pcm_register(pdev); 685 ret = dw_pcm_register(pdev);
694 if (ret) { 686 dev->use_pio = true;
695 dev_err(&pdev->dev, 687 } else {
696 "Could not register PIO PCM: %d\n", 688 ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL,
689 0);
690 dev->use_pio = false;
691 }
692
693 if (ret) {
694 dev_err(&pdev->dev, "could not register pcm: %d\n",
697 ret); 695 ret);
698 goto err_clk_disable; 696 goto err_clk_disable;
699 }
700 } 697 }
701 } 698 }
702 699
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 50349437d961..fde08660b63b 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -224,6 +224,12 @@ struct fsl_ssi_soc_data {
224 * @dbg_stats: Debugging statistics 224 * @dbg_stats: Debugging statistics
225 * 225 *
226 * @soc: SoC specific data 226 * @soc: SoC specific data
227 *
228 * @fifo_watermark: the FIFO watermark setting. Notifies DMA when
229 * there are @fifo_watermark or fewer words in TX fifo or
230 * @fifo_watermark or more empty words in RX fifo.
231 * @dma_maxburst: max number of words to transfer in one go. So far,
232 * this is always the same as fifo_watermark.
227 */ 233 */
228struct fsl_ssi_private { 234struct fsl_ssi_private {
229 struct regmap *regs; 235 struct regmap *regs;
@@ -263,6 +269,9 @@ struct fsl_ssi_private {
263 269
264 const struct fsl_ssi_soc_data *soc; 270 const struct fsl_ssi_soc_data *soc;
265 struct device *dev; 271 struct device *dev;
272
273 u32 fifo_watermark;
274 u32 dma_maxburst;
266}; 275};
267 276
268/* 277/*
@@ -1051,21 +1060,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
1051 regmap_write(regs, CCSR_SSI_SRCR, srcr); 1060 regmap_write(regs, CCSR_SSI_SRCR, srcr);
1052 regmap_write(regs, CCSR_SSI_SCR, scr); 1061 regmap_write(regs, CCSR_SSI_SCR, scr);
1053 1062
1054 /* 1063 wm = ssi_private->fifo_watermark;
1055 * Set the watermark for transmit FIFI 0 and receive FIFO 0. We don't
1056 * use FIFO 1. We program the transmit water to signal a DMA transfer
1057 * if there are only two (or fewer) elements left in the FIFO. Two
1058 * elements equals one frame (left channel, right channel). This value,
1059 * however, depends on the depth of the transmit buffer.
1060 *
1061 * We set the watermark on the same level as the DMA burstsize. For
1062 * fiq it is probably better to use the biggest possible watermark
1063 * size.
1064 */
1065 if (ssi_private->use_dma)
1066 wm = ssi_private->fifo_depth - 2;
1067 else
1068 wm = ssi_private->fifo_depth;
1069 1064
1070 regmap_write(regs, CCSR_SSI_SFCSR, 1065 regmap_write(regs, CCSR_SSI_SFCSR,
1071 CCSR_SSI_SFCSR_TFWM0(wm) | CCSR_SSI_SFCSR_RFWM0(wm) | 1066 CCSR_SSI_SFCSR_TFWM0(wm) | CCSR_SSI_SFCSR_RFWM0(wm) |
@@ -1373,12 +1368,8 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
1373 dev_dbg(&pdev->dev, "could not get baud clock: %ld\n", 1368 dev_dbg(&pdev->dev, "could not get baud clock: %ld\n",
1374 PTR_ERR(ssi_private->baudclk)); 1369 PTR_ERR(ssi_private->baudclk));
1375 1370
1376 /* 1371 ssi_private->dma_params_tx.maxburst = ssi_private->dma_maxburst;
1377 * We have burstsize be "fifo_depth - 2" to match the SSI 1372 ssi_private->dma_params_rx.maxburst = ssi_private->dma_maxburst;
1378 * watermark setting in fsl_ssi_startup().
1379 */
1380 ssi_private->dma_params_tx.maxburst = ssi_private->fifo_depth - 2;
1381 ssi_private->dma_params_rx.maxburst = ssi_private->fifo_depth - 2;
1382 ssi_private->dma_params_tx.addr = ssi_private->ssi_phys + CCSR_SSI_STX0; 1373 ssi_private->dma_params_tx.addr = ssi_private->ssi_phys + CCSR_SSI_STX0;
1383 ssi_private->dma_params_rx.addr = ssi_private->ssi_phys + CCSR_SSI_SRX0; 1374 ssi_private->dma_params_rx.addr = ssi_private->ssi_phys + CCSR_SSI_SRX0;
1384 1375
@@ -1543,6 +1534,47 @@ static int fsl_ssi_probe(struct platform_device *pdev)
1543 /* Older 8610 DTs didn't have the fifo-depth property */ 1534 /* Older 8610 DTs didn't have the fifo-depth property */
1544 ssi_private->fifo_depth = 8; 1535 ssi_private->fifo_depth = 8;
1545 1536
1537 /*
1538 * Set the watermark for transmit FIFO 0 and receive FIFO 0. We don't
1539 * use FIFO 1 but set the watermark appropriately nontheless.
1540 * We program the transmit water to signal a DMA transfer
1541 * if there are N elements left in the FIFO. For chips with 15-deep
1542 * FIFOs, set watermark to 8. This allows the SSI to operate at a
1543 * high data rate without channel slipping. Behavior is unchanged
1544 * for the older chips with a fifo depth of only 8. A value of 4
1545 * might be appropriate for the older chips, but is left at
1546 * fifo_depth-2 until sombody has a chance to test.
1547 *
1548 * We set the watermark on the same level as the DMA burstsize. For
1549 * fiq it is probably better to use the biggest possible watermark
1550 * size.
1551 */
1552 switch (ssi_private->fifo_depth) {
1553 case 15:
1554 /*
1555 * 2 samples is not enough when running at high data
1556 * rates (like 48kHz @ 16 bits/channel, 16 channels)
1557 * 8 seems to split things evenly and leave enough time
1558 * for the DMA to fill the FIFO before it's over/under
1559 * run.
1560 */
1561 ssi_private->fifo_watermark = 8;
1562 ssi_private->dma_maxburst = 8;
1563 break;
1564 case 8:
1565 default:
1566 /*
1567 * maintain old behavior for older chips.
1568 * Keeping it the same because I don't have an older
1569 * board to test with.
1570 * I suspect this could be changed to be something to
1571 * leave some more space in the fifo.
1572 */
1573 ssi_private->fifo_watermark = ssi_private->fifo_depth - 2;
1574 ssi_private->dma_maxburst = ssi_private->fifo_depth - 2;
1575 break;
1576 }
1577
1546 dev_set_drvdata(&pdev->dev, ssi_private); 1578 dev_set_drvdata(&pdev->dev, ssi_private);
1547 1579
1548 if (ssi_private->soc->imx) { 1580 if (ssi_private->soc->imx) {
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
index 507a86a5eafe..8d2fb2d6f532 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -142,7 +142,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
142 * for Jack detection and button press 142 * for Jack detection and button press
143 */ 143 */
144 ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_RCCLK, 144 ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_RCCLK,
145 0, 145 48000 * 512,
146 SND_SOC_CLOCK_IN); 146 SND_SOC_CLOCK_IN);
147 if (!ret) { 147 if (!ret) {
148 if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) && priv->mclk) 148 if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) && priv->mclk)
@@ -825,10 +825,20 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
825 if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) && (is_valleyview())) { 825 if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) && (is_valleyview())) {
826 priv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3"); 826 priv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
827 if (IS_ERR(priv->mclk)) { 827 if (IS_ERR(priv->mclk)) {
828 ret_val = PTR_ERR(priv->mclk);
829
828 dev_err(&pdev->dev, 830 dev_err(&pdev->dev,
829 "Failed to get MCLK from pmc_plt_clk_3: %ld\n", 831 "Failed to get MCLK from pmc_plt_clk_3: %d\n",
830 PTR_ERR(priv->mclk)); 832 ret_val);
831 return PTR_ERR(priv->mclk); 833
834 /*
835 * Fall back to bit clock usage for -ENOENT (clock not
836 * available likely due to missing dependencies), bail
837 * for all other errors, including -EPROBE_DEFER
838 */
839 if (ret_val != -ENOENT)
840 return ret_val;
841 byt_rt5640_quirk &= ~BYT_RT5640_MCLK_EN;
832 } 842 }
833 } 843 }
834 844
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 84b5101e6ca6..6c6b63a6b338 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -180,6 +180,9 @@ static int skl_pcm_open(struct snd_pcm_substream *substream,
180 snd_pcm_set_sync(substream); 180 snd_pcm_set_sync(substream);
181 181
182 mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); 182 mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream);
183 if (!mconfig)
184 return -EINVAL;
185
183 skl_tplg_d0i3_get(skl, mconfig->d0i3_caps); 186 skl_tplg_d0i3_get(skl, mconfig->d0i3_caps);
184 187
185 return 0; 188 return 0;
diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
index 8fc3178bc79c..b30bd384c8d3 100644
--- a/sound/soc/intel/skylake/skl-sst.c
+++ b/sound/soc/intel/skylake/skl-sst.c
@@ -515,6 +515,9 @@ EXPORT_SYMBOL_GPL(skl_sst_init_fw);
515 515
516void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx) 516void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx)
517{ 517{
518
519 if (ctx->dsp->fw)
520 release_firmware(ctx->dsp->fw);
518 skl_clear_module_table(ctx->dsp); 521 skl_clear_module_table(ctx->dsp);
519 skl_freeup_uuid_list(ctx); 522 skl_freeup_uuid_list(ctx);
520 skl_ipc_free(&ctx->ipc); 523 skl_ipc_free(&ctx->ipc);
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 4bd68de76130..99b5b0835c1e 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1030,10 +1030,8 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
1030 return -ENOMEM; 1030 return -ENOMEM;
1031 1031
1032 ret = snd_ctl_add(card, kctrl); 1032 ret = snd_ctl_add(card, kctrl);
1033 if (ret < 0) { 1033 if (ret < 0)
1034 snd_ctl_free_one(kctrl);
1035 return ret; 1034 return ret;
1036 }
1037 1035
1038 cfg->update = update; 1036 cfg->update = update;
1039 cfg->card = card; 1037 cfg->card = card;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f1901bb1466e..baa1afa41e3d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1748,6 +1748,7 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num)
1748 1748
1749 component->init = aux_dev->init; 1749 component->init = aux_dev->init;
1750 component->auxiliary = 1; 1750 component->auxiliary = 1;
1751 list_add(&component->card_aux_list, &card->aux_comp_list);
1751 1752
1752 return 0; 1753 return 0;
1753 1754
@@ -1758,16 +1759,14 @@ err_defer:
1758 1759
1759static int soc_probe_aux_devices(struct snd_soc_card *card) 1760static int soc_probe_aux_devices(struct snd_soc_card *card)
1760{ 1761{
1761 struct snd_soc_component *comp; 1762 struct snd_soc_component *comp, *tmp;
1762 int order; 1763 int order;
1763 int ret; 1764 int ret;
1764 1765
1765 for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST; 1766 for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
1766 order++) { 1767 order++) {
1767 list_for_each_entry(comp, &card->component_dev_list, card_list) { 1768 list_for_each_entry_safe(comp, tmp, &card->aux_comp_list,
1768 if (!comp->auxiliary) 1769 card_aux_list) {
1769 continue;
1770
1771 if (comp->driver->probe_order == order) { 1770 if (comp->driver->probe_order == order) {
1772 ret = soc_probe_component(card, comp); 1771 ret = soc_probe_component(card, comp);
1773 if (ret < 0) { 1772 if (ret < 0) {
@@ -1776,6 +1775,7 @@ static int soc_probe_aux_devices(struct snd_soc_card *card)
1776 comp->name, ret); 1775 comp->name, ret);
1777 return ret; 1776 return ret;
1778 } 1777 }
1778 list_del(&comp->card_aux_list);
1779 } 1779 }
1780 } 1780 }
1781 } 1781 }
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index e7a1eaa2772f..6aba14009c92 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2184,9 +2184,11 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
2184 break; 2184 break;
2185 case SNDRV_PCM_TRIGGER_STOP: 2185 case SNDRV_PCM_TRIGGER_STOP:
2186 case SNDRV_PCM_TRIGGER_SUSPEND: 2186 case SNDRV_PCM_TRIGGER_SUSPEND:
2187 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
2188 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; 2187 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP;
2189 break; 2188 break;
2189 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
2190 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED;
2191 break;
2190 } 2192 }
2191 2193
2192out: 2194out:
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 65670b2b408c..fbfb1fab88d5 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -514,13 +514,12 @@ static void remove_widget(struct snd_soc_component *comp,
514 == SND_SOC_TPLG_TYPE_MIXER) 514 == SND_SOC_TPLG_TYPE_MIXER)
515 kfree(kcontrol->tlv.p); 515 kfree(kcontrol->tlv.p);
516 516
517 snd_ctl_remove(card, kcontrol);
518
519 /* Private value is used as struct soc_mixer_control 517 /* Private value is used as struct soc_mixer_control
520 * for volume mixers or soc_bytes_ext for bytes 518 * for volume mixers or soc_bytes_ext for bytes
521 * controls. 519 * controls.
522 */ 520 */
523 kfree((void *)kcontrol->private_value); 521 kfree((void *)kcontrol->private_value);
522 snd_ctl_remove(card, kcontrol);
524 } 523 }
525 kfree(w->kcontrol_news); 524 kfree(w->kcontrol_news);
526 } 525 }
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index b3fd2382fdd9..eb4b9f7a571e 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1135,6 +1135,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
1135 case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ 1135 case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */
1136 case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ 1136 case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */
1137 case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ 1137 case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */
1138 case USB_ID(0x047F, 0x02F7): /* Plantronics BT-600 */
1138 case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */ 1139 case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */
1139 case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ 1140 case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */
1140 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ 1141 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */