aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-07-11 08:15:48 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-11 08:15:55 -0400
commitb7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch)
tree2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /sound
parentc172d82500a6cf3c32d1e650722a1055d72ce858 (diff)
parente3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff)
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that are based on newer code already present upstream.
Diffstat (limited to 'sound')
-rw-r--r--sound/atmel/abdac.c2
-rw-r--r--sound/atmel/ac97c.c2
-rw-r--r--sound/core/misc.c40
-rw-r--r--sound/firewire/isight.c1
-rw-r--r--sound/pci/asihpi/asihpi.c1
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c8
-rw-r--r--sound/pci/hda/hda_beep.h9
-rw-r--r--sound/pci/hda/hda_eld.c2
-rw-r--r--sound/pci/hda/patch_conexant.c5
-rw-r--r--sound/pci/hda/patch_realtek.c64
-rw-r--r--sound/pci/hda/patch_via.c46
-rw-r--r--sound/pci/lola/lola.c2
-rw-r--r--sound/pci/rme9652/hdspm.c16
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c5
-rw-r--r--sound/soc/blackfin/bf5xx-ad1836.c4
-rw-r--r--sound/soc/blackfin/bf5xx-i2s-pcm.c13
-rw-r--r--sound/soc/codecs/ad1836.c14
-rw-r--r--sound/soc/codecs/ad1836.h6
-rw-r--r--sound/soc/codecs/ak4642.c2
-rw-r--r--sound/soc/codecs/tlv320aic26.c14
-rw-r--r--sound/soc/codecs/tlv320aic3x.c9
-rw-r--r--sound/soc/codecs/wm8731.c29
-rw-r--r--sound/soc/codecs/wm8804.c9
-rw-r--r--sound/soc/codecs/wm8915.c3
-rw-r--r--sound/soc/codecs/wm8962.c4
-rw-r--r--sound/soc/codecs/wm8991.c1
-rw-r--r--sound/soc/codecs/wm8994.c2
-rw-r--r--sound/soc/fsl/fsl_dma.c9
-rw-r--r--sound/soc/imx/Kconfig7
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c2
-rw-r--r--sound/soc/imx/imx-ssi.c2
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c4
-rw-r--r--sound/soc/samsung/i2s.c4
-rw-r--r--sound/soc/soc-cache.c6
-rw-r--r--sound/soc/soc-core.c5
-rw-r--r--sound/soc/soc-dapm.c17
-rw-r--r--sound/soc/tegra/tegra_i2s.c6
-rw-r--r--sound/spi/at73c213.c2
-rw-r--r--sound/usb/6fire/firmware.c1
-rw-r--r--sound/usb/6fire/pcm.c4
41 files changed, 232 insertions, 154 deletions
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index 30468b31cad8..6fd9391b3a6c 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -599,4 +599,4 @@ module_exit(atmel_abdac_exit);
599 599
600MODULE_LICENSE("GPL"); 600MODULE_LICENSE("GPL");
601MODULE_DESCRIPTION("Driver for Atmel Audio Bitstream DAC (ABDAC)"); 601MODULE_DESCRIPTION("Driver for Atmel Audio Bitstream DAC (ABDAC)");
602MODULE_AUTHOR("Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>"); 602MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 41b901bde5c7..6e5addeb236b 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -1199,4 +1199,4 @@ module_exit(atmel_ac97c_exit);
1199 1199
1200MODULE_LICENSE("GPL"); 1200MODULE_LICENSE("GPL");
1201MODULE_DESCRIPTION("Driver for Atmel AC97 controller"); 1201MODULE_DESCRIPTION("Driver for Atmel AC97 controller");
1202MODULE_AUTHOR("Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>"); 1202MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
diff --git a/sound/core/misc.c b/sound/core/misc.c
index 2c41825c836e..eb9fe2e1d291 100644
--- a/sound/core/misc.c
+++ b/sound/core/misc.c
@@ -58,26 +58,6 @@ static const char *sanity_file_name(const char *path)
58 else 58 else
59 return path; 59 return path;
60} 60}
61
62/* print file and line with a certain printk prefix */
63static int print_snd_pfx(unsigned int level, const char *path, int line,
64 const char *format)
65{
66 const char *file = sanity_file_name(path);
67 char tmp[] = "<0>";
68 const char *pfx = level ? KERN_DEBUG : KERN_DEFAULT;
69 int ret = 0;
70
71 if (format[0] == '<' && format[2] == '>') {
72 tmp[1] = format[1];
73 pfx = tmp;
74 ret = 1;
75 }
76 printk("%sALSA %s:%d: ", pfx, file, line);
77 return ret;
78}
79#else
80#define print_snd_pfx(level, path, line, format) 0
81#endif 61#endif
82 62
83#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) 63#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
@@ -85,15 +65,29 @@ void __snd_printk(unsigned int level, const char *path, int line,
85 const char *format, ...) 65 const char *format, ...)
86{ 66{
87 va_list args; 67 va_list args;
88 68#ifdef CONFIG_SND_VERBOSE_PRINTK
69 struct va_format vaf;
70 char verbose_fmt[] = KERN_DEFAULT "ALSA %s:%d %pV";
71#endif
72
89#ifdef CONFIG_SND_DEBUG 73#ifdef CONFIG_SND_DEBUG
90 if (debug < level) 74 if (debug < level)
91 return; 75 return;
92#endif 76#endif
77
93 va_start(args, format); 78 va_start(args, format);
94 if (print_snd_pfx(level, path, line, format)) 79#ifdef CONFIG_SND_VERBOSE_PRINTK
95 format += 3; /* skip the printk level-prefix */ 80 vaf.fmt = format;
81 vaf.va = &args;
82 if (format[0] == '<' && format[2] == '>') {
83 memcpy(verbose_fmt, format, 3);
84 vaf.fmt = format + 3;
85 } else if (level)
86 memcpy(verbose_fmt, KERN_DEBUG, 3);
87 printk(verbose_fmt, sanity_file_name(path), line, &vaf);
88#else
96 vprintk(format, args); 89 vprintk(format, args);
90#endif
97 va_end(args); 91 va_end(args);
98} 92}
99EXPORT_SYMBOL_GPL(__snd_printk); 93EXPORT_SYMBOL_GPL(__snd_printk);
diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
index 86ee16ca365e..440030818db7 100644
--- a/sound/firewire/isight.c
+++ b/sound/firewire/isight.c
@@ -209,6 +209,7 @@ static void isight_packet(struct fw_iso_context *context, u32 cycle,
209 isight->packet_index = -1; 209 isight->packet_index = -1;
210 return; 210 return;
211 } 211 }
212 fw_iso_context_queue_flush(isight->context);
212 213
213 if (++index >= QUEUE_LENGTH) 214 if (++index >= QUEUE_LENGTH)
214 index = 0; 215 index = 0;
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 2ca6f4f85b41..e3569bdd3b64 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -27,7 +27,6 @@
27#include "hpioctl.h" 27#include "hpioctl.h"
28 28
29#include <linux/pci.h> 29#include <linux/pci.h>
30#include <linux/version.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/jiffies.h> 31#include <linux/jiffies.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index f16bc8aad6ed..e083122ca55a 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -149,7 +149,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
149 &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i]; 149 &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
150 desc->addr = cpu_to_le32(addr); 150 desc->addr = cpu_to_le32(addr);
151 desc->size = cpu_to_le32(period_bytes); 151 desc->size = cpu_to_le32(period_bytes);
152 desc->ctlreserved = cpu_to_le32(PRD_EOP); 152 desc->ctlreserved = cpu_to_le16(PRD_EOP);
153 desc_addr += sizeof(struct cs5535audio_dma_desc); 153 desc_addr += sizeof(struct cs5535audio_dma_desc);
154 addr += period_bytes; 154 addr += period_bytes;
155 } 155 }
@@ -157,7 +157,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
157 lastdesc = &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[periods]; 157 lastdesc = &((struct cs5535audio_dma_desc *) dma->desc_buf.area)[periods];
158 lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr); 158 lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
159 lastdesc->size = 0; 159 lastdesc->size = 0;
160 lastdesc->ctlreserved = cpu_to_le32(PRD_JMP); 160 lastdesc->ctlreserved = cpu_to_le16(PRD_JMP);
161 jmpprd_addr = cpu_to_le32(lastdesc->addr + 161 jmpprd_addr = cpu_to_le32(lastdesc->addr +
162 (sizeof(struct cs5535audio_dma_desc)*periods)); 162 (sizeof(struct cs5535audio_dma_desc)*periods));
163 163
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 5e619a84da06..15f0161ce4a2 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1440,6 +1440,14 @@ static struct snd_emu_chip_details emu_chip_details[] = {
1440 .ca0102_chip = 1, 1440 .ca0102_chip = 1,
1441 .spk71 = 1, 1441 .spk71 = 1,
1442 .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */ 1442 .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */
1443 /* EMU0404 PCIe */
1444 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40051102,
1445 .driver = "Audigy2", .name = "E-mu 0404 PCIe [MAEM8984]",
1446 .id = "EMU0404",
1447 .emu10k2_chip = 1,
1448 .ca0108_chip = 1,
1449 .spk71 = 1,
1450 .emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 PCIe ver_03 */
1443 /* Note that all E-mu cards require kernel 2.6 or newer. */ 1451 /* Note that all E-mu cards require kernel 2.6 or newer. */
1444 {.vendor = 0x1102, .device = 0x0008, 1452 {.vendor = 0x1102, .device = 0x0008,
1445 .driver = "Audigy2", .name = "SB Audigy 2 Value [Unknown]", 1453 .driver = "Audigy2", .name = "SB Audigy 2 Value [Unknown]",
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index f1de1bac042c..55f0647458c7 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -50,7 +50,12 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
50int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); 50int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
51void snd_hda_detach_beep_device(struct hda_codec *codec); 51void snd_hda_detach_beep_device(struct hda_codec *codec);
52#else 52#else
53#define snd_hda_attach_beep_device(...) 0 53static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
54#define snd_hda_detach_beep_device(...) 54{
55 return 0;
56}
57static inline void snd_hda_detach_beep_device(struct hda_codec *codec)
58{
59}
55#endif 60#endif
56#endif 61#endif
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index b05f7be9dc1b..e3e853153d14 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_eld *e,
294 snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl); 294 snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl);
295 goto out_fail; 295 goto out_fail;
296 } else 296 } else
297 strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl); 297 strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl + 1);
298 298
299 for (i = 0; i < e->sad_count; i++) { 299 for (i = 0; i < e->sad_count; i++) {
300 if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) { 300 if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 3e6b9a8539c2..7bbc5f237a5e 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3074,6 +3074,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
3074}; 3074};
3075 3075
3076static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { 3076static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3077 SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT5066_AUTO),
3077 SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), 3078 SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
3078 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), 3079 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
3079 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), 3080 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
@@ -3102,6 +3103,7 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3102 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), 3103 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
3103 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO), 3104 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO),
3104 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ 3105 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
3106 SND_PCI_QUIRK(0x1b0a, 0x2092, "CyberpowerPC Gamer Xplorer N57001", CXT5066_AUTO),
3105 {} 3107 {}
3106}; 3108};
3107 3109
@@ -4388,6 +4390,8 @@ static const struct hda_codec_preset snd_hda_preset_conexant[] = {
4388 .patch = patch_cxt5066 }, 4390 .patch = patch_cxt5066 },
4389 { .id = 0x14f15069, .name = "CX20585", 4391 { .id = 0x14f15069, .name = "CX20585",
4390 .patch = patch_cxt5066 }, 4392 .patch = patch_cxt5066 },
4393 { .id = 0x14f1506c, .name = "CX20588",
4394 .patch = patch_cxt5066 },
4391 { .id = 0x14f1506e, .name = "CX20590", 4395 { .id = 0x14f1506e, .name = "CX20590",
4392 .patch = patch_cxt5066 }, 4396 .patch = patch_cxt5066 },
4393 { .id = 0x14f15097, .name = "CX20631", 4397 { .id = 0x14f15097, .name = "CX20631",
@@ -4416,6 +4420,7 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066");
4416MODULE_ALIAS("snd-hda-codec-id:14f15067"); 4420MODULE_ALIAS("snd-hda-codec-id:14f15067");
4417MODULE_ALIAS("snd-hda-codec-id:14f15068"); 4421MODULE_ALIAS("snd-hda-codec-id:14f15068");
4418MODULE_ALIAS("snd-hda-codec-id:14f15069"); 4422MODULE_ALIAS("snd-hda-codec-id:14f15069");
4423MODULE_ALIAS("snd-hda-codec-id:14f1506c");
4419MODULE_ALIAS("snd-hda-codec-id:14f1506e"); 4424MODULE_ALIAS("snd-hda-codec-id:14f1506e");
4420MODULE_ALIAS("snd-hda-codec-id:14f15097"); 4425MODULE_ALIAS("snd-hda-codec-id:14f15097");
4421MODULE_ALIAS("snd-hda-codec-id:14f15098"); 4426MODULE_ALIAS("snd-hda-codec-id:14f15098");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7a4e10002f56..b48fb43b5448 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1141,6 +1141,13 @@ static void update_speakers(struct hda_codec *codec)
1141 struct alc_spec *spec = codec->spec; 1141 struct alc_spec *spec = codec->spec;
1142 int on; 1142 int on;
1143 1143
1144 /* Control HP pins/amps depending on master_mute state;
1145 * in general, HP pins/amps control should be enabled in all cases,
1146 * but currently set only for master_mute, just to be safe
1147 */
1148 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
1149 spec->autocfg.hp_pins, spec->master_mute, true);
1150
1144 if (!spec->automute) 1151 if (!spec->automute)
1145 on = 0; 1152 on = 0;
1146 else 1153 else
@@ -2708,17 +2715,30 @@ typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
2708 2715
2709static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, 2716static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
2710 struct snd_ctl_elem_value *ucontrol, 2717 struct snd_ctl_elem_value *ucontrol,
2711 getput_call_t func) 2718 getput_call_t func, bool check_adc_switch)
2712{ 2719{
2713 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2720 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2714 struct alc_spec *spec = codec->spec; 2721 struct alc_spec *spec = codec->spec;
2715 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2722 int i, err = 0;
2716 int err;
2717 2723
2718 mutex_lock(&codec->control_mutex); 2724 mutex_lock(&codec->control_mutex);
2719 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 2725 if (check_adc_switch && spec->dual_adc_switch) {
2720 3, 0, HDA_INPUT); 2726 for (i = 0; i < spec->num_adc_nids; i++) {
2721 err = func(kcontrol, ucontrol); 2727 kcontrol->private_value =
2728 HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
2729 3, 0, HDA_INPUT);
2730 err = func(kcontrol, ucontrol);
2731 if (err < 0)
2732 goto error;
2733 }
2734 } else {
2735 i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2736 kcontrol->private_value =
2737 HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
2738 3, 0, HDA_INPUT);
2739 err = func(kcontrol, ucontrol);
2740 }
2741 error:
2722 mutex_unlock(&codec->control_mutex); 2742 mutex_unlock(&codec->control_mutex);
2723 return err; 2743 return err;
2724} 2744}
@@ -2727,14 +2747,14 @@ static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
2727 struct snd_ctl_elem_value *ucontrol) 2747 struct snd_ctl_elem_value *ucontrol)
2728{ 2748{
2729 return alc_cap_getput_caller(kcontrol, ucontrol, 2749 return alc_cap_getput_caller(kcontrol, ucontrol,
2730 snd_hda_mixer_amp_volume_get); 2750 snd_hda_mixer_amp_volume_get, false);
2731} 2751}
2732 2752
2733static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, 2753static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
2734 struct snd_ctl_elem_value *ucontrol) 2754 struct snd_ctl_elem_value *ucontrol)
2735{ 2755{
2736 return alc_cap_getput_caller(kcontrol, ucontrol, 2756 return alc_cap_getput_caller(kcontrol, ucontrol,
2737 snd_hda_mixer_amp_volume_put); 2757 snd_hda_mixer_amp_volume_put, true);
2738} 2758}
2739 2759
2740/* capture mixer elements */ 2760/* capture mixer elements */
@@ -2744,14 +2764,14 @@ static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
2744 struct snd_ctl_elem_value *ucontrol) 2764 struct snd_ctl_elem_value *ucontrol)
2745{ 2765{
2746 return alc_cap_getput_caller(kcontrol, ucontrol, 2766 return alc_cap_getput_caller(kcontrol, ucontrol,
2747 snd_hda_mixer_amp_switch_get); 2767 snd_hda_mixer_amp_switch_get, false);
2748} 2768}
2749 2769
2750static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, 2770static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
2751 struct snd_ctl_elem_value *ucontrol) 2771 struct snd_ctl_elem_value *ucontrol)
2752{ 2772{
2753 return alc_cap_getput_caller(kcontrol, ucontrol, 2773 return alc_cap_getput_caller(kcontrol, ucontrol,
2754 snd_hda_mixer_amp_switch_put); 2774 snd_hda_mixer_amp_switch_put, true);
2755} 2775}
2756 2776
2757#define _DEFINE_CAPMIX(num) \ 2777#define _DEFINE_CAPMIX(num) \
@@ -4876,7 +4896,6 @@ static const struct snd_pci_quirk alc880_cfg_tbl[] = {
4876 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG), 4896 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
4877 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST), 4897 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
4878 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG), 4898 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
4879 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
4880 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V), 4899 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
4881 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG), 4900 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
4882 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG), 4901 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
@@ -6201,11 +6220,6 @@ static const struct snd_kcontrol_new alc260_input_mixer[] = {
6201/* update HP, line and mono out pins according to the master switch */ 6220/* update HP, line and mono out pins according to the master switch */
6202static void alc260_hp_master_update(struct hda_codec *codec) 6221static void alc260_hp_master_update(struct hda_codec *codec)
6203{ 6222{
6204 struct alc_spec *spec = codec->spec;
6205
6206 /* change HP pins */
6207 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
6208 spec->autocfg.hp_pins, spec->master_mute, true);
6209 update_speakers(codec); 6223 update_speakers(codec);
6210} 6224}
6211 6225
@@ -11924,7 +11938,7 @@ static const struct hda_verb alc262_nec_verbs[] = {
11924 * 0x1b = port replicator headphone out 11938 * 0x1b = port replicator headphone out
11925 */ 11939 */
11926 11940
11927#define ALC_HP_EVENT 0x37 11941#define ALC_HP_EVENT ALC880_HP_EVENT
11928 11942
11929static const struct hda_verb alc262_fujitsu_unsol_verbs[] = { 11943static const struct hda_verb alc262_fujitsu_unsol_verbs[] = {
11930 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, 11944 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
@@ -12598,6 +12612,7 @@ static const struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
12598 */ 12612 */
12599enum { 12613enum {
12600 PINFIX_FSC_H270, 12614 PINFIX_FSC_H270,
12615 PINFIX_HP_Z200,
12601}; 12616};
12602 12617
12603static const struct alc_fixup alc262_fixups[] = { 12618static const struct alc_fixup alc262_fixups[] = {
@@ -12610,9 +12625,17 @@ static const struct alc_fixup alc262_fixups[] = {
12610 { } 12625 { }
12611 } 12626 }
12612 }, 12627 },
12628 [PINFIX_HP_Z200] = {
12629 .type = ALC_FIXUP_PINS,
12630 .v.pins = (const struct alc_pincfg[]) {
12631 { 0x16, 0x99130120 }, /* internal speaker */
12632 { }
12633 }
12634 },
12613}; 12635};
12614 12636
12615static const struct snd_pci_quirk alc262_fixup_tbl[] = { 12637static const struct snd_pci_quirk alc262_fixup_tbl[] = {
12638 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", PINFIX_HP_Z200),
12616 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270), 12639 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270),
12617 {} 12640 {}
12618}; 12641};
@@ -12729,6 +12752,8 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = {
12729 ALC262_HP_BPC), 12752 ALC262_HP_BPC),
12730 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series", 12753 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
12731 ALC262_HP_BPC), 12754 ALC262_HP_BPC),
12755 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200",
12756 ALC262_AUTO),
12732 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series", 12757 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
12733 ALC262_HP_BPC), 12758 ALC262_HP_BPC),
12734 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), 12759 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -13314,9 +13339,8 @@ static void alc268_acer_lc_setup(struct hda_codec *codec)
13314 struct alc_spec *spec = codec->spec; 13339 struct alc_spec *spec = codec->spec;
13315 spec->autocfg.hp_pins[0] = 0x15; 13340 spec->autocfg.hp_pins[0] = 0x15;
13316 spec->autocfg.speaker_pins[0] = 0x14; 13341 spec->autocfg.speaker_pins[0] = 0x14;
13317 spec->automute_mixer_nid[0] = 0x0f;
13318 spec->automute = 1; 13342 spec->automute = 1;
13319 spec->automute_mode = ALC_AUTOMUTE_MIXER; 13343 spec->automute_mode = ALC_AUTOMUTE_AMP;
13320 spec->ext_mic.pin = 0x18; 13344 spec->ext_mic.pin = 0x18;
13321 spec->ext_mic.mux_idx = 0; 13345 spec->ext_mic.mux_idx = 0;
13322 spec->int_mic.pin = 0x12; 13346 spec->int_mic.pin = 0x12;
@@ -13860,6 +13884,7 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = {
13860 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", 13884 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
13861 ALC268_ACER_ASPIRE_ONE), 13885 ALC268_ACER_ASPIRE_ONE),
13862 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 13886 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
13887 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO),
13863 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0, 13888 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
13864 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL), 13889 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
13865 /* almost compatible with toshiba but with optional digital outs; 13890 /* almost compatible with toshiba but with optional digital outs;
@@ -13870,7 +13895,6 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = {
13870 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 13895 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
13871 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), 13896 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
13872 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), 13897 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
13873 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
13874 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), 13898 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
13875 {} 13899 {}
13876}; 13900};
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 605c99e1e520..f43bb0eaed8b 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
745 struct via_spec *spec = codec->spec; 745 struct via_spec *spec = codec->spec;
746 hda_nid_t nid = kcontrol->private_value; 746 hda_nid_t nid = kcontrol->private_value;
747 unsigned int pinsel = ucontrol->value.enumerated.item[0]; 747 unsigned int pinsel = ucontrol->value.enumerated.item[0];
748 unsigned int parm0, parm1;
748 /* Get Independent Mode index of headphone pin widget */ 749 /* Get Independent Mode index of headphone pin widget */
749 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel 750 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
750 ? 1 : 0; 751 ? 1 : 0;
751 if (spec->codec_type == VT1718S) 752 if (spec->codec_type == VT1718S) {
752 snd_hda_codec_write(codec, nid, 0, 753 snd_hda_codec_write(codec, nid, 0,
753 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0); 754 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
755 /* Set correct mute switch for MW3 */
756 parm0 = spec->hp_independent_mode ?
757 AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0);
758 parm1 = spec->hp_independent_mode ?
759 AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1);
760 snd_hda_codec_write(codec, 0x1b, 0,
761 AC_VERB_SET_AMP_GAIN_MUTE, parm0);
762 snd_hda_codec_write(codec, 0x1b, 0,
763 AC_VERB_SET_AMP_GAIN_MUTE, parm1);
764 }
754 else 765 else
755 snd_hda_codec_write(codec, nid, 0, 766 snd_hda_codec_write(codec, nid, 0,
756 AC_VERB_SET_CONNECT_SEL, pinsel); 767 AC_VERB_SET_CONNECT_SEL, pinsel);
@@ -832,10 +843,13 @@ static int via_hp_build(struct hda_codec *codec)
832 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid; 843 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
833 knew->private_value = nid; 844 knew->private_value = nid;
834 845
835 knew = via_clone_control(spec, &via_hp_mixer[1]); 846 nid = side_mute_channel(spec);
836 if (knew == NULL) 847 if (nid) {
837 return -ENOMEM; 848 knew = via_clone_control(spec, &via_hp_mixer[1]);
838 knew->subdevice = side_mute_channel(spec); 849 if (knew == NULL)
850 return -ENOMEM;
851 knew->subdevice = nid;
852 }
839 853
840 return 0; 854 return 0;
841} 855}
@@ -4280,9 +4294,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4280 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 4294 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
4281 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 4295 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
4282 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)}, 4296 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
4283
4284 /* Setup default input of Front HP to MW9 */
4285 {0x28, AC_VERB_SET_CONNECT_SEL, 0x1},
4286 /* PW9 PW10 Output enable */ 4297 /* PW9 PW10 Output enable */
4287 {0x2d, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN}, 4298 {0x2d, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
4288 {0x2e, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN}, 4299 {0x2e, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
@@ -4291,10 +4302,10 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4291 /* Enable Boost Volume backdoor */ 4302 /* Enable Boost Volume backdoor */
4292 {0x1, 0xf88, 0x8}, 4303 {0x1, 0xf88, 0x8},
4293 /* MW0/1/2/3/4: un-mute index 0 (AOWx), mute index 1 (MW9) */ 4304 /* MW0/1/2/3/4: un-mute index 0 (AOWx), mute index 1 (MW9) */
4294 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4305 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4295 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4306 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4296 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4307 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4297 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4308 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4298 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4309 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4299 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4310 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4300 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 4311 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
@@ -4304,8 +4315,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4304 /* set MUX1 = 2 (AOW4), MUX2 = 1 (AOW3) */ 4315 /* set MUX1 = 2 (AOW4), MUX2 = 1 (AOW3) */
4305 {0x34, AC_VERB_SET_CONNECT_SEL, 0x2}, 4316 {0x34, AC_VERB_SET_CONNECT_SEL, 0x2},
4306 {0x35, AC_VERB_SET_CONNECT_SEL, 0x1}, 4317 {0x35, AC_VERB_SET_CONNECT_SEL, 0x1},
4307 /* Unmute MW4's index 0 */
4308 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4309 { } 4318 { }
4310}; 4319};
4311 4320
@@ -4453,6 +4462,19 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec,
4453 if (err < 0) 4462 if (err < 0)
4454 return err; 4463 return err;
4455 } else if (i == AUTO_SEQ_FRONT) { 4464 } else if (i == AUTO_SEQ_FRONT) {
4465 /* add control to mixer index 0 */
4466 err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
4467 "Master Front Playback Volume",
4468 HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
4469 HDA_INPUT));
4470 if (err < 0)
4471 return err;
4472 err = via_add_control(spec, VIA_CTL_WIDGET_MUTE,
4473 "Master Front Playback Switch",
4474 HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
4475 HDA_INPUT));
4476 if (err < 0)
4477 return err;
4456 /* Front */ 4478 /* Front */
4457 sprintf(name, "%s Playback Volume", chname[i]); 4479 sprintf(name, "%s Playback Volume", chname[i]);
4458 err = via_add_control( 4480 err = via_add_control(
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
index 34b24286d279..2692e5ae5f2d 100644
--- a/sound/pci/lola/lola.c
+++ b/sound/pci/lola/lola.c
@@ -445,7 +445,7 @@ static void lola_reset_setups(struct lola *chip)
445 lola_setup_all_analog_gains(chip, PLAY, false); /* output, update */ 445 lola_setup_all_analog_gains(chip, PLAY, false); /* output, update */
446} 446}
447 447
448static int lola_parse_tree(struct lola *chip) 448static int __devinit lola_parse_tree(struct lola *chip)
449{ 449{
450 unsigned int val; 450 unsigned int val;
451 int nid, err; 451 int nid, err;
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 949691a876d3..c8e402fc3782 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -521,6 +521,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
521#define HDSPM_DMA_AREA_KILOBYTES (HDSPM_DMA_AREA_BYTES/1024) 521#define HDSPM_DMA_AREA_KILOBYTES (HDSPM_DMA_AREA_BYTES/1024)
522 522
523/* revisions >= 230 indicate AES32 card */ 523/* revisions >= 230 indicate AES32 card */
524#define HDSPM_MADI_OLD_REV 207
524#define HDSPM_MADI_REV 210 525#define HDSPM_MADI_REV 210
525#define HDSPM_RAYDAT_REV 211 526#define HDSPM_RAYDAT_REV 211
526#define HDSPM_AIO_REV 212 527#define HDSPM_AIO_REV 212
@@ -895,11 +896,11 @@ struct hdspm {
895 unsigned char max_channels_in; 896 unsigned char max_channels_in;
896 unsigned char max_channels_out; 897 unsigned char max_channels_out;
897 898
898 char *channel_map_in; 899 signed char *channel_map_in;
899 char *channel_map_out; 900 signed char *channel_map_out;
900 901
901 char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs; 902 signed char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs;
902 char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs; 903 signed char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs;
903 904
904 char **port_names_in; 905 char **port_names_in;
905 char **port_names_out; 906 char **port_names_out;
@@ -1143,7 +1144,7 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
1143 1144
1144 /* if wordclock has synced freq and wordclock is valid */ 1145 /* if wordclock has synced freq and wordclock is valid */
1145 if ((status2 & HDSPM_wcLock) != 0 && 1146 if ((status2 & HDSPM_wcLock) != 0 &&
1146 (status & HDSPM_SelSyncRef0) == 0) { 1147 (status2 & HDSPM_SelSyncRef0) == 0) {
1147 1148
1148 rate_bits = status2 & HDSPM_wcFreqMask; 1149 rate_bits = status2 & HDSPM_wcFreqMask;
1149 1150
@@ -1639,12 +1640,14 @@ static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi)
1639 } 1640 }
1640 } 1641 }
1641 hmidi->pending = 0; 1642 hmidi->pending = 0;
1643 spin_unlock_irqrestore(&hmidi->lock, flags);
1642 1644
1645 spin_lock_irqsave(&hmidi->hdspm->lock, flags);
1643 hmidi->hdspm->control_register |= hmidi->ie; 1646 hmidi->hdspm->control_register |= hmidi->ie;
1644 hdspm_write(hmidi->hdspm, HDSPM_controlRegister, 1647 hdspm_write(hmidi->hdspm, HDSPM_controlRegister,
1645 hmidi->hdspm->control_register); 1648 hmidi->hdspm->control_register);
1649 spin_unlock_irqrestore(&hmidi->hdspm->lock, flags);
1646 1650
1647 spin_unlock_irqrestore (&hmidi->lock, flags);
1648 return snd_hdspm_midi_output_write (hmidi); 1651 return snd_hdspm_midi_output_write (hmidi);
1649} 1652}
1650 1653
@@ -6377,6 +6380,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
6377 6380
6378 switch (hdspm->firmware_rev) { 6381 switch (hdspm->firmware_rev) {
6379 case HDSPM_MADI_REV: 6382 case HDSPM_MADI_REV:
6383 case HDSPM_MADI_OLD_REV:
6380 hdspm->io_type = MADI; 6384 hdspm->io_type = MADI;
6381 hdspm->card_name = "RME MADI"; 6385 hdspm->card_name = "RME MADI";
6382 hdspm->midiPorts = 3; 6386 hdspm->midiPorts = 3;
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 7fbfa051f6e1..eda955b15834 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -848,9 +848,10 @@ int atmel_ssc_set_audio(int ssc_id)
848 if (IS_ERR(ssc)) 848 if (IS_ERR(ssc))
849 pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n", 849 pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n",
850 PTR_ERR(ssc)); 850 PTR_ERR(ssc));
851 else 851 else {
852 ssc_pdev->dev.parent = &(ssc->pdev->dev); 852 ssc_pdev->dev.parent = &(ssc->pdev->dev);
853 ssc_free(ssc); 853 ssc_free(ssc);
854 }
854 855
855 ret = platform_device_add(ssc_pdev); 856 ret = platform_device_add(ssc_pdev);
856 if (ret < 0) 857 if (ret < 0)
diff --git a/sound/soc/blackfin/bf5xx-ad1836.c b/sound/soc/blackfin/bf5xx-ad1836.c
index ea4951cf5526..f79d1655e035 100644
--- a/sound/soc/blackfin/bf5xx-ad1836.c
+++ b/sound/soc/blackfin/bf5xx-ad1836.c
@@ -75,7 +75,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = {
75 .cpu_dai_name = "bfin-tdm.0", 75 .cpu_dai_name = "bfin-tdm.0",
76 .codec_dai_name = "ad1836-hifi", 76 .codec_dai_name = "ad1836-hifi",
77 .platform_name = "bfin-tdm-pcm-audio", 77 .platform_name = "bfin-tdm-pcm-audio",
78 .codec_name = "ad1836.0", 78 .codec_name = "spi0.4",
79 .ops = &bf5xx_ad1836_ops, 79 .ops = &bf5xx_ad1836_ops,
80 }, 80 },
81 { 81 {
@@ -84,7 +84,7 @@ static struct snd_soc_dai_link bf5xx_ad1836_dai[] = {
84 .cpu_dai_name = "bfin-tdm.1", 84 .cpu_dai_name = "bfin-tdm.1",
85 .codec_dai_name = "ad1836-hifi", 85 .codec_dai_name = "ad1836-hifi",
86 .platform_name = "bfin-tdm-pcm-audio", 86 .platform_name = "bfin-tdm-pcm-audio",
87 .codec_name = "ad1836.0", 87 .codec_name = "spi0.4",
88 .ops = &bf5xx_ad1836_ops, 88 .ops = &bf5xx_ad1836_ops,
89 }, 89 },
90}; 90};
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index b5101efd1c87..f1fd95bb6416 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
138 pr_debug("%s enter\n", __func__); 138 pr_debug("%s enter\n", __func__);
139 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 139 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
140 diff = sport_curr_offset_tx(sport); 140 diff = sport_curr_offset_tx(sport);
141 frames = bytes_to_frames(substream->runtime, diff);
142 } else { 141 } else {
143 diff = sport_curr_offset_rx(sport); 142 diff = sport_curr_offset_rx(sport);
144 frames = bytes_to_frames(substream->runtime, diff);
145 } 143 }
144
145 /*
146 * TX at least can report one frame beyond the end of the
147 * buffer if we hit the wraparound case - clamp to within the
148 * buffer as the ALSA APIs require.
149 */
150 if (diff == snd_pcm_lib_buffer_bytes(substream))
151 diff = 0;
152
153 frames = bytes_to_frames(substream->runtime, diff);
154
146 return frames; 155 return frames;
147} 156}
148 157
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index ab63d52e36e1..754c496412bd 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -145,22 +145,22 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream,
145 /* bit size */ 145 /* bit size */
146 switch (params_format(params)) { 146 switch (params_format(params)) {
147 case SNDRV_PCM_FORMAT_S16_LE: 147 case SNDRV_PCM_FORMAT_S16_LE:
148 word_len = 3; 148 word_len = AD1836_WORD_LEN_16;
149 break; 149 break;
150 case SNDRV_PCM_FORMAT_S20_3LE: 150 case SNDRV_PCM_FORMAT_S20_3LE:
151 word_len = 1; 151 word_len = AD1836_WORD_LEN_20;
152 break; 152 break;
153 case SNDRV_PCM_FORMAT_S24_LE: 153 case SNDRV_PCM_FORMAT_S24_LE:
154 case SNDRV_PCM_FORMAT_S32_LE: 154 case SNDRV_PCM_FORMAT_S32_LE:
155 word_len = 0; 155 word_len = AD1836_WORD_LEN_24;
156 break; 156 break;
157 } 157 }
158 158
159 snd_soc_update_bits(codec, AD1836_DAC_CTRL1, 159 snd_soc_update_bits(codec, AD1836_DAC_CTRL1, AD1836_DAC_WORD_LEN_MASK,
160 AD1836_DAC_WORD_LEN_MASK, word_len); 160 word_len << AD1836_DAC_WORD_LEN_OFFSET);
161 161
162 snd_soc_update_bits(codec, AD1836_ADC_CTRL2, 162 snd_soc_update_bits(codec, AD1836_ADC_CTRL2, AD1836_ADC_WORD_LEN_MASK,
163 AD1836_ADC_WORD_LEN_MASK, word_len); 163 word_len << AD1836_ADC_WORD_OFFSET);
164 164
165 return 0; 165 return 0;
166} 166}
diff --git a/sound/soc/codecs/ad1836.h b/sound/soc/codecs/ad1836.h
index 845596717fdf..9d6a3f8f8aaf 100644
--- a/sound/soc/codecs/ad1836.h
+++ b/sound/soc/codecs/ad1836.h
@@ -25,6 +25,7 @@
25#define AD1836_DAC_SERFMT_PCK256 (0x4 << 5) 25#define AD1836_DAC_SERFMT_PCK256 (0x4 << 5)
26#define AD1836_DAC_SERFMT_PCK128 (0x5 << 5) 26#define AD1836_DAC_SERFMT_PCK128 (0x5 << 5)
27#define AD1836_DAC_WORD_LEN_MASK 0x18 27#define AD1836_DAC_WORD_LEN_MASK 0x18
28#define AD1836_DAC_WORD_LEN_OFFSET 3
28 29
29#define AD1836_DAC_CTRL2 1 30#define AD1836_DAC_CTRL2 1
30#define AD1836_DACL1_MUTE 0 31#define AD1836_DACL1_MUTE 0
@@ -51,6 +52,7 @@
51#define AD1836_ADCL2_MUTE 2 52#define AD1836_ADCL2_MUTE 2
52#define AD1836_ADCR2_MUTE 3 53#define AD1836_ADCR2_MUTE 3
53#define AD1836_ADC_WORD_LEN_MASK 0x30 54#define AD1836_ADC_WORD_LEN_MASK 0x30
55#define AD1836_ADC_WORD_OFFSET 5
54#define AD1836_ADC_SERFMT_MASK (7 << 6) 56#define AD1836_ADC_SERFMT_MASK (7 << 6)
55#define AD1836_ADC_SERFMT_PCK256 (0x4 << 6) 57#define AD1836_ADC_SERFMT_PCK256 (0x4 << 6)
56#define AD1836_ADC_SERFMT_PCK128 (0x5 << 6) 58#define AD1836_ADC_SERFMT_PCK128 (0x5 << 6)
@@ -60,4 +62,8 @@
60 62
61#define AD1836_NUM_REGS 16 63#define AD1836_NUM_REGS 16
62 64
65#define AD1836_WORD_LEN_24 0x0
66#define AD1836_WORD_LEN_20 0x1
67#define AD1836_WORD_LEN_16 0x2
68
63#endif 69#endif
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index 4be0570e3f1f..65f46047b1cb 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
357 default: 357 default:
358 return -EINVAL; 358 return -EINVAL;
359 } 359 }
360 snd_soc_update_bits(codec, PW_MGMT2, MS, data); 360 snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data);
361 snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); 361 snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko);
362 362
363 /* format type */ 363 /* format type */
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index e2a7608d3944..7859bdcc93db 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -161,10 +161,18 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
161 dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; 161 dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
162 } 162 }
163 163
164 /* Configure PLL */ 164 /**
165 * Configure PLL
166 * fsref = (mclk * PLLM) / 2048
167 * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal)
168 */
165 pval = 1; 169 pval = 1;
166 jval = (fsref == 44100) ? 7 : 8; 170 /* compute J portion of multiplier */
167 dval = (fsref == 44100) ? 5264 : 1920; 171 jval = fsref / (aic26->mclk / 2048);
172 /* compute fractional DDDD component of multiplier */
173 dval = fsref - (jval * (aic26->mclk / 2048));
174 dval = (10000 * dval) / (aic26->mclk / 2048);
175 dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval);
168 qval = 0; 176 qval = 0;
169 reg = 0x8000 | qval << 11 | pval << 8 | jval << 2; 177 reg = 0x8000 | qval << 11 | pval << 8 | jval << 2;
170 aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg); 178 aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg);
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index c3d96fc8c267..789453d44ec5 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1114,12 +1114,19 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
1114 1114
1115 /* Sync reg_cache with the hardware */ 1115 /* Sync reg_cache with the hardware */
1116 codec->cache_only = 0; 1116 codec->cache_only = 0;
1117 for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++) 1117 for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++)
1118 snd_soc_write(codec, i, cache[i]); 1118 snd_soc_write(codec, i, cache[i]);
1119 if (aic3x->model == AIC3X_MODEL_3007) 1119 if (aic3x->model == AIC3X_MODEL_3007)
1120 aic3x_init_3007(codec); 1120 aic3x_init_3007(codec);
1121 codec->cache_sync = 0; 1121 codec->cache_sync = 0;
1122 } else { 1122 } else {
1123 /*
1124 * Do soft reset to this codec instance in order to clear
1125 * possible VDD leakage currents in case the supply regulators
1126 * remain on
1127 */
1128 snd_soc_write(codec, AIC3X_RESET, SOFT_RESET);
1129 codec->cache_sync = 1;
1123 aic3x->power = 0; 1130 aic3x->power = 0;
1124 /* HW writes are needless when bias is off */ 1131 /* HW writes are needless when bias is off */
1125 codec->cache_only = 1; 1132 codec->cache_only = 1;
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 2dc964b55e4f..76b4361e9b80 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls =
175SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); 175SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
176 176
177static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { 177static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
178SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0),
178SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), 179SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
179SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, 180SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
180 &wm8731_output_mixer_controls[0], 181 &wm8731_output_mixer_controls[0],
@@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
204static const struct snd_soc_dapm_route wm8731_intercon[] = { 205static const struct snd_soc_dapm_route wm8731_intercon[] = {
205 {"DAC", NULL, "OSC", wm8731_check_osc}, 206 {"DAC", NULL, "OSC", wm8731_check_osc},
206 {"ADC", NULL, "OSC", wm8731_check_osc}, 207 {"ADC", NULL, "OSC", wm8731_check_osc},
208 {"DAC", NULL, "ACTIVE"},
209 {"ADC", NULL, "ACTIVE"},
207 210
208 /* output mixer */ 211 /* output mixer */
209 {"Output Mixer", "Line Bypass Switch", "Line Input"}, 212 {"Output Mixer", "Line Bypass Switch", "Line Input"},
@@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
315 return 0; 318 return 0;
316} 319}
317 320
318static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
319 struct snd_soc_dai *dai)
320{
321 struct snd_soc_codec *codec = dai->codec;
322
323 /* set active */
324 snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
325
326 return 0;
327}
328
329static void wm8731_shutdown(struct snd_pcm_substream *substream,
330 struct snd_soc_dai *dai)
331{
332 struct snd_soc_codec *codec = dai->codec;
333
334 /* deactivate */
335 if (!codec->active) {
336 udelay(50);
337 snd_soc_write(codec, WM8731_ACTIVE, 0x0);
338 }
339}
340
341static int wm8731_mute(struct snd_soc_dai *dai, int mute) 321static int wm8731_mute(struct snd_soc_dai *dai, int mute)
342{ 322{
343 struct snd_soc_codec *codec = dai->codec; 323 struct snd_soc_codec *codec = dai->codec;
@@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
480 snd_soc_write(codec, WM8731_PWR, reg | 0x0040); 460 snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
481 break; 461 break;
482 case SND_SOC_BIAS_OFF: 462 case SND_SOC_BIAS_OFF:
483 snd_soc_write(codec, WM8731_ACTIVE, 0x0);
484 snd_soc_write(codec, WM8731_PWR, 0xffff); 463 snd_soc_write(codec, WM8731_PWR, 0xffff);
485 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), 464 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
486 wm8731->supplies); 465 wm8731->supplies);
@@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
496 SNDRV_PCM_FMTBIT_S24_LE) 475 SNDRV_PCM_FMTBIT_S24_LE)
497 476
498static struct snd_soc_dai_ops wm8731_dai_ops = { 477static struct snd_soc_dai_ops wm8731_dai_ops = {
499 .prepare = wm8731_pcm_prepare,
500 .hw_params = wm8731_hw_params, 478 .hw_params = wm8731_hw_params,
501 .shutdown = wm8731_shutdown,
502 .digital_mute = wm8731_mute, 479 .digital_mute = wm8731_mute,
503 .set_sysclk = wm8731_set_dai_sysclk, 480 .set_sysclk = wm8731_set_dai_sysclk,
504 .set_fmt = wm8731_set_dai_fmt, 481 .set_fmt = wm8731_set_dai_fmt,
diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index 6785688f8806..9a5e67c5a6bd 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -680,20 +680,25 @@ static struct snd_soc_dai_ops wm8804_dai_ops = {
680#define WM8804_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ 680#define WM8804_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
681 SNDRV_PCM_FMTBIT_S24_LE) 681 SNDRV_PCM_FMTBIT_S24_LE)
682 682
683#define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
684 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \
685 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \
686 SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000)
687
683static struct snd_soc_dai_driver wm8804_dai = { 688static struct snd_soc_dai_driver wm8804_dai = {
684 .name = "wm8804-spdif", 689 .name = "wm8804-spdif",
685 .playback = { 690 .playback = {
686 .stream_name = "Playback", 691 .stream_name = "Playback",
687 .channels_min = 2, 692 .channels_min = 2,
688 .channels_max = 2, 693 .channels_max = 2,
689 .rates = SNDRV_PCM_RATE_8000_192000, 694 .rates = WM8804_RATES,
690 .formats = WM8804_FORMATS, 695 .formats = WM8804_FORMATS,
691 }, 696 },
692 .capture = { 697 .capture = {
693 .stream_name = "Capture", 698 .stream_name = "Capture",
694 .channels_min = 2, 699 .channels_min = 2,
695 .channels_max = 2, 700 .channels_max = 2,
696 .rates = SNDRV_PCM_RATE_8000_192000, 701 .rates = WM8804_RATES,
697 .formats = WM8804_FORMATS, 702 .formats = WM8804_FORMATS,
698 }, 703 },
699 .ops = &wm8804_dai_ops, 704 .ops = &wm8804_dai_ops,
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index a0b1a7278284..e2ab4fac2819 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -1839,7 +1839,7 @@ static int wm8915_set_sysclk(struct snd_soc_dai *dai,
1839 int old; 1839 int old;
1840 1840
1841 /* Disable SYSCLK while we reconfigure */ 1841 /* Disable SYSCLK while we reconfigure */
1842 old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1); 1842 old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1) & WM8915_SYSCLK_ENA;
1843 snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1, 1843 snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1,
1844 WM8915_SYSCLK_ENA, 0); 1844 WM8915_SYSCLK_ENA, 0);
1845 1845
@@ -2038,6 +2038,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2038 break; 2038 break;
2039 case WM8915_FLL_MCLK2: 2039 case WM8915_FLL_MCLK2:
2040 reg = 1; 2040 reg = 1;
2041 break;
2041 case WM8915_FLL_DACLRCLK1: 2042 case WM8915_FLL_DACLRCLK1:
2042 reg = 2; 2043 reg = 2;
2043 break; 2044 break;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index f90ae427242b..5e05eed96c38 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -1999,12 +1999,12 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol,
1999 return 0; 1999 return 0;
2000 2000
2001 /* If the left PGA is enabled hit that VU bit... */ 2001 /* If the left PGA is enabled hit that VU bit... */
2002 if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTL_PGA_ENA) 2002 if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTL_PGA_ENA)
2003 return snd_soc_write(codec, WM8962_HPOUTL_VOLUME, 2003 return snd_soc_write(codec, WM8962_HPOUTL_VOLUME,
2004 reg_cache[WM8962_HPOUTL_VOLUME]); 2004 reg_cache[WM8962_HPOUTL_VOLUME]);
2005 2005
2006 /* ...otherwise the right. The VU is stereo. */ 2006 /* ...otherwise the right. The VU is stereo. */
2007 if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTR_PGA_ENA) 2007 if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTR_PGA_ENA)
2008 return snd_soc_write(codec, WM8962_HPOUTR_VOLUME, 2008 return snd_soc_write(codec, WM8962_HPOUTR_VOLUME,
2009 reg_cache[WM8962_HPOUTR_VOLUME]); 2009 reg_cache[WM8962_HPOUTR_VOLUME]);
2010 2010
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 3c2ee1bb73cd..6af23d06870f 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
16#include <linux/version.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/delay.h> 18#include <linux/delay.h>
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 970a95c5360b..c2fc0356c2a4 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -1713,6 +1713,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,
1713 snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset, 1713 snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset,
1714 WM8994_FLL1_ENA | WM8994_FLL1_FRAC, 1714 WM8994_FLL1_ENA | WM8994_FLL1_FRAC,
1715 reg); 1715 reg);
1716
1717 msleep(5);
1716 } 1718 }
1717 1719
1718 wm8994->fll[id].in = freq_in; 1720 wm8994->fll[id].in = freq_in;
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 15dac0f20cd8..6680c0b4d203 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -310,7 +310,7 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
310 * should allocate a DMA buffer only for the streams that are valid. 310 * should allocate a DMA buffer only for the streams that are valid.
311 */ 311 */
312 312
313 if (dai->driver->playback.channels_min) { 313 if (pcm->streams[0].substream) {
314 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, 314 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
315 fsl_dma_hardware.buffer_bytes_max, 315 fsl_dma_hardware.buffer_bytes_max,
316 &pcm->streams[0].substream->dma_buffer); 316 &pcm->streams[0].substream->dma_buffer);
@@ -320,13 +320,13 @@ static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai,
320 } 320 }
321 } 321 }
322 322
323 if (dai->driver->capture.channels_min) { 323 if (pcm->streams[1].substream) {
324 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, 324 ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
325 fsl_dma_hardware.buffer_bytes_max, 325 fsl_dma_hardware.buffer_bytes_max,
326 &pcm->streams[1].substream->dma_buffer); 326 &pcm->streams[1].substream->dma_buffer);
327 if (ret) { 327 if (ret) {
328 snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
329 dev_err(card->dev, "can't alloc capture dma buffer\n"); 328 dev_err(card->dev, "can't alloc capture dma buffer\n");
329 snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
330 return ret; 330 return ret;
331 } 331 }
332 } 332 }
@@ -449,7 +449,8 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
449 dma_private->ld_buf_phys = ld_buf_phys; 449 dma_private->ld_buf_phys = ld_buf_phys;
450 dma_private->dma_buf_phys = substream->dma_buffer.addr; 450 dma_private->dma_buf_phys = substream->dma_buffer.addr;
451 451
452 ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "DMA", dma_private); 452 ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "fsldma-audio",
453 dma_private);
453 if (ret) { 454 if (ret) {
454 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n", 455 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
455 dma_private->irq, ret); 456 dma_private->irq, ret);
diff --git a/sound/soc/imx/Kconfig b/sound/soc/imx/Kconfig
index d8f130d39dd9..bb699bb55a50 100644
--- a/sound/soc/imx/Kconfig
+++ b/sound/soc/imx/Kconfig
@@ -11,9 +11,6 @@ menuconfig SND_IMX_SOC
11 11
12if SND_IMX_SOC 12if SND_IMX_SOC
13 13
14config SND_MXC_SOC_SSI
15 tristate
16
17config SND_MXC_SOC_FIQ 14config SND_MXC_SOC_FIQ
18 tristate 15 tristate
19 16
@@ -24,7 +21,6 @@ config SND_MXC_SOC_WM1133_EV1
24 tristate "Audio on the the i.MX31ADS with WM1133-EV1 fitted" 21 tristate "Audio on the the i.MX31ADS with WM1133-EV1 fitted"
25 depends on MACH_MX31ADS_WM1133_EV1 && EXPERIMENTAL 22 depends on MACH_MX31ADS_WM1133_EV1 && EXPERIMENTAL
26 select SND_SOC_WM8350 23 select SND_SOC_WM8350
27 select SND_MXC_SOC_SSI
28 select SND_MXC_SOC_FIQ 24 select SND_MXC_SOC_FIQ
29 help 25 help
30 Enable support for audio on the i.MX31ADS with the WM1133-EV1 26 Enable support for audio on the i.MX31ADS with the WM1133-EV1
@@ -34,7 +30,6 @@ config SND_SOC_MX27VIS_AIC32X4
34 tristate "SoC audio support for Visstrim M10 boards" 30 tristate "SoC audio support for Visstrim M10 boards"
35 depends on MACH_IMX27_VISSTRIM_M10 31 depends on MACH_IMX27_VISSTRIM_M10
36 select SND_SOC_TVL320AIC32X4 32 select SND_SOC_TVL320AIC32X4
37 select SND_MXC_SOC_SSI
38 select SND_MXC_SOC_MX2 33 select SND_MXC_SOC_MX2
39 help 34 help
40 Say Y if you want to add support for SoC audio on Visstrim SM10 35 Say Y if you want to add support for SoC audio on Visstrim SM10
@@ -44,7 +39,6 @@ config SND_SOC_PHYCORE_AC97
44 tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards" 39 tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards"
45 depends on MACH_PCM043 || MACH_PCA100 40 depends on MACH_PCM043 || MACH_PCA100
46 select SND_SOC_WM9712 41 select SND_SOC_WM9712
47 select SND_MXC_SOC_SSI
48 select SND_MXC_SOC_FIQ 42 select SND_MXC_SOC_FIQ
49 help 43 help
50 Say Y if you want to add support for SoC audio on Phytec phyCORE 44 Say Y if you want to add support for SoC audio on Phytec phyCORE
@@ -57,7 +51,6 @@ config SND_SOC_EUKREA_TLV320
57 || MACH_EUKREA_MBIMXSD35_BASEBOARD \ 51 || MACH_EUKREA_MBIMXSD35_BASEBOARD \
58 || MACH_EUKREA_MBIMXSD51_BASEBOARD 52 || MACH_EUKREA_MBIMXSD51_BASEBOARD
59 select SND_SOC_TLV320AIC23 53 select SND_SOC_TLV320AIC23
60 select SND_MXC_SOC_SSI
61 select SND_MXC_SOC_FIQ 54 select SND_MXC_SOC_FIQ
62 help 55 help
63 Enable I2S based access to the TLV320AIC23B codec attached 56 Enable I2S based access to the TLV320AIC23B codec attached
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index aab7765f401a..4173b3d87f97 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -337,3 +337,5 @@ static void __exit snd_imx_pcm_exit(void)
337 platform_driver_unregister(&imx_pcm_driver); 337 platform_driver_unregister(&imx_pcm_driver);
338} 338}
339module_exit(snd_imx_pcm_exit); 339module_exit(snd_imx_pcm_exit);
340MODULE_LICENSE("GPL");
341MODULE_ALIAS("platform:imx-pcm-audio");
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c
index 5b13feca7537..61fceb09cdb5 100644
--- a/sound/soc/imx/imx-ssi.c
+++ b/sound/soc/imx/imx-ssi.c
@@ -774,4 +774,4 @@ module_exit(imx_ssi_exit);
774MODULE_AUTHOR("Sascha Hauer, <s.hauer@pengutronix.de>"); 774MODULE_AUTHOR("Sascha Hauer, <s.hauer@pengutronix.de>");
775MODULE_DESCRIPTION("i.MX I2S/ac97 SoC Interface"); 775MODULE_DESCRIPTION("i.MX I2S/ac97 SoC Interface");
776MODULE_LICENSE("GPL"); 776MODULE_LICENSE("GPL");
777 777MODULE_ALIAS("platform:imx-ssi");
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index 2ce0b2d891d5..fab20a54e863 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -95,14 +95,14 @@ static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
95 if (!card->dev->coherent_dma_mask) 95 if (!card->dev->coherent_dma_mask)
96 card->dev->coherent_dma_mask = DMA_BIT_MASK(32); 96 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
97 97
98 if (dai->driver->playback.channels_min) { 98 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
99 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm, 99 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
100 SNDRV_PCM_STREAM_PLAYBACK); 100 SNDRV_PCM_STREAM_PLAYBACK);
101 if (ret) 101 if (ret)
102 goto out; 102 goto out;
103 } 103 }
104 104
105 if (dai->driver->capture.channels_min) { 105 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
106 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm, 106 ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
107 SNDRV_PCM_STREAM_CAPTURE); 107 SNDRV_PCM_STREAM_CAPTURE);
108 if (ret) 108 if (ret)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index ffa09b3b2caa..992a732b5211 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -191,7 +191,7 @@ static inline bool tx_active(struct i2s_dai *i2s)
191 if (!i2s) 191 if (!i2s)
192 return false; 192 return false;
193 193
194 active = readl(i2s->addr + I2SMOD); 194 active = readl(i2s->addr + I2SCON);
195 195
196 if (is_secondary(i2s)) 196 if (is_secondary(i2s))
197 active &= CON_TXSDMA_ACTIVE; 197 active &= CON_TXSDMA_ACTIVE;
@@ -223,7 +223,7 @@ static inline bool rx_active(struct i2s_dai *i2s)
223 if (!i2s) 223 if (!i2s)
224 return false; 224 return false;
225 225
226 active = readl(i2s->addr + I2SMOD) & CON_RXDMA_ACTIVE; 226 active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE;
227 227
228 return active ? true : false; 228 return active ? true : false;
229} 229}
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 06b7b81a1601..039b9532b270 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -409,9 +409,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
409 codec->bulk_write_raw = snd_soc_hw_bulk_write_raw; 409 codec->bulk_write_raw = snd_soc_hw_bulk_write_raw;
410 410
411 switch (control) { 411 switch (control) {
412 case SND_SOC_CUSTOM:
413 break;
414
415 case SND_SOC_I2C: 412 case SND_SOC_I2C:
416#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE)) 413#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
417 codec->hw_write = (hw_write_t)i2c_master_send; 414 codec->hw_write = (hw_write_t)i2c_master_send;
@@ -466,6 +463,9 @@ static bool snd_soc_set_cache_val(void *base, unsigned int idx,
466static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx, 463static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx,
467 unsigned int word_size) 464 unsigned int word_size)
468{ 465{
466 if (!base)
467 return -1;
468
469 switch (word_size) { 469 switch (word_size) {
470 case 1: { 470 case 1: {
471 const u8 *cache = base; 471 const u8 *cache = base;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index d75043ed7fc0..b194be09e74d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1929,8 +1929,9 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1929 "%s", card->name); 1929 "%s", card->name);
1930 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), 1930 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
1931 "%s", card->long_name ? card->long_name : card->name); 1931 "%s", card->long_name ? card->long_name : card->name);
1932 snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), 1932 if (card->driver_name)
1933 "%s", card->driver_name ? card->driver_name : card->name); 1933 strlcpy(card->snd_card->driver, card->driver_name,
1934 sizeof(card->snd_card->driver));
1934 1935
1935 if (card->late_probe) { 1936 if (card->late_probe) {
1936 ret = card->late_probe(card); 1937 ret = card->late_probe(card);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 776e6f418306..32ab7fc4579a 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -350,9 +350,9 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
350} 350}
351 351
352/* create new dapm mixer control */ 352/* create new dapm mixer control */
353static int dapm_new_mixer(struct snd_soc_dapm_context *dapm, 353static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
354 struct snd_soc_dapm_widget *w)
355{ 354{
355 struct snd_soc_dapm_context *dapm = w->dapm;
356 int i, ret = 0; 356 int i, ret = 0;
357 size_t name_len, prefix_len; 357 size_t name_len, prefix_len;
358 struct snd_soc_dapm_path *path; 358 struct snd_soc_dapm_path *path;
@@ -450,9 +450,9 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm,
450} 450}
451 451
452/* create new dapm mux control */ 452/* create new dapm mux control */
453static int dapm_new_mux(struct snd_soc_dapm_context *dapm, 453static int dapm_new_mux(struct snd_soc_dapm_widget *w)
454 struct snd_soc_dapm_widget *w)
455{ 454{
455 struct snd_soc_dapm_context *dapm = w->dapm;
456 struct snd_soc_dapm_path *path = NULL; 456 struct snd_soc_dapm_path *path = NULL;
457 struct snd_kcontrol *kcontrol; 457 struct snd_kcontrol *kcontrol;
458 struct snd_card *card = dapm->card->snd_card; 458 struct snd_card *card = dapm->card->snd_card;
@@ -535,8 +535,7 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm,
535} 535}
536 536
537/* create new dapm volume control */ 537/* create new dapm volume control */
538static int dapm_new_pga(struct snd_soc_dapm_context *dapm, 538static int dapm_new_pga(struct snd_soc_dapm_widget *w)
539 struct snd_soc_dapm_widget *w)
540{ 539{
541 if (w->num_kcontrols) 540 if (w->num_kcontrols)
542 dev_err(w->dapm->dev, 541 dev_err(w->dapm->dev,
@@ -1826,13 +1825,13 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
1826 case snd_soc_dapm_mixer: 1825 case snd_soc_dapm_mixer:
1827 case snd_soc_dapm_mixer_named_ctl: 1826 case snd_soc_dapm_mixer_named_ctl:
1828 w->power_check = dapm_generic_check_power; 1827 w->power_check = dapm_generic_check_power;
1829 dapm_new_mixer(dapm, w); 1828 dapm_new_mixer(w);
1830 break; 1829 break;
1831 case snd_soc_dapm_mux: 1830 case snd_soc_dapm_mux:
1832 case snd_soc_dapm_virt_mux: 1831 case snd_soc_dapm_virt_mux:
1833 case snd_soc_dapm_value_mux: 1832 case snd_soc_dapm_value_mux:
1834 w->power_check = dapm_generic_check_power; 1833 w->power_check = dapm_generic_check_power;
1835 dapm_new_mux(dapm, w); 1834 dapm_new_mux(w);
1836 break; 1835 break;
1837 case snd_soc_dapm_adc: 1836 case snd_soc_dapm_adc:
1838 case snd_soc_dapm_aif_out: 1837 case snd_soc_dapm_aif_out:
@@ -1845,7 +1844,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
1845 case snd_soc_dapm_pga: 1844 case snd_soc_dapm_pga:
1846 case snd_soc_dapm_out_drv: 1845 case snd_soc_dapm_out_drv:
1847 w->power_check = dapm_generic_check_power; 1846 w->power_check = dapm_generic_check_power;
1848 dapm_new_pga(dapm, w); 1847 dapm_new_pga(w);
1849 break; 1848 break;
1850 case snd_soc_dapm_input: 1849 case snd_soc_dapm_input:
1851 case snd_soc_dapm_output: 1850 case snd_soc_dapm_output:
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 6b817e20548c..95f03c10b4f7 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -222,12 +222,18 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
222 if (i2sclock % (2 * srate)) 222 if (i2sclock % (2 * srate))
223 reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE; 223 reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE;
224 224
225 if (!i2s->clk_refs)
226 clk_enable(i2s->clk_i2s);
227
225 tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg); 228 tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg);
226 229
227 tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR, 230 tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR,
228 TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS | 231 TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS |
229 TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS); 232 TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS);
230 233
234 if (!i2s->clk_refs)
235 clk_disable(i2s->clk_i2s);
236
231 return 0; 237 return 0;
232} 238}
233 239
diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c
index 337a00241a1f..4dd051bdf4fd 100644
--- a/sound/spi/at73c213.c
+++ b/sound/spi/at73c213.c
@@ -1124,6 +1124,6 @@ static void __exit at73c213_exit(void)
1124} 1124}
1125module_exit(at73c213_exit); 1125module_exit(at73c213_exit);
1126 1126
1127MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); 1127MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
1128MODULE_DESCRIPTION("Sound driver for AT73C213 with Atmel SSC"); 1128MODULE_DESCRIPTION("Sound driver for AT73C213 with Atmel SSC");
1129MODULE_LICENSE("GPL"); 1129MODULE_LICENSE("GPL");
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
index a91719d5918b..1e3ae3327dd3 100644
--- a/sound/usb/6fire/firmware.c
+++ b/sound/usb/6fire/firmware.c
@@ -270,7 +270,6 @@ static int usb6fire_fw_ezusb_upload(
270 data = 0x00; /* resume ezusb cpu */ 270 data = 0x00; /* resume ezusb cpu */
271 ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1); 271 ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1);
272 if (ret < 0) { 272 if (ret < 0) {
273 release_firmware(fw);
274 snd_printk(KERN_ERR PREFIX "unable to upload ezusb " 273 snd_printk(KERN_ERR PREFIX "unable to upload ezusb "
275 "firmware %s: end message.\n", fwname); 274 "firmware %s: end message.\n", fwname);
276 return ret; 275 return ret;
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c
index b137b25865cc..d144cdb2f159 100644
--- a/sound/usb/6fire/pcm.c
+++ b/sound/usb/6fire/pcm.c
@@ -395,12 +395,12 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub)
395 alsa_rt->hw = pcm_hw; 395 alsa_rt->hw = pcm_hw;
396 396
397 if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) { 397 if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) {
398 if (rt->rate >= 0) 398 if (rt->rate < ARRAY_SIZE(rates))
399 alsa_rt->hw.rates = rates_alsaid[rt->rate]; 399 alsa_rt->hw.rates = rates_alsaid[rt->rate];
400 alsa_rt->hw.channels_max = OUT_N_CHANNELS; 400 alsa_rt->hw.channels_max = OUT_N_CHANNELS;
401 sub = &rt->playback; 401 sub = &rt->playback;
402 } else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) { 402 } else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) {
403 if (rt->rate >= 0) 403 if (rt->rate < ARRAY_SIZE(rates))
404 alsa_rt->hw.rates = rates_alsaid[rt->rate]; 404 alsa_rt->hw.rates = rates_alsaid[rt->rate];
405 alsa_rt->hw.channels_max = IN_N_CHANNELS; 405 alsa_rt->hw.channels_max = IN_N_CHANNELS;
406 sub = &rt->capture; 406 sub = &rt->capture;