diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-27 01:53:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-27 01:53:21 -0400 |
commit | 03cef71062cf185e95d588d90406f27bad740b3c (patch) | |
tree | a117af89e98e8c16a96b4a3212f74b8829bfd79a | |
parent | 28687b935e93a9041a485b9ecdcab0e335f8eda5 (diff) | |
parent | a820cd3d25c2891028b5f296a8a871ce6dd92c0d (diff) |
Merge tag 'sound-4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here are a bunch of fixes as you can see in diffstat.
One core change in ASoC is about the unexpected unbinding error, and
another about debugfs cleanup.
The rest are wide-spread driver-specific fixes: a series of LINE6 USB
fixes, a HD-audio quirk, and various ASoC fixes including OMAP boot
fixes and Intel SKL fixes"
* tag 'sound-4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (22 commits)
ALSA: hda/realtek - fix headset mic detection for MSI MS-B120
ASoC: omap-mcpdm: Fix irq resource handling
ASoC: max98371: Add terminate entry for i2c_device_id tables
ALSA: line6: Fix POD sysfs attributes segfault
ALSA: line6: Give up on the lock while URBs are released.
ALSA: line6: Remove double line6_pcm_release() after failed acquire.
ASoC: omap-abe-twl6040: Correct dmic-codec device registration
ASoC: core: Clean up DAPM before the card debugfs
ASoC: omap-mcpdm: Drop pdmclk clock handling
ASoC: atmel_ssc_dai: Don't unconditionally reset SSC on stream startup
ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
ASoC: Intel: Skylake: Fix error return code in skl_probe()
ASoC: wm2000: Fix return of uninitialised varible
ASoC: Fix leak of rtd in soc_bind_dai_link
ASoC: da7213: Default to 64 BCLKs per WCLK to support all formats
ASoC: nau8825: fix static check error about semaphone control
ASoC: nau8825: fix bug in playback when suspend
ASoC: samsung: Fix clock handling in S3C24XX_UDA134X card
ASoC: simple-card-utils: add missing MODULE_xxx()
ASoC: Intel: Skylake: Check list empty while getting module info
...
-rw-r--r-- | Documentation/devicetree/bindings/sound/omap-mcpdm.txt | 10 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 7 | ||||
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 5 | ||||
-rw-r--r-- | sound/soc/codecs/da7213.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/max98371.c | 1 | ||||
-rw-r--r-- | sound/soc/codecs/nau8825.c | 78 | ||||
-rw-r--r-- | sound/soc/codecs/wm2000.c | 2 | ||||
-rw-r--r-- | sound/soc/generic/Makefile | 6 | ||||
-rw-r--r-- | sound/soc/generic/simple-card-utils.c | 6 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-sst-utils.c | 5 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 4 | ||||
-rw-r--r-- | sound/soc/omap/omap-abe-twl6040.c | 61 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcpdm.c | 22 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx_uda134x.c | 7 | ||||
-rw-r--r-- | sound/soc/sh/rcar/src.c | 6 | ||||
-rw-r--r-- | sound/soc/soc-compress.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 5 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 10 | ||||
-rw-r--r-- | sound/usb/line6/pcm.c | 3 | ||||
-rw-r--r-- | sound/usb/line6/pod.c | 12 |
20 files changed, 127 insertions, 131 deletions
diff --git a/Documentation/devicetree/bindings/sound/omap-mcpdm.txt b/Documentation/devicetree/bindings/sound/omap-mcpdm.txt index 6f6c2f8e908d..0741dff048dd 100644 --- a/Documentation/devicetree/bindings/sound/omap-mcpdm.txt +++ b/Documentation/devicetree/bindings/sound/omap-mcpdm.txt | |||
@@ -8,8 +8,6 @@ Required properties: | |||
8 | - interrupts: Interrupt number for McPDM | 8 | - interrupts: Interrupt number for McPDM |
9 | - interrupt-parent: The parent interrupt controller | 9 | - interrupt-parent: The parent interrupt controller |
10 | - ti,hwmods: Name of the hwmod associated to the McPDM | 10 | - ti,hwmods: Name of the hwmod associated to the McPDM |
11 | - clocks: phandle for the pdmclk provider, likely <&twl6040> | ||
12 | - clock-names: Must be "pdmclk" | ||
13 | 11 | ||
14 | Example: | 12 | Example: |
15 | 13 | ||
@@ -21,11 +19,3 @@ mcpdm: mcpdm@40132000 { | |||
21 | interrupt-parent = <&gic>; | 19 | interrupt-parent = <&gic>; |
22 | ti,hwmods = "mcpdm"; | 20 | ti,hwmods = "mcpdm"; |
23 | }; | 21 | }; |
24 | |||
25 | In board DTS file the pdmclk needs to be added: | ||
26 | |||
27 | &mcpdm { | ||
28 | clocks = <&twl6040>; | ||
29 | clock-names = "pdmclk"; | ||
30 | status = "okay"; | ||
31 | }; | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 574b1b48996f..7100f05e651a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4828,7 +4828,7 @@ enum { | |||
4828 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, | 4828 | ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, |
4829 | ALC292_FIXUP_TPT440_DOCK, | 4829 | ALC292_FIXUP_TPT440_DOCK, |
4830 | ALC292_FIXUP_TPT440, | 4830 | ALC292_FIXUP_TPT440, |
4831 | ALC283_FIXUP_BXBT2807_MIC, | 4831 | ALC283_FIXUP_HEADSET_MIC, |
4832 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, | 4832 | ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, |
4833 | ALC282_FIXUP_ASPIRE_V5_PINS, | 4833 | ALC282_FIXUP_ASPIRE_V5_PINS, |
4834 | ALC280_FIXUP_HP_GPIO4, | 4834 | ALC280_FIXUP_HP_GPIO4, |
@@ -5321,7 +5321,7 @@ static const struct hda_fixup alc269_fixups[] = { | |||
5321 | .chained = true, | 5321 | .chained = true, |
5322 | .chain_id = ALC292_FIXUP_TPT440_DOCK, | 5322 | .chain_id = ALC292_FIXUP_TPT440_DOCK, |
5323 | }, | 5323 | }, |
5324 | [ALC283_FIXUP_BXBT2807_MIC] = { | 5324 | [ALC283_FIXUP_HEADSET_MIC] = { |
5325 | .type = HDA_FIXUP_PINS, | 5325 | .type = HDA_FIXUP_PINS, |
5326 | .v.pins = (const struct hda_pintbl[]) { | 5326 | .v.pins = (const struct hda_pintbl[]) { |
5327 | { 0x19, 0x04a110f0 }, | 5327 | { 0x19, 0x04a110f0 }, |
@@ -5651,7 +5651,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
5651 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), | 5651 | SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), |
5652 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), | 5652 | SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
5653 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), | 5653 | SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
5654 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_BXBT2807_MIC), | 5654 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
5655 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | ||
5655 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), | 5656 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
5656 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | 5657 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
5657 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | 5658 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 54c09acd3fed..16e459aedffe 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c | |||
@@ -299,8 +299,9 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, | |||
299 | clk_enable(ssc_p->ssc->clk); | 299 | clk_enable(ssc_p->ssc->clk); |
300 | ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk); | 300 | ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk); |
301 | 301 | ||
302 | /* Reset the SSC to keep it at a clean status */ | 302 | /* Reset the SSC unless initialized to keep it in a clean state */ |
303 | ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST)); | 303 | if (!ssc_p->initialized) |
304 | ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST)); | ||
304 | 305 | ||
305 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 306 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
306 | dir = 0; | 307 | dir = 0; |
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index e5527bc570ae..bcf1834c5648 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c | |||
@@ -1247,8 +1247,8 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
1247 | return -EINVAL; | 1247 | return -EINVAL; |
1248 | } | 1248 | } |
1249 | 1249 | ||
1250 | /* By default only 32 BCLK per WCLK is supported */ | 1250 | /* By default only 64 BCLK per WCLK is supported */ |
1251 | dai_clk_mode |= DA7213_DAI_BCLKS_PER_WCLK_32; | 1251 | dai_clk_mode |= DA7213_DAI_BCLKS_PER_WCLK_64; |
1252 | 1252 | ||
1253 | snd_soc_write(codec, DA7213_DAI_CLK_MODE, dai_clk_mode); | 1253 | snd_soc_write(codec, DA7213_DAI_CLK_MODE, dai_clk_mode); |
1254 | snd_soc_update_bits(codec, DA7213_DAI_CTRL, DA7213_DAI_FORMAT_MASK, | 1254 | snd_soc_update_bits(codec, DA7213_DAI_CTRL, DA7213_DAI_FORMAT_MASK, |
diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c index cf0a39bb631a..02352ed8961c 100644 --- a/sound/soc/codecs/max98371.c +++ b/sound/soc/codecs/max98371.c | |||
@@ -412,6 +412,7 @@ static int max98371_i2c_remove(struct i2c_client *client) | |||
412 | 412 | ||
413 | static const struct i2c_device_id max98371_i2c_id[] = { | 413 | static const struct i2c_device_id max98371_i2c_id[] = { |
414 | { "max98371", 0 }, | 414 | { "max98371", 0 }, |
415 | { } | ||
415 | }; | 416 | }; |
416 | 417 | ||
417 | MODULE_DEVICE_TABLE(i2c, max98371_i2c_id); | 418 | MODULE_DEVICE_TABLE(i2c, max98371_i2c_id); |
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index 5c9707ac4bbf..2e59a85e360b 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c | |||
@@ -212,31 +212,6 @@ static const unsigned short logtable[256] = { | |||
212 | 0xfa2f, 0xfaea, 0xfba5, 0xfc60, 0xfd1a, 0xfdd4, 0xfe8e, 0xff47 | 212 | 0xfa2f, 0xfaea, 0xfba5, 0xfc60, 0xfd1a, 0xfdd4, 0xfe8e, 0xff47 |
213 | }; | 213 | }; |
214 | 214 | ||
215 | static struct snd_soc_dai *nau8825_get_codec_dai(struct nau8825 *nau8825) | ||
216 | { | ||
217 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(nau8825->dapm); | ||
218 | struct snd_soc_component *component = &codec->component; | ||
219 | struct snd_soc_dai *codec_dai, *_dai; | ||
220 | |||
221 | list_for_each_entry_safe(codec_dai, _dai, &component->dai_list, list) { | ||
222 | if (!strncmp(codec_dai->name, NUVOTON_CODEC_DAI, | ||
223 | strlen(NUVOTON_CODEC_DAI))) | ||
224 | return codec_dai; | ||
225 | } | ||
226 | return NULL; | ||
227 | } | ||
228 | |||
229 | static bool nau8825_dai_is_active(struct nau8825 *nau8825) | ||
230 | { | ||
231 | struct snd_soc_dai *codec_dai = nau8825_get_codec_dai(nau8825); | ||
232 | |||
233 | if (codec_dai) { | ||
234 | if (codec_dai->playback_active || codec_dai->capture_active) | ||
235 | return true; | ||
236 | } | ||
237 | return false; | ||
238 | } | ||
239 | |||
240 | /** | 215 | /** |
241 | * nau8825_sema_acquire - acquire the semaphore of nau88l25 | 216 | * nau8825_sema_acquire - acquire the semaphore of nau88l25 |
242 | * @nau8825: component to register the codec private data with | 217 | * @nau8825: component to register the codec private data with |
@@ -250,19 +225,26 @@ static bool nau8825_dai_is_active(struct nau8825 *nau8825) | |||
250 | * Acquires the semaphore without jiffies. If no more tasks are allowed | 225 | * Acquires the semaphore without jiffies. If no more tasks are allowed |
251 | * to acquire the semaphore, calling this function will put the task to | 226 | * to acquire the semaphore, calling this function will put the task to |
252 | * sleep until the semaphore is released. | 227 | * sleep until the semaphore is released. |
253 | * It returns if the semaphore was acquired. | 228 | * If the semaphore is not released within the specified number of jiffies, |
229 | * this function returns -ETIME. | ||
230 | * If the sleep is interrupted by a signal, this function will return -EINTR. | ||
231 | * It returns 0 if the semaphore was acquired successfully. | ||
254 | */ | 232 | */ |
255 | static void nau8825_sema_acquire(struct nau8825 *nau8825, long timeout) | 233 | static int nau8825_sema_acquire(struct nau8825 *nau8825, long timeout) |
256 | { | 234 | { |
257 | int ret; | 235 | int ret; |
258 | 236 | ||
259 | if (timeout) | 237 | if (timeout) { |
260 | ret = down_timeout(&nau8825->xtalk_sem, timeout); | 238 | ret = down_timeout(&nau8825->xtalk_sem, timeout); |
261 | else | 239 | if (ret < 0) |
240 | dev_warn(nau8825->dev, "Acquire semaphone timeout\n"); | ||
241 | } else { | ||
262 | ret = down_interruptible(&nau8825->xtalk_sem); | 242 | ret = down_interruptible(&nau8825->xtalk_sem); |
243 | if (ret < 0) | ||
244 | dev_warn(nau8825->dev, "Acquire semaphone fail\n"); | ||
245 | } | ||
263 | 246 | ||
264 | if (ret < 0) | 247 | return ret; |
265 | dev_warn(nau8825->dev, "Acquire semaphone fail\n"); | ||
266 | } | 248 | } |
267 | 249 | ||
268 | /** | 250 | /** |
@@ -1205,6 +1187,8 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, | |||
1205 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); | 1187 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); |
1206 | unsigned int val_len = 0; | 1188 | unsigned int val_len = 0; |
1207 | 1189 | ||
1190 | nau8825_sema_acquire(nau8825, 2 * HZ); | ||
1191 | |||
1208 | switch (params_width(params)) { | 1192 | switch (params_width(params)) { |
1209 | case 16: | 1193 | case 16: |
1210 | val_len |= NAU8825_I2S_DL_16; | 1194 | val_len |= NAU8825_I2S_DL_16; |
@@ -1225,6 +1209,9 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, | |||
1225 | regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1, | 1209 | regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL1, |
1226 | NAU8825_I2S_DL_MASK, val_len); | 1210 | NAU8825_I2S_DL_MASK, val_len); |
1227 | 1211 | ||
1212 | /* Release the semaphone. */ | ||
1213 | nau8825_sema_release(nau8825); | ||
1214 | |||
1228 | return 0; | 1215 | return 0; |
1229 | } | 1216 | } |
1230 | 1217 | ||
@@ -1234,6 +1221,8 @@ static int nau8825_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
1234 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); | 1221 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); |
1235 | unsigned int ctrl1_val = 0, ctrl2_val = 0; | 1222 | unsigned int ctrl1_val = 0, ctrl2_val = 0; |
1236 | 1223 | ||
1224 | nau8825_sema_acquire(nau8825, 2 * HZ); | ||
1225 | |||
1237 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 1226 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
1238 | case SND_SOC_DAIFMT_CBM_CFM: | 1227 | case SND_SOC_DAIFMT_CBM_CFM: |
1239 | ctrl2_val |= NAU8825_I2S_MS_MASTER; | 1228 | ctrl2_val |= NAU8825_I2S_MS_MASTER; |
@@ -1282,6 +1271,9 @@ static int nau8825_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
1282 | regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, | 1271 | regmap_update_bits(nau8825->regmap, NAU8825_REG_I2S_PCM_CTRL2, |
1283 | NAU8825_I2S_MS_MASK, ctrl2_val); | 1272 | NAU8825_I2S_MS_MASK, ctrl2_val); |
1284 | 1273 | ||
1274 | /* Release the semaphone. */ | ||
1275 | nau8825_sema_release(nau8825); | ||
1276 | |||
1285 | return 0; | 1277 | return 0; |
1286 | } | 1278 | } |
1287 | 1279 | ||
@@ -1611,8 +1603,11 @@ static irqreturn_t nau8825_interrupt(int irq, void *data) | |||
1611 | * cess and restore changes if process | 1603 | * cess and restore changes if process |
1612 | * is ongoing when ejection. | 1604 | * is ongoing when ejection. |
1613 | */ | 1605 | */ |
1606 | int ret; | ||
1614 | nau8825->xtalk_protect = true; | 1607 | nau8825->xtalk_protect = true; |
1615 | nau8825_sema_acquire(nau8825, 0); | 1608 | ret = nau8825_sema_acquire(nau8825, 0); |
1609 | if (ret < 0) | ||
1610 | nau8825->xtalk_protect = false; | ||
1616 | } | 1611 | } |
1617 | /* Startup cross talk detection process */ | 1612 | /* Startup cross talk detection process */ |
1618 | nau8825->xtalk_state = NAU8825_XTALK_PREPARE; | 1613 | nau8825->xtalk_state = NAU8825_XTALK_PREPARE; |
@@ -2238,23 +2233,14 @@ static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec) | |||
2238 | static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec) | 2233 | static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec) |
2239 | { | 2234 | { |
2240 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); | 2235 | struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec); |
2236 | int ret; | ||
2241 | 2237 | ||
2242 | regcache_cache_only(nau8825->regmap, false); | 2238 | regcache_cache_only(nau8825->regmap, false); |
2243 | regcache_sync(nau8825->regmap); | 2239 | regcache_sync(nau8825->regmap); |
2244 | if (nau8825_is_jack_inserted(nau8825->regmap)) { | 2240 | nau8825->xtalk_protect = true; |
2245 | /* If the jack is inserted, we need to check whether the play- | 2241 | ret = nau8825_sema_acquire(nau8825, 0); |
2246 | * back is active before suspend. If active, the driver has to | 2242 | if (ret < 0) |
2247 | * raise the protection for cross talk function to avoid the | 2243 | nau8825->xtalk_protect = false; |
2248 | * playback recovers before cross talk process finish. Other- | ||
2249 | * wise, the playback will be interfered by cross talk func- | ||
2250 | * tion. It is better to apply hardware related parameters | ||
2251 | * before starting playback or record. | ||
2252 | */ | ||
2253 | if (nau8825_dai_is_active(nau8825)) { | ||
2254 | nau8825->xtalk_protect = true; | ||
2255 | nau8825_sema_acquire(nau8825, 0); | ||
2256 | } | ||
2257 | } | ||
2258 | enable_irq(nau8825->irq); | 2244 | enable_irq(nau8825->irq); |
2259 | 2245 | ||
2260 | return 0; | 2246 | return 0; |
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index a67ea10f41a1..f2664396be6f 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -581,7 +581,7 @@ static int wm2000_anc_transition(struct wm2000_priv *wm2000, | |||
581 | if (anc_transitions[i].dest == ANC_OFF) | 581 | if (anc_transitions[i].dest == ANC_OFF) |
582 | clk_disable_unprepare(wm2000->mclk); | 582 | clk_disable_unprepare(wm2000->mclk); |
583 | 583 | ||
584 | return ret; | 584 | return 0; |
585 | } | 585 | } |
586 | 586 | ||
587 | static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) | 587 | static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) |
diff --git a/sound/soc/generic/Makefile b/sound/soc/generic/Makefile index 45602ca8536e..2d53c8d70705 100644 --- a/sound/soc/generic/Makefile +++ b/sound/soc/generic/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) := simple-card-utils.o | 1 | snd-soc-simple-card-utils-objs := simple-card-utils.o |
2 | |||
3 | snd-soc-simple-card-objs := simple-card.o | 2 | snd-soc-simple-card-objs := simple-card.o |
4 | 3 | ||
5 | obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o | 4 | obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) += snd-soc-simple-card-utils.o |
5 | obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o | ||
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index d89a9a1b2471..9599de69a880 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/module.h> | ||
10 | #include <linux/of.h> | 11 | #include <linux/of.h> |
11 | #include <sound/simple_card_utils.h> | 12 | #include <sound/simple_card_utils.h> |
12 | 13 | ||
@@ -95,3 +96,8 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, | |||
95 | return 0; | 96 | return 0; |
96 | } | 97 | } |
97 | EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); | 98 | EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); |
99 | |||
100 | /* Module information */ | ||
101 | MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"); | ||
102 | MODULE_DESCRIPTION("ALSA SoC Simple Card Utils"); | ||
103 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/sound/soc/intel/skylake/skl-sst-utils.c b/sound/soc/intel/skylake/skl-sst-utils.c index 25fcb796bd86..ddcb52a51854 100644 --- a/sound/soc/intel/skylake/skl-sst-utils.c +++ b/sound/soc/intel/skylake/skl-sst-utils.c | |||
@@ -123,6 +123,11 @@ int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid, | |||
123 | 123 | ||
124 | uuid_mod = (uuid_le *)uuid; | 124 | uuid_mod = (uuid_le *)uuid; |
125 | 125 | ||
126 | if (list_empty(&ctx->uuid_list)) { | ||
127 | dev_err(ctx->dev, "Module list is empty\n"); | ||
128 | return -EINVAL; | ||
129 | } | ||
130 | |||
126 | list_for_each_entry(module, &ctx->uuid_list, list) { | 131 | list_for_each_entry(module, &ctx->uuid_list, list) { |
127 | if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) { | 132 | if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) { |
128 | dfw_config->module_id = module->id; | 133 | dfw_config->module_id = module->id; |
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index cd59536a761d..e3e764167765 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -672,8 +672,10 @@ static int skl_probe(struct pci_dev *pci, | |||
672 | 672 | ||
673 | skl->nhlt = skl_nhlt_init(bus->dev); | 673 | skl->nhlt = skl_nhlt_init(bus->dev); |
674 | 674 | ||
675 | if (skl->nhlt == NULL) | 675 | if (skl->nhlt == NULL) { |
676 | err = -ENODEV; | ||
676 | goto out_free; | 677 | goto out_free; |
678 | } | ||
677 | 679 | ||
678 | skl_nhlt_update_topology_bin(skl); | 680 | skl_nhlt_update_topology_bin(skl); |
679 | 681 | ||
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 0843a68f277c..f61b3b58083b 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c | |||
@@ -38,10 +38,10 @@ | |||
38 | struct abe_twl6040 { | 38 | struct abe_twl6040 { |
39 | int jack_detection; /* board can detect jack events */ | 39 | int jack_detection; /* board can detect jack events */ |
40 | int mclk_freq; /* MCLK frequency speed for twl6040 */ | 40 | int mclk_freq; /* MCLK frequency speed for twl6040 */ |
41 | |||
42 | struct platform_device *dmic_codec_dev; | ||
43 | }; | 41 | }; |
44 | 42 | ||
43 | struct platform_device *dmic_codec_dev; | ||
44 | |||
45 | static int omap_abe_hw_params(struct snd_pcm_substream *substream, | 45 | static int omap_abe_hw_params(struct snd_pcm_substream *substream, |
46 | struct snd_pcm_hw_params *params) | 46 | struct snd_pcm_hw_params *params) |
47 | { | 47 | { |
@@ -258,8 +258,6 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
258 | if (priv == NULL) | 258 | if (priv == NULL) |
259 | return -ENOMEM; | 259 | return -ENOMEM; |
260 | 260 | ||
261 | priv->dmic_codec_dev = ERR_PTR(-EINVAL); | ||
262 | |||
263 | if (snd_soc_of_parse_card_name(card, "ti,model")) { | 261 | if (snd_soc_of_parse_card_name(card, "ti,model")) { |
264 | dev_err(&pdev->dev, "Card name is not provided\n"); | 262 | dev_err(&pdev->dev, "Card name is not provided\n"); |
265 | return -ENODEV; | 263 | return -ENODEV; |
@@ -284,13 +282,6 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
284 | num_links = 2; | 282 | num_links = 2; |
285 | abe_twl6040_dai_links[1].cpu_of_node = dai_node; | 283 | abe_twl6040_dai_links[1].cpu_of_node = dai_node; |
286 | abe_twl6040_dai_links[1].platform_of_node = dai_node; | 284 | abe_twl6040_dai_links[1].platform_of_node = dai_node; |
287 | |||
288 | priv->dmic_codec_dev = platform_device_register_simple( | ||
289 | "dmic-codec", -1, NULL, 0); | ||
290 | if (IS_ERR(priv->dmic_codec_dev)) { | ||
291 | dev_err(&pdev->dev, "Can't instantiate dmic-codec\n"); | ||
292 | return PTR_ERR(priv->dmic_codec_dev); | ||
293 | } | ||
294 | } else { | 285 | } else { |
295 | num_links = 1; | 286 | num_links = 1; |
296 | } | 287 | } |
@@ -299,16 +290,14 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
299 | of_property_read_u32(node, "ti,mclk-freq", &priv->mclk_freq); | 290 | of_property_read_u32(node, "ti,mclk-freq", &priv->mclk_freq); |
300 | if (!priv->mclk_freq) { | 291 | if (!priv->mclk_freq) { |
301 | dev_err(&pdev->dev, "MCLK frequency not provided\n"); | 292 | dev_err(&pdev->dev, "MCLK frequency not provided\n"); |
302 | ret = -EINVAL; | 293 | return -EINVAL; |
303 | goto err_unregister; | ||
304 | } | 294 | } |
305 | 295 | ||
306 | card->fully_routed = 1; | 296 | card->fully_routed = 1; |
307 | 297 | ||
308 | if (!priv->mclk_freq) { | 298 | if (!priv->mclk_freq) { |
309 | dev_err(&pdev->dev, "MCLK frequency missing\n"); | 299 | dev_err(&pdev->dev, "MCLK frequency missing\n"); |
310 | ret = -ENODEV; | 300 | return -ENODEV; |
311 | goto err_unregister; | ||
312 | } | 301 | } |
313 | 302 | ||
314 | card->dai_link = abe_twl6040_dai_links; | 303 | card->dai_link = abe_twl6040_dai_links; |
@@ -317,17 +306,9 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
317 | snd_soc_card_set_drvdata(card, priv); | 306 | snd_soc_card_set_drvdata(card, priv); |
318 | 307 | ||
319 | ret = snd_soc_register_card(card); | 308 | ret = snd_soc_register_card(card); |
320 | if (ret) { | 309 | if (ret) |
321 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", | 310 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
322 | ret); | 311 | ret); |
323 | goto err_unregister; | ||
324 | } | ||
325 | |||
326 | return 0; | ||
327 | |||
328 | err_unregister: | ||
329 | if (!IS_ERR(priv->dmic_codec_dev)) | ||
330 | platform_device_unregister(priv->dmic_codec_dev); | ||
331 | 312 | ||
332 | return ret; | 313 | return ret; |
333 | } | 314 | } |
@@ -335,13 +316,9 @@ err_unregister: | |||
335 | static int omap_abe_remove(struct platform_device *pdev) | 316 | static int omap_abe_remove(struct platform_device *pdev) |
336 | { | 317 | { |
337 | struct snd_soc_card *card = platform_get_drvdata(pdev); | 318 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
338 | struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card); | ||
339 | 319 | ||
340 | snd_soc_unregister_card(card); | 320 | snd_soc_unregister_card(card); |
341 | 321 | ||
342 | if (!IS_ERR(priv->dmic_codec_dev)) | ||
343 | platform_device_unregister(priv->dmic_codec_dev); | ||
344 | |||
345 | return 0; | 322 | return 0; |
346 | } | 323 | } |
347 | 324 | ||
@@ -361,7 +338,33 @@ static struct platform_driver omap_abe_driver = { | |||
361 | .remove = omap_abe_remove, | 338 | .remove = omap_abe_remove, |
362 | }; | 339 | }; |
363 | 340 | ||
364 | module_platform_driver(omap_abe_driver); | 341 | static int __init omap_abe_init(void) |
342 | { | ||
343 | int ret; | ||
344 | |||
345 | dmic_codec_dev = platform_device_register_simple("dmic-codec", -1, NULL, | ||
346 | 0); | ||
347 | if (IS_ERR(dmic_codec_dev)) { | ||
348 | pr_err("%s: dmic-codec device registration failed\n", __func__); | ||
349 | return PTR_ERR(dmic_codec_dev); | ||
350 | } | ||
351 | |||
352 | ret = platform_driver_register(&omap_abe_driver); | ||
353 | if (ret) { | ||
354 | pr_err("%s: platform driver registration failed\n", __func__); | ||
355 | platform_device_unregister(dmic_codec_dev); | ||
356 | } | ||
357 | |||
358 | return ret; | ||
359 | } | ||
360 | module_init(omap_abe_init); | ||
361 | |||
362 | static void __exit omap_abe_exit(void) | ||
363 | { | ||
364 | platform_driver_unregister(&omap_abe_driver); | ||
365 | platform_device_unregister(dmic_codec_dev); | ||
366 | } | ||
367 | module_exit(omap_abe_exit); | ||
365 | 368 | ||
366 | MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>"); | 369 | MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>"); |
367 | MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec"); | 370 | MODULE_DESCRIPTION("ALSA SoC for OMAP boards with ABE and twl6040 codec"); |
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index e7cdc51fd806..64609c77a79d 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/clk.h> | ||
35 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
36 | #include <linux/pm_runtime.h> | 35 | #include <linux/pm_runtime.h> |
37 | #include <linux/of_device.h> | 36 | #include <linux/of_device.h> |
@@ -55,7 +54,6 @@ struct omap_mcpdm { | |||
55 | unsigned long phys_base; | 54 | unsigned long phys_base; |
56 | void __iomem *io_base; | 55 | void __iomem *io_base; |
57 | int irq; | 56 | int irq; |
58 | struct clk *pdmclk; | ||
59 | 57 | ||
60 | struct mutex mutex; | 58 | struct mutex mutex; |
61 | 59 | ||
@@ -390,15 +388,14 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) | |||
390 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 388 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
391 | int ret; | 389 | int ret; |
392 | 390 | ||
393 | clk_prepare_enable(mcpdm->pdmclk); | ||
394 | pm_runtime_enable(mcpdm->dev); | 391 | pm_runtime_enable(mcpdm->dev); |
395 | 392 | ||
396 | /* Disable lines while request is ongoing */ | 393 | /* Disable lines while request is ongoing */ |
397 | pm_runtime_get_sync(mcpdm->dev); | 394 | pm_runtime_get_sync(mcpdm->dev); |
398 | omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00); | 395 | omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00); |
399 | 396 | ||
400 | ret = devm_request_irq(mcpdm->dev, mcpdm->irq, omap_mcpdm_irq_handler, | 397 | ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler, 0, "McPDM", |
401 | 0, "McPDM", (void *)mcpdm); | 398 | (void *)mcpdm); |
402 | 399 | ||
403 | pm_runtime_put_sync(mcpdm->dev); | 400 | pm_runtime_put_sync(mcpdm->dev); |
404 | 401 | ||
@@ -423,9 +420,9 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai) | |||
423 | { | 420 | { |
424 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 421 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
425 | 422 | ||
423 | free_irq(mcpdm->irq, (void *)mcpdm); | ||
426 | pm_runtime_disable(mcpdm->dev); | 424 | pm_runtime_disable(mcpdm->dev); |
427 | 425 | ||
428 | clk_disable_unprepare(mcpdm->pdmclk); | ||
429 | return 0; | 426 | return 0; |
430 | } | 427 | } |
431 | 428 | ||
@@ -445,8 +442,6 @@ static int omap_mcpdm_suspend(struct snd_soc_dai *dai) | |||
445 | mcpdm->pm_active_count++; | 442 | mcpdm->pm_active_count++; |
446 | } | 443 | } |
447 | 444 | ||
448 | clk_disable_unprepare(mcpdm->pdmclk); | ||
449 | |||
450 | return 0; | 445 | return 0; |
451 | } | 446 | } |
452 | 447 | ||
@@ -454,8 +449,6 @@ static int omap_mcpdm_resume(struct snd_soc_dai *dai) | |||
454 | { | 449 | { |
455 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 450 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
456 | 451 | ||
457 | clk_prepare_enable(mcpdm->pdmclk); | ||
458 | |||
459 | if (mcpdm->pm_active_count) { | 452 | if (mcpdm->pm_active_count) { |
460 | while (mcpdm->pm_active_count--) | 453 | while (mcpdm->pm_active_count--) |
461 | pm_runtime_get_sync(mcpdm->dev); | 454 | pm_runtime_get_sync(mcpdm->dev); |
@@ -549,15 +542,6 @@ static int asoc_mcpdm_probe(struct platform_device *pdev) | |||
549 | 542 | ||
550 | mcpdm->dev = &pdev->dev; | 543 | mcpdm->dev = &pdev->dev; |
551 | 544 | ||
552 | mcpdm->pdmclk = devm_clk_get(&pdev->dev, "pdmclk"); | ||
553 | if (IS_ERR(mcpdm->pdmclk)) { | ||
554 | if (PTR_ERR(mcpdm->pdmclk) == -EPROBE_DEFER) | ||
555 | return -EPROBE_DEFER; | ||
556 | dev_warn(&pdev->dev, "Error getting pdmclk (%ld)!\n", | ||
557 | PTR_ERR(mcpdm->pdmclk)); | ||
558 | mcpdm->pdmclk = NULL; | ||
559 | } | ||
560 | |||
561 | ret = devm_snd_soc_register_component(&pdev->dev, | 545 | ret = devm_snd_soc_register_component(&pdev->dev, |
562 | &omap_mcpdm_component, | 546 | &omap_mcpdm_component, |
563 | &omap_mcpdm_dai, 1); | 547 | &omap_mcpdm_dai, 1); |
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c index 50849e137fc0..92e88bca386e 100644 --- a/sound/soc/samsung/s3c24xx_uda134x.c +++ b/sound/soc/samsung/s3c24xx_uda134x.c | |||
@@ -58,10 +58,12 @@ static struct platform_device *s3c24xx_uda134x_snd_device; | |||
58 | 58 | ||
59 | static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) | 59 | static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) |
60 | { | 60 | { |
61 | int ret = 0; | 61 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
62 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
62 | #ifdef ENFORCE_RATES | 63 | #ifdef ENFORCE_RATES |
63 | struct snd_pcm_runtime *runtime = substream->runtime; | 64 | struct snd_pcm_runtime *runtime = substream->runtime; |
64 | #endif | 65 | #endif |
66 | int ret = 0; | ||
65 | 67 | ||
66 | mutex_lock(&clk_lock); | 68 | mutex_lock(&clk_lock); |
67 | pr_debug("%s %d\n", __func__, clk_users); | 69 | pr_debug("%s %d\n", __func__, clk_users); |
@@ -71,8 +73,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) | |||
71 | printk(KERN_ERR "%s cannot get xtal\n", __func__); | 73 | printk(KERN_ERR "%s cannot get xtal\n", __func__); |
72 | ret = PTR_ERR(xtal); | 74 | ret = PTR_ERR(xtal); |
73 | } else { | 75 | } else { |
74 | pclk = clk_get(&s3c24xx_uda134x_snd_device->dev, | 76 | pclk = clk_get(cpu_dai->dev, "iis"); |
75 | "pclk"); | ||
76 | if (IS_ERR(pclk)) { | 77 | if (IS_ERR(pclk)) { |
77 | printk(KERN_ERR "%s cannot get pclk\n", | 78 | printk(KERN_ERR "%s cannot get pclk\n", |
78 | __func__); | 79 | __func__); |
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index e39f916d0f2f..969a5169de25 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
@@ -226,8 +226,12 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, | |||
226 | ifscr = 0; | 226 | ifscr = 0; |
227 | fsrate = 0; | 227 | fsrate = 0; |
228 | if (fin != fout) { | 228 | if (fin != fout) { |
229 | u64 n; | ||
230 | |||
229 | ifscr = 1; | 231 | ifscr = 1; |
230 | fsrate = 0x0400000 / fout * fin; | 232 | n = (u64)0x0400000 * fin; |
233 | do_div(n, fout); | ||
234 | fsrate = n; | ||
231 | } | 235 | } |
232 | 236 | ||
233 | /* | 237 | /* |
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index d2df46c14c68..bf7b52fce597 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -121,7 +121,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) | |||
121 | 121 | ||
122 | dpcm_be_disconnect(fe, stream); | 122 | dpcm_be_disconnect(fe, stream); |
123 | fe->dpcm[stream].runtime = NULL; | 123 | fe->dpcm[stream].runtime = NULL; |
124 | goto fe_err; | 124 | goto path_err; |
125 | } | 125 | } |
126 | 126 | ||
127 | dpcm_clear_pending_state(fe, stream); | 127 | dpcm_clear_pending_state(fe, stream); |
@@ -136,6 +136,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) | |||
136 | 136 | ||
137 | return 0; | 137 | return 0; |
138 | 138 | ||
139 | path_err: | ||
140 | dpcm_path_put(&list); | ||
139 | fe_err: | 141 | fe_err: |
140 | if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown) | 142 | if (fe->dai_link->compr_ops && fe->dai_link->compr_ops->shutdown) |
141 | fe->dai_link->compr_ops->shutdown(cstream); | 143 | fe->dai_link->compr_ops->shutdown(cstream); |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 16369cad4803..4afa8dba5e98 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1056,7 +1056,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, | |||
1056 | if (!rtd->platform) { | 1056 | if (!rtd->platform) { |
1057 | dev_err(card->dev, "ASoC: platform %s not registered\n", | 1057 | dev_err(card->dev, "ASoC: platform %s not registered\n", |
1058 | dai_link->platform_name); | 1058 | dai_link->platform_name); |
1059 | return -EPROBE_DEFER; | 1059 | goto _err_defer; |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | soc_add_pcm_runtime(card, rtd); | 1062 | soc_add_pcm_runtime(card, rtd); |
@@ -2083,14 +2083,13 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) | |||
2083 | /* remove auxiliary devices */ | 2083 | /* remove auxiliary devices */ |
2084 | soc_remove_aux_devices(card); | 2084 | soc_remove_aux_devices(card); |
2085 | 2085 | ||
2086 | snd_soc_dapm_free(&card->dapm); | ||
2086 | soc_cleanup_card_debugfs(card); | 2087 | soc_cleanup_card_debugfs(card); |
2087 | 2088 | ||
2088 | /* remove the card */ | 2089 | /* remove the card */ |
2089 | if (card->remove) | 2090 | if (card->remove) |
2090 | card->remove(card); | 2091 | card->remove(card); |
2091 | 2092 | ||
2092 | snd_soc_dapm_free(&card->dapm); | ||
2093 | |||
2094 | snd_card_free(card->snd_card); | 2093 | snd_card_free(card->snd_card); |
2095 | return 0; | 2094 | return 0; |
2096 | 2095 | ||
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8698c26773b3..d908ff8f9755 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -3493,6 +3493,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3493 | const struct snd_soc_pcm_stream *config = w->params + w->params_select; | 3493 | const struct snd_soc_pcm_stream *config = w->params + w->params_select; |
3494 | struct snd_pcm_substream substream; | 3494 | struct snd_pcm_substream substream; |
3495 | struct snd_pcm_hw_params *params = NULL; | 3495 | struct snd_pcm_hw_params *params = NULL; |
3496 | struct snd_pcm_runtime *runtime = NULL; | ||
3496 | u64 fmt; | 3497 | u64 fmt; |
3497 | int ret; | 3498 | int ret; |
3498 | 3499 | ||
@@ -3541,6 +3542,14 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3541 | 3542 | ||
3542 | memset(&substream, 0, sizeof(substream)); | 3543 | memset(&substream, 0, sizeof(substream)); |
3543 | 3544 | ||
3545 | /* Allocate a dummy snd_pcm_runtime for startup() and other ops() */ | ||
3546 | runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); | ||
3547 | if (!runtime) { | ||
3548 | ret = -ENOMEM; | ||
3549 | goto out; | ||
3550 | } | ||
3551 | substream.runtime = runtime; | ||
3552 | |||
3544 | switch (event) { | 3553 | switch (event) { |
3545 | case SND_SOC_DAPM_PRE_PMU: | 3554 | case SND_SOC_DAPM_PRE_PMU: |
3546 | substream.stream = SNDRV_PCM_STREAM_CAPTURE; | 3555 | substream.stream = SNDRV_PCM_STREAM_CAPTURE; |
@@ -3606,6 +3615,7 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, | |||
3606 | } | 3615 | } |
3607 | 3616 | ||
3608 | out: | 3617 | out: |
3618 | kfree(runtime); | ||
3609 | kfree(params); | 3619 | kfree(params); |
3610 | return ret; | 3620 | return ret; |
3611 | } | 3621 | } |
diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 204cc074adb9..41aa3355e920 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c | |||
@@ -55,7 +55,6 @@ static int snd_line6_impulse_volume_put(struct snd_kcontrol *kcontrol, | |||
55 | err = line6_pcm_acquire(line6pcm, LINE6_STREAM_IMPULSE); | 55 | err = line6_pcm_acquire(line6pcm, LINE6_STREAM_IMPULSE); |
56 | if (err < 0) { | 56 | if (err < 0) { |
57 | line6pcm->impulse_volume = 0; | 57 | line6pcm->impulse_volume = 0; |
58 | line6_pcm_release(line6pcm, LINE6_STREAM_IMPULSE); | ||
59 | return err; | 58 | return err; |
60 | } | 59 | } |
61 | } else { | 60 | } else { |
@@ -211,7 +210,9 @@ static void line6_stream_stop(struct snd_line6_pcm *line6pcm, int direction, | |||
211 | spin_lock_irqsave(&pstr->lock, flags); | 210 | spin_lock_irqsave(&pstr->lock, flags); |
212 | clear_bit(type, &pstr->running); | 211 | clear_bit(type, &pstr->running); |
213 | if (!pstr->running) { | 212 | if (!pstr->running) { |
213 | spin_unlock_irqrestore(&pstr->lock, flags); | ||
214 | line6_unlink_audio_urbs(line6pcm, pstr); | 214 | line6_unlink_audio_urbs(line6pcm, pstr); |
215 | spin_lock_irqsave(&pstr->lock, flags); | ||
215 | if (direction == SNDRV_PCM_STREAM_CAPTURE) { | 216 | if (direction == SNDRV_PCM_STREAM_CAPTURE) { |
216 | line6pcm->prev_fbuf = NULL; | 217 | line6pcm->prev_fbuf = NULL; |
217 | line6pcm->prev_fsize = 0; | 218 | line6pcm->prev_fsize = 0; |
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index daf81d169a42..45dd34874f43 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c | |||
@@ -244,8 +244,8 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, | |||
244 | static ssize_t serial_number_show(struct device *dev, | 244 | static ssize_t serial_number_show(struct device *dev, |
245 | struct device_attribute *attr, char *buf) | 245 | struct device_attribute *attr, char *buf) |
246 | { | 246 | { |
247 | struct usb_interface *interface = to_usb_interface(dev); | 247 | struct snd_card *card = dev_to_snd_card(dev); |
248 | struct usb_line6_pod *pod = usb_get_intfdata(interface); | 248 | struct usb_line6_pod *pod = card->private_data; |
249 | 249 | ||
250 | return sprintf(buf, "%u\n", pod->serial_number); | 250 | return sprintf(buf, "%u\n", pod->serial_number); |
251 | } | 251 | } |
@@ -256,8 +256,8 @@ static ssize_t serial_number_show(struct device *dev, | |||
256 | static ssize_t firmware_version_show(struct device *dev, | 256 | static ssize_t firmware_version_show(struct device *dev, |
257 | struct device_attribute *attr, char *buf) | 257 | struct device_attribute *attr, char *buf) |
258 | { | 258 | { |
259 | struct usb_interface *interface = to_usb_interface(dev); | 259 | struct snd_card *card = dev_to_snd_card(dev); |
260 | struct usb_line6_pod *pod = usb_get_intfdata(interface); | 260 | struct usb_line6_pod *pod = card->private_data; |
261 | 261 | ||
262 | return sprintf(buf, "%d.%02d\n", pod->firmware_version / 100, | 262 | return sprintf(buf, "%d.%02d\n", pod->firmware_version / 100, |
263 | pod->firmware_version % 100); | 263 | pod->firmware_version % 100); |
@@ -269,8 +269,8 @@ static ssize_t firmware_version_show(struct device *dev, | |||
269 | static ssize_t device_id_show(struct device *dev, | 269 | static ssize_t device_id_show(struct device *dev, |
270 | struct device_attribute *attr, char *buf) | 270 | struct device_attribute *attr, char *buf) |
271 | { | 271 | { |
272 | struct usb_interface *interface = to_usb_interface(dev); | 272 | struct snd_card *card = dev_to_snd_card(dev); |
273 | struct usb_line6_pod *pod = usb_get_intfdata(interface); | 273 | struct usb_line6_pod *pod = card->private_data; |
274 | 274 | ||
275 | return sprintf(buf, "%d\n", pod->device_id); | 275 | return sprintf(buf, "%d\n", pod->device_id); |
276 | } | 276 | } |