Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-05-20 07:01:26 +0200
committerKernel Build Daemon <kbuild@suse.de>2019-05-20 07:01:26 +0200
commit80b7d22f73a1132068733689a5a55f8aee3a3bd6 (patch)
treeb44e12968590a572742d9415574c7a08f3dee2b9
parent43788e3f3e89aae9a8057488471a0a99eafe5d9a (diff)
parent1d28cd14e0a05e8f6cd8043f44ded7f8d09ed007 (diff)
Merge branch 'SLE15' into openSUSE-15.0
-rw-r--r--blacklist.conf1
-rw-r--r--patches.drivers/ALSA-hda-Use-a-macro-for-snd_array-iteration-loops.patch422
-rw-r--r--patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch143
-rw-r--r--patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch43
-rw-r--r--patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch44
-rw-r--r--patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch113
-rw-r--r--series.conf5
7 files changed, 771 insertions, 0 deletions
diff --git a/blacklist.conf b/blacklist.conf
index 3e6e1e47b4..a4ced472c4 100644
--- a/blacklist.conf
+++ b/blacklist.conf
@@ -1112,3 +1112,4 @@ f7a621728a6a23bfd2c6ac4d3e42e1303aefde0f # regulator: missing regulator_lock() A
98fdaaca9537b997062f1abc0aa87c61b50ce40a # Duplicate of fc89a38d99d4b1b33ca5b0e2329f5ddea02ecfb5: drm/i915/opregion: fix version check
a0f52c3d357af218a9c1f7cd906ab70426176a1a # Duplicate of 16eb0f34cdf4cf04cd92762c7a79f98aa51e053f: drm/i915/opregion: rvda is relative from opregion base in opregion 2.1+
+ed180abba7f1fc3cf04ffa27767b1bcc8e8c842a # sound/hda: breaks kABI
diff --git a/patches.drivers/ALSA-hda-Use-a-macro-for-snd_array-iteration-loops.patch b/patches.drivers/ALSA-hda-Use-a-macro-for-snd_array-iteration-loops.patch
new file mode 100644
index 0000000000..8a80fee511
--- /dev/null
+++ b/patches.drivers/ALSA-hda-Use-a-macro-for-snd_array-iteration-loops.patch
@@ -0,0 +1,422 @@
+From a9c2dfc8527318a27db045cd7ea51e8ecab8c884 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 23 Apr 2018 17:24:56 +0200
+Subject: [PATCH] ALSA: hda - Use a macro for snd_array iteration loops
+Git-commit: a9c2dfc8527318a27db045cd7ea51e8ecab8c884
+Patch-mainline: v4.18-rc1
+References: bsc#1051510
+
+Introduce a new helper macro, snd_array_for_each(), to iterate for
+each snd_array element. It slightly improves the readability than
+lengthy open codes at each place.
+
+Along with it, add const prefix to some obvious places.
+
+There should be no functional changes by this.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ include/sound/hdaudio.h | 5 +++++
+ sound/hda/hdac_regmap.c | 4 ++--
+ sound/pci/hda/hda_auto_parser.c | 10 +++++-----
+ sound/pci/hda/hda_codec.c | 36 ++++++++++++++++++------------------
+ sound/pci/hda/hda_generic.c | 27 +++++++++++++--------------
+ sound/pci/hda/hda_sysfs.c | 20 ++++++++++----------
+ sound/pci/hda/patch_conexant.c | 5 ++---
+ sound/pci/hda/patch_realtek.c | 4 ++--
+ 8 files changed, 57 insertions(+), 54 deletions(-)
+
+diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
+index 06536e01ed94..c052afc27547 100644
+--- a/include/sound/hdaudio.h
++++ b/include/sound/hdaudio.h
+@@ -571,4 +571,9 @@ static inline unsigned int snd_array_index(struct snd_array *array, void *ptr)
+ return (unsigned long)(ptr - array->list) / array->elem_size;
+ }
+
++/* a helper macro to iterate for each snd_array element */
++#define snd_array_for_each(array, idx, ptr) \
++ for ((idx) = 0, (ptr) = (array)->list; (idx) < (array)->used; \
++ (ptr) = snd_array_elem(array, ++(idx)))
++
+ #endif /* __SOUND_HDAUDIO_H */
+diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c
+index 47a358fab132..419e285e0226 100644
+--- a/sound/hda/hdac_regmap.c
++++ b/sound/hda/hdac_regmap.c
+@@ -65,10 +65,10 @@ static bool hda_writeable_reg(struct device *dev, unsigned int reg)
+ {
+ struct hdac_device *codec = dev_to_hdac_dev(dev);
+ unsigned int verb = get_verb(reg);
++ const unsigned int *v;
+ int i;
+
+- for (i = 0; i < codec->vendor_verbs.used; i++) {
+- unsigned int *v = snd_array_elem(&codec->vendor_verbs, i);
++ snd_array_for_each(&codec->vendor_verbs, i, v) {
+ if (verb == *v)
+ return true;
+ }
+diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
+index d3ea73171a3d..b9a6b66aeb0e 100644
+--- a/sound/pci/hda/hda_auto_parser.c
++++ b/sound/pci/hda/hda_auto_parser.c
+@@ -793,11 +793,11 @@ EXPORT_SYMBOL_GPL(snd_hda_add_verbs);
+ */
+ void snd_hda_apply_verbs(struct hda_codec *codec)
+ {
++ const struct hda_verb **v;
+ int i;
+- for (i = 0; i < codec->verbs.used; i++) {
+- struct hda_verb **v = snd_array_elem(&codec->verbs, i);
++
++ snd_array_for_each(&codec->verbs, i, v)
+ snd_hda_sequence_write(codec, *v);
+- }
+ }
+ EXPORT_SYMBOL_GPL(snd_hda_apply_verbs);
+
+@@ -890,10 +890,10 @@ EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
+ static bool pin_config_match(struct hda_codec *codec,
+ const struct hda_pintbl *pins)
+ {
++ const struct hda_pincfg *pin;
+ int i;
+
+- for (i = 0; i < codec->init_pins.used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
++ snd_array_for_each(&codec->init_pins, i, pin) {
+ hda_nid_t nid = pin->nid;
+ u32 cfg = pin->cfg;
+ const struct hda_pintbl *t_pins;
+diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
+index 5bc3a7468e17..0aa923d129f5 100644
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -481,9 +481,10 @@ static struct hda_pincfg *look_up_pincfg(struct hda_codec *codec,
+ struct snd_array *array,
+ hda_nid_t nid)
+ {
++ struct hda_pincfg *pin;
+ int i;
+- for (i = 0; i < array->used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(array, i);
++
++ snd_array_for_each(array, i, pin) {
+ if (pin->nid == nid)
+ return pin;
+ }
+@@ -618,14 +619,15 @@ EXPORT_SYMBOL_GPL(snd_hda_codec_get_pin_target);
+ */
+ void snd_hda_shutup_pins(struct hda_codec *codec)
+ {
++ const struct hda_pincfg *pin;
+ int i;
++
+ /* don't shut up pins when unloading the driver; otherwise it breaks
+ * the default pin setup at the next load of the driver
+ */
+ if (codec->bus->shutdown)
+ return;
+- for (i = 0; i < codec->init_pins.used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
++ snd_array_for_each(&codec->init_pins, i, pin) {
+ /* use read here for syncing after issuing each verb */
+ snd_hda_codec_read(codec, pin->nid, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
+@@ -638,13 +640,14 @@ EXPORT_SYMBOL_GPL(snd_hda_shutup_pins);
+ /* Restore the pin controls cleared previously via snd_hda_shutup_pins() */
+ static void restore_shutup_pins(struct hda_codec *codec)
+ {
++ const struct hda_pincfg *pin;
+ int i;
++
+ if (!codec->pins_shutup)
+ return;
+ if (codec->bus->shutdown)
+ return;
+- for (i = 0; i < codec->init_pins.used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
++ snd_array_for_each(&codec->init_pins, i, pin) {
+ snd_hda_codec_write(codec, pin->nid, 0,
+ AC_VERB_SET_PIN_WIDGET_CONTROL,
+ pin->ctrl);
+@@ -697,8 +700,7 @@ get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid)
+ struct hda_cvt_setup *p;
+ int i;
+
+- for (i = 0; i < codec->cvt_setups.used; i++) {
+- p = snd_array_elem(&codec->cvt_setups, i);
++ snd_array_for_each(&codec->cvt_setups, i, p) {
+ if (p->nid == nid)
+ return p;
+ }
+@@ -1076,8 +1078,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
+ /* make other inactive cvts with the same stream-tag dirty */
+ type = get_wcaps_type(get_wcaps(codec, nid));
+ list_for_each_codec(c, codec->bus) {
+- for (i = 0; i < c->cvt_setups.used; i++) {
+- p = snd_array_elem(&c->cvt_setups, i);
++ snd_array_for_each(&c->cvt_setups, i, p) {
+ if (!p->active && p->stream_tag == stream_tag &&
+ get_wcaps_type(get_wcaps(c, p->nid)) == type)
+ p->dirty = 1;
+@@ -1140,12 +1141,11 @@ static void really_cleanup_stream(struct hda_codec *codec,
+ static void purify_inactive_streams(struct hda_codec *codec)
+ {
+ struct hda_codec *c;
++ struct hda_cvt_setup *p;
+ int i;
+
+ list_for_each_codec(c, codec->bus) {
+- for (i = 0; i < c->cvt_setups.used; i++) {
+- struct hda_cvt_setup *p;
+- p = snd_array_elem(&c->cvt_setups, i);
++ snd_array_for_each(&c->cvt_setups, i, p) {
+ if (p->dirty)
+ really_cleanup_stream(c, p);
+ }
+@@ -1156,10 +1156,10 @@ static void purify_inactive_streams(struct hda_codec *codec)
+ /* clean up all streams; called from suspend */
+ static void hda_cleanup_all_streams(struct hda_codec *codec)
+ {
++ struct hda_cvt_setup *p;
+ int i;
+
+- for (i = 0; i < codec->cvt_setups.used; i++) {
+- struct hda_cvt_setup *p = snd_array_elem(&codec->cvt_setups, i);
++ snd_array_for_each(&codec->cvt_setups, i, p) {
+ if (p->stream_tag)
+ really_cleanup_stream(codec, p);
+ }
+@@ -2461,10 +2461,10 @@ EXPORT_SYMBOL_GPL(snd_hda_create_dig_out_ctls);
+ struct hda_spdif_out *snd_hda_spdif_out_of_nid(struct hda_codec *codec,
+ hda_nid_t nid)
+ {
++ struct hda_spdif_out *spdif;
+ int i;
+- for (i = 0; i < codec->spdif_out.used; i++) {
+- struct hda_spdif_out *spdif =
+- snd_array_elem(&codec->spdif_out, i);
++
++ snd_array_for_each(&codec->spdif_out, i, spdif) {
+ if (spdif->nid == nid)
+ return spdif;
+ }
+diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
+index 5cc65093d941..51030f040745 100644
+--- a/sound/pci/hda/hda_generic.c
++++ b/sound/pci/hda/hda_generic.c
+@@ -264,10 +264,10 @@ static struct nid_path *get_nid_path(struct hda_codec *codec,
+ int anchor_nid)
+ {
+ struct hda_gen_spec *spec = codec->spec;
++ struct nid_path *path;
+ int i;
+
+- for (i = 0; i < spec->paths.used; i++) {
+- struct nid_path *path = snd_array_elem(&spec->paths, i);
++ snd_array_for_each(&spec->paths, i, path) {
+ if (path->depth <= 0)
+ continue;
+ if ((!from_nid || path->path[0] == from_nid) &&
+@@ -325,10 +325,10 @@ EXPORT_SYMBOL_GPL(snd_hda_get_path_from_idx);
+ static bool is_dac_already_used(struct hda_codec *codec, hda_nid_t nid)
+ {
+ struct hda_gen_spec *spec = codec->spec;
++ const struct nid_path *path;
+ int i;
+
+- for (i = 0; i < spec->paths.used; i++) {
+- struct nid_path *path = snd_array_elem(&spec->paths, i);
++ snd_array_for_each(&spec->paths, i, path) {
+ if (path->path[0] == nid)
+ return true;
+ }
+@@ -351,11 +351,11 @@ static bool is_reachable_path(struct hda_codec *codec,
+ static bool is_ctl_used(struct hda_codec *codec, unsigned int val, int type)
+ {
+ struct hda_gen_spec *spec = codec->spec;
++ const struct nid_path *path;
+ int i;
+
+ val &= AMP_VAL_COMPARE_MASK;
+- for (i = 0; i < spec->paths.used; i++) {
+- struct nid_path *path = snd_array_elem(&spec->paths, i);
++ snd_array_for_each(&spec->paths, i, path) {
+ if ((path->ctls[type] & AMP_VAL_COMPARE_MASK) == val)
+ return true;
+ }
+@@ -638,13 +638,13 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
+ {
+ struct hda_gen_spec *spec = codec->spec;
+ int type = get_wcaps_type(get_wcaps(codec, nid));
++ const struct nid_path *path;
+ int i, n;
+
+ if (nid == codec->core.afg)
+ return true;
+
+- for (n = 0; n < spec->paths.used; n++) {
+- struct nid_path *path = snd_array_elem(&spec->paths, n);
++ snd_array_for_each(&spec->paths, n, path) {
+ if (!path->active)
+ continue;
+ if (codec->power_save_node) {
+@@ -2696,10 +2696,10 @@ static const struct snd_kcontrol_new out_jack_mode_enum = {
+ static bool find_kctl_name(struct hda_codec *codec, const char *name, int idx)
+ {
+ struct hda_gen_spec *spec = codec->spec;
++ const struct snd_kcontrol_new *kctl;
+ int i;
+
+- for (i = 0; i < spec->kctls.used; i++) {
+- struct snd_kcontrol_new *kctl = snd_array_elem(&spec->kctls, i);
++ snd_array_for_each(&spec->kctls, i, kctl) {
+ if (!strcmp(kctl->name, name) && kctl->index == idx)
+ return true;
+ }
+@@ -4021,8 +4021,7 @@ static hda_nid_t set_path_power(struct hda_codec *codec, hda_nid_t nid,
+ struct nid_path *path;
+ int n;
+
+- for (n = 0; n < spec->paths.used; n++) {
+- path = snd_array_elem(&spec->paths, n);
++ snd_array_for_each(&spec->paths, n, path) {
+ if (!path->depth)
+ continue;
+ if (path->path[0] == nid ||
+@@ -5831,10 +5830,10 @@ static void init_digital(struct hda_codec *codec)
+ */
+ static void clear_unsol_on_unused_pins(struct hda_codec *codec)
+ {
++ const struct hda_pincfg *pin;
+ int i;
+
+- for (i = 0; i < codec->init_pins.used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
++ snd_array_for_each(&codec->init_pins, i, pin) {
+ hda_nid_t nid = pin->nid;
+ if (is_jack_detectable(codec, nid) &&
+ !snd_hda_jack_tbl_get(codec, nid))
+diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
+index 9b7efece4484..6ec79c58d48d 100644
+--- a/sound/pci/hda/hda_sysfs.c
++++ b/sound/pci/hda/hda_sysfs.c
+@@ -80,10 +80,10 @@ static ssize_t pin_configs_show(struct hda_codec *codec,
+ struct snd_array *list,
+ char *buf)
+ {
++ const struct hda_pincfg *pin;
+ int i, len = 0;
+ mutex_lock(&codec->user_mutex);
+- for (i = 0; i < list->used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(list, i);
++ snd_array_for_each(list, i, pin) {
+ len += sprintf(buf + len, "0x%02x 0x%08x\n",
+ pin->nid, pin->cfg);
+ }
+@@ -217,10 +217,10 @@ static ssize_t init_verbs_show(struct device *dev,
+ char *buf)
+ {
+ struct hda_codec *codec = dev_get_drvdata(dev);
++ const struct hda_verb *v;
+ int i, len = 0;
+ mutex_lock(&codec->user_mutex);
+- for (i = 0; i < codec->init_verbs.used; i++) {
+- struct hda_verb *v = snd_array_elem(&codec->init_verbs, i);
++ snd_array_for_each(&codec->init_verbs, i, v) {
+ len += snprintf(buf + len, PAGE_SIZE - len,
+ "0x%02x 0x%03x 0x%04x\n",
+ v->nid, v->verb, v->param);
+@@ -267,10 +267,10 @@ static ssize_t hints_show(struct device *dev,
+ char *buf)
+ {
+ struct hda_codec *codec = dev_get_drvdata(dev);
++ const struct hda_hint *hint;
+ int i, len = 0;
+ mutex_lock(&codec->user_mutex);
+- for (i = 0; i < codec->hints.used; i++) {
+- struct hda_hint *hint = snd_array_elem(&codec->hints, i);
++ snd_array_for_each(&codec->hints, i, hint) {
+ len += snprintf(buf + len, PAGE_SIZE - len,
+ "%s = %s\n", hint->key, hint->val);
+ }
+@@ -280,10 +280,10 @@ static ssize_t hints_show(struct device *dev,
+
+ static struct hda_hint *get_hint(struct hda_codec *codec, const char *key)
+ {
++ struct hda_hint *hint;
+ int i;
+
+- for (i = 0; i < codec->hints.used; i++) {
+- struct hda_hint *hint = snd_array_elem(&codec->hints, i);
++ snd_array_for_each(&codec->hints, i, hint) {
+ if (!strcmp(hint->key, key))
+ return hint;
+ }
+@@ -783,13 +783,13 @@ void snd_hda_sysfs_init(struct hda_codec *codec)
+ void snd_hda_sysfs_clear(struct hda_codec *codec)
+ {
+ #ifdef CONFIG_SND_HDA_RECONFIG
++ struct hda_hint *hint;
+ int i;
+
+ /* clear init verbs */
+ snd_array_free(&codec->init_verbs);
+ /* clear hints */
+- for (i = 0; i < codec->hints.used; i++) {
+- struct hda_hint *hint = snd_array_elem(&codec->hints, i);
++ snd_array_for_each(&codec->hints, i, hint) {
+ kfree(hint->key); /* we don't need to free hint->val */
+ }
+ snd_array_free(&codec->hints);
+diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
+index 5b4dbcec6de8..093d2a9ece85 100644
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -588,6 +588,7 @@ static void cxt_fixup_olpc_xo(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+ {
+ struct conexant_spec *spec = codec->spec;
++ struct snd_kcontrol_new *kctl;
+ int i;
+
+ if (action != HDA_FIXUP_ACT_PROBE)
+@@ -606,9 +607,7 @@ static void cxt_fixup_olpc_xo(struct hda_codec *codec,
+ snd_hda_codec_set_pin_target(codec, 0x1a, PIN_VREF50);
+
+ /* override mic boost control */
+- for (i = 0; i < spec->gen.kctls.used; i++) {
+- struct snd_kcontrol_new *kctl =
+- snd_array_elem(&spec->gen.kctls, i);
++ snd_array_for_each(&spec->gen.kctls, i, kctl) {
+ if (!strcmp(kctl->name, "Mic Boost Volume")) {
+ kctl->put = olpc_xo_mic_boost_put;
+ break;
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index aef1f52db7d9..7f2d5b157b75 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -2828,6 +2828,7 @@ static int find_ext_mic_pin(struct hda_codec *codec);
+
+ static void alc286_shutup(struct hda_codec *codec)
+ {
++ const struct hda_pincfg *pin;
+ int i;
+ int mic_pin = find_ext_mic_pin(codec);
+ /* don't shut up pins when unloading the driver; otherwise it breaks
+@@ -2835,8 +2836,7 @@ static void alc286_shutup(struct hda_codec *codec)
+ */
+ if (codec->bus->shutdown)
+ return;
+- for (i = 0; i < codec->init_pins.used; i++) {
+- struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
++ snd_array_for_each(&codec->init_pins, i, pin) {
+ /* use read here for syncing after issuing each verb */
+ if (pin->nid != mic_pin)
+ snd_hda_codec_read(codec, pin->nid, 0,
+--
+2.16.4
+
diff --git a/patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch b/patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch
new file mode 100644
index 0000000000..5644dd7536
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch
@@ -0,0 +1,143 @@
+From c9af753f26bdf80291eb2c2279b9de1989fbc591 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 10 May 2019 11:01:43 +0200
+Subject: [PATCH] ALSA: hda/realtek - Avoid superfluous COEF EAPD setups
+Git-commit: c9af753f26bdf80291eb2c2279b9de1989fbc591
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Realtek codec driver applied the COEF setups to change the EAPD
+control to the default mode (i.e. control by EPAD verbs) at the init
+callback. It works, but this is too excessive at the same time, since
+it's called at each runtime PM resume. That is, the initialization
+should be done only once after the probe. One may think that moving
+this to the probe should be OK, but no -- there is a catch; when a
+system resumes from S4 (hibernation), we need to re-initialize this
+again manually, because it's out of regcache restoration.
+
+This patch addresses the issue by introducing alc_pre_init() function
+that performs such a task. This is called from each codec probe
+function, and it's called from the resume callback conditionally only
+from S4 resume.
+
+Reported-and-tested-by: Kailang Yang <kailang@realtek.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 31 ++++++++++++++++++++++++++++++-
+ 1 file changed, 30 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -509,7 +509,6 @@ static void alc_eapd_shutup(struct hda_c
+ /* generic EAPD initialization */
+ static void alc_auto_init_amp(struct hda_codec *codec, int type)
+ {
+- alc_fill_eapd_coef(codec);
+ alc_auto_setup_eapd(codec, true);
+ alc_write_gpio(codec);
+ switch (type) {
+@@ -837,10 +836,22 @@ static int alc_build_controls(struct hda
+ * Common callbacks
+ */
+
++static void alc_pre_init(struct hda_codec *codec)
++{
++ alc_fill_eapd_coef(codec);
++}
++
++#define is_s4_resume(codec) \
++ ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
++
+ static int alc_init(struct hda_codec *codec)
+ {
+ struct alc_spec *spec = codec->spec;
+
++ /* hibernation resume needs the full chip initialization */
++ if (is_s4_resume(codec))
++ alc_pre_init(codec);
++
+ if (spec->init_hook)
+ spec->init_hook(codec);
+
+@@ -1556,6 +1567,8 @@ static int patch_alc880(struct hda_codec
+
+ codec->patch_ops.unsol_event = alc880_unsol_event;
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
+ alc880_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+@@ -1804,6 +1817,8 @@ static int patch_alc260(struct hda_codec
+
+ spec->shutup = alc_eapd_shutup;
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
+ alc260_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+@@ -2512,6 +2527,8 @@ static int patch_alc882(struct hda_codec
+ break;
+ }
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
+ alc882_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+@@ -2675,6 +2692,8 @@ static int patch_alc262(struct hda_codec
+ #endif
+ alc_fix_pll_init(codec, 0x20, 0x0a, 10);
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
+ alc262_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+@@ -2816,6 +2835,8 @@ static int patch_alc268(struct hda_codec
+
+ spec->shutup = alc_eapd_shutup;
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+
+@@ -7518,6 +7539,8 @@ static int patch_alc269(struct hda_codec
+ spec->shutup = alc_default_shutup;
+ spec->init_hook = alc_default_init;
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc269_fixup_models,
+ alc269_fixup_tbl, alc269_fixups);
+ snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
+@@ -7782,6 +7805,8 @@ static int patch_alc861(struct hda_codec
+ spec->power_hook = alc_power_eapd;
+ #endif
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+
+@@ -7871,6 +7896,8 @@ static int patch_alc861vd(struct hda_cod
+
+ spec->shutup = alc_eapd_shutup;
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
+ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
+
+@@ -8592,6 +8619,8 @@ static int patch_alc662(struct hda_codec
+ break;
+ }
+
++ alc_pre_init(codec);
++
+ snd_hda_pick_fixup(codec, alc662_fixup_models,
+ alc662_fixup_tbl, alc662_fixups);
+ snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
diff --git a/patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch b/patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch
new file mode 100644
index 0000000000..1814966393
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch
@@ -0,0 +1,43 @@
+From 891afcf2462d2cc4ef7caf94215358ca61fa32cb Mon Sep 17 00:00:00 2001
+From: Jeremy Soller <jeremy@system76.com>
+Date: Fri, 10 May 2019 10:15:07 -0400
+Subject: [PATCH] ALSA: hda/realtek - Corrected fixup for System76 Gazelle (gaze14)
+Git-commit: 891afcf2462d2cc4ef7caf94215358ca61fa32cb
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+A mistake was made in the identification of the four variants of the
+System76 Gazelle (gaze14). This patch corrects the PCI ID of the
+17-inch, GTX 1660 Ti variant from 0x8560 to 0x8551. This patch also
+adds the correct fixups for the 15-inch and 17-inch GTX 1650 variants
+with PCI IDs 0x8560 and 0x8561.
+
+Tests were done on all four variants ensuring full audio capability.
+
+Fixes: 80a5052db751 ("ALSA: hdea/realtek - Headset fixup for System76 Gazelle (gaze14)")
+Signed-off-by: Jeremy Soller <jeremy@system76.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index 2a50e580aa56..3511ea91eae8 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -6997,7 +6997,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+ SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+- SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++ SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++ SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
++ SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
+ SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
+ SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
+--
+2.16.4
+
diff --git a/patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch b/patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch
new file mode 100644
index 0000000000..8d98d5c0bb
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch
@@ -0,0 +1,44 @@
+From 56df90b631fc027fe28b70d41352d820797239bb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20Wadowski?= <wadosm@gmail.com>
+Date: Tue, 14 May 2019 16:58:00 +0200
+Subject: [PATCH] ALSA: hda/realtek - Fix for Lenovo B50-70 inverted internal microphone bug
+Mime-version: 1.0
+Content-type: text/plain; charset=UTF-8
+Content-transfer-encoding: 8bit
+Git-commit: 56df90b631fc027fe28b70d41352d820797239bb
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Add patch for realtek codec in Lenovo B50-70 that fixes inverted
+internal microphone channel.
+Device IdeaPad Y410P has the same PCI SSID as Lenovo B50-70,
+but first one is about fix the noise and it didn't seem help in a
+later kernel version.
+So I replaced IdeaPad Y410P device description with B50-70 and apply
+inverted microphone fix.
+
+Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215
+Signed-off-by: MichaƂ Wadowski <wadosm@gmail.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index 3511ea91eae8..f83f21d64dd4 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -7042,7 +7042,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+ SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
+ SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
+ SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
+- SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
++ SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
+ SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+ SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
+ SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
+--
+2.16.4
+
diff --git a/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch b/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
new file mode 100644
index 0000000000..8bb6f289b5
--- /dev/null
+++ b/patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
@@ -0,0 +1,113 @@
+From dad3197da7a3817f27bb24f7fd3c135ffa707202 Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Fri, 10 May 2019 16:28:57 +0800
+Subject: [PATCH] ALSA: hda/realtek - Fixup headphone noise via runtime suspend
+Git-commit: dad3197da7a3817f27bb24f7fd3c135ffa707202
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Dell platform with ALC298.
+system enter to runtime suspend. Headphone had noise.
+Let Headset Mic not shutup will solve this issue.
+
+[ Fixed minor coding style issues by tiwai ]
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 59 +++++++++++++++++++++++++------------------
+ 1 file changed, 35 insertions(+), 24 deletions(-)
+
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index c53ca589c930..c39f48e02ee9 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -478,12 +478,45 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
+ set_eapd(codec, *p, on);
+ }
+
++static int find_ext_mic_pin(struct hda_codec *codec);
++
++static void alc_headset_mic_no_shutup(struct hda_codec *codec)
++{
++ const struct hda_pincfg *pin;
++ int mic_pin = find_ext_mic_pin(codec);
++ int i;
++
++ /* don't shut up pins when unloading the driver; otherwise it breaks
++ * the default pin setup at the next load of the driver
++ */
++ if (codec->bus->shutdown)
++ return;
++
++ snd_array_for_each(&codec->init_pins, i, pin) {
++ /* use read here for syncing after issuing each verb */
++ if (pin->nid != mic_pin)
++ snd_hda_codec_read(codec, pin->nid, 0,
++ AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
++ }
++
++ codec->pins_shutup = 1;
++}
++
+ static void alc_shutup_pins(struct hda_codec *codec)
+ {
+ struct alc_spec *spec = codec->spec;
+
+- if (!spec->no_shutup_pins)
+- snd_hda_shutup_pins(codec);
++ switch (codec->core.vendor_id) {
++ case 0x10ec0286:
++ case 0x10ec0288:
++ case 0x10ec0298:
++ alc_headset_mic_no_shutup(codec);
++ break;
++ default:
++ if (!spec->no_shutup_pins)
++ snd_hda_shutup_pins(codec);
++ break;
++ }
+ }
+
+ /* generic shutup callback;
+@@ -2924,27 +2957,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
+ return alc_parse_auto_config(codec, alc269_ignore, ssids);
+ }
+
+-static int find_ext_mic_pin(struct hda_codec *codec);
+-
+-static void alc286_shutup(struct hda_codec *codec)
+-{
+- const struct hda_pincfg *pin;
+- int i;
+- int mic_pin = find_ext_mic_pin(codec);
+- /* don't shut up pins when unloading the driver; otherwise it breaks
+- * the default pin setup at the next load of the driver
+- */
+- if (codec->bus->shutdown)
+- return;
+- snd_array_for_each(&codec->init_pins, i, pin) {
+- /* use read here for syncing after issuing each verb */
+- if (pin->nid != mic_pin)
+- snd_hda_codec_read(codec, pin->nid, 0,
+- AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
+- }
+- codec->pins_shutup = 1;
+-}
+-
+ static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
+ {
+ alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
+@@ -7736,7 +7748,6 @@ static int patch_alc269(struct hda_codec *codec)
+ case 0x10ec0286:
+ case 0x10ec0288:
+ spec->codec_variant = ALC269_TYPE_ALC286;
+- spec->shutup = alc286_shutup;
+ break;
+ case 0x10ec0298:
+ spec->codec_variant = ALC269_TYPE_ALC298;
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index b06ab7a45b..abc5ee0fb3 100644
--- a/series.conf
+++ b/series.conf
@@ -16600,6 +16600,7 @@
patches.drm/drm-exynos-Fix-default-value-for-zpos-plane-property
patches.drivers/ALSA-usb-audio-simplify-set_sync_ep_implicit_fb_quir
patches.drivers/ALSA-usb-audio-add-more-quirks-for-DSD-interfaces
+ patches.drivers/ALSA-hda-Use-a-macro-for-snd_array-iteration-loops.patch
patches.drivers/ALSA-hda-ca0132-fix-build-failure-when-a-local-macro
patches.drivers/ALSA-usb-audio-Initialize-Dell-Dock-playback-volumes
patches.drivers/ALSA-usb-audio-Avoid-superfluous-usb_set_interface-c
@@ -22044,6 +22045,10 @@
patches.drivers/media-atmel-atmel-isc-fix-INIT_WORK-misplacement.patch
patches.drivers/media-omap_vout-potential-buffer-overflow-in-vidioc_.patch
patches.drivers/media-davinci-vpbe-array-underflow-in-vpbe_enum_outp.patch
+ patches.drivers/ALSA-hda-realtek-Fixup-headphone-noise-via-runtime-s.patch
+ patches.drivers/ALSA-hda-realtek-Avoid-superfluous-COEF-EAPD-setups.patch
+ patches.drivers/ALSA-hda-realtek-Corrected-fixup-for-System76-Gazell.patch
+ patches.drivers/ALSA-hda-realtek-Fix-for-Lenovo-B50-70-inverted-inte.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch