aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/aoa/fabrics/layout.c8
-rw-r--r--sound/aoa/soundbus/i2sbus/core.c3
-rw-r--r--sound/core/pcm_native.c4
-rw-r--r--sound/oss/Kconfig2
-rw-r--r--sound/pci/hda/hda_generic.c77
-rw-r--r--sound/pci/hda/hda_generic.h1
-rw-r--r--sound/pci/hda/patch_cirrus.c23
-rw-r--r--sound/pci/hda/patch_realtek.c10
-rw-r--r--sound/pci/hda/patch_via.c10
-rw-r--r--sound/pci/sis7019.c3
-rw-r--r--sound/soc/codecs/ab8500-codec.h36
-rw-r--r--sound/soc/codecs/cs42l52.c12
-rw-r--r--sound/soc/codecs/cs42l52.h2
-rw-r--r--sound/soc/codecs/da7213.c8
-rw-r--r--sound/soc/codecs/max98090.c2
-rw-r--r--sound/soc/codecs/tlv320aic3x.c10
-rw-r--r--sound/soc/codecs/wm0010.c1
-rw-r--r--sound/soc/codecs/wm5102.c3
-rw-r--r--sound/soc/codecs/wm5110.c7
-rw-r--r--sound/soc/codecs/wm8994.c15
-rw-r--r--sound/soc/davinci/davinci-mcasp.c7
-rw-r--r--sound/soc/fsl/imx-ssi.c6
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c5
-rw-r--r--sound/soc/soc-compress.c8
-rw-r--r--sound/soc/soc-dapm.c49
-rw-r--r--sound/soc/soc-pcm.c13
-rw-r--r--sound/usb/6fire/firmware.c6
-rw-r--r--sound/usb/card.c22
-rw-r--r--sound/usb/mixer.c2
-rw-r--r--sound/usb/proc.c22
-rw-r--r--sound/usb/quirks-table.h14
31 files changed, 254 insertions, 137 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
index 552b97afbca5..61ab640e195f 100644
--- a/sound/aoa/fabrics/layout.c
+++ b/sound/aoa/fabrics/layout.c
@@ -113,6 +113,7 @@ MODULE_ALIAS("sound-layout-100");
113MODULE_ALIAS("aoa-device-id-14"); 113MODULE_ALIAS("aoa-device-id-14");
114MODULE_ALIAS("aoa-device-id-22"); 114MODULE_ALIAS("aoa-device-id-22");
115MODULE_ALIAS("aoa-device-id-35"); 115MODULE_ALIAS("aoa-device-id-35");
116MODULE_ALIAS("aoa-device-id-44");
116 117
117/* onyx with all but microphone connected */ 118/* onyx with all but microphone connected */
118static struct codec_connection onyx_connections_nomic[] = { 119static struct codec_connection onyx_connections_nomic[] = {
@@ -361,6 +362,13 @@ static struct layout layouts[] = {
361 .connections = tas_connections_nolineout, 362 .connections = tas_connections_nolineout,
362 }, 363 },
363 }, 364 },
365 /* PowerBook6,5 */
366 { .device_id = 44,
367 .codecs[0] = {
368 .name = "tas",
369 .connections = tas_connections_all,
370 },
371 },
364 /* PowerBook6,7 */ 372 /* PowerBook6,7 */
365 { .layout_id = 80, 373 { .layout_id = 80,
366 .codecs[0] = { 374 .codecs[0] = {
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 010658335881..15e76131b501 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -200,7 +200,8 @@ static int i2sbus_add_dev(struct macio_dev *macio,
200 * We probably cannot handle all device-id machines, 200 * We probably cannot handle all device-id machines,
201 * so restrict to those we do handle for now. 201 * so restrict to those we do handle for now.
202 */ 202 */
203 if (id && (*id == 22 || *id == 14 || *id == 35)) { 203 if (id && (*id == 22 || *id == 14 || *id == 35 ||
204 *id == 44)) {
204 snprintf(dev->sound.modalias, 32, 205 snprintf(dev->sound.modalias, 32,
205 "aoa-device-id-%d", *id); 206 "aoa-device-id-%d", *id);
206 ok = 1; 207 ok = 1;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index ccfa383f1fda..f92818155958 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1649,6 +1649,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
1649 } 1649 }
1650 if (!snd_pcm_stream_linked(substream)) { 1650 if (!snd_pcm_stream_linked(substream)) {
1651 substream->group = group; 1651 substream->group = group;
1652 group = NULL;
1652 spin_lock_init(&substream->group->lock); 1653 spin_lock_init(&substream->group->lock);
1653 INIT_LIST_HEAD(&substream->group->substreams); 1654 INIT_LIST_HEAD(&substream->group->substreams);
1654 list_add_tail(&substream->link_list, &substream->group->substreams); 1655 list_add_tail(&substream->link_list, &substream->group->substreams);
@@ -1663,8 +1664,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
1663 _nolock: 1664 _nolock:
1664 snd_card_unref(substream1->pcm->card); 1665 snd_card_unref(substream1->pcm->card);
1665 fput_light(file, fput_needed); 1666 fput_light(file, fput_needed);
1666 if (res < 0) 1667 kfree(group);
1667 kfree(group);
1668 return res; 1668 return res;
1669} 1669}
1670 1670
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 51c4ba95a32d..1a9640254433 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -250,7 +250,7 @@ config MSND_FIFOSIZE
250menuconfig SOUND_OSS 250menuconfig SOUND_OSS
251 tristate "OSS sound modules" 251 tristate "OSS sound modules"
252 depends on ISA_DMA_API && VIRT_TO_BUS 252 depends on ISA_DMA_API && VIRT_TO_BUS
253 depends on !ISA_DMA_SUPPORT_BROKEN 253 depends on !GENERIC_ISA_DMA_SUPPORT_BROKEN
254 help 254 help
255 OSS is the Open Sound System suite of sound card drivers. They make 255 OSS is the Open Sound System suite of sound card drivers. They make
256 sound programming easier since they provide a common API. Say Y or 256 sound programming easier since they provide a common API. Say Y or
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index ac079f93c535..4b1524a861f3 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -606,6 +606,10 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
606 return false; 606 return false;
607} 607}
608 608
609/* check whether the NID is referred by any active paths */
610#define is_active_nid_for_any(codec, nid) \
611 is_active_nid(codec, nid, HDA_OUTPUT, 0)
612
609/* get the default amp value for the target state */ 613/* get the default amp value for the target state */
610static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid, 614static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,
611 int dir, unsigned int caps, bool enable) 615 int dir, unsigned int caps, bool enable)
@@ -759,7 +763,8 @@ static void path_power_down_sync(struct hda_codec *codec, struct nid_path *path)
759 763
760 for (i = 0; i < path->depth; i++) { 764 for (i = 0; i < path->depth; i++) {
761 hda_nid_t nid = path->path[i]; 765 hda_nid_t nid = path->path[i];
762 if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3)) { 766 if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3) &&
767 !is_active_nid_for_any(codec, nid)) {
763 snd_hda_codec_write(codec, nid, 0, 768 snd_hda_codec_write(codec, nid, 0,
764 AC_VERB_SET_POWER_STATE, 769 AC_VERB_SET_POWER_STATE,
765 AC_PWRST_D3); 770 AC_PWRST_D3);
@@ -783,6 +788,8 @@ static void set_pin_eapd(struct hda_codec *codec, hda_nid_t pin, bool enable)
783 return; 788 return;
784 if (codec->inv_eapd) 789 if (codec->inv_eapd)
785 enable = !enable; 790 enable = !enable;
791 if (spec->keep_eapd_on && !enable)
792 return;
786 snd_hda_codec_update_cache(codec, pin, 0, 793 snd_hda_codec_update_cache(codec, pin, 0,
787 AC_VERB_SET_EAPD_BTLENABLE, 794 AC_VERB_SET_EAPD_BTLENABLE,
788 enable ? 0x02 : 0x00); 795 enable ? 0x02 : 0x00);
@@ -1933,17 +1940,7 @@ static int create_speaker_out_ctls(struct hda_codec *codec)
1933 * independent HP controls 1940 * independent HP controls
1934 */ 1941 */
1935 1942
1936/* update HP auto-mute state too */ 1943static void call_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack);
1937static void update_hp_automute_hook(struct hda_codec *codec)
1938{
1939 struct hda_gen_spec *spec = codec->spec;
1940
1941 if (spec->hp_automute_hook)
1942 spec->hp_automute_hook(codec, NULL);
1943 else
1944 snd_hda_gen_hp_automute(codec, NULL);
1945}
1946
1947static int indep_hp_info(struct snd_kcontrol *kcontrol, 1944static int indep_hp_info(struct snd_kcontrol *kcontrol,
1948 struct snd_ctl_elem_info *uinfo) 1945 struct snd_ctl_elem_info *uinfo)
1949{ 1946{
@@ -2004,7 +2001,7 @@ static int indep_hp_put(struct snd_kcontrol *kcontrol,
2004 else 2001 else
2005 *dacp = spec->alt_dac_nid; 2002 *dacp = spec->alt_dac_nid;
2006 2003
2007 update_hp_automute_hook(codec); 2004 call_hp_automute(codec, NULL);
2008 ret = 1; 2005 ret = 1;
2009 } 2006 }
2010 unlock: 2007 unlock:
@@ -2300,7 +2297,7 @@ static void update_hp_mic(struct hda_codec *codec, int adc_mux, bool force)
2300 else 2297 else
2301 val = PIN_HP; 2298 val = PIN_HP;
2302 set_pin_target(codec, pin, val, true); 2299 set_pin_target(codec, pin, val, true);
2303 update_hp_automute_hook(codec); 2300 call_hp_automute(codec, NULL);
2304 } 2301 }
2305} 2302}
2306 2303
@@ -2709,7 +2706,7 @@ static int hp_mic_jack_mode_put(struct snd_kcontrol *kcontrol,
2709 val = snd_hda_get_default_vref(codec, nid); 2706 val = snd_hda_get_default_vref(codec, nid);
2710 } 2707 }
2711 snd_hda_set_pin_ctl_cache(codec, nid, val); 2708 snd_hda_set_pin_ctl_cache(codec, nid, val);
2712 update_hp_automute_hook(codec); 2709 call_hp_automute(codec, NULL);
2713 2710
2714 return 1; 2711 return 1;
2715} 2712}
@@ -3854,20 +3851,42 @@ void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *ja
3854} 3851}
3855EXPORT_SYMBOL_HDA(snd_hda_gen_mic_autoswitch); 3852EXPORT_SYMBOL_HDA(snd_hda_gen_mic_autoswitch);
3856 3853
3857/* update jack retasking */ 3854/* call appropriate hooks */
3858static void update_automute_all(struct hda_codec *codec) 3855static void call_hp_automute(struct hda_codec *codec, struct hda_jack_tbl *jack)
3859{ 3856{
3860 struct hda_gen_spec *spec = codec->spec; 3857 struct hda_gen_spec *spec = codec->spec;
3858 if (spec->hp_automute_hook)
3859 spec->hp_automute_hook(codec, jack);
3860 else
3861 snd_hda_gen_hp_automute(codec, jack);
3862}
3861 3863
3862 update_hp_automute_hook(codec); 3864static void call_line_automute(struct hda_codec *codec,
3865 struct hda_jack_tbl *jack)
3866{
3867 struct hda_gen_spec *spec = codec->spec;
3863 if (spec->line_automute_hook) 3868 if (spec->line_automute_hook)
3864 spec->line_automute_hook(codec, NULL); 3869 spec->line_automute_hook(codec, jack);
3865 else 3870 else
3866 snd_hda_gen_line_automute(codec, NULL); 3871 snd_hda_gen_line_automute(codec, jack);
3872}
3873
3874static void call_mic_autoswitch(struct hda_codec *codec,
3875 struct hda_jack_tbl *jack)
3876{
3877 struct hda_gen_spec *spec = codec->spec;
3867 if (spec->mic_autoswitch_hook) 3878 if (spec->mic_autoswitch_hook)
3868 spec->mic_autoswitch_hook(codec, NULL); 3879 spec->mic_autoswitch_hook(codec, jack);
3869 else 3880 else
3870 snd_hda_gen_mic_autoswitch(codec, NULL); 3881 snd_hda_gen_mic_autoswitch(codec, jack);
3882}
3883
3884/* update jack retasking */
3885static void update_automute_all(struct hda_codec *codec)
3886{
3887 call_hp_automute(codec, NULL);
3888 call_line_automute(codec, NULL);
3889 call_mic_autoswitch(codec, NULL);
3871} 3890}
3872 3891
3873/* 3892/*
@@ -4004,9 +4023,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4004 snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", 4023 snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n",
4005 nid); 4024 nid);
4006 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, 4025 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT,
4007 spec->hp_automute_hook ? 4026 call_hp_automute);
4008 spec->hp_automute_hook :
4009 snd_hda_gen_hp_automute);
4010 spec->detect_hp = 1; 4027 spec->detect_hp = 1;
4011 } 4028 }
4012 4029
@@ -4019,9 +4036,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4019 snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); 4036 snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid);
4020 snd_hda_jack_detect_enable_callback(codec, nid, 4037 snd_hda_jack_detect_enable_callback(codec, nid,
4021 HDA_GEN_FRONT_EVENT, 4038 HDA_GEN_FRONT_EVENT,
4022 spec->line_automute_hook ? 4039 call_line_automute);
4023 spec->line_automute_hook :
4024 snd_hda_gen_line_automute);
4025 spec->detect_lo = 1; 4040 spec->detect_lo = 1;
4026 } 4041 }
4027 spec->automute_lo_possible = spec->detect_hp; 4042 spec->automute_lo_possible = spec->detect_hp;
@@ -4063,9 +4078,7 @@ static bool auto_mic_check_imux(struct hda_codec *codec)
4063 snd_hda_jack_detect_enable_callback(codec, 4078 snd_hda_jack_detect_enable_callback(codec,
4064 spec->am_entry[i].pin, 4079 spec->am_entry[i].pin,
4065 HDA_GEN_MIC_EVENT, 4080 HDA_GEN_MIC_EVENT,
4066 spec->mic_autoswitch_hook ? 4081 call_mic_autoswitch);
4067 spec->mic_autoswitch_hook :
4068 snd_hda_gen_mic_autoswitch);
4069 return true; 4082 return true;
4070} 4083}
4071 4084
@@ -4157,7 +4170,7 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
4157 return power_state; 4170 return power_state;
4158 if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER) 4171 if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER)
4159 return power_state; 4172 return power_state;
4160 if (is_active_nid(codec, nid, HDA_OUTPUT, 0)) 4173 if (is_active_nid_for_any(codec, nid))
4161 return power_state; 4174 return power_state;
4162 return AC_PWRST_D3; 4175 return AC_PWRST_D3;
4163} 4176}
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 54e665160379..76200314ee95 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -222,6 +222,7 @@ struct hda_gen_spec {
222 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ 222 unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */
223 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ 223 unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */
224 unsigned int own_eapd_ctl:1; /* set EAPD by own function */ 224 unsigned int own_eapd_ctl:1; /* set EAPD by own function */
225 unsigned int keep_eapd_on:1; /* don't turn off EAPD automatically */
225 unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */ 226 unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */
226 unsigned int indep_hp:1; /* independent HP supported */ 227 unsigned int indep_hp:1; /* independent HP supported */
227 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */ 228 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index bd8d46cca2b3..cccaf9c7a7bb 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -58,6 +58,7 @@ enum {
58 CS420X_GPIO_23, 58 CS420X_GPIO_23,
59 CS420X_MBP101, 59 CS420X_MBP101,
60 CS420X_MBP81, 60 CS420X_MBP81,
61 CS420X_MBA42,
61 CS420X_AUTO, 62 CS420X_AUTO,
62 /* aliases */ 63 /* aliases */
63 CS420X_IMAC27_122 = CS420X_GPIO_23, 64 CS420X_IMAC27_122 = CS420X_GPIO_23,
@@ -346,6 +347,7 @@ static const struct hda_model_fixup cs420x_models[] = {
346 { .id = CS420X_APPLE, .name = "apple" }, 347 { .id = CS420X_APPLE, .name = "apple" },
347 { .id = CS420X_MBP101, .name = "mbp101" }, 348 { .id = CS420X_MBP101, .name = "mbp101" },
348 { .id = CS420X_MBP81, .name = "mbp81" }, 349 { .id = CS420X_MBP81, .name = "mbp81" },
350 { .id = CS420X_MBA42, .name = "mba42" },
349 {} 351 {}
350}; 352};
351 353
@@ -361,6 +363,7 @@ static const struct snd_pci_quirk cs420x_fixup_tbl[] = {
361 SND_PCI_QUIRK(0x106b, 0x1c00, "MacBookPro 8,1", CS420X_MBP81), 363 SND_PCI_QUIRK(0x106b, 0x1c00, "MacBookPro 8,1", CS420X_MBP81),
362 SND_PCI_QUIRK(0x106b, 0x2000, "iMac 12,2", CS420X_IMAC27_122), 364 SND_PCI_QUIRK(0x106b, 0x2000, "iMac 12,2", CS420X_IMAC27_122),
363 SND_PCI_QUIRK(0x106b, 0x2800, "MacBookPro 10,1", CS420X_MBP101), 365 SND_PCI_QUIRK(0x106b, 0x2800, "MacBookPro 10,1", CS420X_MBP101),
366 SND_PCI_QUIRK(0x106b, 0x5b00, "MacBookAir 4,2", CS420X_MBA42),
364 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE), 367 SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS420X_APPLE),
365 {} /* terminator */ 368 {} /* terminator */
366}; 369};
@@ -414,6 +417,20 @@ static const struct hda_pintbl mbp101_pincfgs[] = {
414 {} /* terminator */ 417 {} /* terminator */
415}; 418};
416 419
420static const struct hda_pintbl mba42_pincfgs[] = {
421 { 0x09, 0x012b4030 }, /* HP */
422 { 0x0a, 0x400000f0 },
423 { 0x0b, 0x90100120 }, /* speaker */
424 { 0x0c, 0x400000f0 },
425 { 0x0d, 0x90a00110 }, /* mic */
426 { 0x0e, 0x400000f0 },
427 { 0x0f, 0x400000f0 },
428 { 0x10, 0x400000f0 },
429 { 0x12, 0x400000f0 },
430 { 0x15, 0x400000f0 },
431 {} /* terminator */
432};
433
417static void cs420x_fixup_gpio_13(struct hda_codec *codec, 434static void cs420x_fixup_gpio_13(struct hda_codec *codec,
418 const struct hda_fixup *fix, int action) 435 const struct hda_fixup *fix, int action)
419{ 436{
@@ -482,6 +499,12 @@ static const struct hda_fixup cs420x_fixups[] = {
482 .chained = true, 499 .chained = true,
483 .chain_id = CS420X_GPIO_13, 500 .chain_id = CS420X_GPIO_13,
484 }, 501 },
502 [CS420X_MBA42] = {
503 .type = HDA_FIXUP_PINS,
504 .v.pins = mba42_pincfgs,
505 .chained = true,
506 .chain_id = CS420X_GPIO_13,
507 },
485}; 508};
486 509
487static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid) 510static struct cs_spec *cs_alloc_spec(struct hda_codec *codec, int vendor_nid)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 6bf47f7326ad..403010c9e82e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3482,6 +3482,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3482 SND_PCI_QUIRK(0x1028, 0x05c9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3482 SND_PCI_QUIRK(0x1028, 0x05c9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3483 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 3483 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
3484 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 3484 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
3485 SND_PCI_QUIRK(0x1028, 0x05de, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
3486 SND_PCI_QUIRK(0x1028, 0x05e0, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
3485 SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3487 SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3486 SND_PCI_QUIRK(0x1028, 0x05ea, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3488 SND_PCI_QUIRK(0x1028, 0x05ea, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3487 SND_PCI_QUIRK(0x1028, 0x05eb, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3489 SND_PCI_QUIRK(0x1028, 0x05eb, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -3492,6 +3494,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3492 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3494 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3493 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3495 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3494 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 3496 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3497 SND_PCI_QUIRK(0x1028, 0x05f8, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3498 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3499 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3500 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3495 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 3501 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
3496 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 3502 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
3497 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 3503 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
@@ -3529,6 +3535,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3529 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), 3535 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
3530 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), 3536 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
3531 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), 3537 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
3538 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
3532 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK), 3539 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
3533 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), 3540 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
3534 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), 3541 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
@@ -3592,6 +3599,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
3592 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"}, 3599 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
3593 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, 3600 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
3594 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, 3601 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
3602 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
3603 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
3595 {} 3604 {}
3596}; 3605};
3597 3606
@@ -4271,6 +4280,7 @@ static const struct hda_model_fixup alc662_fixup_models[] = {
4271 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, 4280 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
4272 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, 4281 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
4273 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, 4282 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
4283 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
4274 {} 4284 {}
4275}; 4285};
4276 4286
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index e0dadcf2030d..e5245544eb52 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -136,6 +136,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec)
136 spec->codec_type = VT1708S; 136 spec->codec_type = VT1708S;
137 spec->no_pin_power_ctl = 1; 137 spec->no_pin_power_ctl = 1;
138 spec->gen.indep_hp = 1; 138 spec->gen.indep_hp = 1;
139 spec->gen.keep_eapd_on = 1;
139 spec->gen.pcm_playback_hook = via_playback_pcm_hook; 140 spec->gen.pcm_playback_hook = via_playback_pcm_hook;
140 return spec; 141 return spec;
141} 142}
@@ -231,9 +232,14 @@ static void vt1708_update_hp_work(struct hda_codec *codec)
231 232
232static void set_widgets_power_state(struct hda_codec *codec) 233static void set_widgets_power_state(struct hda_codec *codec)
233{ 234{
235#if 0 /* FIXME: the assumed connections don't match always with the
236 * actual routes by the generic parser, so better to disable
237 * the control for safety.
238 */
234 struct via_spec *spec = codec->spec; 239 struct via_spec *spec = codec->spec;
235 if (spec->set_widgets_power_state) 240 if (spec->set_widgets_power_state)
236 spec->set_widgets_power_state(codec); 241 spec->set_widgets_power_state(codec);
242#endif
237} 243}
238 244
239static void update_power_state(struct hda_codec *codec, hda_nid_t nid, 245static void update_power_state(struct hda_codec *codec, hda_nid_t nid,
@@ -478,7 +484,9 @@ static int via_suspend(struct hda_codec *codec)
478 /* Fix pop noise on headphones */ 484 /* Fix pop noise on headphones */
479 int i; 485 int i;
480 for (i = 0; i < spec->gen.autocfg.hp_outs; i++) 486 for (i = 0; i < spec->gen.autocfg.hp_outs; i++)
481 snd_hda_set_pin_ctl(codec, spec->gen.autocfg.hp_pins[i], 0); 487 snd_hda_codec_write(codec, spec->gen.autocfg.hp_pins[i],
488 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
489 0x00);
482 } 490 }
483 491
484 return 0; 492 return 0;
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index d59abe1682c5..748e82d4d257 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1341,7 +1341,8 @@ static int sis_chip_create(struct snd_card *card,
1341 if (rc) 1341 if (rc)
1342 goto error_out; 1342 goto error_out;
1343 1343
1344 if (pci_set_dma_mask(pci, DMA_BIT_MASK(30)) < 0) { 1344 rc = pci_set_dma_mask(pci, DMA_BIT_MASK(30));
1345 if (rc < 0) {
1345 dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA"); 1346 dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA");
1346 goto error_out_enabled; 1347 goto error_out_enabled;
1347 } 1348 }
diff --git a/sound/soc/codecs/ab8500-codec.h b/sound/soc/codecs/ab8500-codec.h
index 114f69a0c629..306d0bc8455f 100644
--- a/sound/soc/codecs/ab8500-codec.h
+++ b/sound/soc/codecs/ab8500-codec.h
@@ -348,25 +348,25 @@
348 348
349/* AB8500_ADSLOTSELX */ 349/* AB8500_ADSLOTSELX */
350#define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_ODD 0x00 350#define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_ODD 0x00
351#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_ODD 0x01 351#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_ODD 0x10
352#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_ODD 0x02 352#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_ODD 0x20
353#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_ODD 0x03 353#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_ODD 0x30
354#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_ODD 0x04 354#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_ODD 0x40
355#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_ODD 0x05 355#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_ODD 0x50
356#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_ODD 0x06 356#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_ODD 0x60
357#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_ODD 0x07 357#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_ODD 0x70
358#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_ODD 0x08 358#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_ODD 0x80
359#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_ODD 0x0F 359#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_ODD 0xF0
360#define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_EVEN 0x00 360#define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_EVEN 0x00
361#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_EVEN 0x10 361#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_EVEN 0x01
362#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_EVEN 0x20 362#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_EVEN 0x02
363#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_EVEN 0x30 363#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_EVEN 0x03
364#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_EVEN 0x40 364#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_EVEN 0x04
365#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_EVEN 0x50 365#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_EVEN 0x05
366#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_EVEN 0x60 366#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_EVEN 0x06
367#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_EVEN 0x70 367#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_EVEN 0x07
368#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_EVEN 0x80 368#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_EVEN 0x08
369#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_EVEN 0xF0 369#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_EVEN 0x0F
370#define AB8500_ADSLOTSELX_EVEN_SHIFT 0 370#define AB8500_ADSLOTSELX_EVEN_SHIFT 0
371#define AB8500_ADSLOTSELX_ODD_SHIFT 4 371#define AB8500_ADSLOTSELX_ODD_SHIFT 4
372 372
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 0f6f481cec09..987f728718c5 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -86,7 +86,7 @@ static const struct reg_default cs42l52_reg_defaults[] = {
86 { CS42L52_BEEP_VOL, 0x00 }, /* r1D Beep Volume off Time */ 86 { CS42L52_BEEP_VOL, 0x00 }, /* r1D Beep Volume off Time */
87 { CS42L52_BEEP_TONE_CTL, 0x00 }, /* r1E Beep Tone Cfg. */ 87 { CS42L52_BEEP_TONE_CTL, 0x00 }, /* r1E Beep Tone Cfg. */
88 { CS42L52_TONE_CTL, 0x00 }, /* r1F Tone Ctl */ 88 { CS42L52_TONE_CTL, 0x00 }, /* r1F Tone Ctl */
89 { CS42L52_MASTERA_VOL, 0x88 }, /* r20 Master A Volume */ 89 { CS42L52_MASTERA_VOL, 0x00 }, /* r20 Master A Volume */
90 { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */ 90 { CS42L52_MASTERB_VOL, 0x00 }, /* r21 Master B Volume */
91 { CS42L52_HPA_VOL, 0x00 }, /* r22 Headphone A Volume */ 91 { CS42L52_HPA_VOL, 0x00 }, /* r22 Headphone A Volume */
92 { CS42L52_HPB_VOL, 0x00 }, /* r23 Headphone B Volume */ 92 { CS42L52_HPB_VOL, 0x00 }, /* r23 Headphone B Volume */
@@ -193,6 +193,8 @@ static DECLARE_TLV_DB_SCALE(mic_tlv, 1600, 100, 0);
193 193
194static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0); 194static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
195 195
196static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);
197
196static const unsigned int limiter_tlv[] = { 198static const unsigned int limiter_tlv[] = {
197 TLV_DB_RANGE_HEAD(2), 199 TLV_DB_RANGE_HEAD(2),
198 0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0), 200 0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0),
@@ -225,7 +227,7 @@ static const char * const mic_bias_level_text[] = {
225}; 227};
226 228
227static const struct soc_enum mic_bias_level_enum = 229static const struct soc_enum mic_bias_level_enum =
228 SOC_ENUM_SINGLE(CS42L52_IFACE_CTL1, 0, 230 SOC_ENUM_SINGLE(CS42L52_IFACE_CTL2, 0,
229 ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text); 231 ARRAY_SIZE(mic_bias_level_text), mic_bias_level_text);
230 232
231static const char * const cs42l52_mic_text[] = { "Single", "Differential" }; 233static const char * const cs42l52_mic_text[] = { "Single", "Differential" };
@@ -260,7 +262,7 @@ static const char * const hp_gain_num_text[] = {
260}; 262};
261 263
262static const struct soc_enum hp_gain_enum = 264static const struct soc_enum hp_gain_enum =
263 SOC_ENUM_SINGLE(CS42L52_PB_CTL1, 4, 265 SOC_ENUM_SINGLE(CS42L52_PB_CTL1, 5,
264 ARRAY_SIZE(hp_gain_num_text), hp_gain_num_text); 266 ARRAY_SIZE(hp_gain_num_text), hp_gain_num_text);
265 267
266static const char * const beep_pitch_text[] = { 268static const char * const beep_pitch_text[] = {
@@ -413,7 +415,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
413 SOC_ENUM("Headphone Analog Gain", hp_gain_enum), 415 SOC_ENUM("Headphone Analog Gain", hp_gain_enum),
414 416
415 SOC_DOUBLE_R_SX_TLV("Speaker Volume", CS42L52_SPKA_VOL, 417 SOC_DOUBLE_R_SX_TLV("Speaker Volume", CS42L52_SPKA_VOL,
416 CS42L52_SPKB_VOL, 7, 0x1, 0xff, hl_tlv), 418 CS42L52_SPKB_VOL, 0, 0x1, 0xff, hl_tlv),
417 419
418 SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL, 420 SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL,
419 CS42L52_PASSTHRUB_VOL, 6, 0x18, 0x90, pga_tlv), 421 CS42L52_PASSTHRUB_VOL, 6, 0x18, 0x90, pga_tlv),
@@ -441,7 +443,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
441 443
442 SOC_DOUBLE_R_SX_TLV("PCM Mixer Volume", 444 SOC_DOUBLE_R_SX_TLV("PCM Mixer Volume",
443 CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, 445 CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL,
444 6, 0x7f, 0x19, hl_tlv), 446 0, 0x7f, 0x19, mix_tlv),
445 SOC_DOUBLE_R("PCM Mixer Switch", 447 SOC_DOUBLE_R("PCM Mixer Switch",
446 CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, 7, 1, 1), 448 CS42L52_PCMA_MIXER_VOL, CS42L52_PCMB_MIXER_VOL, 7, 1, 1),
447 449
diff --git a/sound/soc/codecs/cs42l52.h b/sound/soc/codecs/cs42l52.h
index 60985c059071..4277012c4719 100644
--- a/sound/soc/codecs/cs42l52.h
+++ b/sound/soc/codecs/cs42l52.h
@@ -157,7 +157,7 @@
157#define CS42L52_PB_CTL1_INV_PCMA (1 << 2) 157#define CS42L52_PB_CTL1_INV_PCMA (1 << 2)
158#define CS42L52_PB_CTL1_MSTB_MUTE (1 << 1) 158#define CS42L52_PB_CTL1_MSTB_MUTE (1 << 1)
159#define CS42L52_PB_CTL1_MSTA_MUTE (1 << 0) 159#define CS42L52_PB_CTL1_MSTA_MUTE (1 << 0)
160#define CS42L52_PB_CTL1_MUTE_MASK 0xFFFD 160#define CS42L52_PB_CTL1_MUTE_MASK 0x03
161#define CS42L52_PB_CTL1_MUTE 3 161#define CS42L52_PB_CTL1_MUTE 3
162#define CS42L52_PB_CTL1_UNMUTE 0 162#define CS42L52_PB_CTL1_UNMUTE 0
163 163
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index 41230ad1c3e0..4a6f1daf911f 100644
--- a/sound/soc/codecs/da7213.c
+++ b/sound/soc/codecs/da7213.c
@@ -1488,17 +1488,17 @@ static int da7213_probe(struct snd_soc_codec *codec)
1488 DA7213_DMIC_DATA_SEL_SHIFT); 1488 DA7213_DMIC_DATA_SEL_SHIFT);
1489 break; 1489 break;
1490 } 1490 }
1491 switch (pdata->dmic_data_sel) { 1491 switch (pdata->dmic_samplephase) {
1492 case DA7213_DMIC_SAMPLE_ON_CLKEDGE: 1492 case DA7213_DMIC_SAMPLE_ON_CLKEDGE:
1493 case DA7213_DMIC_SAMPLE_BETWEEN_CLKEDGE: 1493 case DA7213_DMIC_SAMPLE_BETWEEN_CLKEDGE:
1494 dmic_cfg |= (pdata->dmic_data_sel << 1494 dmic_cfg |= (pdata->dmic_samplephase <<
1495 DA7213_DMIC_SAMPLEPHASE_SHIFT); 1495 DA7213_DMIC_SAMPLEPHASE_SHIFT);
1496 break; 1496 break;
1497 } 1497 }
1498 switch (pdata->dmic_data_sel) { 1498 switch (pdata->dmic_clk_rate) {
1499 case DA7213_DMIC_CLK_3_0MHZ: 1499 case DA7213_DMIC_CLK_3_0MHZ:
1500 case DA7213_DMIC_CLK_1_5MHZ: 1500 case DA7213_DMIC_CLK_1_5MHZ:
1501 dmic_cfg |= (pdata->dmic_data_sel << 1501 dmic_cfg |= (pdata->dmic_clk_rate <<
1502 DA7213_DMIC_CLK_RATE_SHIFT); 1502 DA7213_DMIC_CLK_RATE_SHIFT);
1503 break; 1503 break;
1504 } 1504 }
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index ce0d36412c97..8d14a76c7249 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2233,7 +2233,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
2233 dev_dbg(codec->dev, "irq = %d\n", max98090->irq); 2233 dev_dbg(codec->dev, "irq = %d\n", max98090->irq);
2234 2234
2235 ret = request_threaded_irq(max98090->irq, NULL, 2235 ret = request_threaded_irq(max98090->irq, NULL,
2236 max98090_interrupt, IRQF_TRIGGER_FALLING, 2236 max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
2237 "max98090_interrupt", codec); 2237 "max98090_interrupt", codec);
2238 if (ret < 0) { 2238 if (ret < 0) {
2239 dev_err(codec->dev, "request_irq failed: %d\n", 2239 dev_err(codec->dev, "request_irq failed: %d\n",
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 65d09d60b7c6..1514bf845e4b 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -187,14 +187,14 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
187 187
188 break; 188 break;
189 } 189 }
190
191 if (found)
192 snd_soc_dapm_sync(widget->dapm);
193 } 190 }
194 191
195 ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
196
197 mutex_unlock(&widget->codec->mutex); 192 mutex_unlock(&widget->codec->mutex);
193
194 if (found)
195 snd_soc_dapm_sync(widget->dapm);
196
197 ret = snd_soc_update_bits_locked(widget->codec, reg, val_mask, val);
198 return ret; 198 return ret;
199} 199}
200 200
diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index 8df2b6e1a1a6..370af0cbcc9a 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -667,6 +667,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
667 /* On wm0010 only the CLKCTRL1 value is used */ 667 /* On wm0010 only the CLKCTRL1 value is used */
668 pll_rec.clkctrl1 = wm0010->pll_clkctrl1; 668 pll_rec.clkctrl1 = wm0010->pll_clkctrl1;
669 669
670 ret = -ENOMEM;
670 len = pll_rec.length + 8; 671 len = pll_rec.length + 8;
671 out = kzalloc(len, GFP_KERNEL); 672 out = kzalloc(len, GFP_KERNEL);
672 if (!out) { 673 if (!out) {
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index e895d3939eef..100fdadda56a 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -1120,7 +1120,8 @@ SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
1120ARIZONA_DSP_WIDGETS(DSP1, "DSP1"), 1120ARIZONA_DSP_WIDGETS(DSP1, "DSP1"),
1121 1121
1122SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1, 1122SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
1123 ARIZONA_AEC_LOOPBACK_ENA, 0, &wm5102_aec_loopback_mux), 1123 ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
1124 &wm5102_aec_loopback_mux),
1124 1125
1125SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM, 1126SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
1126 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev, 1127 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 731884e04776..88ad7db52dde 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -190,7 +190,7 @@ ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE),
190ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE), 190ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE),
191ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE), 191ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE),
192ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE), 192ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE),
193ARIZONA_MIXER_CONTROLS("DSP5R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE), 193ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),
194 194
195ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE), 195ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
196ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE), 196ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),
@@ -503,7 +503,8 @@ SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0,
503 NULL, 0), 503 NULL, 0),
504 504
505SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1, 505SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
506 ARIZONA_AEC_LOOPBACK_ENA, 0, &wm5110_aec_loopback_mux), 506 ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
507 &wm5110_aec_loopback_mux),
507 508
508SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0, 509SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
509 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0), 510 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0),
@@ -976,6 +977,8 @@ static int wm5110_codec_probe(struct snd_soc_codec *codec)
976 if (ret != 0) 977 if (ret != 0)
977 return ret; 978 return ret;
978 979
980 arizona_init_spk(codec);
981
979 snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS"); 982 snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
980 983
981 priv->core.arizona->dapm = &codec->dapm; 984 priv->core.arizona->dapm = &codec->dapm;
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 1eb152cb1097..29e95f93d482 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -383,6 +383,8 @@ static int wm8994_get_drc_enum(struct snd_kcontrol *kcontrol,
383 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 383 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
384 int drc = wm8994_get_drc(kcontrol->id.name); 384 int drc = wm8994_get_drc(kcontrol->id.name);
385 385
386 if (drc < 0)
387 return drc;
386 ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc]; 388 ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc];
387 389
388 return 0; 390 return 0;
@@ -488,6 +490,9 @@ static int wm8994_get_retune_mobile_enum(struct snd_kcontrol *kcontrol,
488 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 490 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
489 int block = wm8994_get_retune_mobile_block(kcontrol->id.name); 491 int block = wm8994_get_retune_mobile_block(kcontrol->id.name);
490 492
493 if (block < 0)
494 return block;
495
491 ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block]; 496 ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block];
492 497
493 return 0; 498 return 0;
@@ -1031,7 +1036,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w,
1031{ 1036{
1032 struct snd_soc_codec *codec = w->codec; 1037 struct snd_soc_codec *codec = w->codec;
1033 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1038 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
1034 struct wm8994 *control = codec->control_data; 1039 struct wm8994 *control = wm8994->wm8994;
1035 int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; 1040 int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
1036 int i; 1041 int i;
1037 int dac; 1042 int dac;
@@ -3831,8 +3836,14 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data)
3831 ret); 3836 ret);
3832 } else if (!(ret & WM1811_JACKDET_LVL)) { 3837 } else if (!(ret & WM1811_JACKDET_LVL)) {
3833 dev_dbg(codec->dev, "Ignoring removed jack\n"); 3838 dev_dbg(codec->dev, "Ignoring removed jack\n");
3834 return IRQ_HANDLED; 3839 goto out;
3835 } 3840 }
3841 } else if (!(reg & WM8958_MICD_STS)) {
3842 snd_soc_jack_report(wm8994->micdet[0].jack, 0,
3843 SND_JACK_MECHANICAL | SND_JACK_HEADSET |
3844 wm8994->btn_mask);
3845 wm8994->mic_detecting = true;
3846 goto out;
3836 } 3847 }
3837 3848
3838 if (wm8994->mic_detecting) 3849 if (wm8994->mic_detecting)
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 56ecfc72f2e9..81490febac6d 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -631,7 +631,8 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
631 int word_length) 631 int word_length)
632{ 632{
633 u32 fmt; 633 u32 fmt;
634 u32 rotate = (word_length / 4) & 0x7; 634 u32 tx_rotate = (word_length / 4) & 0x7;
635 u32 rx_rotate = (32 - word_length) / 4;
635 u32 mask = (1ULL << word_length) - 1; 636 u32 mask = (1ULL << word_length) - 1;
636 637
637 /* 638 /*
@@ -655,9 +656,9 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
655 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, 656 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
656 TXSSZ(fmt), TXSSZ(0x0F)); 657 TXSSZ(fmt), TXSSZ(0x0F));
657 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, 658 mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
658 TXROT(rotate), TXROT(7)); 659 TXROT(tx_rotate), TXROT(7));
659 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, 660 mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
660 RXROT(rotate), RXROT(7)); 661 RXROT(rx_rotate), RXROT(7));
661 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, 662 mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG,
662 mask); 663 mask);
663 } 664 }
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 902fab02b851..c6fa03e2114a 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -540,11 +540,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
540 clk_prepare_enable(ssi->clk); 540 clk_prepare_enable(ssi->clk);
541 541
542 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 542 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
543 if (!res) {
544 ret = -ENODEV;
545 goto failed_get_resource;
546 }
547
548 ssi->base = devm_ioremap_resource(&pdev->dev, res); 543 ssi->base = devm_ioremap_resource(&pdev->dev, res);
549 if (IS_ERR(ssi->base)) { 544 if (IS_ERR(ssi->base)) {
550 ret = PTR_ERR(ssi->base); 545 ret = PTR_ERR(ssi->base);
@@ -633,7 +628,6 @@ failed_pdev_fiq_alloc:
633 snd_soc_unregister_component(&pdev->dev); 628 snd_soc_unregister_component(&pdev->dev);
634failed_register: 629failed_register:
635 release_mem_region(res->start, resource_size(res)); 630 release_mem_region(res->start, resource_size(res));
636failed_get_resource:
637 clk_disable_unprepare(ssi->clk); 631 clk_disable_unprepare(ssi->clk);
638failed_clk: 632failed_clk:
639 633
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index befe68f59285..4c9dad3263c5 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -471,11 +471,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
471 dev_set_drvdata(&pdev->dev, priv); 471 dev_set_drvdata(&pdev->dev, priv);
472 472
473 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 473 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
474 if (!mem) {
475 dev_err(&pdev->dev, "platform_get_resource failed\n");
476 return -ENXIO;
477 }
478
479 priv->io = devm_ioremap_resource(&pdev->dev, mem); 474 priv->io = devm_ioremap_resource(&pdev->dev, mem);
480 if (IS_ERR(priv->io)) 475 if (IS_ERR(priv->io))
481 return PTR_ERR(priv->io); 476 return PTR_ERR(priv->io);
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 3853f7eb3f28..06a8000aa07b 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -220,8 +220,12 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream,
220 goto err; 220 goto err;
221 } 221 }
222 222
223 snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK, 223 if (cstream->direction == SND_COMPRESS_PLAYBACK)
224 SND_SOC_DAPM_STREAM_START); 224 snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK,
225 SND_SOC_DAPM_STREAM_START);
226 else
227 snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_CAPTURE,
228 SND_SOC_DAPM_STREAM_START);
225 229
226 /* cancel any delayed stream shutdown that is pending */ 230 /* cancel any delayed stream shutdown that is pending */
227 rtd->pop_wait = 0; 231 rtd->pop_wait = 0;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a80c883bb8be..c7051c457b75 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -55,7 +55,8 @@ static int dapm_up_seq[] = {
55 [snd_soc_dapm_clock_supply] = 1, 55 [snd_soc_dapm_clock_supply] = 1,
56 [snd_soc_dapm_micbias] = 2, 56 [snd_soc_dapm_micbias] = 2,
57 [snd_soc_dapm_dai_link] = 2, 57 [snd_soc_dapm_dai_link] = 2,
58 [snd_soc_dapm_dai] = 3, 58 [snd_soc_dapm_dai_in] = 3,
59 [snd_soc_dapm_dai_out] = 3,
59 [snd_soc_dapm_aif_in] = 3, 60 [snd_soc_dapm_aif_in] = 3,
60 [snd_soc_dapm_aif_out] = 3, 61 [snd_soc_dapm_aif_out] = 3,
61 [snd_soc_dapm_mic] = 4, 62 [snd_soc_dapm_mic] = 4,
@@ -92,7 +93,8 @@ static int dapm_down_seq[] = {
92 [snd_soc_dapm_value_mux] = 9, 93 [snd_soc_dapm_value_mux] = 9,
93 [snd_soc_dapm_aif_in] = 10, 94 [snd_soc_dapm_aif_in] = 10,
94 [snd_soc_dapm_aif_out] = 10, 95 [snd_soc_dapm_aif_out] = 10,
95 [snd_soc_dapm_dai] = 10, 96 [snd_soc_dapm_dai_in] = 10,
97 [snd_soc_dapm_dai_out] = 10,
96 [snd_soc_dapm_dai_link] = 11, 98 [snd_soc_dapm_dai_link] = 11,
97 [snd_soc_dapm_clock_supply] = 12, 99 [snd_soc_dapm_clock_supply] = 12,
98 [snd_soc_dapm_regulator_supply] = 12, 100 [snd_soc_dapm_regulator_supply] = 12,
@@ -419,7 +421,8 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
419 case snd_soc_dapm_clock_supply: 421 case snd_soc_dapm_clock_supply:
420 case snd_soc_dapm_aif_in: 422 case snd_soc_dapm_aif_in:
421 case snd_soc_dapm_aif_out: 423 case snd_soc_dapm_aif_out:
422 case snd_soc_dapm_dai: 424 case snd_soc_dapm_dai_in:
425 case snd_soc_dapm_dai_out:
423 case snd_soc_dapm_hp: 426 case snd_soc_dapm_hp:
424 case snd_soc_dapm_mic: 427 case snd_soc_dapm_mic:
425 case snd_soc_dapm_spk: 428 case snd_soc_dapm_spk:
@@ -820,7 +823,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
820 switch (widget->id) { 823 switch (widget->id) {
821 case snd_soc_dapm_adc: 824 case snd_soc_dapm_adc:
822 case snd_soc_dapm_aif_out: 825 case snd_soc_dapm_aif_out:
823 case snd_soc_dapm_dai: 826 case snd_soc_dapm_dai_out:
824 if (widget->active) { 827 if (widget->active) {
825 widget->outputs = snd_soc_dapm_suspend_check(widget); 828 widget->outputs = snd_soc_dapm_suspend_check(widget);
826 return widget->outputs; 829 return widget->outputs;
@@ -916,7 +919,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
916 switch (widget->id) { 919 switch (widget->id) {
917 case snd_soc_dapm_dac: 920 case snd_soc_dapm_dac:
918 case snd_soc_dapm_aif_in: 921 case snd_soc_dapm_aif_in:
919 case snd_soc_dapm_dai: 922 case snd_soc_dapm_dai_in:
920 if (widget->active) { 923 if (widget->active) {
921 widget->inputs = snd_soc_dapm_suspend_check(widget); 924 widget->inputs = snd_soc_dapm_suspend_check(widget);
922 return widget->inputs; 925 return widget->inputs;
@@ -1135,16 +1138,6 @@ static int dapm_generic_check_power(struct snd_soc_dapm_widget *w)
1135 return out != 0 && in != 0; 1138 return out != 0 && in != 0;
1136} 1139}
1137 1140
1138static int dapm_dai_check_power(struct snd_soc_dapm_widget *w)
1139{
1140 DAPM_UPDATE_STAT(w, power_checks);
1141
1142 if (w->active)
1143 return w->active;
1144
1145 return dapm_generic_check_power(w);
1146}
1147
1148/* Check to see if an ADC has power */ 1141/* Check to see if an ADC has power */
1149static int dapm_adc_check_power(struct snd_soc_dapm_widget *w) 1142static int dapm_adc_check_power(struct snd_soc_dapm_widget *w)
1150{ 1143{
@@ -2318,7 +2311,8 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
2318 case snd_soc_dapm_clock_supply: 2311 case snd_soc_dapm_clock_supply:
2319 case snd_soc_dapm_aif_in: 2312 case snd_soc_dapm_aif_in:
2320 case snd_soc_dapm_aif_out: 2313 case snd_soc_dapm_aif_out:
2321 case snd_soc_dapm_dai: 2314 case snd_soc_dapm_dai_in:
2315 case snd_soc_dapm_dai_out:
2322 case snd_soc_dapm_dai_link: 2316 case snd_soc_dapm_dai_link:
2323 list_add(&path->list, &dapm->card->paths); 2317 list_add(&path->list, &dapm->card->paths);
2324 list_add(&path->list_sink, &wsink->sources); 2318 list_add(&path->list_sink, &wsink->sources);
@@ -3129,10 +3123,12 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3129 break; 3123 break;
3130 case snd_soc_dapm_adc: 3124 case snd_soc_dapm_adc:
3131 case snd_soc_dapm_aif_out: 3125 case snd_soc_dapm_aif_out:
3126 case snd_soc_dapm_dai_out:
3132 w->power_check = dapm_adc_check_power; 3127 w->power_check = dapm_adc_check_power;
3133 break; 3128 break;
3134 case snd_soc_dapm_dac: 3129 case snd_soc_dapm_dac:
3135 case snd_soc_dapm_aif_in: 3130 case snd_soc_dapm_aif_in:
3131 case snd_soc_dapm_dai_in:
3136 w->power_check = dapm_dac_check_power; 3132 w->power_check = dapm_dac_check_power;
3137 break; 3133 break;
3138 case snd_soc_dapm_pga: 3134 case snd_soc_dapm_pga:
@@ -3152,9 +3148,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3152 case snd_soc_dapm_clock_supply: 3148 case snd_soc_dapm_clock_supply:
3153 w->power_check = dapm_supply_check_power; 3149 w->power_check = dapm_supply_check_power;
3154 break; 3150 break;
3155 case snd_soc_dapm_dai:
3156 w->power_check = dapm_dai_check_power;
3157 break;
3158 default: 3151 default:
3159 w->power_check = dapm_always_on_check_power; 3152 w->power_check = dapm_always_on_check_power;
3160 break; 3153 break;
@@ -3375,7 +3368,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
3375 template.reg = SND_SOC_NOPM; 3368 template.reg = SND_SOC_NOPM;
3376 3369
3377 if (dai->driver->playback.stream_name) { 3370 if (dai->driver->playback.stream_name) {
3378 template.id = snd_soc_dapm_dai; 3371 template.id = snd_soc_dapm_dai_in;
3379 template.name = dai->driver->playback.stream_name; 3372 template.name = dai->driver->playback.stream_name;
3380 template.sname = dai->driver->playback.stream_name; 3373 template.sname = dai->driver->playback.stream_name;
3381 3374
@@ -3393,7 +3386,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
3393 } 3386 }
3394 3387
3395 if (dai->driver->capture.stream_name) { 3388 if (dai->driver->capture.stream_name) {
3396 template.id = snd_soc_dapm_dai; 3389 template.id = snd_soc_dapm_dai_out;
3397 template.name = dai->driver->capture.stream_name; 3390 template.name = dai->driver->capture.stream_name;
3398 template.sname = dai->driver->capture.stream_name; 3391 template.sname = dai->driver->capture.stream_name;
3399 3392
@@ -3423,8 +3416,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
3423 3416
3424 /* For each DAI widget... */ 3417 /* For each DAI widget... */
3425 list_for_each_entry(dai_w, &card->widgets, list) { 3418 list_for_each_entry(dai_w, &card->widgets, list) {
3426 if (dai_w->id != snd_soc_dapm_dai) 3419 switch (dai_w->id) {
3420 case snd_soc_dapm_dai_in:
3421 case snd_soc_dapm_dai_out:
3422 break;
3423 default:
3427 continue; 3424 continue;
3425 }
3428 3426
3429 dai = dai_w->priv; 3427 dai = dai_w->priv;
3430 3428
@@ -3433,8 +3431,13 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
3433 if (w->dapm != dai_w->dapm) 3431 if (w->dapm != dai_w->dapm)
3434 continue; 3432 continue;
3435 3433
3436 if (w->id == snd_soc_dapm_dai) 3434 switch (w->id) {
3435 case snd_soc_dapm_dai_in:
3436 case snd_soc_dapm_dai_out:
3437 continue; 3437 continue;
3438 default:
3439 break;
3440 }
3438 3441
3439 if (!w->sname) 3442 if (!w->sname)
3440 continue; 3443 continue;
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 73bb8eefa491..ccb6be4d658d 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -928,8 +928,13 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
928 /* Create any new FE <--> BE connections */ 928 /* Create any new FE <--> BE connections */
929 for (i = 0; i < list->num_widgets; i++) { 929 for (i = 0; i < list->num_widgets; i++) {
930 930
931 if (list->widgets[i]->id != snd_soc_dapm_dai) 931 switch (list->widgets[i]->id) {
932 case snd_soc_dapm_dai_in:
933 case snd_soc_dapm_dai_out:
934 break;
935 default:
932 continue; 936 continue;
937 }
933 938
934 /* is there a valid BE rtd for this widget */ 939 /* is there a valid BE rtd for this widget */
935 be = dpcm_get_be(card, list->widgets[i], stream); 940 be = dpcm_get_be(card, list->widgets[i], stream);
@@ -2011,9 +2016,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
2011 if (cpu_dai->driver->capture.channels_min) 2016 if (cpu_dai->driver->capture.channels_min)
2012 capture = 1; 2017 capture = 1;
2013 } else { 2018 } else {
2014 if (codec_dai->driver->playback.channels_min) 2019 if (codec_dai->driver->playback.channels_min &&
2020 cpu_dai->driver->playback.channels_min)
2015 playback = 1; 2021 playback = 1;
2016 if (codec_dai->driver->capture.channels_min) 2022 if (codec_dai->driver->capture.channels_min &&
2023 cpu_dai->driver->capture.channels_min)
2017 capture = 1; 2024 capture = 1;
2018 } 2025 }
2019 2026
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
index a1d9b0792a1e..b9defcdeb7ef 100644
--- a/sound/usb/6fire/firmware.c
+++ b/sound/usb/6fire/firmware.c
@@ -42,8 +42,8 @@ static const u8 ep_w_max_packet_size[] = {
42 0x94, 0x01, 0x5c, 0x02 /* alt 3: 404 EP2 and 604 EP6 (25 fpp) */ 42 0x94, 0x01, 0x5c, 0x02 /* alt 3: 404 EP2 and 604 EP6 (25 fpp) */
43}; 43};
44 44
45static const u8 known_fw_versions[][4] = { 45static const u8 known_fw_versions[][2] = {
46 { 0x03, 0x01, 0x0b, 0x00 } 46 { 0x03, 0x01 }
47}; 47};
48 48
49struct ihex_record { 49struct ihex_record {
@@ -343,7 +343,7 @@ static int usb6fire_fw_check(u8 *version)
343 int i; 343 int i;
344 344
345 for (i = 0; i < ARRAY_SIZE(known_fw_versions); i++) 345 for (i = 0; i < ARRAY_SIZE(known_fw_versions); i++)
346 if (!memcmp(version, known_fw_versions + i, 4)) 346 if (!memcmp(version, known_fw_versions + i, 2))
347 return 0; 347 return 0;
348 348
349 snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. " 349 snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 1a033177b83f..64952e2d3ed1 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -147,14 +147,32 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int
147 return -EINVAL; 147 return -EINVAL;
148 } 148 }
149 149
150 alts = &iface->altsetting[0];
151 altsd = get_iface_desc(alts);
152
153 /*
154 * Android with both accessory and audio interfaces enabled gets the
155 * interface numbers wrong.
156 */
157 if ((chip->usb_id == USB_ID(0x18d1, 0x2d04) ||
158 chip->usb_id == USB_ID(0x18d1, 0x2d05)) &&
159 interface == 0 &&
160 altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
161 altsd->bInterfaceSubClass == USB_SUBCLASS_VENDOR_SPEC) {
162 interface = 2;
163 iface = usb_ifnum_to_if(dev, interface);
164 if (!iface)
165 return -EINVAL;
166 alts = &iface->altsetting[0];
167 altsd = get_iface_desc(alts);
168 }
169
150 if (usb_interface_claimed(iface)) { 170 if (usb_interface_claimed(iface)) {
151 snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n", 171 snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n",
152 dev->devnum, ctrlif, interface); 172 dev->devnum, ctrlif, interface);
153 return -EINVAL; 173 return -EINVAL;
154 } 174 }
155 175
156 alts = &iface->altsetting[0];
157 altsd = get_iface_desc(alts);
158 if ((altsd->bInterfaceClass == USB_CLASS_AUDIO || 176 if ((altsd->bInterfaceClass == USB_CLASS_AUDIO ||
159 altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) && 177 altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) &&
160 altsd->bInterfaceSubClass == USB_SUBCLASS_MIDISTREAMING) { 178 altsd->bInterfaceSubClass == USB_SUBCLASS_MIDISTREAMING) {
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ca4739c3f650..d5438083fd6a 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -885,7 +885,9 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
885 885
886 case USB_ID(0x046d, 0x0808): 886 case USB_ID(0x046d, 0x0808):
887 case USB_ID(0x046d, 0x0809): 887 case USB_ID(0x046d, 0x0809):
888 case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */
888 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ 889 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */
890 case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */
889 case USB_ID(0x046d, 0x0991): 891 case USB_ID(0x046d, 0x0991):
890 /* Most audio usb devices lie about volume resolution. 892 /* Most audio usb devices lie about volume resolution.
891 * Most Logitech webcams have res = 384. 893 * Most Logitech webcams have res = 384.
diff --git a/sound/usb/proc.c b/sound/usb/proc.c
index 135c76871063..5f761ab34c01 100644
--- a/sound/usb/proc.c
+++ b/sound/usb/proc.c
@@ -116,21 +116,22 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s
116} 116}
117 117
118static void proc_dump_ep_status(struct snd_usb_substream *subs, 118static void proc_dump_ep_status(struct snd_usb_substream *subs,
119 struct snd_usb_endpoint *ep, 119 struct snd_usb_endpoint *data_ep,
120 struct snd_usb_endpoint *sync_ep,
120 struct snd_info_buffer *buffer) 121 struct snd_info_buffer *buffer)
121{ 122{
122 if (!ep) 123 if (!data_ep)
123 return; 124 return;
124 snd_iprintf(buffer, " Packet Size = %d\n", ep->curpacksize); 125 snd_iprintf(buffer, " Packet Size = %d\n", data_ep->curpacksize);
125 snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n", 126 snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n",
126 subs->speed == USB_SPEED_FULL 127 subs->speed == USB_SPEED_FULL
127 ? get_full_speed_hz(ep->freqm) 128 ? get_full_speed_hz(data_ep->freqm)
128 : get_high_speed_hz(ep->freqm), 129 : get_high_speed_hz(data_ep->freqm),
129 ep->freqm >> 16, ep->freqm & 0xffff); 130 data_ep->freqm >> 16, data_ep->freqm & 0xffff);
130 if (ep->freqshift != INT_MIN) { 131 if (sync_ep && data_ep->freqshift != INT_MIN) {
131 int res = 16 - ep->freqshift; 132 int res = 16 - data_ep->freqshift;
132 snd_iprintf(buffer, " Feedback Format = %d.%d\n", 133 snd_iprintf(buffer, " Feedback Format = %d.%d\n",
133 (ep->syncmaxsize > 3 ? 32 : 24) - res, res); 134 (sync_ep->syncmaxsize > 3 ? 32 : 24) - res, res);
134 } 135 }
135} 136}
136 137
@@ -140,8 +141,7 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn
140 snd_iprintf(buffer, " Status: Running\n"); 141 snd_iprintf(buffer, " Status: Running\n");
141 snd_iprintf(buffer, " Interface = %d\n", subs->interface); 142 snd_iprintf(buffer, " Interface = %d\n", subs->interface);
142 snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx); 143 snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx);
143 proc_dump_ep_status(subs, subs->data_endpoint, buffer); 144 proc_dump_ep_status(subs, subs->data_endpoint, subs->sync_endpoint, buffer);
144 proc_dump_ep_status(subs, subs->sync_endpoint, buffer);
145 } else { 145 } else {
146 snd_iprintf(buffer, " Status: Stop\n"); 146 snd_iprintf(buffer, " Status: Stop\n");
147 } 147 }
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index 7f1722f82c89..8b75bcf136f6 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -215,7 +215,13 @@
215 .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL 215 .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
216}, 216},
217{ 217{
218 USB_DEVICE(0x046d, 0x0990), 218 .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
219 USB_DEVICE_ID_MATCH_INT_CLASS |
220 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
221 .idVendor = 0x046d,
222 .idProduct = 0x0990,
223 .bInterfaceClass = USB_CLASS_AUDIO,
224 .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
219 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 225 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
220 .vendor_name = "Logitech, Inc.", 226 .vendor_name = "Logitech, Inc.",
221 .product_name = "QuickCam Pro 9000", 227 .product_name = "QuickCam Pro 9000",
@@ -1792,7 +1798,11 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1792 USB_DEVICE_VENDOR_SPEC(0x0582, 0x0108), 1798 USB_DEVICE_VENDOR_SPEC(0x0582, 0x0108),
1793 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1799 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1794 .ifnum = 0, 1800 .ifnum = 0,
1795 .type = QUIRK_MIDI_STANDARD_INTERFACE 1801 .type = QUIRK_MIDI_FIXED_ENDPOINT,
1802 .data = & (const struct snd_usb_midi_endpoint_info) {
1803 .out_cables = 0x0007,
1804 .in_cables = 0x0007
1805 }
1796 } 1806 }
1797}, 1807},
1798{ 1808{