aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:50:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-16 15:50:53 -0500
commit73d75ba99e3bdd627275afd3fe48cc933723084b (patch)
tree8923aa413662c6eee1f36b473b211aab52474ec2 /sound
parent71f777ed50e9109c235c14604d5e23d2f8e7453c (diff)
parentabfe69dd2e313d0c8226ca4a12329e3d829cfd7c (diff)
Merge tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Two peaks in diffstat are for the audio EQ init of IDT codecs and the EMU2004 usb mixer addition, both of which are pretty device-specific, so safe to apply. The rest are a bunch of small fixes, most of them are regression fixes" * tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits) ALSA: hda - load EQ params into IDT codec on HP bNB13 systems ASoC: cs42l52: Correct MIC CTL mask ASoC: wm8962: Turn on regcache_cache_only before disabling regulator ALSA: jack: Unregister input device at disconnection ALSA: pcsp: Fix the order of input device unregistration ASoC: fsl: imx-pcm-fiq: omit fiq counter to avoid harm in unbalanced situations ASoC: blackfin: Fix missing break ALSA: usb-audio: add front jack channel selector for EMU0204 ALSA: hda - Don't clear the power state at snd_hda_codec_reset() ASoC: arizona: Fix typo in name of EQ coefficient controls ALSA: hda - Control EAPD for Master volume on Lenovo N100 ALSA: hda - Don't turn off EAPD for headphone on Lenovo N100 ALSA: isa: not allocating enough space ALSA: snd-aoa: two copy and paste bugs ASoC: wm8997: Correct typo in ISRC mux routes ALSA: hda - Check keep_eapd_on before inv_eapd ALSA: hda - Fix Line Out automute on Realtek multifunction jacks ALSA: msnd: Avoid duplicated driver name ALSA: compress_core: don't return -EBADFD from poll if paused ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD ...
Diffstat (limited to 'sound')
-rw-r--r--sound/aoa/fabrics/layout.c4
-rw-r--r--sound/core/compress_offload.c3
-rw-r--r--sound/core/jack.c19
-rw-r--r--sound/drivers/pcsp/pcsp.c2
-rw-r--r--sound/isa/msnd/msnd_pinnacle.c4
-rw-r--r--sound/isa/wavefront/wavefront_synth.c2
-rw-r--r--sound/pci/hda/hda_codec.c3
-rw-r--r--sound/pci/hda/hda_eld.c37
-rw-r--r--sound/pci/hda/hda_generic.c4
-rw-r--r--sound/pci/hda/patch_analog.c33
-rw-r--r--sound/pci/hda/patch_cirrus.c56
-rw-r--r--sound/pci/hda/patch_hdmi.c11
-rw-r--r--sound/pci/hda/patch_realtek.c4
-rw-r--r--sound/pci/hda/patch_sigmatel.c532
-rw-r--r--sound/soc/blackfin/bf5xx-i2s.c1
-rw-r--r--sound/soc/codecs/cs42l52.h2
-rw-r--r--sound/soc/codecs/wm5102.c8
-rw-r--r--sound/soc/codecs/wm5110.c8
-rw-r--r--sound/soc/codecs/wm8962.c2
-rw-r--r--sound/soc/codecs/wm8997.c10
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c29
-rw-r--r--sound/sparc/cs4231.c11
-rw-r--r--sound/usb/mixer_quirks.c90
-rw-r--r--sound/usb/stream.c4
24 files changed, 803 insertions, 76 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
index 61ab640e195f..9dc5806d23dd 100644
--- a/sound/aoa/fabrics/layout.c
+++ b/sound/aoa/fabrics/layout.c
@@ -644,7 +644,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \
644 struct snd_ctl_elem_value *ucontrol) \ 644 struct snd_ctl_elem_value *ucontrol) \
645{ \ 645{ \
646 struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol); \ 646 struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol); \
647 if (gpio->methods && gpio->methods->get_##n) \ 647 if (gpio->methods && gpio->methods->set_##n) \
648 gpio->methods->set_##n(gpio, \ 648 gpio->methods->set_##n(gpio, \
649 !!ucontrol->value.integer.value[0]); \ 649 !!ucontrol->value.integer.value[0]); \
650 return 1; \ 650 return 1; \
@@ -1135,7 +1135,7 @@ static int aoa_fabric_layout_resume(struct soundbus_dev *sdev)
1135{ 1135{
1136 struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); 1136 struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev);
1137 1137
1138 if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off) 1138 if (ldev->gpio.methods && ldev->gpio.methods->all_amps_restore)
1139 ldev->gpio.methods->all_amps_restore(&ldev->gpio); 1139 ldev->gpio.methods->all_amps_restore(&ldev->gpio);
1140 1140
1141 return 0; 1141 return 0;
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index d9af6387f37c..9d518ac73eea 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -384,8 +384,7 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
384 return -EFAULT; 384 return -EFAULT;
385 385
386 mutex_lock(&stream->device->lock); 386 mutex_lock(&stream->device->lock);
387 if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED || 387 if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
388 stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
389 retval = -EBADFD; 388 retval = -EBADFD;
390 goto out; 389 goto out;
391 } 390 }
diff --git a/sound/core/jack.c b/sound/core/jack.c
index b35fe7345c20..8658578eb584 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -34,12 +34,12 @@ static int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
34 SW_LINEIN_INSERT, 34 SW_LINEIN_INSERT,
35}; 35};
36 36
37static int snd_jack_dev_free(struct snd_device *device) 37static int snd_jack_dev_disconnect(struct snd_device *device)
38{ 38{
39 struct snd_jack *jack = device->device_data; 39 struct snd_jack *jack = device->device_data;
40 40
41 if (jack->private_free) 41 if (!jack->input_dev)
42 jack->private_free(jack); 42 return 0;
43 43
44 /* If the input device is registered with the input subsystem 44 /* If the input device is registered with the input subsystem
45 * then we need to use a different deallocator. */ 45 * then we need to use a different deallocator. */
@@ -47,6 +47,18 @@ static int snd_jack_dev_free(struct snd_device *device)
47 input_unregister_device(jack->input_dev); 47 input_unregister_device(jack->input_dev);
48 else 48 else
49 input_free_device(jack->input_dev); 49 input_free_device(jack->input_dev);
50 jack->input_dev = NULL;
51 return 0;
52}
53
54static int snd_jack_dev_free(struct snd_device *device)
55{
56 struct snd_jack *jack = device->device_data;
57
58 if (jack->private_free)
59 jack->private_free(jack);
60
61 snd_jack_dev_disconnect(device);
50 62
51 kfree(jack->id); 63 kfree(jack->id);
52 kfree(jack); 64 kfree(jack);
@@ -110,6 +122,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
110 static struct snd_device_ops ops = { 122 static struct snd_device_ops ops = {
111 .dev_free = snd_jack_dev_free, 123 .dev_free = snd_jack_dev_free,
112 .dev_register = snd_jack_dev_register, 124 .dev_register = snd_jack_dev_register,
125 .dev_disconnect = snd_jack_dev_disconnect,
113 }; 126 };
114 127
115 jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL); 128 jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL);
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index f664bae3b9b0..328bd29264ce 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -188,8 +188,8 @@ static int pcsp_probe(struct platform_device *dev)
188static int pcsp_remove(struct platform_device *dev) 188static int pcsp_remove(struct platform_device *dev)
189{ 189{
190 struct snd_pcsp *chip = platform_get_drvdata(dev); 190 struct snd_pcsp *chip = platform_get_drvdata(dev);
191 alsa_card_pcsp_exit(chip);
192 pcspkr_input_remove(chip->input_dev); 191 pcspkr_input_remove(chip->input_dev);
192 alsa_card_pcsp_exit(chip);
193 return 0; 193 return 0;
194} 194}
195 195
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c
index 81aeb934261a..0a90bd6ae232 100644
--- a/sound/isa/msnd/msnd_pinnacle.c
+++ b/sound/isa/msnd/msnd_pinnacle.c
@@ -73,9 +73,11 @@
73#ifdef MSND_CLASSIC 73#ifdef MSND_CLASSIC
74# include "msnd_classic.h" 74# include "msnd_classic.h"
75# define LOGNAME "msnd_classic" 75# define LOGNAME "msnd_classic"
76# define DEV_NAME "msnd-classic"
76#else 77#else
77# include "msnd_pinnacle.h" 78# include "msnd_pinnacle.h"
78# define LOGNAME "snd_msnd_pinnacle" 79# define LOGNAME "snd_msnd_pinnacle"
80# define DEV_NAME "msnd-pinnacle"
79#endif 81#endif
80 82
81static void set_default_audio_parameters(struct snd_msnd *chip) 83static void set_default_audio_parameters(struct snd_msnd *chip)
@@ -1067,8 +1069,6 @@ static int snd_msnd_isa_remove(struct device *pdev, unsigned int dev)
1067 return 0; 1069 return 0;
1068} 1070}
1069 1071
1070#define DEV_NAME "msnd-pinnacle"
1071
1072static struct isa_driver snd_msnd_driver = { 1072static struct isa_driver snd_msnd_driver = {
1073 .match = snd_msnd_isa_match, 1073 .match = snd_msnd_isa_match,
1074 .probe = snd_msnd_isa_probe, 1074 .probe = snd_msnd_isa_probe,
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index a2f87f9488ee..e5db001363ee 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -1196,7 +1196,7 @@ wavefront_send_multisample (snd_wavefront_t *dev, wavefront_patch_info *header)
1196 int num_samples; 1196 int num_samples;
1197 unsigned char *msample_hdr; 1197 unsigned char *msample_hdr;
1198 1198
1199 msample_hdr = kmalloc(sizeof(WF_MSAMPLE_BYTES), GFP_KERNEL); 1199 msample_hdr = kmalloc(WF_MSAMPLE_BYTES, GFP_KERNEL);
1200 if (! msample_hdr) 1200 if (! msample_hdr)
1201 return -ENOMEM; 1201 return -ENOMEM;
1202 1202
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index dd5403d40830..afb90f48867f 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2579,9 +2579,6 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2579 cancel_delayed_work_sync(&codec->jackpoll_work); 2579 cancel_delayed_work_sync(&codec->jackpoll_work);
2580#ifdef CONFIG_PM 2580#ifdef CONFIG_PM
2581 cancel_delayed_work_sync(&codec->power_work); 2581 cancel_delayed_work_sync(&codec->power_work);
2582 codec->power_on = 0;
2583 codec->power_transition = 0;
2584 codec->power_jiffies = jiffies;
2585 flush_workqueue(bus->workq); 2582 flush_workqueue(bus->workq);
2586#endif 2583#endif
2587 snd_hda_ctls_clear(codec); 2584 snd_hda_ctls_clear(codec);
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 32d3e3855a6e..79ca80f6c77a 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -680,7 +680,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
680 680
681 spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0); 681 spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0);
682 682
683 if (!spkalloc) { 683 if (spkalloc <= 0) {
684 snd_printd(KERN_INFO "HDMI ATI/AMD: no speaker allocation for ELD\n"); 684 snd_printd(KERN_INFO "HDMI ATI/AMD: no speaker allocation for ELD\n");
685 return -EINVAL; 685 return -EINVAL;
686 } 686 }
@@ -742,6 +742,9 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
742 snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_AUDIO_DESCRIPTOR, i << 3); 742 snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_AUDIO_DESCRIPTOR, i << 3);
743 ati_sad = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_DESCRIPTOR, 0); 743 ati_sad = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_DESCRIPTOR, 0);
744 744
745 if (ati_sad <= 0)
746 continue;
747
745 if (ati_sad & ATI_AUDIODESC_RATES) { 748 if (ati_sad & ATI_AUDIODESC_RATES) {
746 /* format is supported, copy SAD as-is */ 749 /* format is supported, copy SAD as-is */
747 buf[pos++] = (ati_sad & 0x0000ff) >> 0; 750 buf[pos++] = (ati_sad & 0x0000ff) >> 0;
@@ -765,21 +768,39 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
765 return -EINVAL; 768 return -EINVAL;
766 } 769 }
767 770
771 /*
772 * HDMI VSDB latency format:
773 * separately for both audio and video:
774 * 0 field not valid or unknown latency
775 * [1..251] msecs = (x-1)*2 (max 500ms with x = 251 = 0xfb)
776 * 255 audio/video not supported
777 *
778 * HDA latency format:
779 * single value indicating video latency relative to audio:
780 * 0 unknown or 0ms
781 * [1..250] msecs = x*2 (max 500ms with x = 250 = 0xfa)
782 * [251..255] reserved
783 */
768 aud_synch = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_VIDEO_DELAY, 0); 784 aud_synch = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_VIDEO_DELAY, 0);
769 if ((aud_synch & ATI_DELAY_VIDEO_LATENCY) && (aud_synch & ATI_DELAY_AUDIO_LATENCY)) { 785 if ((aud_synch & ATI_DELAY_VIDEO_LATENCY) && (aud_synch & ATI_DELAY_AUDIO_LATENCY)) {
770 int video_latency = (aud_synch & ATI_DELAY_VIDEO_LATENCY) - 1; 786 int video_latency_hdmi = (aud_synch & ATI_DELAY_VIDEO_LATENCY);
771 int audio_latency = ((aud_synch & ATI_DELAY_AUDIO_LATENCY) >> 8) - 1; 787 int audio_latency_hdmi = (aud_synch & ATI_DELAY_AUDIO_LATENCY) >> 8;
772 788
773 if (video_latency > audio_latency) 789 if (video_latency_hdmi <= 0xfb && audio_latency_hdmi <= 0xfb &&
774 buf[6] = min(video_latency - audio_latency, 0xfa); 790 video_latency_hdmi > audio_latency_hdmi)
791 buf[6] = video_latency_hdmi - audio_latency_hdmi;
792 /* else unknown/invalid or 0ms or video ahead of audio, so use zero */
775 } 793 }
776 794
777 /* Baseline length */
778 buf[2] = pos - 4;
779
780 /* SAD count */ 795 /* SAD count */
781 buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4; 796 buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4;
782 797
798 /* Baseline ELD block length is 4-byte aligned */
799 pos = round_up(pos, 4);
800
801 /* Baseline ELD length (4-byte header is not counted in) */
802 buf[2] = (pos - 4) / 4;
803
783 *eld_size = pos; 804 *eld_size = pos;
784 805
785 return 0; 806 return 0;
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 276f6e759bac..3067ed4fe3b2 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -796,10 +796,10 @@ static void set_pin_eapd(struct hda_codec *codec, hda_nid_t pin, bool enable)
796 if (spec->own_eapd_ctl || 796 if (spec->own_eapd_ctl ||
797 !(snd_hda_query_pin_caps(codec, pin) & AC_PINCAP_EAPD)) 797 !(snd_hda_query_pin_caps(codec, pin) & AC_PINCAP_EAPD))
798 return; 798 return;
799 if (codec->inv_eapd)
800 enable = !enable;
801 if (spec->keep_eapd_on && !enable) 799 if (spec->keep_eapd_on && !enable)
802 return; 800 return;
801 if (codec->inv_eapd)
802 enable = !enable;
803 snd_hda_codec_update_cache(codec, pin, 0, 803 snd_hda_codec_update_cache(codec, pin, 0,
804 AC_VERB_SET_EAPD_BTLENABLE, 804 AC_VERB_SET_EAPD_BTLENABLE,
805 enable ? 0x02 : 0x00); 805 enable ? 0x02 : 0x00);
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 87d2e0335ae4..1a83559f4cbd 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -139,6 +139,18 @@ static int ad198x_suspend(struct hda_codec *codec)
139} 139}
140#endif 140#endif
141 141
142/* follow EAPD via vmaster hook */
143static void ad_vmaster_eapd_hook(void *private_data, int enabled)
144{
145 struct hda_codec *codec = private_data;
146 struct ad198x_spec *spec = codec->spec;
147
148 if (!spec->eapd_nid)
149 return;
150 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
151 AC_VERB_SET_EAPD_BTLENABLE,
152 enabled ? 0x02 : 0x00);
153}
142 154
143/* 155/*
144 * Automatic parse of I/O pins from the BIOS configuration 156 * Automatic parse of I/O pins from the BIOS configuration
@@ -219,8 +231,14 @@ static int alloc_ad_spec(struct hda_codec *codec)
219static void ad_fixup_inv_jack_detect(struct hda_codec *codec, 231static void ad_fixup_inv_jack_detect(struct hda_codec *codec,
220 const struct hda_fixup *fix, int action) 232 const struct hda_fixup *fix, int action)
221{ 233{
222 if (action == HDA_FIXUP_ACT_PRE_PROBE) 234 struct ad198x_spec *spec = codec->spec;
235
236 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
223 codec->inv_jack_detect = 1; 237 codec->inv_jack_detect = 1;
238 spec->gen.keep_eapd_on = 1;
239 spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
240 spec->eapd_nid = 0x1b;
241 }
224} 242}
225 243
226enum { 244enum {
@@ -465,19 +483,6 @@ static int patch_ad1983(struct hda_codec *codec)
465 * AD1981 HD specific 483 * AD1981 HD specific
466 */ 484 */
467 485
468/* follow EAPD via vmaster hook */
469static void ad_vmaster_eapd_hook(void *private_data, int enabled)
470{
471 struct hda_codec *codec = private_data;
472 struct ad198x_spec *spec = codec->spec;
473
474 if (!spec->eapd_nid)
475 return;
476 snd_hda_codec_update_cache(codec, spec->eapd_nid, 0,
477 AC_VERB_SET_EAPD_BTLENABLE,
478 enabled ? 0x02 : 0x00);
479}
480
481static void ad1981_fixup_hp_eapd(struct hda_codec *codec, 486static void ad1981_fixup_hp_eapd(struct hda_codec *codec,
482 const struct hda_fixup *fix, int action) 487 const struct hda_fixup *fix, int action)
483{ 488{
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 072755c8289c..fc492ac24caa 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -47,6 +47,10 @@ struct cs_spec {
47 unsigned int spdif_present:1; 47 unsigned int spdif_present:1;
48 unsigned int sense_b:1; 48 unsigned int sense_b:1;
49 hda_nid_t vendor_nid; 49 hda_nid_t vendor_nid;
50
51 /* for MBP SPDIF control */
52 int (*spdif_sw_put)(struct snd_kcontrol *kcontrol,
53 struct snd_ctl_elem_value *ucontrol);
50}; 54};
51 55
52/* available models with CS420x */ 56/* available models with CS420x */
@@ -331,10 +335,21 @@ static int cs_init(struct hda_codec *codec)
331 return 0; 335 return 0;
332} 336}
333 337
338static int cs_build_controls(struct hda_codec *codec)
339{
340 int err;
341
342 err = snd_hda_gen_build_controls(codec);
343 if (err < 0)
344 return err;
345 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
346 return 0;
347}
348
334#define cs_free snd_hda_gen_free 349#define cs_free snd_hda_gen_free
335 350
336static const struct hda_codec_ops cs_patch_ops = { 351static const struct hda_codec_ops cs_patch_ops = {
337 .build_controls = snd_hda_gen_build_controls, 352 .build_controls = cs_build_controls,
338 .build_pcms = snd_hda_gen_build_pcms, 353 .build_pcms = snd_hda_gen_build_pcms,
339 .init = cs_init, 354 .init = cs_init,
340 .free = cs_free, 355 .free = cs_free,
@@ -599,12 +614,14 @@ static int patch_cs420x(struct hda_codec *codec)
599enum { 614enum {
600 CS4208_MAC_AUTO, 615 CS4208_MAC_AUTO,
601 CS4208_MBA6, 616 CS4208_MBA6,
617 CS4208_MBP11,
602 CS4208_GPIO0, 618 CS4208_GPIO0,
603}; 619};
604 620
605static const struct hda_model_fixup cs4208_models[] = { 621static const struct hda_model_fixup cs4208_models[] = {
606 { .id = CS4208_GPIO0, .name = "gpio0" }, 622 { .id = CS4208_GPIO0, .name = "gpio0" },
607 { .id = CS4208_MBA6, .name = "mba6" }, 623 { .id = CS4208_MBA6, .name = "mba6" },
624 { .id = CS4208_MBP11, .name = "mbp11" },
608 {} 625 {}
609}; 626};
610 627
@@ -615,6 +632,7 @@ static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
615 632
616/* codec SSID matching */ 633/* codec SSID matching */
617static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = { 634static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
635 SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
618 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), 636 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6),
619 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), 637 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6),
620 {} /* terminator */ 638 {} /* terminator */
@@ -646,6 +664,36 @@ static void cs4208_fixup_mac(struct hda_codec *codec,
646 snd_hda_apply_fixup(codec, action); 664 snd_hda_apply_fixup(codec, action);
647} 665}
648 666
667static int cs4208_spdif_sw_put(struct snd_kcontrol *kcontrol,
668 struct snd_ctl_elem_value *ucontrol)
669{
670 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
671 struct cs_spec *spec = codec->spec;
672 hda_nid_t pin = spec->gen.autocfg.dig_out_pins[0];
673 int pinctl = ucontrol->value.integer.value[0] ? PIN_OUT : 0;
674
675 snd_hda_set_pin_ctl_cache(codec, pin, pinctl);
676 return spec->spdif_sw_put(kcontrol, ucontrol);
677}
678
679/* hook the SPDIF switch */
680static void cs4208_fixup_spdif_switch(struct hda_codec *codec,
681 const struct hda_fixup *fix, int action)
682{
683 if (action == HDA_FIXUP_ACT_BUILD) {
684 struct cs_spec *spec = codec->spec;
685 struct snd_kcontrol *kctl;
686
687 if (!spec->gen.autocfg.dig_out_pins[0])
688 return;
689 kctl = snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch");
690 if (!kctl)
691 return;
692 spec->spdif_sw_put = kctl->put;
693 kctl->put = cs4208_spdif_sw_put;
694 }
695}
696
649static const struct hda_fixup cs4208_fixups[] = { 697static const struct hda_fixup cs4208_fixups[] = {
650 [CS4208_MBA6] = { 698 [CS4208_MBA6] = {
651 .type = HDA_FIXUP_PINS, 699 .type = HDA_FIXUP_PINS,
@@ -653,6 +701,12 @@ static const struct hda_fixup cs4208_fixups[] = {
653 .chained = true, 701 .chained = true,
654 .chain_id = CS4208_GPIO0, 702 .chain_id = CS4208_GPIO0,
655 }, 703 },
704 [CS4208_MBP11] = {
705 .type = HDA_FIXUP_FUNC,
706 .v.func = cs4208_fixup_spdif_switch,
707 .chained = true,
708 .chain_id = CS4208_GPIO0,
709 },
656 [CS4208_GPIO0] = { 710 [CS4208_GPIO0] = {
657 .type = HDA_FIXUP_FUNC, 711 .type = HDA_FIXUP_FUNC,
658 .v.func = cs4208_fixup_gpio0, 712 .v.func = cs4208_fixup_gpio0,
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index e68792311bb2..08407bed093e 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -763,12 +763,12 @@ static struct channel_map_table map_tables[] = {
763 { SNDRV_CHMAP_RC, RC }, 763 { SNDRV_CHMAP_RC, RC },
764 { SNDRV_CHMAP_FLC, FLC }, 764 { SNDRV_CHMAP_FLC, FLC },
765 { SNDRV_CHMAP_FRC, FRC }, 765 { SNDRV_CHMAP_FRC, FRC },
766 { SNDRV_CHMAP_FLH, FLH }, 766 { SNDRV_CHMAP_TFL, FLH },
767 { SNDRV_CHMAP_FRH, FRH }, 767 { SNDRV_CHMAP_TFR, FRH },
768 { SNDRV_CHMAP_FLW, FLW }, 768 { SNDRV_CHMAP_FLW, FLW },
769 { SNDRV_CHMAP_FRW, FRW }, 769 { SNDRV_CHMAP_FRW, FRW },
770 { SNDRV_CHMAP_TC, TC }, 770 { SNDRV_CHMAP_TC, TC },
771 { SNDRV_CHMAP_FCH, FCH }, 771 { SNDRV_CHMAP_TFC, FCH },
772 {} /* terminator */ 772 {} /* terminator */
773}; 773};
774 774
@@ -1247,6 +1247,9 @@ static int hdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid,
1247 pinctl = snd_hda_codec_read(codec, pin_nid, 0, 1247 pinctl = snd_hda_codec_read(codec, pin_nid, 0,
1248 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 1248 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1249 1249
1250 if (pinctl < 0)
1251 return hbr ? -EINVAL : 0;
1252
1250 new_pinctl = pinctl & ~AC_PINCTL_EPT; 1253 new_pinctl = pinctl & ~AC_PINCTL_EPT;
1251 if (hbr) 1254 if (hbr)
1252 new_pinctl |= AC_PINCTL_EPT_HBR; 1255 new_pinctl |= AC_PINCTL_EPT_HBR;
@@ -3091,7 +3094,7 @@ static int atihdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid,
3091 int hbr_ctl, hbr_ctl_new; 3094 int hbr_ctl, hbr_ctl_new;
3092 3095
3093 hbr_ctl = snd_hda_codec_read(codec, pin_nid, 0, ATI_VERB_GET_HBR_CONTROL, 0); 3096 hbr_ctl = snd_hda_codec_read(codec, pin_nid, 0, ATI_VERB_GET_HBR_CONTROL, 0);
3094 if (hbr_ctl & ATI_HBR_CAPABLE) { 3097 if (hbr_ctl >= 0 && (hbr_ctl & ATI_HBR_CAPABLE)) {
3095 if (hbr) 3098 if (hbr)
3096 hbr_ctl_new = hbr_ctl | ATI_HBR_ENABLE; 3099 hbr_ctl_new = hbr_ctl | ATI_HBR_ENABLE;
3097 else 3100 else
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 24d924d563aa..04d1e6be600e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3344,8 +3344,10 @@ static void alc_update_headset_mode(struct hda_codec *codec)
3344 else 3344 else
3345 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE; 3345 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
3346 3346
3347 if (new_headset_mode == spec->current_headset_mode) 3347 if (new_headset_mode == spec->current_headset_mode) {
3348 snd_hda_gen_update_outputs(codec);
3348 return; 3349 return;
3350 }
3349 3351
3350 switch (new_headset_mode) { 3352 switch (new_headset_mode) {
3351 case ALC_HEADSET_MODE_UNPLUGGED: 3353 case ALC_HEADSET_MODE_UNPLUGGED:
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 69a549a82345..d2cc0041d9d3 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -100,6 +100,7 @@ enum {
100 STAC_92HD83XXX_HEADSET_JACK, 100 STAC_92HD83XXX_HEADSET_JACK,
101 STAC_92HD83XXX_HP, 101 STAC_92HD83XXX_HP,
102 STAC_HP_ENVY_BASS, 102 STAC_HP_ENVY_BASS,
103 STAC_HP_BNB13_EQ,
103 STAC_92HD83XXX_MODELS 104 STAC_92HD83XXX_MODELS
104}; 105};
105 106
@@ -2106,6 +2107,434 @@ static void stac92hd83xxx_fixup_headset_jack(struct hda_codec *codec,
2106 spec->headset_jack = 1; 2107 spec->headset_jack = 1;
2107} 2108}
2108 2109
2110static const struct hda_verb hp_bnb13_eq_verbs[] = {
2111 /* 44.1KHz base */
2112 { 0x22, 0x7A6, 0x3E },
2113 { 0x22, 0x7A7, 0x68 },
2114 { 0x22, 0x7A8, 0x17 },
2115 { 0x22, 0x7A9, 0x3E },
2116 { 0x22, 0x7AA, 0x68 },
2117 { 0x22, 0x7AB, 0x17 },
2118 { 0x22, 0x7AC, 0x00 },
2119 { 0x22, 0x7AD, 0x80 },
2120 { 0x22, 0x7A6, 0x83 },
2121 { 0x22, 0x7A7, 0x2F },
2122 { 0x22, 0x7A8, 0xD1 },
2123 { 0x22, 0x7A9, 0x83 },
2124 { 0x22, 0x7AA, 0x2F },
2125 { 0x22, 0x7AB, 0xD1 },
2126 { 0x22, 0x7AC, 0x01 },
2127 { 0x22, 0x7AD, 0x80 },
2128 { 0x22, 0x7A6, 0x3E },
2129 { 0x22, 0x7A7, 0x68 },
2130 { 0x22, 0x7A8, 0x17 },
2131 { 0x22, 0x7A9, 0x3E },
2132 { 0x22, 0x7AA, 0x68 },
2133 { 0x22, 0x7AB, 0x17 },
2134 { 0x22, 0x7AC, 0x02 },
2135 { 0x22, 0x7AD, 0x80 },
2136 { 0x22, 0x7A6, 0x7C },
2137 { 0x22, 0x7A7, 0xC6 },
2138 { 0x22, 0x7A8, 0x0C },
2139 { 0x22, 0x7A9, 0x7C },
2140 { 0x22, 0x7AA, 0xC6 },
2141 { 0x22, 0x7AB, 0x0C },
2142 { 0x22, 0x7AC, 0x03 },
2143 { 0x22, 0x7AD, 0x80 },
2144 { 0x22, 0x7A6, 0xC3 },
2145 { 0x22, 0x7A7, 0x25 },
2146 { 0x22, 0x7A8, 0xAF },
2147 { 0x22, 0x7A9, 0xC3 },
2148 { 0x22, 0x7AA, 0x25 },
2149 { 0x22, 0x7AB, 0xAF },
2150 { 0x22, 0x7AC, 0x04 },
2151 { 0x22, 0x7AD, 0x80 },
2152 { 0x22, 0x7A6, 0x3E },
2153 { 0x22, 0x7A7, 0x85 },
2154 { 0x22, 0x7A8, 0x73 },
2155 { 0x22, 0x7A9, 0x3E },
2156 { 0x22, 0x7AA, 0x85 },
2157 { 0x22, 0x7AB, 0x73 },
2158 { 0x22, 0x7AC, 0x05 },
2159 { 0x22, 0x7AD, 0x80 },
2160 { 0x22, 0x7A6, 0x85 },
2161 { 0x22, 0x7A7, 0x39 },
2162 { 0x22, 0x7A8, 0xC7 },
2163 { 0x22, 0x7A9, 0x85 },
2164 { 0x22, 0x7AA, 0x39 },
2165 { 0x22, 0x7AB, 0xC7 },
2166 { 0x22, 0x7AC, 0x06 },
2167 { 0x22, 0x7AD, 0x80 },
2168 { 0x22, 0x7A6, 0x3C },
2169 { 0x22, 0x7A7, 0x90 },
2170 { 0x22, 0x7A8, 0xB0 },
2171 { 0x22, 0x7A9, 0x3C },
2172 { 0x22, 0x7AA, 0x90 },
2173 { 0x22, 0x7AB, 0xB0 },
2174 { 0x22, 0x7AC, 0x07 },
2175 { 0x22, 0x7AD, 0x80 },
2176 { 0x22, 0x7A6, 0x7A },
2177 { 0x22, 0x7A7, 0xC6 },
2178 { 0x22, 0x7A8, 0x39 },
2179 { 0x22, 0x7A9, 0x7A },
2180 { 0x22, 0x7AA, 0xC6 },
2181 { 0x22, 0x7AB, 0x39 },
2182 { 0x22, 0x7AC, 0x08 },
2183 { 0x22, 0x7AD, 0x80 },
2184 { 0x22, 0x7A6, 0xC4 },
2185 { 0x22, 0x7A7, 0xE9 },
2186 { 0x22, 0x7A8, 0xDC },
2187 { 0x22, 0x7A9, 0xC4 },
2188 { 0x22, 0x7AA, 0xE9 },
2189 { 0x22, 0x7AB, 0xDC },
2190 { 0x22, 0x7AC, 0x09 },
2191 { 0x22, 0x7AD, 0x80 },
2192 { 0x22, 0x7A6, 0x3D },
2193 { 0x22, 0x7A7, 0xE1 },
2194 { 0x22, 0x7A8, 0x0D },
2195 { 0x22, 0x7A9, 0x3D },
2196 { 0x22, 0x7AA, 0xE1 },
2197 { 0x22, 0x7AB, 0x0D },
2198 { 0x22, 0x7AC, 0x0A },
2199 { 0x22, 0x7AD, 0x80 },
2200 { 0x22, 0x7A6, 0x89 },
2201 { 0x22, 0x7A7, 0xB6 },
2202 { 0x22, 0x7A8, 0xEB },
2203 { 0x22, 0x7A9, 0x89 },
2204 { 0x22, 0x7AA, 0xB6 },
2205 { 0x22, 0x7AB, 0xEB },
2206 { 0x22, 0x7AC, 0x0B },
2207 { 0x22, 0x7AD, 0x80 },
2208 { 0x22, 0x7A6, 0x39 },
2209 { 0x22, 0x7A7, 0x9D },
2210 { 0x22, 0x7A8, 0xFE },
2211 { 0x22, 0x7A9, 0x39 },
2212 { 0x22, 0x7AA, 0x9D },
2213 { 0x22, 0x7AB, 0xFE },
2214 { 0x22, 0x7AC, 0x0C },
2215 { 0x22, 0x7AD, 0x80 },
2216 { 0x22, 0x7A6, 0x76 },
2217 { 0x22, 0x7A7, 0x49 },
2218 { 0x22, 0x7A8, 0x15 },
2219 { 0x22, 0x7A9, 0x76 },
2220 { 0x22, 0x7AA, 0x49 },
2221 { 0x22, 0x7AB, 0x15 },
2222 { 0x22, 0x7AC, 0x0D },
2223 { 0x22, 0x7AD, 0x80 },
2224 { 0x22, 0x7A6, 0xC8 },
2225 { 0x22, 0x7A7, 0x80 },
2226 { 0x22, 0x7A8, 0xF5 },
2227 { 0x22, 0x7A9, 0xC8 },
2228 { 0x22, 0x7AA, 0x80 },
2229 { 0x22, 0x7AB, 0xF5 },
2230 { 0x22, 0x7AC, 0x0E },
2231 { 0x22, 0x7AD, 0x80 },
2232 { 0x22, 0x7A6, 0x40 },
2233 { 0x22, 0x7A7, 0x00 },
2234 { 0x22, 0x7A8, 0x00 },
2235 { 0x22, 0x7A9, 0x40 },
2236 { 0x22, 0x7AA, 0x00 },
2237 { 0x22, 0x7AB, 0x00 },
2238 { 0x22, 0x7AC, 0x0F },
2239 { 0x22, 0x7AD, 0x80 },
2240 { 0x22, 0x7A6, 0x90 },
2241 { 0x22, 0x7A7, 0x68 },
2242 { 0x22, 0x7A8, 0xF1 },
2243 { 0x22, 0x7A9, 0x90 },
2244 { 0x22, 0x7AA, 0x68 },
2245 { 0x22, 0x7AB, 0xF1 },
2246 { 0x22, 0x7AC, 0x10 },
2247 { 0x22, 0x7AD, 0x80 },
2248 { 0x22, 0x7A6, 0x34 },
2249 { 0x22, 0x7A7, 0x47 },
2250 { 0x22, 0x7A8, 0x6C },
2251 { 0x22, 0x7A9, 0x34 },
2252 { 0x22, 0x7AA, 0x47 },
2253 { 0x22, 0x7AB, 0x6C },
2254 { 0x22, 0x7AC, 0x11 },
2255 { 0x22, 0x7AD, 0x80 },
2256 { 0x22, 0x7A6, 0x6F },
2257 { 0x22, 0x7A7, 0x97 },
2258 { 0x22, 0x7A8, 0x0F },
2259 { 0x22, 0x7A9, 0x6F },
2260 { 0x22, 0x7AA, 0x97 },
2261 { 0x22, 0x7AB, 0x0F },
2262 { 0x22, 0x7AC, 0x12 },
2263 { 0x22, 0x7AD, 0x80 },
2264 { 0x22, 0x7A6, 0xCB },
2265 { 0x22, 0x7A7, 0xB8 },
2266 { 0x22, 0x7A8, 0x94 },
2267 { 0x22, 0x7A9, 0xCB },
2268 { 0x22, 0x7AA, 0xB8 },
2269 { 0x22, 0x7AB, 0x94 },
2270 { 0x22, 0x7AC, 0x13 },
2271 { 0x22, 0x7AD, 0x80 },
2272 { 0x22, 0x7A6, 0x40 },
2273 { 0x22, 0x7A7, 0x00 },
2274 { 0x22, 0x7A8, 0x00 },
2275 { 0x22, 0x7A9, 0x40 },
2276 { 0x22, 0x7AA, 0x00 },
2277 { 0x22, 0x7AB, 0x00 },
2278 { 0x22, 0x7AC, 0x14 },
2279 { 0x22, 0x7AD, 0x80 },
2280 { 0x22, 0x7A6, 0x95 },
2281 { 0x22, 0x7A7, 0x76 },
2282 { 0x22, 0x7A8, 0x5B },
2283 { 0x22, 0x7A9, 0x95 },
2284 { 0x22, 0x7AA, 0x76 },
2285 { 0x22, 0x7AB, 0x5B },
2286 { 0x22, 0x7AC, 0x15 },
2287 { 0x22, 0x7AD, 0x80 },
2288 { 0x22, 0x7A6, 0x31 },
2289 { 0x22, 0x7A7, 0xAC },
2290 { 0x22, 0x7A8, 0x31 },
2291 { 0x22, 0x7A9, 0x31 },
2292 { 0x22, 0x7AA, 0xAC },
2293 { 0x22, 0x7AB, 0x31 },
2294 { 0x22, 0x7AC, 0x16 },
2295 { 0x22, 0x7AD, 0x80 },
2296 { 0x22, 0x7A6, 0x6A },
2297 { 0x22, 0x7A7, 0x89 },
2298 { 0x22, 0x7A8, 0xA5 },
2299 { 0x22, 0x7A9, 0x6A },
2300 { 0x22, 0x7AA, 0x89 },
2301 { 0x22, 0x7AB, 0xA5 },
2302 { 0x22, 0x7AC, 0x17 },
2303 { 0x22, 0x7AD, 0x80 },
2304 { 0x22, 0x7A6, 0xCE },
2305 { 0x22, 0x7A7, 0x53 },
2306 { 0x22, 0x7A8, 0xCF },
2307 { 0x22, 0x7A9, 0xCE },
2308 { 0x22, 0x7AA, 0x53 },
2309 { 0x22, 0x7AB, 0xCF },
2310 { 0x22, 0x7AC, 0x18 },
2311 { 0x22, 0x7AD, 0x80 },
2312 { 0x22, 0x7A6, 0x40 },
2313 { 0x22, 0x7A7, 0x00 },
2314 { 0x22, 0x7A8, 0x00 },
2315 { 0x22, 0x7A9, 0x40 },
2316 { 0x22, 0x7AA, 0x00 },
2317 { 0x22, 0x7AB, 0x00 },
2318 { 0x22, 0x7AC, 0x19 },
2319 { 0x22, 0x7AD, 0x80 },
2320 /* 48KHz base */
2321 { 0x22, 0x7A6, 0x3E },
2322 { 0x22, 0x7A7, 0x88 },
2323 { 0x22, 0x7A8, 0xDC },
2324 { 0x22, 0x7A9, 0x3E },
2325 { 0x22, 0x7AA, 0x88 },
2326 { 0x22, 0x7AB, 0xDC },
2327 { 0x22, 0x7AC, 0x1A },
2328 { 0x22, 0x7AD, 0x80 },
2329 { 0x22, 0x7A6, 0x82 },
2330 { 0x22, 0x7A7, 0xEE },
2331 { 0x22, 0x7A8, 0x46 },
2332 { 0x22, 0x7A9, 0x82 },
2333 { 0x22, 0x7AA, 0xEE },
2334 { 0x22, 0x7AB, 0x46 },
2335 { 0x22, 0x7AC, 0x1B },
2336 { 0x22, 0x7AD, 0x80 },
2337 { 0x22, 0x7A6, 0x3E },
2338 { 0x22, 0x7A7, 0x88 },
2339 { 0x22, 0x7A8, 0xDC },
2340 { 0x22, 0x7A9, 0x3E },
2341 { 0x22, 0x7AA, 0x88 },
2342 { 0x22, 0x7AB, 0xDC },
2343 { 0x22, 0x7AC, 0x1C },
2344 { 0x22, 0x7AD, 0x80 },
2345 { 0x22, 0x7A6, 0x7D },
2346 { 0x22, 0x7A7, 0x09 },
2347 { 0x22, 0x7A8, 0x28 },
2348 { 0x22, 0x7A9, 0x7D },
2349 { 0x22, 0x7AA, 0x09 },
2350 { 0x22, 0x7AB, 0x28 },
2351 { 0x22, 0x7AC, 0x1D },
2352 { 0x22, 0x7AD, 0x80 },
2353 { 0x22, 0x7A6, 0xC2 },
2354 { 0x22, 0x7A7, 0xE5 },
2355 { 0x22, 0x7A8, 0xB4 },
2356 { 0x22, 0x7A9, 0xC2 },
2357 { 0x22, 0x7AA, 0xE5 },
2358 { 0x22, 0x7AB, 0xB4 },
2359 { 0x22, 0x7AC, 0x1E },
2360 { 0x22, 0x7AD, 0x80 },
2361 { 0x22, 0x7A6, 0x3E },
2362 { 0x22, 0x7A7, 0xA3 },
2363 { 0x22, 0x7A8, 0x1F },
2364 { 0x22, 0x7A9, 0x3E },
2365 { 0x22, 0x7AA, 0xA3 },
2366 { 0x22, 0x7AB, 0x1F },
2367 { 0x22, 0x7AC, 0x1F },
2368 { 0x22, 0x7AD, 0x80 },
2369 { 0x22, 0x7A6, 0x84 },
2370 { 0x22, 0x7A7, 0xCA },
2371 { 0x22, 0x7A8, 0xF1 },
2372 { 0x22, 0x7A9, 0x84 },
2373 { 0x22, 0x7AA, 0xCA },
2374 { 0x22, 0x7AB, 0xF1 },
2375 { 0x22, 0x7AC, 0x20 },
2376 { 0x22, 0x7AD, 0x80 },
2377 { 0x22, 0x7A6, 0x3C },
2378 { 0x22, 0x7A7, 0xD5 },
2379 { 0x22, 0x7A8, 0x9C },
2380 { 0x22, 0x7A9, 0x3C },
2381 { 0x22, 0x7AA, 0xD5 },
2382 { 0x22, 0x7AB, 0x9C },
2383 { 0x22, 0x7AC, 0x21 },
2384 { 0x22, 0x7AD, 0x80 },
2385 { 0x22, 0x7A6, 0x7B },
2386 { 0x22, 0x7A7, 0x35 },
2387 { 0x22, 0x7A8, 0x0F },
2388 { 0x22, 0x7A9, 0x7B },
2389 { 0x22, 0x7AA, 0x35 },
2390 { 0x22, 0x7AB, 0x0F },
2391 { 0x22, 0x7AC, 0x22 },
2392 { 0x22, 0x7AD, 0x80 },
2393 { 0x22, 0x7A6, 0xC4 },
2394 { 0x22, 0x7A7, 0x87 },
2395 { 0x22, 0x7A8, 0x45 },
2396 { 0x22, 0x7A9, 0xC4 },
2397 { 0x22, 0x7AA, 0x87 },
2398 { 0x22, 0x7AB, 0x45 },
2399 { 0x22, 0x7AC, 0x23 },
2400 { 0x22, 0x7AD, 0x80 },
2401 { 0x22, 0x7A6, 0x3E },
2402 { 0x22, 0x7A7, 0x0A },
2403 { 0x22, 0x7A8, 0x78 },
2404 { 0x22, 0x7A9, 0x3E },
2405 { 0x22, 0x7AA, 0x0A },
2406 { 0x22, 0x7AB, 0x78 },
2407 { 0x22, 0x7AC, 0x24 },
2408 { 0x22, 0x7AD, 0x80 },
2409 { 0x22, 0x7A6, 0x88 },
2410 { 0x22, 0x7A7, 0xE2 },
2411 { 0x22, 0x7A8, 0x05 },
2412 { 0x22, 0x7A9, 0x88 },
2413 { 0x22, 0x7AA, 0xE2 },
2414 { 0x22, 0x7AB, 0x05 },
2415 { 0x22, 0x7AC, 0x25 },
2416 { 0x22, 0x7AD, 0x80 },
2417 { 0x22, 0x7A6, 0x3A },
2418 { 0x22, 0x7A7, 0x1A },
2419 { 0x22, 0x7A8, 0xA3 },
2420 { 0x22, 0x7A9, 0x3A },
2421 { 0x22, 0x7AA, 0x1A },
2422 { 0x22, 0x7AB, 0xA3 },
2423 { 0x22, 0x7AC, 0x26 },
2424 { 0x22, 0x7AD, 0x80 },
2425 { 0x22, 0x7A6, 0x77 },
2426 { 0x22, 0x7A7, 0x1D },
2427 { 0x22, 0x7A8, 0xFB },
2428 { 0x22, 0x7A9, 0x77 },
2429 { 0x22, 0x7AA, 0x1D },
2430 { 0x22, 0x7AB, 0xFB },
2431 { 0x22, 0x7AC, 0x27 },
2432 { 0x22, 0x7AD, 0x80 },
2433 { 0x22, 0x7A6, 0xC7 },
2434 { 0x22, 0x7A7, 0xDA },
2435 { 0x22, 0x7A8, 0xE5 },
2436 { 0x22, 0x7A9, 0xC7 },
2437 { 0x22, 0x7AA, 0xDA },
2438 { 0x22, 0x7AB, 0xE5 },
2439 { 0x22, 0x7AC, 0x28 },
2440 { 0x22, 0x7AD, 0x80 },
2441 { 0x22, 0x7A6, 0x40 },
2442 { 0x22, 0x7A7, 0x00 },
2443 { 0x22, 0x7A8, 0x00 },
2444 { 0x22, 0x7A9, 0x40 },
2445 { 0x22, 0x7AA, 0x00 },
2446 { 0x22, 0x7AB, 0x00 },
2447 { 0x22, 0x7AC, 0x29 },
2448 { 0x22, 0x7AD, 0x80 },
2449 { 0x22, 0x7A6, 0x8E },
2450 { 0x22, 0x7A7, 0xD7 },
2451 { 0x22, 0x7A8, 0x22 },
2452 { 0x22, 0x7A9, 0x8E },
2453 { 0x22, 0x7AA, 0xD7 },
2454 { 0x22, 0x7AB, 0x22 },
2455 { 0x22, 0x7AC, 0x2A },
2456 { 0x22, 0x7AD, 0x80 },
2457 { 0x22, 0x7A6, 0x35 },
2458 { 0x22, 0x7A7, 0x26 },
2459 { 0x22, 0x7A8, 0xC6 },
2460 { 0x22, 0x7A9, 0x35 },
2461 { 0x22, 0x7AA, 0x26 },
2462 { 0x22, 0x7AB, 0xC6 },
2463 { 0x22, 0x7AC, 0x2B },
2464 { 0x22, 0x7AD, 0x80 },
2465 { 0x22, 0x7A6, 0x71 },
2466 { 0x22, 0x7A7, 0x28 },
2467 { 0x22, 0x7A8, 0xDE },
2468 { 0x22, 0x7A9, 0x71 },
2469 { 0x22, 0x7AA, 0x28 },
2470 { 0x22, 0x7AB, 0xDE },
2471 { 0x22, 0x7AC, 0x2C },
2472 { 0x22, 0x7AD, 0x80 },
2473 { 0x22, 0x7A6, 0xCA },
2474 { 0x22, 0x7A7, 0xD9 },
2475 { 0x22, 0x7A8, 0x3A },
2476 { 0x22, 0x7A9, 0xCA },
2477 { 0x22, 0x7AA, 0xD9 },
2478 { 0x22, 0x7AB, 0x3A },
2479 { 0x22, 0x7AC, 0x2D },
2480 { 0x22, 0x7AD, 0x80 },
2481 { 0x22, 0x7A6, 0x40 },
2482 { 0x22, 0x7A7, 0x00 },
2483 { 0x22, 0x7A8, 0x00 },
2484 { 0x22, 0x7A9, 0x40 },
2485 { 0x22, 0x7AA, 0x00 },
2486 { 0x22, 0x7AB, 0x00 },
2487 { 0x22, 0x7AC, 0x2E },
2488 { 0x22, 0x7AD, 0x80 },
2489 { 0x22, 0x7A6, 0x93 },
2490 { 0x22, 0x7A7, 0x5E },
2491 { 0x22, 0x7A8, 0xD8 },
2492 { 0x22, 0x7A9, 0x93 },
2493 { 0x22, 0x7AA, 0x5E },
2494 { 0x22, 0x7AB, 0xD8 },
2495 { 0x22, 0x7AC, 0x2F },
2496 { 0x22, 0x7AD, 0x80 },
2497 { 0x22, 0x7A6, 0x32 },
2498 { 0x22, 0x7A7, 0xB7 },
2499 { 0x22, 0x7A8, 0xB1 },
2500 { 0x22, 0x7A9, 0x32 },
2501 { 0x22, 0x7AA, 0xB7 },
2502 { 0x22, 0x7AB, 0xB1 },
2503 { 0x22, 0x7AC, 0x30 },
2504 { 0x22, 0x7AD, 0x80 },
2505 { 0x22, 0x7A6, 0x6C },
2506 { 0x22, 0x7A7, 0xA1 },
2507 { 0x22, 0x7A8, 0x28 },
2508 { 0x22, 0x7A9, 0x6C },
2509 { 0x22, 0x7AA, 0xA1 },
2510 { 0x22, 0x7AB, 0x28 },
2511 { 0x22, 0x7AC, 0x31 },
2512 { 0x22, 0x7AD, 0x80 },
2513 { 0x22, 0x7A6, 0xCD },
2514 { 0x22, 0x7A7, 0x48 },
2515 { 0x22, 0x7A8, 0x4F },
2516 { 0x22, 0x7A9, 0xCD },
2517 { 0x22, 0x7AA, 0x48 },
2518 { 0x22, 0x7AB, 0x4F },
2519 { 0x22, 0x7AC, 0x32 },
2520 { 0x22, 0x7AD, 0x80 },
2521 { 0x22, 0x7A6, 0x40 },
2522 { 0x22, 0x7A7, 0x00 },
2523 { 0x22, 0x7A8, 0x00 },
2524 { 0x22, 0x7A9, 0x40 },
2525 { 0x22, 0x7AA, 0x00 },
2526 { 0x22, 0x7AB, 0x00 },
2527 { 0x22, 0x7AC, 0x33 },
2528 { 0x22, 0x7AD, 0x80 },
2529 /* common */
2530 { 0x22, 0x782, 0xC1 },
2531 { 0x22, 0x771, 0x2C },
2532 { 0x22, 0x772, 0x2C },
2533 { 0x22, 0x788, 0x04 },
2534 { 0x01, 0x7B0, 0x08 },
2535 {}
2536};
2537
2109static const struct hda_fixup stac92hd83xxx_fixups[] = { 2538static const struct hda_fixup stac92hd83xxx_fixups[] = {
2110 [STAC_92HD83XXX_REF] = { 2539 [STAC_92HD83XXX_REF] = {
2111 .type = HDA_FIXUP_PINS, 2540 .type = HDA_FIXUP_PINS,
@@ -2174,6 +2603,12 @@ static const struct hda_fixup stac92hd83xxx_fixups[] = {
2174 {} 2603 {}
2175 }, 2604 },
2176 }, 2605 },
2606 [STAC_HP_BNB13_EQ] = {
2607 .type = HDA_FIXUP_VERBS,
2608 .v.verbs = hp_bnb13_eq_verbs,
2609 .chained = true,
2610 .chain_id = STAC_92HD83XXX_HP_MIC_LED,
2611 },
2177}; 2612};
2178 2613
2179static const struct hda_model_fixup stac92hd83xxx_models[] = { 2614static const struct hda_model_fixup stac92hd83xxx_models[] = {
@@ -2189,6 +2624,7 @@ static const struct hda_model_fixup stac92hd83xxx_models[] = {
2189 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" }, 2624 { .id = STAC_92HD83XXX_HP_MIC_LED, .name = "hp-mic-led" },
2190 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" }, 2625 { .id = STAC_92HD83XXX_HEADSET_JACK, .name = "headset-jack" },
2191 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" }, 2626 { .id = STAC_HP_ENVY_BASS, .name = "hp-envy-bass" },
2627 { .id = STAC_HP_BNB13_EQ, .name = "hp-bnb13-eq" },
2192 {} 2628 {}
2193}; 2629};
2194 2630
@@ -2235,7 +2671,101 @@ static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
2235 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888, 2671 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1888,
2236 "HP Envy Spectre", STAC_HP_ENVY_BASS), 2672 "HP Envy Spectre", STAC_HP_ENVY_BASS),
2237 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df, 2673 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18df,
2238 "HP Folio", STAC_92HD83XXX_HP_MIC_LED), 2674 "HP Folio", STAC_HP_BNB13_EQ),
2675 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x18F8,
2676 "HP bNB13", STAC_HP_BNB13_EQ),
2677 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1909,
2678 "HP bNB13", STAC_HP_BNB13_EQ),
2679 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x190A,
2680 "HP bNB13", STAC_HP_BNB13_EQ),
2681 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1940,
2682 "HP bNB13", STAC_HP_BNB13_EQ),
2683 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1941,
2684 "HP bNB13", STAC_HP_BNB13_EQ),
2685 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1942,
2686 "HP bNB13", STAC_HP_BNB13_EQ),
2687 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1943,
2688 "HP bNB13", STAC_HP_BNB13_EQ),
2689 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1944,
2690 "HP bNB13", STAC_HP_BNB13_EQ),
2691 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1945,
2692 "HP bNB13", STAC_HP_BNB13_EQ),
2693 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1946,
2694 "HP bNB13", STAC_HP_BNB13_EQ),
2695 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1948,
2696 "HP bNB13", STAC_HP_BNB13_EQ),
2697 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1949,
2698 "HP bNB13", STAC_HP_BNB13_EQ),
2699 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194A,
2700 "HP bNB13", STAC_HP_BNB13_EQ),
2701 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194B,
2702 "HP bNB13", STAC_HP_BNB13_EQ),
2703 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194C,
2704 "HP bNB13", STAC_HP_BNB13_EQ),
2705 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194E,
2706 "HP bNB13", STAC_HP_BNB13_EQ),
2707 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x194F,
2708 "HP bNB13", STAC_HP_BNB13_EQ),
2709 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1950,
2710 "HP bNB13", STAC_HP_BNB13_EQ),
2711 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1951,
2712 "HP bNB13", STAC_HP_BNB13_EQ),
2713 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195A,
2714 "HP bNB13", STAC_HP_BNB13_EQ),
2715 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195B,
2716 "HP bNB13", STAC_HP_BNB13_EQ),
2717 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x195C,
2718 "HP bNB13", STAC_HP_BNB13_EQ),
2719 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1991,
2720 "HP bNB13", STAC_HP_BNB13_EQ),
2721 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2103,
2722 "HP bNB13", STAC_HP_BNB13_EQ),
2723 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2104,
2724 "HP bNB13", STAC_HP_BNB13_EQ),
2725 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2105,
2726 "HP bNB13", STAC_HP_BNB13_EQ),
2727 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2106,
2728 "HP bNB13", STAC_HP_BNB13_EQ),
2729 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2107,
2730 "HP bNB13", STAC_HP_BNB13_EQ),
2731 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2108,
2732 "HP bNB13", STAC_HP_BNB13_EQ),
2733 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2109,
2734 "HP bNB13", STAC_HP_BNB13_EQ),
2735 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x210A,
2736 "HP bNB13", STAC_HP_BNB13_EQ),
2737 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x210B,
2738 "HP bNB13", STAC_HP_BNB13_EQ),
2739 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211C,
2740 "HP bNB13", STAC_HP_BNB13_EQ),
2741 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211D,
2742 "HP bNB13", STAC_HP_BNB13_EQ),
2743 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211E,
2744 "HP bNB13", STAC_HP_BNB13_EQ),
2745 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x211F,
2746 "HP bNB13", STAC_HP_BNB13_EQ),
2747 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2120,
2748 "HP bNB13", STAC_HP_BNB13_EQ),
2749 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2121,
2750 "HP bNB13", STAC_HP_BNB13_EQ),
2751 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2122,
2752 "HP bNB13", STAC_HP_BNB13_EQ),
2753 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2123,
2754 "HP bNB13", STAC_HP_BNB13_EQ),
2755 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x213E,
2756 "HP bNB13", STAC_HP_BNB13_EQ),
2757 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x213F,
2758 "HP bNB13", STAC_HP_BNB13_EQ),
2759 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2140,
2760 "HP bNB13", STAC_HP_BNB13_EQ),
2761 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B2,
2762 "HP bNB13", STAC_HP_BNB13_EQ),
2763 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B3,
2764 "HP bNB13", STAC_HP_BNB13_EQ),
2765 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B5,
2766 "HP bNB13", STAC_HP_BNB13_EQ),
2767 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x21B6,
2768 "HP bNB13", STAC_HP_BNB13_EQ),
2239 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x1900, 2769 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x1900,
2240 "HP", STAC_92HD83XXX_HP_MIC_LED), 2770 "HP", STAC_92HD83XXX_HP_MIC_LED),
2241 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2000, 2771 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x2000,
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c
index 9a174fc47d39..39d774839b3e 100644
--- a/sound/soc/blackfin/bf5xx-i2s.c
+++ b/sound/soc/blackfin/bf5xx-i2s.c
@@ -121,6 +121,7 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
121 bf5xx_i2s->tcr2 |= 7; 121 bf5xx_i2s->tcr2 |= 7;
122 bf5xx_i2s->rcr2 |= 7; 122 bf5xx_i2s->rcr2 |= 7;
123 sport_handle->wdsize = 1; 123 sport_handle->wdsize = 1;
124 break;
124 case SNDRV_PCM_FORMAT_S16_LE: 125 case SNDRV_PCM_FORMAT_S16_LE:
125 bf5xx_i2s->tcr2 |= 15; 126 bf5xx_i2s->tcr2 |= 15;
126 bf5xx_i2s->rcr2 |= 15; 127 bf5xx_i2s->rcr2 |= 15;
diff --git a/sound/soc/codecs/cs42l52.h b/sound/soc/codecs/cs42l52.h
index 1a9412d86d17..6fb8f00f4191 100644
--- a/sound/soc/codecs/cs42l52.h
+++ b/sound/soc/codecs/cs42l52.h
@@ -179,7 +179,7 @@
179#define CS42L52_MICB_CTL 0x11 179#define CS42L52_MICB_CTL 0x11
180#define CS42L52_MIC_CTL_MIC_SEL_MASK 0xBF 180#define CS42L52_MIC_CTL_MIC_SEL_MASK 0xBF
181#define CS42L52_MIC_CTL_MIC_SEL_SHIFT 6 181#define CS42L52_MIC_CTL_MIC_SEL_SHIFT 6
182#define CS42L52_MIC_CTL_TYPE_MASK 0xDF 182#define CS42L52_MIC_CTL_TYPE_MASK 0x20
183#define CS42L52_MIC_CTL_TYPE_SHIFT 5 183#define CS42L52_MIC_CTL_TYPE_SHIFT 5
184 184
185 185
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 8bbddc151aa8..a08e8bf6d07c 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -685,13 +685,13 @@ ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
685ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), 685ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
686ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), 686ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
687 687
688SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21, 688SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
689 ARIZONA_EQ1_ENA_MASK), 689 ARIZONA_EQ1_ENA_MASK),
690SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21, 690SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
691 ARIZONA_EQ2_ENA_MASK), 691 ARIZONA_EQ2_ENA_MASK),
692SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21, 692SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
693 ARIZONA_EQ3_ENA_MASK), 693 ARIZONA_EQ3_ENA_MASK),
694SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21, 694SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
695 ARIZONA_EQ4_ENA_MASK), 695 ARIZONA_EQ4_ENA_MASK),
696 696
697SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, 697SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 8c91be5d67e3..f2d1094424b9 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -101,13 +101,13 @@ ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
101ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), 101ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
102ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), 102ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
103 103
104SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21, 104SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
105 ARIZONA_EQ1_ENA_MASK), 105 ARIZONA_EQ1_ENA_MASK),
106SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21, 106SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
107 ARIZONA_EQ2_ENA_MASK), 107 ARIZONA_EQ2_ENA_MASK),
108SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21, 108SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
109 ARIZONA_EQ3_ENA_MASK), 109 ARIZONA_EQ3_ENA_MASK),
110SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21, 110SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
111 ARIZONA_EQ4_ENA_MASK), 111 ARIZONA_EQ4_ENA_MASK),
112 112
113SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, 113SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index ac1ff9947a90..543c5c2631b6 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3728,6 +3728,8 @@ static int wm8962_i2c_probe(struct i2c_client *i2c,
3728 if (ret < 0) 3728 if (ret < 0)
3729 goto err_enable; 3729 goto err_enable;
3730 3730
3731 regcache_cache_only(wm8962->regmap, true);
3732
3731 /* The drivers should power up as needed */ 3733 /* The drivers should power up as needed */
3732 regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies); 3734 regulator_bulk_disable(ARRAY_SIZE(wm8962->supplies), wm8962->supplies);
3733 3735
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index 6ec3de3efa4f..1392bb3c9254 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -170,13 +170,13 @@ ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
170ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), 170ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
171ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), 171ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
172 172
173SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21, 173SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
174 ARIZONA_EQ1_ENA_MASK), 174 ARIZONA_EQ1_ENA_MASK),
175SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21, 175SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
176 ARIZONA_EQ2_ENA_MASK), 176 ARIZONA_EQ2_ENA_MASK),
177SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21, 177SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
178 ARIZONA_EQ3_ENA_MASK), 178 ARIZONA_EQ3_ENA_MASK),
179SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21, 179SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
180 ARIZONA_EQ4_ENA_MASK), 180 ARIZONA_EQ4_ENA_MASK),
181 181
182SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, 182SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
@@ -887,7 +887,7 @@ static const struct snd_soc_dapm_route wm8997_dapm_routes[] = {
887 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"), 887 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"),
888 888
889 ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"), 889 ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
890 ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC2INT2"), 890 ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
891 891
892 ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"), 892 ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
893 ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"), 893 ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 41740e488820..c75d43bb2e92 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -42,7 +42,8 @@ struct imx_pcm_runtime_data {
42 struct hrtimer hrt; 42 struct hrtimer hrt;
43 int poll_time_ns; 43 int poll_time_ns;
44 struct snd_pcm_substream *substream; 44 struct snd_pcm_substream *substream;
45 atomic_t running; 45 atomic_t playing;
46 atomic_t capturing;
46}; 47};
47 48
48static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) 49static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
@@ -52,7 +53,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt)
52 struct snd_pcm_substream *substream = iprtd->substream; 53 struct snd_pcm_substream *substream = iprtd->substream;
53 struct pt_regs regs; 54 struct pt_regs regs;
54 55
55 if (!atomic_read(&iprtd->running)) 56 if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing))
56 return HRTIMER_NORESTART; 57 return HRTIMER_NORESTART;
57 58
58 get_fiq_regs(&regs); 59 get_fiq_regs(&regs);
@@ -106,7 +107,6 @@ static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
106 return 0; 107 return 0;
107} 108}
108 109
109static int fiq_enable;
110static int imx_pcm_fiq; 110static int imx_pcm_fiq;
111 111
112static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) 112static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
@@ -118,23 +118,27 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
118 case SNDRV_PCM_TRIGGER_START: 118 case SNDRV_PCM_TRIGGER_START:
119 case SNDRV_PCM_TRIGGER_RESUME: 119 case SNDRV_PCM_TRIGGER_RESUME:
120 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 120 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
121 atomic_set(&iprtd->running, 1); 121 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
122 atomic_set(&iprtd->playing, 1);
123 else
124 atomic_set(&iprtd->capturing, 1);
122 hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns), 125 hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns),
123 HRTIMER_MODE_REL); 126 HRTIMER_MODE_REL);
124 if (++fiq_enable == 1) 127 enable_fiq(imx_pcm_fiq);
125 enable_fiq(imx_pcm_fiq);
126
127 break; 128 break;
128 129
129 case SNDRV_PCM_TRIGGER_STOP: 130 case SNDRV_PCM_TRIGGER_STOP:
130 case SNDRV_PCM_TRIGGER_SUSPEND: 131 case SNDRV_PCM_TRIGGER_SUSPEND:
131 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 132 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
132 atomic_set(&iprtd->running, 0); 133 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
133 134 atomic_set(&iprtd->playing, 0);
134 if (--fiq_enable == 0) 135 else
136 atomic_set(&iprtd->capturing, 0);
137 if (!atomic_read(&iprtd->playing) &&
138 !atomic_read(&iprtd->capturing))
135 disable_fiq(imx_pcm_fiq); 139 disable_fiq(imx_pcm_fiq);
136
137 break; 140 break;
141
138 default: 142 default:
139 return -EINVAL; 143 return -EINVAL;
140 } 144 }
@@ -182,7 +186,8 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
182 186
183 iprtd->substream = substream; 187 iprtd->substream = substream;
184 188
185 atomic_set(&iprtd->running, 0); 189 atomic_set(&iprtd->playing, 0);
190 atomic_set(&iprtd->capturing, 0);
186 hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 191 hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
187 iprtd->hrt.function = snd_hrtimer_callback; 192 iprtd->hrt.function = snd_hrtimer_callback;
188 193
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index b47f6fe6277f..dbb1b625eb2f 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -907,19 +907,24 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
907 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); 907 struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
908 struct snd_pcm_runtime *runtime = substream->runtime; 908 struct snd_pcm_runtime *runtime = substream->runtime;
909 unsigned long flags; 909 unsigned long flags;
910 int ret = 0;
910 911
911 spin_lock_irqsave(&chip->lock, flags); 912 spin_lock_irqsave(&chip->lock, flags);
912 913
913 chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE | 914 chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
914 CS4231_PLAYBACK_PIO); 915 CS4231_PLAYBACK_PIO);
915 916
916 if (WARN_ON(runtime->period_size > 0xffff + 1)) 917 if (WARN_ON(runtime->period_size > 0xffff + 1)) {
917 return -EINVAL; 918 ret = -EINVAL;
919 goto out;
920 }
918 921
919 chip->p_periods_sent = 0; 922 chip->p_periods_sent = 0;
923
924out:
920 spin_unlock_irqrestore(&chip->lock, flags); 925 spin_unlock_irqrestore(&chip->lock, flags);
921 926
922 return 0; 927 return ret;
923} 928}
924 929
925static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream, 930static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream,
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index d42a584cf829..3454262358b3 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -433,6 +433,89 @@ static void snd_audigy2nx_proc_read(struct snd_info_entry *entry,
433 } 433 }
434} 434}
435 435
436/* EMU0204 */
437static int snd_emu0204_ch_switch_info(struct snd_kcontrol *kcontrol,
438 struct snd_ctl_elem_info *uinfo)
439{
440 static const char *texts[2] = {"1/2",
441 "3/4"
442 };
443
444 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
445 uinfo->count = 1;
446 uinfo->value.enumerated.items = 2;
447 if (uinfo->value.enumerated.item > 1)
448 uinfo->value.enumerated.item = 1;
449 strcpy(uinfo->value.enumerated.name,
450 texts[uinfo->value.enumerated.item]);
451
452 return 0;
453}
454
455static int snd_emu0204_ch_switch_get(struct snd_kcontrol *kcontrol,
456 struct snd_ctl_elem_value *ucontrol)
457{
458 ucontrol->value.enumerated.item[0] = kcontrol->private_value;
459 return 0;
460}
461
462static int snd_emu0204_ch_switch_put(struct snd_kcontrol *kcontrol,
463 struct snd_ctl_elem_value *ucontrol)
464{
465 struct usb_mixer_interface *mixer = snd_kcontrol_chip(kcontrol);
466 unsigned int value = ucontrol->value.enumerated.item[0];
467 int err, changed;
468 unsigned char buf[2];
469
470 if (value > 1)
471 return -EINVAL;
472
473 buf[0] = 0x01;
474 buf[1] = value ? 0x02 : 0x01;
475
476 changed = value != kcontrol->private_value;
477 down_read(&mixer->chip->shutdown_rwsem);
478 if (mixer->chip->shutdown) {
479 err = -ENODEV;
480 goto out;
481 }
482 err = snd_usb_ctl_msg(mixer->chip->dev,
483 usb_sndctrlpipe(mixer->chip->dev, 0), UAC_SET_CUR,
484 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
485 0x0400, 0x0e00, buf, 2);
486 out:
487 up_read(&mixer->chip->shutdown_rwsem);
488 if (err < 0)
489 return err;
490 kcontrol->private_value = value;
491 return changed;
492}
493
494
495static struct snd_kcontrol_new snd_emu0204_controls[] = {
496 {
497 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
498 .name = "Front Jack Channels",
499 .info = snd_emu0204_ch_switch_info,
500 .get = snd_emu0204_ch_switch_get,
501 .put = snd_emu0204_ch_switch_put,
502 .private_value = 0,
503 },
504};
505
506static int snd_emu0204_controls_create(struct usb_mixer_interface *mixer)
507{
508 int i, err;
509
510 for (i = 0; i < ARRAY_SIZE(snd_emu0204_controls); ++i) {
511 err = snd_ctl_add(mixer->chip->card,
512 snd_ctl_new1(&snd_emu0204_controls[i], mixer));
513 if (err < 0)
514 return err;
515 }
516
517 return 0;
518}
436/* ASUS Xonar U1 / U3 controls */ 519/* ASUS Xonar U1 / U3 controls */
437 520
438static int snd_xonar_u1_switch_get(struct snd_kcontrol *kcontrol, 521static int snd_xonar_u1_switch_get(struct snd_kcontrol *kcontrol,
@@ -1545,6 +1628,13 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer)
1545 snd_audigy2nx_proc_read); 1628 snd_audigy2nx_proc_read);
1546 break; 1629 break;
1547 1630
1631 /* EMU0204 */
1632 case USB_ID(0x041e, 0x3f19):
1633 err = snd_emu0204_controls_create(mixer);
1634 if (err < 0)
1635 break;
1636 break;
1637
1548 case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ 1638 case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */
1549 case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C400 */ 1639 case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C400 */
1550 err = snd_c400_create_mixer(mixer); 1640 err = snd_c400_create_mixer(mixer);
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index d737d0e6e558..2fb71be5e100 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -273,8 +273,8 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits,
273 SNDRV_CHMAP_TSL, /* top side left */ 273 SNDRV_CHMAP_TSL, /* top side left */
274 SNDRV_CHMAP_TSR, /* top side right */ 274 SNDRV_CHMAP_TSR, /* top side right */
275 SNDRV_CHMAP_BC, /* bottom center */ 275 SNDRV_CHMAP_BC, /* bottom center */
276 SNDRV_CHMAP_BLC, /* bottom left center */ 276 SNDRV_CHMAP_RLC, /* back left of center */
277 SNDRV_CHMAP_BRC, /* bottom right center */ 277 SNDRV_CHMAP_RRC, /* back right of center */
278 0 /* terminator */ 278 0 /* terminator */
279 }; 279 };
280 struct snd_pcm_chmap_elem *chmap; 280 struct snd_pcm_chmap_elem *chmap;