aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 13:52:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 13:52:40 -0400
commitaaf675f53a7176475f69595827248c8b2556ea8c (patch)
tree0cb744dec714328c9f89bf85553fb7195107e5d4 /sound
parent347c4e95845fad1853c0e3da6603a44c5d6122b3 (diff)
parenta0d271cbfed1dd50278c6b06bead3d00ba0a88f9 (diff)
Merge tag 'v3.6' into staging/for_v3.7
Linux 3.6 * tag 'v3.6': (562 commits) Linux 3.6 vfs: dcache: fix deadlock in tree traversal mtdchar: fix offset overflow detection thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy iommu/amd: Fix wrong assumption in iommu-group specific code netdev: octeon: fix return value check in octeon_mgmt_init_phy() ALSA: snd-usb: fix next_packet_size calls for pause case inetpeer: fix token initialization qlcnic: Fix scheduling while atomic bug bnx2: Clean up remaining iounmap trivial select_parent documentation fix net: phy: smsc: Implement PHY config_init for LAN87xx smsc75xx: fix resume after device reset um: Preinclude include/linux/kern_levels.h um: Fix IPC on um netdev: pasemi: fix return value check in pasemi_mac_phy_init() team: fix return value check l2tp: fix return value check USB: Fix race condition when removing host controllers USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq ...
Diffstat (limited to 'sound')
-rw-r--r--sound/core/compress_offload.c8
-rw-r--r--sound/pci/hda/hda_codec.c2
-rw-r--r--sound/pci/hda/hda_intel.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
-rw-r--r--sound/pci/ice1712/prodigy_hifi.c3
-rw-r--r--sound/soc/codecs/arizona.c2
-rw-r--r--sound/soc/codecs/mc13783.c8
-rw-r--r--sound/soc/codecs/wm2000.c2
-rw-r--r--sound/soc/codecs/wm8904.c2
-rw-r--r--sound/soc/fsl/imx-sgtl5000.c2
-rw-r--r--sound/soc/omap/am3517evm.c2
-rw-r--r--sound/soc/samsung/dma.c8
-rw-r--r--sound/soc/soc-dapm.c5
-rw-r--r--sound/soc/spear/spear_pcm.c2
-rw-r--r--sound/soc/tegra/tegra_alc5632.c1
-rw-r--r--sound/soc/tegra/tegra_pcm.c4
-rw-r--r--sound/soc/ux500/ux500_msp_i2s.c25
-rw-r--r--sound/usb/endpoint.c8
-rw-r--r--sound/usb/pcm.c6
19 files changed, 44 insertions, 50 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index ec2118d0e27a..eb60cb8dbb8a 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -80,14 +80,12 @@ static int snd_compr_open(struct inode *inode, struct file *f)
80 int maj = imajor(inode); 80 int maj = imajor(inode);
81 int ret; 81 int ret;
82 82
83 if (f->f_flags & O_WRONLY) 83 if ((f->f_flags & O_ACCMODE) == O_WRONLY)
84 dirn = SND_COMPRESS_PLAYBACK; 84 dirn = SND_COMPRESS_PLAYBACK;
85 else if (f->f_flags & O_RDONLY) 85 else if ((f->f_flags & O_ACCMODE) == O_RDONLY)
86 dirn = SND_COMPRESS_CAPTURE; 86 dirn = SND_COMPRESS_CAPTURE;
87 else { 87 else
88 pr_err("invalid direction\n");
89 return -EINVAL; 88 return -EINVAL;
90 }
91 89
92 if (maj == snd_major) 90 if (maj == snd_major)
93 compr = snd_lookup_minor_data(iminor(inode), 91 compr = snd_lookup_minor_data(iminor(inode),
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index f25c24c743f9..1c65cc5e3a31 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2353,6 +2353,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2353 } 2353 }
2354 if (codec->patch_ops.free) 2354 if (codec->patch_ops.free)
2355 codec->patch_ops.free(codec); 2355 codec->patch_ops.free(codec);
2356 memset(&codec->patch_ops, 0, sizeof(codec->patch_ops));
2356 snd_hda_jack_tbl_clear(codec); 2357 snd_hda_jack_tbl_clear(codec);
2357 codec->proc_widget_hook = NULL; 2358 codec->proc_widget_hook = NULL;
2358 codec->spec = NULL; 2359 codec->spec = NULL;
@@ -2368,7 +2369,6 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2368 codec->num_pcms = 0; 2369 codec->num_pcms = 0;
2369 codec->pcm_info = NULL; 2370 codec->pcm_info = NULL;
2370 codec->preset = NULL; 2371 codec->preset = NULL;
2371 memset(&codec->patch_ops, 0, sizeof(codec->patch_ops));
2372 codec->slave_dig_outs = NULL; 2372 codec->slave_dig_outs = NULL;
2373 codec->spdif_status_reset = 0; 2373 codec->spdif_status_reset = 0;
2374 module_put(codec->owner); 2374 module_put(codec->owner);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 60882c62f180..c4763c52eaf6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2701,6 +2701,8 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2701 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2701 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2702 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), 2702 SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
2703 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), 2703 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
2704 SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF),
2705 SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF),
2704 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), 2706 SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
2705 SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), 2707 SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB),
2706 SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), 2708 SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 6f806d3e56bb..3d4722f0a1ca 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1075,7 +1075,7 @@ static struct snd_kcontrol_new stac_smux_mixer = {
1075 1075
1076static const char * const slave_pfxs[] = { 1076static const char * const slave_pfxs[] = {
1077 "Front", "Surround", "Center", "LFE", "Side", 1077 "Front", "Surround", "Center", "LFE", "Side",
1078 "Headphone", "Speaker", "IEC958", 1078 "Headphone", "Speaker", "IEC958", "PCM",
1079 NULL 1079 NULL
1080}; 1080};
1081 1081
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
index 764cc93dbca4..075d5aa1fee0 100644
--- a/sound/pci/ice1712/prodigy_hifi.c
+++ b/sound/pci/ice1712/prodigy_hifi.c
@@ -297,6 +297,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
297} 297}
298 298
299static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); 299static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1);
300static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);
300 301
301static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = { 302static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = {
302 { 303 {
@@ -307,7 +308,7 @@ static struct snd_kcontrol_new prodigy_hd2_controls[] __devinitdata = {
307 .info = ak4396_dac_vol_info, 308 .info = ak4396_dac_vol_info,
308 .get = ak4396_dac_vol_get, 309 .get = ak4396_dac_vol_get,
309 .put = ak4396_dac_vol_put, 310 .put = ak4396_dac_vol_put,
310 .tlv = { .p = db_scale_wm_dac }, 311 .tlv = { .p = ak4396_db_scale },
311 }, 312 },
312}; 313};
313 314
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 5c9cacaf2d52..1cf7a32d1b21 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -426,7 +426,7 @@ static const int arizona_44k1_bclk_rates[] = {
426 940800, 426 940800,
427 1411200, 427 1411200,
428 1881600, 428 1881600,
429 2882400, 429 2822400,
430 3763200, 430 3763200,
431 5644800, 431 5644800,
432 7526400, 432 7526400,
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 8f726c063f42..115a40301810 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -659,7 +659,7 @@ static struct snd_soc_dai_driver mc13783_dai_async[] = {
659 .id = MC13783_ID_STEREO_DAC, 659 .id = MC13783_ID_STEREO_DAC,
660 .playback = { 660 .playback = {
661 .stream_name = "Playback", 661 .stream_name = "Playback",
662 .channels_min = 1, 662 .channels_min = 2,
663 .channels_max = 2, 663 .channels_max = 2,
664 .rates = SNDRV_PCM_RATE_8000_96000, 664 .rates = SNDRV_PCM_RATE_8000_96000,
665 .formats = MC13783_FORMATS, 665 .formats = MC13783_FORMATS,
@@ -670,7 +670,7 @@ static struct snd_soc_dai_driver mc13783_dai_async[] = {
670 .id = MC13783_ID_STEREO_CODEC, 670 .id = MC13783_ID_STEREO_CODEC,
671 .capture = { 671 .capture = {
672 .stream_name = "Capture", 672 .stream_name = "Capture",
673 .channels_min = 1, 673 .channels_min = 2,
674 .channels_max = 2, 674 .channels_max = 2,
675 .rates = MC13783_RATES_RECORD, 675 .rates = MC13783_RATES_RECORD,
676 .formats = MC13783_FORMATS, 676 .formats = MC13783_FORMATS,
@@ -692,14 +692,14 @@ static struct snd_soc_dai_driver mc13783_dai_sync[] = {
692 .id = MC13783_ID_SYNC, 692 .id = MC13783_ID_SYNC,
693 .playback = { 693 .playback = {
694 .stream_name = "Playback", 694 .stream_name = "Playback",
695 .channels_min = 1, 695 .channels_min = 2,
696 .channels_max = 2, 696 .channels_max = 2,
697 .rates = SNDRV_PCM_RATE_8000_96000, 697 .rates = SNDRV_PCM_RATE_8000_96000,
698 .formats = MC13783_FORMATS, 698 .formats = MC13783_FORMATS,
699 }, 699 },
700 .capture = { 700 .capture = {
701 .stream_name = "Capture", 701 .stream_name = "Capture",
702 .channels_min = 1, 702 .channels_min = 2,
703 .channels_max = 2, 703 .channels_max = 2,
704 .rates = MC13783_RATES_RECORD, 704 .rates = MC13783_RATES_RECORD,
705 .formats = MC13783_FORMATS, 705 .formats = MC13783_FORMATS,
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
index 3fd5b29dc933..a3acb7a85f6a 100644
--- a/sound/soc/codecs/wm2000.c
+++ b/sound/soc/codecs/wm2000.c
@@ -702,7 +702,7 @@ static bool wm2000_readable_reg(struct device *dev, unsigned int reg)
702} 702}
703 703
704static const struct regmap_config wm2000_regmap = { 704static const struct regmap_config wm2000_regmap = {
705 .reg_bits = 8, 705 .reg_bits = 16,
706 .val_bits = 8, 706 .val_bits = 8,
707 707
708 .max_register = WM2000_REG_IF_CTL, 708 .max_register = WM2000_REG_IF_CTL,
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 0013afe48e66..dc4262eea4b7 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -100,7 +100,7 @@ static const struct reg_default wm8904_reg_defaults[] = {
100 { 14, 0x0000 }, /* R14 - Power Management 2 */ 100 { 14, 0x0000 }, /* R14 - Power Management 2 */
101 { 15, 0x0000 }, /* R15 - Power Management 3 */ 101 { 15, 0x0000 }, /* R15 - Power Management 3 */
102 { 18, 0x0000 }, /* R18 - Power Management 6 */ 102 { 18, 0x0000 }, /* R18 - Power Management 6 */
103 { 19, 0x945E }, /* R20 - Clock Rates 0 */ 103 { 20, 0x945E }, /* R20 - Clock Rates 0 */
104 { 21, 0x0C05 }, /* R21 - Clock Rates 1 */ 104 { 21, 0x0C05 }, /* R21 - Clock Rates 1 */
105 { 22, 0x0006 }, /* R22 - Clock Rates 2 */ 105 { 22, 0x0006 }, /* R22 - Clock Rates 2 */
106 { 24, 0x0050 }, /* R24 - Audio Interface 0 */ 106 { 24, 0x0050 }, /* R24 - Audio Interface 0 */
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index fb21b17f17f5..199408ec4261 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -94,7 +94,7 @@ static int __devinit imx_sgtl5000_probe(struct platform_device *pdev)
94 dev_err(&pdev->dev, "audmux internal port setup failed\n"); 94 dev_err(&pdev->dev, "audmux internal port setup failed\n");
95 return ret; 95 return ret;
96 } 96 }
97 imx_audmux_v2_configure_port(ext_port, 97 ret = imx_audmux_v2_configure_port(ext_port,
98 IMX_AUDMUX_V2_PTCR_SYN, 98 IMX_AUDMUX_V2_PTCR_SYN,
99 IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)); 99 IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
100 if (ret) { 100 if (ret) {
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 009533ab8d18..df65f98211ec 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -59,7 +59,7 @@ static int am3517evm_hw_params(struct snd_pcm_substream *substream,
59 return ret; 59 return ret;
60 } 60 }
61 61
62 snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0, 62 ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_FSR_SRC_FSX, 0,
63 SND_SOC_CLOCK_IN); 63 SND_SOC_CLOCK_IN);
64 if (ret < 0) { 64 if (ret < 0) {
65 printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_FSR_SRC_FSX\n"); 65 printk(KERN_ERR "can't set CPU system clock OMAP_MCBSP_FSR_SRC_FSX\n");
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index f3ebc38c10fe..b70964ea448c 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -34,9 +34,7 @@ static const struct snd_pcm_hardware dma_hardware = {
34 .info = SNDRV_PCM_INFO_INTERLEAVED | 34 .info = SNDRV_PCM_INFO_INTERLEAVED |
35 SNDRV_PCM_INFO_BLOCK_TRANSFER | 35 SNDRV_PCM_INFO_BLOCK_TRANSFER |
36 SNDRV_PCM_INFO_MMAP | 36 SNDRV_PCM_INFO_MMAP |
37 SNDRV_PCM_INFO_MMAP_VALID | 37 SNDRV_PCM_INFO_MMAP_VALID,
38 SNDRV_PCM_INFO_PAUSE |
39 SNDRV_PCM_INFO_RESUME,
40 .formats = SNDRV_PCM_FMTBIT_S16_LE | 38 .formats = SNDRV_PCM_FMTBIT_S16_LE |
41 SNDRV_PCM_FMTBIT_U16_LE | 39 SNDRV_PCM_FMTBIT_U16_LE |
42 SNDRV_PCM_FMTBIT_U8 | 40 SNDRV_PCM_FMTBIT_U8 |
@@ -248,15 +246,11 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd)
248 246
249 switch (cmd) { 247 switch (cmd) {
250 case SNDRV_PCM_TRIGGER_START: 248 case SNDRV_PCM_TRIGGER_START:
251 case SNDRV_PCM_TRIGGER_RESUME:
252 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
253 prtd->state |= ST_RUNNING; 249 prtd->state |= ST_RUNNING;
254 prtd->params->ops->trigger(prtd->params->ch); 250 prtd->params->ops->trigger(prtd->params->ch);
255 break; 251 break;
256 252
257 case SNDRV_PCM_TRIGGER_STOP: 253 case SNDRV_PCM_TRIGGER_STOP:
258 case SNDRV_PCM_TRIGGER_SUSPEND:
259 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
260 prtd->state &= ~ST_RUNNING; 254 prtd->state &= ~ST_RUNNING;
261 prtd->params->ops->stop(prtd->params->ch); 255 prtd->params->ops->stop(prtd->params->ch);
262 break; 256 break;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index dd7c49fafd75..f90139b5f50d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -291,8 +291,11 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
291 if (dapm->codec->driver->set_bias_level) 291 if (dapm->codec->driver->set_bias_level)
292 ret = dapm->codec->driver->set_bias_level(dapm->codec, 292 ret = dapm->codec->driver->set_bias_level(dapm->codec,
293 level); 293 level);
294 } else 294 else
295 dapm->bias_level = level;
296 } else if (!card || dapm != &card->dapm) {
295 dapm->bias_level = level; 297 dapm->bias_level = level;
298 }
296 299
297 if (ret != 0) 300 if (ret != 0)
298 goto out; 301 goto out;
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 97c2cac8e92c..8c7f23729446 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm)
138 continue; 138 continue;
139 139
140 buf = &substream->dma_buffer; 140 buf = &substream->dma_buffer;
141 if (!buf && !buf->area) 141 if (!buf || !buf->area)
142 continue; 142 continue;
143 143
144 dma_free_writecombine(pcm->card->dev, buf->bytes, 144 dma_free_writecombine(pcm->card->dev, buf->bytes,
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index e463529b38bb..76cb1b363b71 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -89,7 +89,6 @@ static struct snd_soc_jack_gpio tegra_alc5632_hp_jack_gpio = {
89 .name = "Headset detection", 89 .name = "Headset detection",
90 .report = SND_JACK_HEADSET, 90 .report = SND_JACK_HEADSET,
91 .debounce_time = 150, 91 .debounce_time = 150,
92 .invert = 1,
93}; 92};
94 93
95static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = { 94static const struct snd_soc_dapm_widget tegra_alc5632_dapm_widgets[] = {
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 5658bcec1931..8d6900c1ee47 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -334,11 +334,11 @@ static int tegra_pcm_hw_params(struct snd_pcm_substream *substream,
334 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 334 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
335 slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 335 slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
336 slave_config.dst_addr = dmap->addr; 336 slave_config.dst_addr = dmap->addr;
337 slave_config.src_maxburst = 0; 337 slave_config.dst_maxburst = 4;
338 } else { 338 } else {
339 slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 339 slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
340 slave_config.src_addr = dmap->addr; 340 slave_config.src_addr = dmap->addr;
341 slave_config.dst_maxburst = 0; 341 slave_config.src_maxburst = 4;
342 } 342 }
343 slave_config.slave_id = dmap->req_sel; 343 slave_config.slave_id = dmap->req_sel;
344 344
diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c
index 5c472f335a64..eb85113d472a 100644
--- a/sound/soc/ux500/ux500_msp_i2s.c
+++ b/sound/soc/ux500/ux500_msp_i2s.c
@@ -663,7 +663,6 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
663 struct ux500_msp **msp_p, 663 struct ux500_msp **msp_p,
664 struct msp_i2s_platform_data *platform_data) 664 struct msp_i2s_platform_data *platform_data)
665{ 665{
666 int ret = 0;
667 struct resource *res = NULL; 666 struct resource *res = NULL;
668 struct i2s_controller *i2s_cont; 667 struct i2s_controller *i2s_cont;
669 struct ux500_msp *msp; 668 struct ux500_msp *msp;
@@ -685,15 +684,14 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
685 if (res == NULL) { 684 if (res == NULL) {
686 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n", 685 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n",
687 __func__); 686 __func__);
688 ret = -ENOMEM; 687 return -ENOMEM;
689 goto err_res;
690 } 688 }
691 689
692 msp->registers = ioremap(res->start, (res->end - res->start + 1)); 690 msp->registers = devm_ioremap(&pdev->dev, res->start,
691 resource_size(res));
693 if (msp->registers == NULL) { 692 if (msp->registers == NULL) {
694 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__); 693 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__);
695 ret = -ENOMEM; 694 return -ENOMEM;
696 goto err_res;
697 } 695 }
698 696
699 msp->msp_state = MSP_STATE_IDLE; 697 msp->msp_state = MSP_STATE_IDLE;
@@ -705,7 +703,7 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
705 dev_err(&pdev->dev, 703 dev_err(&pdev->dev,
706 "%s: ERROR: Failed to allocate I2S-controller!\n", 704 "%s: ERROR: Failed to allocate I2S-controller!\n",
707 __func__); 705 __func__);
708 goto err_i2s_cont; 706 return -ENOMEM;
709 } 707 }
710 i2s_cont->dev.parent = &pdev->dev; 708 i2s_cont->dev.parent = &pdev->dev;
711 i2s_cont->data = (void *)msp; 709 i2s_cont->data = (void *)msp;
@@ -716,14 +714,6 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
716 msp->i2s_cont = i2s_cont; 714 msp->i2s_cont = i2s_cont;
717 715
718 return 0; 716 return 0;
719
720err_i2s_cont:
721 iounmap(msp->registers);
722
723err_res:
724 devm_kfree(&pdev->dev, msp);
725
726 return ret;
727} 717}
728 718
729void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev, 719void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev,
@@ -732,11 +722,6 @@ void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev,
732 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id); 722 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id);
733 723
734 device_unregister(&msp->i2s_cont->dev); 724 device_unregister(&msp->i2s_cont->dev);
735 devm_kfree(&pdev->dev, msp->i2s_cont);
736
737 iounmap(msp->registers);
738
739 devm_kfree(&pdev->dev, msp);
740} 725}
741 726
742MODULE_LICENSE("GPL v2"); 727MODULE_LICENSE("GPL v2");
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index d6e2bb49c59c..060dccb9ec75 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -197,7 +197,13 @@ static void prepare_outbound_urb(struct snd_usb_endpoint *ep,
197 /* no data provider, so send silence */ 197 /* no data provider, so send silence */
198 unsigned int offs = 0; 198 unsigned int offs = 0;
199 for (i = 0; i < ctx->packets; ++i) { 199 for (i = 0; i < ctx->packets; ++i) {
200 int counts = ctx->packet_size[i]; 200 int counts;
201
202 if (ctx->packet_size[i])
203 counts = ctx->packet_size[i];
204 else
205 counts = snd_usb_endpoint_next_packet_size(ep);
206
201 urb->iso_frame_desc[i].offset = offs * ep->stride; 207 urb->iso_frame_desc[i].offset = offs * ep->stride;
202 urb->iso_frame_desc[i].length = counts * ep->stride; 208 urb->iso_frame_desc[i].length = counts * ep->stride;
203 offs += counts; 209 offs += counts;
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index fd5e982fc98c..f782ce19bf5a 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1140,6 +1140,12 @@ static void retire_playback_urb(struct snd_usb_substream *subs,
1140 int processed = urb->transfer_buffer_length / stride; 1140 int processed = urb->transfer_buffer_length / stride;
1141 int est_delay; 1141 int est_delay;
1142 1142
1143 /* ignore the delay accounting when procssed=0 is given, i.e.
1144 * silent payloads are procssed before handling the actual data
1145 */
1146 if (!processed)
1147 return;
1148
1143 spin_lock_irqsave(&subs->lock, flags); 1149 spin_lock_irqsave(&subs->lock, flags);
1144 est_delay = snd_usb_pcm_delay(subs, runtime->rate); 1150 est_delay = snd_usb_pcm_delay(subs, runtime->rate);
1145 /* update delay with exact number of samples played */ 1151 /* update delay with exact number of samples played */