--- /dev/null
+From 3868137ea41866773e75d9ac4b9988dcc361ff1d Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 27 Feb 2012 15:00:58 +0100
+Subject: ALSA: hda - Add a fake mute feature
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 3868137ea41866773e75d9ac4b9988dcc361ff1d upstream.
+
+Some codecs don't supply the mute amp-capabilities although the lowest
+volume gives the mute. It'd be handy if the parser provides the mute
+mixers in such a case.
+
+This patch adds an extension amp-cap bit (which is used only in the
+driver) to represent the min volume = mute state. Also modified the
+amp cache code to support the fake mute feature when this bit is set
+but the real mute bit is unset.
+
+In addition, conexant cx5051 parser uses this new feature to implement
+the missing mute controls.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42825
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_codec.c | 8 ++++++--
+ sound/pci/hda/hda_codec.h | 3 +++
+ sound/pci/hda/patch_conexant.c | 22 +++++++++++++++++++++-
+ 3 files changed, 30 insertions(+), 3 deletions(-)
+
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -1795,7 +1795,11 @@ static void put_vol_mute(struct hda_code
+ parm = ch ? AC_AMP_SET_RIGHT : AC_AMP_SET_LEFT;
+ parm |= direction == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT;
+ parm |= index << AC_AMP_SET_INDEX_SHIFT;
+- parm |= val;
++ if ((val & HDA_AMP_MUTE) && !(info->amp_caps & AC_AMPCAP_MUTE) &&
++ (info->amp_caps & AC_AMPCAP_MIN_MUTE))
++ ; /* set the zero value as a fake mute */
++ else
++ parm |= val;
+ snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, parm);
+ info->vol[ch] = val;
+ }
+@@ -2062,7 +2066,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kco
+ val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT);
+ val1 += ofs;
+ val1 = ((int)val1) * ((int)val2);
+- if (min_mute)
++ if (min_mute || (caps & AC_AMPCAP_MIN_MUTE))
+ val2 |= TLV_DB_SCALE_MUTE;
+ if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv))
+ return -EFAULT;
+--- a/sound/pci/hda/hda_codec.h
++++ b/sound/pci/hda/hda_codec.h
+@@ -298,6 +298,9 @@ enum {
+ #define AC_AMPCAP_MUTE (1<<31) /* mute capable */
+ #define AC_AMPCAP_MUTE_SHIFT 31
+
++/* driver-specific amp-caps: using bits 24-30 */
++#define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */
++
+ /* Connection list */
+ #define AC_CLIST_LENGTH (0x7f<<0)
+ #define AC_CLIST_LONG (1<<7)
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -4132,7 +4132,8 @@ static int cx_auto_add_volume_idx(struct
+ err = snd_hda_ctl_add(codec, nid, kctl);
+ if (err < 0)
+ return err;
+- if (!(query_amp_caps(codec, nid, hda_dir) & AC_AMPCAP_MUTE))
++ if (!(query_amp_caps(codec, nid, hda_dir) &
++ (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)))
+ break;
+ }
+ return 0;
+@@ -4425,6 +4426,22 @@ static const struct snd_pci_quirk cxt_fi
+ {}
+ };
+
++/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches
++ * can be created (bko#42825)
++ */
++static void add_cx5051_fake_mutes(struct hda_codec *codec)
++{
++ static hda_nid_t out_nids[] = {
++ 0x10, 0x11, 0
++ };
++ hda_nid_t *p;
++
++ for (p = out_nids; *p; p++)
++ snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT,
++ AC_AMPCAP_MIN_MUTE |
++ query_amp_caps(codec, *p, HDA_OUTPUT));
++}
++
+ static int patch_conexant_auto(struct hda_codec *codec)
+ {
+ struct conexant_spec *spec;
+@@ -4443,6 +4460,9 @@ static int patch_conexant_auto(struct hd
+ case 0x14f15045:
+ spec->single_adc_amp = 1;
+ break;
++ case 0x14f15051:
++ add_cx5051_fake_mutes(codec);
++ break;
+ }
+
+ apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
--- /dev/null
+From 7bff172a352a2fbe9856bba517d71a2072aab041 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 29 Feb 2012 09:41:17 +0100
+Subject: ALSA: hda - Always set HP pin in unsol handler for STAC/IDT codecs
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 7bff172a352a2fbe9856bba517d71a2072aab041 upstream.
+
+A bug report with an old Sony laptop showed that we can't rely on BIOS
+setting the pins of headphones but the driver should set always by
+itself.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_sigmatel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -4719,7 +4719,7 @@ static void stac92xx_hp_detect(struct hd
+ unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN;
+ if (no_hp_sensing(spec, i))
+ continue;
+- if (presence)
++ if (1 /*presence*/)
+ stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
+ #if 0 /* FIXME */
+ /* Resetting the pinctl like below may lead to (a sort of) regressions
--- /dev/null
+From 068b939431486f524438330b0848a8222e33d421 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Sat, 25 Feb 2012 11:13:16 +0100
+Subject: ALSA: hda/realtek - Fix resume of multiple input sources
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 068b939431486f524438330b0848a8222e33d421 upstream.
+
+When there are multiple input sources, the driver wrongly overwrites with
+the value of the last input source on other slots at resume. Thus the
+primary input source may be shown wrongly.
+
+Reported-and-tested-by: Julian Sikorski <belegdol@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3695,7 +3695,7 @@ static void alc_auto_init_input_src(stru
+ else
+ nums = spec->num_adc_nids;
+ for (c = 0; c < nums; c++)
+- alc_mux_select(codec, 0, spec->cur_mux[c], true);
++ alc_mux_select(codec, c, spec->cur_mux[c], true);
+ }
+
+ /* add mic boosts if needed */
--- /dev/null
+From 81b5482c32769abb6dfb979560dab2f952ba86fa Mon Sep 17 00:00:00 2001
+From: Jean Delvare <khali@linux-fr.org>
+Date: Sat, 18 Feb 2012 17:54:23 +0100
+Subject: mfd: Fix ACPI conflict check
+
+From: Jean Delvare <khali@linux-fr.org>
+
+commit 81b5482c32769abb6dfb979560dab2f952ba86fa upstream.
+
+The code is currently always checking the first resource of every
+device only (several times.) This has been broken since the ACPI check
+was added in February 2010 in commit
+91fedede0338eb6203cdd618d8ece873fdb7c22c.
+
+Fix the check to run on each resource individually, once.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/mfd-core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mfd/mfd-core.c
++++ b/drivers/mfd/mfd-core.c
+@@ -123,7 +123,7 @@ static int mfd_add_device(struct device
+ }
+
+ if (!cell->ignore_resource_conflicts) {
+- ret = acpi_check_resource_conflict(res);
++ ret = acpi_check_resource_conflict(&res[r]);
+ if (ret)
+ goto fail_res;
+ }
--- /dev/null
+From e7c248a049c2aac21bded0b0722caee6f0e57256 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Mon, 20 Feb 2012 21:32:32 +0000
+Subject: mfd: Test for jack detection when deciding if wm8994 should suspend
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit e7c248a049c2aac21bded0b0722caee6f0e57256 upstream.
+
+The jack detection on WM1811 is often required during system suspend, add
+it as another check when deciding if we should suspend.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/wm8994-core.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+--- a/drivers/mfd/wm8994-core.c
++++ b/drivers/mfd/wm8994-core.c
+@@ -252,6 +252,20 @@ static int wm8994_suspend(struct device
+ break;
+ }
+
++ switch (wm8994->type) {
++ case WM1811:
++ ret = wm8994_reg_read(wm8994, WM8994_ANTIPOP_2);
++ if (ret < 0) {
++ dev_err(dev, "Failed to read jackdet: %d\n", ret);
++ } else if (ret & WM1811_JACKDET_MODE_MASK) {
++ dev_dbg(dev, "CODEC still active, ignoring suspend\n");
++ return 0;
++ }
++ break;
++ default:
++ break;
++ }
++
+ /* Disable LDO pulldowns while the device is suspended if we
+ * don't know that something will be driving them. */
+ if (!wm8994->ldo_ena_always_driven)
--- /dev/null
+From 1018faa6cf23b256bf25919ef203cd7c129f06f2 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <joerg.roedel@amd.com>
+Date: Wed, 29 Feb 2012 14:57:32 +0100
+Subject: perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled
+
+From: Joerg Roedel <joerg.roedel@amd.com>
+
+commit 1018faa6cf23b256bf25919ef203cd7c129f06f2 upstream.
+
+It turned out that a performance counter on AMD does not
+count at all when the GO or HO bit is set in the control
+register and SVM is disabled in EFER.
+
+This patch works around this issue by masking out the HO bit
+in the performance counter control register when SVM is not
+enabled.
+
+The GO bit is not touched because it is only set when the
+user wants to count in guest-mode only. So when SVM is
+disabled the counter should not run at all and the
+not-counting is the intended behaviour.
+
+Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Avi Kivity <avi@redhat.com>
+Cc: Stephane Eranian <eranian@google.com>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Gleb Natapov <gleb@redhat.com>
+Cc: Robert Richter <robert.richter@amd.com>
+Link: http://lkml.kernel.org/r/1330523852-19566-1-git-send-email-joerg.roedel@amd.com
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/perf_event.h | 8 +++++++
+ arch/x86/kernel/cpu/perf_event.h | 8 +++++--
+ arch/x86/kernel/cpu/perf_event_amd.c | 37 +++++++++++++++++++++++++++++++++--
+ arch/x86/kvm/svm.c | 5 ++++
+ 4 files changed, 54 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/include/asm/perf_event.h
++++ b/arch/x86/include/asm/perf_event.h
+@@ -212,4 +212,12 @@ static inline perf_guest_switch_msr *per
+ static inline void perf_events_lapic_init(void) { }
+ #endif
+
++#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD)
++ extern void amd_pmu_enable_virt(void);
++ extern void amd_pmu_disable_virt(void);
++#else
++ static inline void amd_pmu_enable_virt(void) { }
++ static inline void amd_pmu_disable_virt(void) { }
++#endif
++
+ #endif /* _ASM_X86_PERF_EVENT_H */
+--- a/arch/x86/kernel/cpu/perf_event.h
++++ b/arch/x86/kernel/cpu/perf_event.h
+@@ -146,7 +146,9 @@ struct cpu_hw_events {
+ /*
+ * AMD specific bits
+ */
+- struct amd_nb *amd_nb;
++ struct amd_nb *amd_nb;
++ /* Inverted mask of bits to clear in the perf_ctr ctrl registers */
++ u64 perf_ctr_virt_mask;
+
+ void *kfree_on_online;
+ };
+@@ -372,9 +374,11 @@ void x86_pmu_disable_all(void);
+ static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
+ u64 enable_mask)
+ {
++ u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
++
+ if (hwc->extra_reg.reg)
+ wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
+- wrmsrl(hwc->config_base, hwc->config | enable_mask);
++ wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
+ }
+
+ void x86_pmu_enable_all(int added);
+--- a/arch/x86/kernel/cpu/perf_event_amd.c
++++ b/arch/x86/kernel/cpu/perf_event_amd.c
+@@ -1,4 +1,5 @@
+ #include <linux/perf_event.h>
++#include <linux/export.h>
+ #include <linux/types.h>
+ #include <linux/init.h>
+ #include <linux/slab.h>
+@@ -357,7 +358,9 @@ static void amd_pmu_cpu_starting(int cpu
+ struct amd_nb *nb;
+ int i, nb_id;
+
+- if (boot_cpu_data.x86_max_cores < 2)
++ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
++
++ if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15)
+ return;
+
+ nb_id = amd_get_nb_id(cpu);
+@@ -587,9 +590,9 @@ static __initconst const struct x86_pmu
+ .put_event_constraints = amd_put_event_constraints,
+
+ .cpu_prepare = amd_pmu_cpu_prepare,
+- .cpu_starting = amd_pmu_cpu_starting,
+ .cpu_dead = amd_pmu_cpu_dead,
+ #endif
++ .cpu_starting = amd_pmu_cpu_starting,
+ };
+
+ __init int amd_pmu_init(void)
+@@ -621,3 +624,33 @@ __init int amd_pmu_init(void)
+
+ return 0;
+ }
++
++void amd_pmu_enable_virt(void)
++{
++ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
++
++ cpuc->perf_ctr_virt_mask = 0;
++
++ /* Reload all events */
++ x86_pmu_disable_all();
++ x86_pmu_enable_all(0);
++}
++EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);
++
++void amd_pmu_disable_virt(void)
++{
++ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
++
++ /*
++ * We only mask out the Host-only bit so that host-only counting works
++ * when SVM is disabled. If someone sets up a guest-only counter when
++ * SVM is disabled the Guest-only bits still gets set and the counter
++ * will not count anything.
++ */
++ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
++
++ /* Reload all events */
++ x86_pmu_disable_all();
++ x86_pmu_enable_all(0);
++}
++EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -29,6 +29,7 @@
+ #include <linux/ftrace_event.h>
+ #include <linux/slab.h>
+
++#include <asm/perf_event.h>
+ #include <asm/tlbflush.h>
+ #include <asm/desc.h>
+ #include <asm/kvm_para.h>
+@@ -575,6 +576,8 @@ static void svm_hardware_disable(void *g
+ wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT);
+
+ cpu_svm_disable();
++
++ amd_pmu_disable_virt();
+ }
+
+ static int svm_hardware_enable(void *garbage)
+@@ -622,6 +625,8 @@ static int svm_hardware_enable(void *gar
+
+ svm_init_erratum_383();
+
++ amd_pmu_enable_virt();
++
+ return 0;
+ }
+
--- /dev/null
+From c8e252586f8d5de906385d8cf6385fee289a825e Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" <hpa@zytor.com>
+Date: Fri, 2 Mar 2012 10:43:48 -0800
+Subject: regset: Prevent null pointer reference on readonly regsets
+
+From: "H. Peter Anvin" <hpa@zytor.com>
+
+commit c8e252586f8d5de906385d8cf6385fee289a825e upstream.
+
+The regset common infrastructure assumed that regsets would always
+have .get and .set methods, but not necessarily .active methods.
+Unfortunately people have since written regsets without .set methods.
+
+Rather than putting in stub functions everywhere, handle regsets with
+null .get or .set methods explicitly.
+
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+Reviewed-by: Oleg Nesterov <oleg@redhat.com>
+Acked-by: Roland McGrath <roland@hack.frob.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/binfmt_elf.c | 2 +-
+ include/linux/regset.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/fs/binfmt_elf.c
++++ b/fs/binfmt_elf.c
+@@ -1421,7 +1421,7 @@ static int fill_thread_core_info(struct
+ for (i = 1; i < view->n; ++i) {
+ const struct user_regset *regset = &view->regsets[i];
+ do_thread_regset_writeback(t->task, regset);
+- if (regset->core_note_type &&
++ if (regset->core_note_type && regset->get &&
+ (!regset->active || regset->active(t->task, regset))) {
+ int ret;
+ size_t size = regset->n * regset->size;
+--- a/include/linux/regset.h
++++ b/include/linux/regset.h
+@@ -335,6 +335,9 @@ static inline int copy_regset_to_user(st
+ {
+ const struct user_regset *regset = &view->regsets[setno];
+
++ if (!regset->get)
++ return -EOPNOTSUPP;
++
+ if (!access_ok(VERIFY_WRITE, data, size))
+ return -EIO;
+
+@@ -358,6 +361,9 @@ static inline int copy_regset_from_user(
+ {
+ const struct user_regset *regset = &view->regsets[setno];
+
++ if (!regset->set)
++ return -EOPNOTSUPP;
++
+ if (!access_ok(VERIFY_READ, data, size))
+ return -EIO;
+
--- /dev/null
+From 5189fa19a4b2b4c3bec37c3a019d446148827717 Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" <hpa@zytor.com>
+Date: Fri, 2 Mar 2012 10:43:49 -0800
+Subject: regset: Return -EFAULT, not -EIO, on host-side memory fault
+
+From: "H. Peter Anvin" <hpa@zytor.com>
+
+commit 5189fa19a4b2b4c3bec37c3a019d446148827717 upstream.
+
+There is only one error code to return for a bad user-space buffer
+pointer passed to a system call in the same address space as the
+system call is executed, and that is EFAULT. Furthermore, the
+low-level access routines, which catch most of the faults, return
+EFAULT already.
+
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+Reviewed-by: Oleg Nesterov <oleg@redhat.com>
+Acked-by: Roland McGrath <roland@hack.frob.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/regset.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/include/linux/regset.h
++++ b/include/linux/regset.h
+@@ -339,7 +339,7 @@ static inline int copy_regset_to_user(st
+ return -EOPNOTSUPP;
+
+ if (!access_ok(VERIFY_WRITE, data, size))
+- return -EIO;
++ return -EFAULT;
+
+ return regset->get(target, regset, offset, size, NULL, data);
+ }
+@@ -365,7 +365,7 @@ static inline int copy_regset_from_user(
+ return -EOPNOTSUPP;
+
+ if (!access_ok(VERIFY_READ, data, size))
+- return -EIO;
++ return -EFAULT;
+
+ return regset->set(target, regset, offset, size, NULL, data);
+ }
i2c-mxs-only-flag-completion-when-queue-is-completely-done.patch
regulator-fix-the-ldo-configure-according-to-88pm860x-spec.patch
s390-keys-enable-the-compat-keyctl-wrapper-on-s390x.patch
+perf-x86-kvm-fix-host-only-guest-only-counting-with-svm-disabled.patch
+alsa-hda-realtek-fix-resume-of-multiple-input-sources.patch
+alsa-hda-add-a-fake-mute-feature.patch
+alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch
+regset-prevent-null-pointer-reference-on-readonly-regsets.patch
+regset-return-efault-not-eio-on-host-side-memory-fault.patch
+mfd-fix-acpi-conflict-check.patch
+mfd-test-for-jack-detection-when-deciding-if-wm8994-should-suspend.patch