diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/debian/bzr-builder.manifest oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/debian/bzr-builder.manifest --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/debian/bzr-builder.manifest 2017-03-09 03:02:10.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/debian/bzr-builder.manifest 2017-06-26 03:02:10.000000000 +0000 @@ -1,5 +1,5 @@ -# bzr-builder format 0.3 deb-version 0.201703090302 -lp:~ubuntu-audio-dev/alsa-driver/dkms-packaging revid:hui.wang@canonical.com-20170308013134-tkw0srunn3ad71mf -nest-part upstream_pci_hda lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit pci/hda hda-src-from-tree revid:git-v1:155f378f03688b71e6c1bf87610cf7cd6f0b8504 -nest-part upstream_hda_core lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit hda hda-src-from-tree/hdacore revid:git-v1:155f378f03688b71e6c1bf87610cf7cd6f0b8504 -nest-part upstream_include lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit include include-src-from-tree revid:git-v1:155f378f03688b71e6c1bf87610cf7cd6f0b8504 +# bzr-builder format 0.3 deb-version 0.201706260301 +lp:~ubuntu-audio-dev/alsa-driver/dkms-packaging revid:hui.wang@canonical.com-20170621080216-3dimm8mujv1pd4fh +nest-part upstream_pci_hda lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit pci/hda hda-src-from-tree revid:git-v1:3fb216a5596e800e6811873db04849eb1e0bae4d +nest-part upstream_hda_core lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit hda hda-src-from-tree/hdacore revid:git-v1:3fb216a5596e800e6811873db04849eb1e0bae4d +nest-part upstream_include lp:~hui.wang/alsa-driver/tiwai-trunk-ffgit include include-src-from-tree revid:git-v1:3fb216a5596e800e6811873db04849eb1e0bae4d diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/debian/changelog oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/debian/changelog --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/debian/changelog 2017-03-09 03:02:10.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/debian/changelog 2017-06-26 03:02:10.000000000 +0000 @@ -1,8 +1,8 @@ -oem-audio-hda-daily-dkms (0.201703090302~ubuntu16.04.1) xenial; urgency=low +oem-audio-hda-daily-dkms (0.201706260301~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Launchpad Package Builder Thu, 09 Mar 2017 03:02:10 +0000 + -- Launchpad Package Builder Mon, 26 Jun 2017 03:02:10 +0000 oem-audio-hda-daily-dkms (0.1) trusty; urgency=low diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/dell_wmi_helper.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/dell_wmi_helper.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/dell_wmi_helper.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/dell_wmi_helper.c 2017-06-26 03:02:08.000000000 +0000 @@ -2,11 +2,11 @@ * to be included from codec driver */ -#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) +#if IS_ENABLED(CONFIG_DELL_LAPTOP) #include static int dell_led_value; -static int (*dell_led_set_func)(int, int); +static int (*dell_micmute_led_set_func)(int); static void (*dell_old_cap_hook)(struct hda_codec *, struct snd_kcontrol *, struct snd_ctl_elem_value *); @@ -18,7 +18,7 @@ if (dell_old_cap_hook) dell_old_cap_hook(codec, kcontrol, ucontrol); - if (!ucontrol || !dell_led_set_func) + if (!ucontrol || !dell_micmute_led_set_func) return; if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { /* TODO: How do I verify if it's a mono or stereo here? */ @@ -26,8 +26,8 @@ if (val == dell_led_value) return; dell_led_value = val; - if (dell_led_set_func) - dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + if (dell_micmute_led_set_func) + dell_micmute_led_set_func(dell_led_value); } } @@ -39,15 +39,15 @@ bool removefunc = false; if (action == HDA_FIXUP_ACT_PROBE) { - if (!dell_led_set_func) - dell_led_set_func = symbol_request(dell_app_wmi_led_set); - if (!dell_led_set_func) { - codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + if (!dell_micmute_led_set_func) + dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); + if (!dell_micmute_led_set_func) { + codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); return; } removefunc = true; - if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + if (dell_micmute_led_set_func(false) >= 0) { dell_led_value = 0; if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); @@ -60,17 +60,17 @@ } - if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { - symbol_put(dell_app_wmi_led_set); - dell_led_set_func = NULL; + if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { + symbol_put(dell_micmute_led_set); + dell_micmute_led_set_func = NULL; dell_old_cap_hook = NULL; } } -#else /* CONFIG_LEDS_DELL_NETBOOKS */ +#else /* CONFIG_DELL_LAPTOP */ static void alc_fixup_dell_wmi(struct hda_codec *codec, const struct hda_fixup *fix, int action) { } -#endif /* CONFIG_LEDS_DELL_NETBOOKS */ +#endif /* CONFIG_DELL_LAPTOP */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_auto_parser.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_auto_parser.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_auto_parser.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_auto_parser.c 2017-06-26 03:02:08.000000000 +0000 @@ -580,6 +580,7 @@ has_multiple_pins = 1; if (has_multiple_pins && type == AUTO_PIN_MIC) has_multiple_pins &= check_mic_location_need(codec, cfg, input); + has_multiple_pins |= codec->force_pin_prefix; return hda_get_input_pin_label(codec, &cfg->inputs[input], cfg->inputs[input].pin, has_multiple_pins); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_codec.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_codec.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_codec.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_codec.c 2017-06-26 03:02:08.000000000 +0000 @@ -19,13 +19,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include #include #include -#include #include #include #include @@ -1477,18 +1475,8 @@ } EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_put); -/** - * snd_hda_mixer_amp_volume_put - TLV callback for a standard AMP mixer volume - * @kcontrol: ctl element - * @op_flag: operation flag - * @size: byte size of input TLV - * @_tlv: TLV data - * - * The control element is supposed to have the private_value field - * set up via HDA_COMPOSE_AMP_VAL*() or related macros. - */ -int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, - unsigned int size, unsigned int __user *_tlv) +/* inquiry the amp caps and convert to TLV */ +static void get_ctl_amp_tlv(struct snd_kcontrol *kcontrol, unsigned int *tlv) { struct hda_codec *codec = snd_kcontrol_chip(kcontrol); hda_nid_t nid = get_amp_nid(kcontrol); @@ -1497,8 +1485,6 @@ bool min_mute = get_amp_min_mute(kcontrol); u32 caps, val1, val2; - if (size < 4 * sizeof(unsigned int)) - return -ENOMEM; caps = query_amp_caps(codec, nid, dir); val2 = (caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_STEP_SIZE_SHIFT; val2 = (val2 + 1) * 25; @@ -1507,13 +1493,31 @@ val1 = ((int)val1) * ((int)val2); if (min_mute || (caps & AC_AMPCAP_MIN_MUTE)) val2 |= TLV_DB_SCALE_MUTE; - if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) - return -EFAULT; - if (put_user(2 * sizeof(unsigned int), _tlv + 1)) - return -EFAULT; - if (put_user(val1, _tlv + 2)) - return -EFAULT; - if (put_user(val2, _tlv + 3)) + tlv[0] = SNDRV_CTL_TLVT_DB_SCALE; + tlv[1] = 2 * sizeof(unsigned int); + tlv[2] = val1; + tlv[3] = val2; +} + +/** + * snd_hda_mixer_amp_tlv - TLV callback for a standard AMP mixer volume + * @kcontrol: ctl element + * @op_flag: operation flag + * @size: byte size of input TLV + * @_tlv: TLV data + * + * The control element is supposed to have the private_value field + * set up via HDA_COMPOSE_AMP_VAL*() or related macros. + */ +int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, + unsigned int size, unsigned int __user *_tlv) +{ + unsigned int tlv[4]; + + if (size < 4 * sizeof(unsigned int)) + return -ENOMEM; + get_ctl_amp_tlv(kcontrol, tlv); + if (copy_to_user(_tlv, tlv, sizeof(tlv))) return -EFAULT; return 0; } @@ -1807,13 +1811,10 @@ const int *tlv = NULL; int val = -1; - if (kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { - /* FIXME: set_fs() hack for obtaining user-space TLV data */ - mm_segment_t fs = get_fs(); - set_fs(get_ds()); - if (!kctl->tlv.c(kctl, 0, sizeof(_tlv), _tlv)) - tlv = _tlv; - set_fs(fs); + if ((kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) && + kctl->tlv.c == snd_hda_mixer_amp_tlv) { + get_ctl_amp_tlv(kctl, _tlv); + tlv = _tlv; } else if (kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) tlv = kctl->tlv.p; if (tlv && tlv[0] == SNDRV_CTL_TLVT_DB_SCALE) { @@ -2118,196 +2119,6 @@ EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_put); /* - * bound volume controls - * - * bind multiple volumes (# indices, from 0) - */ - -#define AMP_VAL_IDX_SHIFT 19 -#define AMP_VAL_IDX_MASK (0x0f<<19) - -/** - * snd_hda_mixer_bind_switch_get - Get callback for a bound volume control - * @kcontrol: ctl element - * @ucontrol: pointer to get/store the data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_MUTE*() macros. - */ -int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - unsigned long pval; - int err; - - mutex_lock(&codec->control_mutex); - pval = kcontrol->private_value; - kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */ - err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); - kcontrol->private_value = pval; - mutex_unlock(&codec->control_mutex); - return err; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_get); - -/** - * snd_hda_mixer_bind_switch_put - Put callback for a bound volume control - * @kcontrol: ctl element - * @ucontrol: pointer to get/store the data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_MUTE*() macros. - */ -int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - unsigned long pval; - int i, indices, err = 0, change = 0; - - mutex_lock(&codec->control_mutex); - pval = kcontrol->private_value; - indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT; - for (i = 0; i < indices; i++) { - kcontrol->private_value = (pval & ~AMP_VAL_IDX_MASK) | - (i << AMP_VAL_IDX_SHIFT); - err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); - if (err < 0) - break; - change |= err; - } - kcontrol->private_value = pval; - mutex_unlock(&codec->control_mutex); - return err < 0 ? err : change; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_put); - -/** - * snd_hda_mixer_bind_ctls_info - Info callback for a generic bound control - * @kcontrol: referred ctl element - * @uinfo: pointer to get/store the data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros. - */ -int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - struct hda_bind_ctls *c; - int err; - - mutex_lock(&codec->control_mutex); - c = (struct hda_bind_ctls *)kcontrol->private_value; - kcontrol->private_value = *c->values; - err = c->ops->info(kcontrol, uinfo); - kcontrol->private_value = (long)c; - mutex_unlock(&codec->control_mutex); - return err; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_info); - -/** - * snd_hda_mixer_bind_ctls_get - Get callback for a generic bound control - * @kcontrol: ctl element - * @ucontrol: pointer to get/store the data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros. - */ -int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - struct hda_bind_ctls *c; - int err; - - mutex_lock(&codec->control_mutex); - c = (struct hda_bind_ctls *)kcontrol->private_value; - kcontrol->private_value = *c->values; - err = c->ops->get(kcontrol, ucontrol); - kcontrol->private_value = (long)c; - mutex_unlock(&codec->control_mutex); - return err; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_get); - -/** - * snd_hda_mixer_bind_ctls_put - Put callback for a generic bound control - * @kcontrol: ctl element - * @ucontrol: pointer to get/store the data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros. - */ -int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - struct hda_bind_ctls *c; - unsigned long *vals; - int err = 0, change = 0; - - mutex_lock(&codec->control_mutex); - c = (struct hda_bind_ctls *)kcontrol->private_value; - for (vals = c->values; *vals; vals++) { - kcontrol->private_value = *vals; - err = c->ops->put(kcontrol, ucontrol); - if (err < 0) - break; - change |= err; - } - kcontrol->private_value = (long)c; - mutex_unlock(&codec->control_mutex); - return err < 0 ? err : change; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_put); - -/** - * snd_hda_mixer_bind_tlv - TLV callback for a generic bound control - * @kcontrol: ctl element - * @op_flag: operation flag - * @size: byte size of input TLV - * @tlv: TLV data - * - * The control element is supposed to have the private_value field - * set up via HDA_BIND_VOL() macro. - */ -int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, - unsigned int size, unsigned int __user *tlv) -{ - struct hda_codec *codec = snd_kcontrol_chip(kcontrol); - struct hda_bind_ctls *c; - int err; - - mutex_lock(&codec->control_mutex); - c = (struct hda_bind_ctls *)kcontrol->private_value; - kcontrol->private_value = *c->values; - err = c->ops->tlv(kcontrol, op_flag, size, tlv); - kcontrol->private_value = (long)c; - mutex_unlock(&codec->control_mutex); - return err; -} -EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_tlv); - -struct hda_ctl_ops snd_hda_bind_vol = { - .info = snd_hda_mixer_amp_volume_info, - .get = snd_hda_mixer_amp_volume_get, - .put = snd_hda_mixer_amp_volume_put, - .tlv = snd_hda_mixer_amp_tlv -}; -EXPORT_SYMBOL_GPL(snd_hda_bind_vol); - -struct hda_ctl_ops snd_hda_bind_sw = { - .info = snd_hda_mixer_amp_switch_info, - .get = snd_hda_mixer_amp_switch_get, - .put = snd_hda_mixer_amp_switch_put, - .tlv = snd_hda_mixer_amp_tlv -}; -EXPORT_SYMBOL_GPL(snd_hda_bind_sw); - -/* * SPDIF out controls */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_codec.h oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_codec.h --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_codec.h 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_codec.h 2017-06-26 03:02:08.000000000 +0000 @@ -256,6 +256,7 @@ unsigned int dump_coef:1; /* dump processing coefs in codec proc file */ unsigned int power_save_node:1; /* advanced PM for each widget */ unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */ + unsigned int force_pin_prefix:1; /* Add location prefix */ #ifdef CONFIG_PM unsigned long power_on_acct; unsigned long power_off_acct; diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/ext/hdac_ext_controller.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/ext/hdac_ext_controller.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/ext/hdac_ext_controller.c 2017-03-09 03:02:09.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/ext/hdac_ext_controller.c 2017-06-26 03:02:09.000000000 +0000 @@ -171,7 +171,7 @@ { int timeout; u32 val; - int mask = (1 << AZX_MLCTL_CPA); + int mask = (1 << AZX_MLCTL_CPA_SHIFT); udelay(3); timeout = 150; @@ -179,10 +179,10 @@ do { val = readl(link->ml_addr + AZX_REG_ML_LCTL); if (enable) { - if (((val & mask) >> AZX_MLCTL_CPA)) + if (((val & mask) >> AZX_MLCTL_CPA_SHIFT)) return 0; } else { - if (!((val & mask) >> AZX_MLCTL_CPA)) + if (!((val & mask) >> AZX_MLCTL_CPA_SHIFT)) return 0; } udelay(3); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_bus.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_bus.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_bus.c 2017-03-09 03:02:09.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_bus.c 2017-06-26 03:02:09.000000000 +0000 @@ -212,5 +212,6 @@ bus->caddr_tbl[codec->addr] = NULL; clear_bit(codec->addr, &bus->codec_powered); bus->num_codecs--; + flush_work(&bus->unsol_work); } EXPORT_SYMBOL_GPL(snd_hdac_bus_remove_device); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_controller.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_controller.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_controller.c 2017-03-09 03:02:09.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_controller.c 2017-06-26 03:02:09.000000000 +0000 @@ -106,7 +106,11 @@ /* disable ringbuffer DMAs */ snd_hdac_chip_writeb(bus, RIRBCTL, 0); snd_hdac_chip_writeb(bus, CORBCTL, 0); + spin_unlock_irq(&bus->reg_lock); + hdac_wait_for_cmd_dmas(bus); + + spin_lock_irq(&bus->reg_lock); /* disable unsolicited responses */ snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, 0); spin_unlock_irq(&bus->reg_lock); @@ -268,11 +272,11 @@ unsigned int offset; unsigned int counter = 0; - offset = snd_hdac_chip_readl(bus, LLCH); + offset = snd_hdac_chip_readw(bus, LLCH); /* Lets walk the linked capabilities list */ do { - cur_cap = _snd_hdac_chip_read(l, bus, offset); + cur_cap = _snd_hdac_chip_readl(bus, offset); dev_dbg(bus->dev, "Capability version: 0x%x\n", (cur_cap & AZX_CAP_HDR_VER_MASK) >> AZX_CAP_HDR_VER_OFF); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_device.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_device.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_device.c 2017-03-09 03:02:09.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_device.c 2017-06-26 03:02:09.000000000 +0000 @@ -159,6 +159,7 @@ if (device_is_registered(&codec->dev)) { hda_widget_sysfs_exit(codec); device_del(&codec->dev); + snd_hdac_bus_remove_device(codec->bus, codec); } } EXPORT_SYMBOL_GPL(snd_hdac_device_unregister); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_stream.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_stream.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_stream.c 2017-03-09 03:02:09.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hdacore/hdac_stream.c 2017-06-26 03:02:09.000000000 +0000 @@ -555,12 +555,12 @@ if (!reg) reg = AZX_REG_SSYNC; - val = _snd_hdac_chip_read(l, bus, reg); + val = _snd_hdac_chip_readl(bus, reg); if (set) val |= streams; else val &= ~streams; - _snd_hdac_chip_write(l, bus, reg, val); + _snd_hdac_chip_writel(bus, reg, val); } EXPORT_SYMBOL_GPL(snd_hdac_stream_sync_trigger); diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_generic.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_generic.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_generic.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_generic.c 2017-06-26 03:02:08.000000000 +0000 @@ -196,6 +196,9 @@ val = snd_hda_get_bool_hint(codec, "hp_mic_detect"); if (val >= 0) spec->suppress_hp_mic_detect = !val; + val = snd_hda_get_bool_hint(codec, "vmaster"); + if (val >= 0) + spec->suppress_vmaster = !val; if (!snd_hda_get_int_hint(codec, "mixer_nid", &val)) spec->mixer_nid = val; @@ -945,6 +948,8 @@ static int hda_gen_mixer_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +static int hda_gen_bind_mute_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol); static int hda_gen_bind_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); @@ -967,7 +972,7 @@ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .info = snd_hda_mixer_amp_switch_info, - .get = snd_hda_mixer_bind_switch_get, + .get = hda_gen_bind_mute_get, .put = hda_gen_bind_mute_put, /* replaced */ .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0), }, @@ -1098,11 +1103,51 @@ return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); } +/* + * Bound mute controls + */ +#define AMP_VAL_IDX_SHIFT 19 +#define AMP_VAL_IDX_MASK (0x0f<<19) + +static int hda_gen_bind_mute_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + unsigned long pval; + int err; + + mutex_lock(&codec->control_mutex); + pval = kcontrol->private_value; + kcontrol->private_value = pval & ~AMP_VAL_IDX_MASK; /* index 0 */ + err = snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); + kcontrol->private_value = pval; + mutex_unlock(&codec->control_mutex); + return err; +} + static int hda_gen_bind_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + unsigned long pval; + int i, indices, err = 0, change = 0; + sync_auto_mute_bits(kcontrol, ucontrol); - return snd_hda_mixer_bind_switch_put(kcontrol, ucontrol); + + mutex_lock(&codec->control_mutex); + pval = kcontrol->private_value; + indices = (pval & AMP_VAL_IDX_MASK) >> AMP_VAL_IDX_SHIFT; + for (i = 0; i < indices; i++) { + kcontrol->private_value = (pval & ~AMP_VAL_IDX_MASK) | + (i << AMP_VAL_IDX_SHIFT); + err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); + if (err < 0) + break; + change |= err; + } + kcontrol->private_value = pval; + mutex_unlock(&codec->control_mutex); + return err < 0 ? err : change; } /* any ctl assigned to the path with the given index? */ @@ -1125,6 +1170,7 @@ *index = 0; if (cfg->line_outs == 1 && !spec->multi_ios && + !codec->force_pin_prefix && !cfg->hp_outs && !cfg->speaker_outs) return spec->vmaster_mute.hook ? "PCM" : "Master"; @@ -1132,6 +1178,7 @@ * use it master (or "PCM" if a vmaster hook is present) */ if (spec->multiout.num_dacs == 1 && !spec->mixer_nid && + !codec->force_pin_prefix && !spec->multiout.hp_out_nid[0] && !spec->multiout.extra_out_nid[0]) return spec->vmaster_mute.hook ? "PCM" : "Master"; @@ -5031,7 +5078,7 @@ } /* if we have no master control, let's create it */ - if (!spec->no_analog && + if (!spec->no_analog && !spec->suppress_vmaster && !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) { err = snd_hda_add_vmaster(codec, "Master Playback Volume", spec->vmaster_tlv, slave_pfxs, @@ -5039,7 +5086,7 @@ if (err < 0) return err; } - if (!spec->no_analog && + if (!spec->no_analog && !spec->suppress_vmaster && !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) { err = __snd_hda_add_vmaster(codec, "Master Playback Switch", NULL, slave_pfxs, diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_generic.h oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_generic.h --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_generic.h 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_generic.h 2017-06-26 03:02:08.000000000 +0000 @@ -229,6 +229,7 @@ unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ unsigned int power_down_unused:1; /* power down unused widgets */ unsigned int dac_min_mute:1; /* minimal = mute for DACs */ + unsigned int suppress_vmaster:1; /* don't create vmaster kctls */ /* other internal flags */ unsigned int no_analog:1; /* digital I/O only */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_intel.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_intel.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_intel.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_intel.c 2017-06-26 03:02:08.000000000 +0000 @@ -53,7 +53,7 @@ #ifdef CONFIG_X86 /* for snoop control */ #include -#include +#include #include #endif #include @@ -77,6 +77,7 @@ POS_FIX_POSBUF, POS_FIX_VIACOMBO, POS_FIX_COMBO, + POS_FIX_SKL, }; /* Defines for ATI HD Audio support in SB450 south bridge */ @@ -148,7 +149,7 @@ MODULE_PARM_DESC(model, "Use the given board model."); module_param_array(position_fix, int, NULL, 0444); MODULE_PARM_DESC(position_fix, "DMA pointer read method." - "(-1 = system default, 0 = auto, 1 = LPIB, 2 = POSBUF, 3 = VIACOMBO, 4 = COMBO)."); + "(-1 = system default, 0 = auto, 1 = LPIB, 2 = POSBUF, 3 = VIACOMBO, 4 = COMBO, 5 = SKL+)."); module_param_array(bdl_pos_adj, int, NULL, 0644); MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); module_param_array(probe_mask, int, NULL, 0444); @@ -262,6 +263,7 @@ AZX_DRIVER_ICH, AZX_DRIVER_PCH, AZX_DRIVER_SCH, + AZX_DRIVER_SKL, AZX_DRIVER_HDMI, AZX_DRIVER_ATI, AZX_DRIVER_ATIHDMI, @@ -363,19 +365,13 @@ ((pci)->device == 0x0d0c) || \ ((pci)->device == 0x160c)) -#define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170) -#define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70) -#define IS_KBL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa171) -#define IS_KBL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d71) -#define IS_KBL_H(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa2f0) #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) -#define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci)) || \ - IS_KBL(pci) || IS_KBL_LP(pci) || IS_KBL_H(pci) static char *driver_short_names[] = { [AZX_DRIVER_ICH] = "HDA Intel", [AZX_DRIVER_PCH] = "HDA Intel PCH", [AZX_DRIVER_SCH] = "HDA Intel MID", + [AZX_DRIVER_SKL] = "HDA Intel PCH", /* kept old name for compatibility */ [AZX_DRIVER_HDMI] = "HDA Intel HDMI", [AZX_DRIVER_ATI] = "HDA ATI SB", [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", @@ -534,9 +530,101 @@ { u32 val; - val = azx_readl(chip, SKL_EM4L); + val = azx_readl(chip, VS_EM4L); val &= (0x3 << 20); - azx_writel(chip, SKL_EM4L, val); + azx_writel(chip, VS_EM4L, val); +} + +/* + * ML_LCAP bits: + * bit 0: 6 MHz Supported + * bit 1: 12 MHz Supported + * bit 2: 24 MHz Supported + * bit 3: 48 MHz Supported + * bit 4: 96 MHz Supported + * bit 5: 192 MHz Supported + */ +static int intel_get_lctl_scf(struct azx *chip) +{ + struct hdac_bus *bus = azx_bus(chip); + static int preferred_bits[] = { 2, 3, 1, 4, 5 }; + u32 val, t; + int i; + + val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCAP); + + for (i = 0; i < ARRAY_SIZE(preferred_bits); i++) { + t = preferred_bits[i]; + if (val & (1 << t)) + return t; + } + + dev_warn(chip->card->dev, "set audio clock frequency to 6MHz"); + return 0; +} + +static int intel_ml_lctl_set_power(struct azx *chip, int state) +{ + struct hdac_bus *bus = azx_bus(chip); + u32 val; + int timeout; + + /* + * the codecs are sharing the first link setting by default + * If other links are enabled for stream, they need similar fix + */ + val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); + val &= ~AZX_MLCTL_SPA; + val |= state << AZX_MLCTL_SPA_SHIFT; + writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); + /* wait for CPA */ + timeout = 50; + while (timeout) { + if (((readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL)) & + AZX_MLCTL_CPA) == (state << AZX_MLCTL_CPA_SHIFT)) + return 0; + timeout--; + udelay(10); + } + + return -1; +} + +static void intel_init_lctl(struct azx *chip) +{ + struct hdac_bus *bus = azx_bus(chip); + u32 val; + int ret; + + /* 0. check lctl register value is correct or not */ + val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); + /* if SCF is already set, let's use it */ + if ((val & ML_LCTL_SCF_MASK) != 0) + return; + + /* + * Before operating on SPA, CPA must match SPA. + * Any deviation may result in undefined behavior. + */ + if (((val & AZX_MLCTL_SPA) >> AZX_MLCTL_SPA_SHIFT) != + ((val & AZX_MLCTL_CPA) >> AZX_MLCTL_CPA_SHIFT)) + return; + + /* 1. turn link down: set SPA to 0 and wait CPA to 0 */ + ret = intel_ml_lctl_set_power(chip, 0); + udelay(100); + if (ret) + goto set_spa; + + /* 2. update SCF to select a properly audio clock*/ + val &= ~ML_LCTL_SCF_MASK; + val |= intel_get_lctl_scf(chip); + writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL); + +set_spa: + /* 4. turn link up: set SPA to 1 and wait CPA to 1 */ + intel_ml_lctl_set_power(chip, 1); + udelay(100); } static void hda_intel_init_chip(struct azx *chip, bool full_reset) @@ -547,13 +635,13 @@ if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) snd_hdac_set_codec_wakeup(bus, true); - if (IS_SKL_PLUS(pci)) { + if (chip->driver_type == AZX_DRIVER_SKL) { pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val); val = val & ~INTEL_HDA_CGCTL_MISCBDCGE; pci_write_config_dword(pci, INTEL_HDA_CGCTL, val); } azx_init_chip(chip, full_reset); - if (IS_SKL_PLUS(pci)) { + if (chip->driver_type == AZX_DRIVER_SKL) { pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val); val = val | INTEL_HDA_CGCTL_MISCBDCGE; pci_write_config_dword(pci, INTEL_HDA_CGCTL, val); @@ -564,6 +652,9 @@ /* reduce dma latency to avoid noise */ if (IS_BXT(pci)) bxt_reduce_dma_latency(chip); + + if (bus->mlcap != NULL) + intel_init_lctl(chip); } /* calculate runtime delay from LPIB */ @@ -815,6 +906,31 @@ return bound_pos + mod_dma_pos; } +static unsigned int azx_skl_get_dpib_pos(struct azx *chip, + struct azx_dev *azx_dev) +{ + return _snd_hdac_chip_readl(azx_bus(chip), + AZX_REG_VS_SDXDPIB_XBASE + + (AZX_REG_VS_SDXDPIB_XINTERVAL * + azx_dev->core.index)); +} + +/* get the current DMA position with correction on SKL+ chips */ +static unsigned int azx_get_pos_skl(struct azx *chip, struct azx_dev *azx_dev) +{ + /* DPIB register gives a more accurate position for playback */ + if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return azx_skl_get_dpib_pos(chip, azx_dev); + + /* For capture, we need to read posbuf, but it requires a delay + * for the possible boundary overlap; the read of DPIB fetches the + * actual posbuf + */ + udelay(20); + azx_skl_get_dpib_pos(chip, azx_dev); + return azx_get_pos_posbuf(chip, azx_dev); +} + #ifdef CONFIG_PM static DEFINE_MUTEX(card_list_lock); static LIST_HEAD(card_list); @@ -950,9 +1066,11 @@ */ static int azx_freeze_noirq(struct device *dev) { + struct snd_card *card = dev_get_drvdata(dev); + struct azx *chip = card->private_data; struct pci_dev *pci = to_pci_dev(dev); - if (IS_SKL_PLUS(pci)) + if (chip->driver_type == AZX_DRIVER_SKL) pci_set_power_state(pci, PCI_D3hot); return 0; @@ -960,9 +1078,11 @@ static int azx_thaw_noirq(struct device *dev) { + struct snd_card *card = dev_get_drvdata(dev); + struct azx *chip = card->private_data; struct pci_dev *pci = to_pci_dev(dev); - if (IS_SKL_PLUS(pci)) + if (chip->driver_type == AZX_DRIVER_SKL) pci_set_power_state(pci, PCI_D0); return 0; @@ -1351,6 +1471,7 @@ case POS_FIX_POSBUF: case POS_FIX_VIACOMBO: case POS_FIX_COMBO: + case POS_FIX_SKL: return fix; } @@ -1371,6 +1492,10 @@ dev_dbg(chip->card->dev, "Using LPIB position fix\n"); return POS_FIX_LPIB; } + if (chip->driver_type == AZX_DRIVER_SKL) { + dev_dbg(chip->card->dev, "Using SKL position fix\n"); + return POS_FIX_SKL; + } return POS_FIX_AUTO; } @@ -1382,6 +1507,7 @@ [POS_FIX_POSBUF] = azx_get_pos_posbuf, [POS_FIX_VIACOMBO] = azx_via_get_position, [POS_FIX_COMBO] = azx_get_pos_lpib, + [POS_FIX_SKL] = azx_get_pos_skl, }; chip->get_position[0] = chip->get_position[1] = callbacks[fix]; @@ -1390,7 +1516,7 @@ if (fix == POS_FIX_COMBO) chip->get_position[1] = NULL; - if (fix == POS_FIX_POSBUF && + if ((fix == POS_FIX_POSBUF || fix == POS_FIX_SKL) && (chip->driver_caps & AZX_DCAPS_COUNT_LPIB_DELAY)) { chip->get_delay[0] = chip->get_delay[1] = azx_get_delay_from_lpib; @@ -1667,7 +1793,7 @@ return -ENXIO; } - if (IS_SKL_PLUS(pci)) + if (chip->driver_type == AZX_DRIVER_SKL) snd_hdac_bus_parse_capabilities(bus); /* @@ -2236,28 +2362,31 @@ .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, /* Sunrise Point */ { PCI_DEVICE(0x8086, 0xa170), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, /* Sunrise Point-LP */ { PCI_DEVICE(0x8086, 0x9d70), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, /* Kabylake */ { PCI_DEVICE(0x8086, 0xa171), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, /* Kabylake-LP */ { PCI_DEVICE(0x8086, 0x9d71), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, /* Kabylake-H */ { PCI_DEVICE(0x8086, 0xa2f0), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, + /* Coffelake */ + { PCI_DEVICE(0x8086, 0xa348), + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, /* Broxton-P(Apollolake) */ { PCI_DEVICE(0x8086, 0x5a98), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, /* Broxton-T */ { PCI_DEVICE(0x8086, 0x1a98), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, /* Gemini-Lake */ { PCI_DEVICE(0x8086, 0x3198), - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, /* Haswell */ { PCI_DEVICE(0x8086, 0x0a0c), .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL }, diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_local.h oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_local.h --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/hda_local.h 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/hda_local.h 2017-06-26 03:02:08.000000000 +0000 @@ -178,67 +178,6 @@ #define HDA_AMP_UNMUTE 0x00 #define HDA_AMP_VOLMASK 0x7f -/* mono switch binding multiple inputs */ -#define HDA_BIND_MUTE_MONO(xname, nid, channel, indices, direction) \ - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = 0, \ - .info = snd_hda_mixer_amp_switch_info, \ - .get = snd_hda_mixer_bind_switch_get, \ - .put = snd_hda_mixer_bind_switch_put, \ - .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, indices, direction) } - -/* stereo switch binding multiple inputs */ -#define HDA_BIND_MUTE(xname,nid,indices,dir) \ - HDA_BIND_MUTE_MONO(xname,nid,3,indices,dir) - -int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol); -int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol); - -/* more generic bound controls */ -struct hda_ctl_ops { - snd_kcontrol_info_t *info; - snd_kcontrol_get_t *get; - snd_kcontrol_put_t *put; - snd_kcontrol_tlv_rw_t *tlv; -}; - -extern struct hda_ctl_ops snd_hda_bind_vol; /* for bind-volume with TLV */ -extern struct hda_ctl_ops snd_hda_bind_sw; /* for bind-switch */ - -struct hda_bind_ctls { - struct hda_ctl_ops *ops; - unsigned long values[]; -}; - -int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo); -int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol); -int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol); -int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, - unsigned int size, unsigned int __user *tlv); - -#define HDA_BIND_VOL(xname, bindrec) \ - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ - .name = xname, \ - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\ - SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ - SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,\ - .info = snd_hda_mixer_bind_ctls_info,\ - .get = snd_hda_mixer_bind_ctls_get,\ - .put = snd_hda_mixer_bind_ctls_put,\ - .tlv = { .c = snd_hda_mixer_bind_tlv },\ - .private_value = (long) (bindrec) } -#define HDA_BIND_SW(xname, bindrec) \ - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,\ - .name = xname, \ - .info = snd_hda_mixer_bind_ctls_info,\ - .get = snd_hda_mixer_bind_ctls_get,\ - .put = snd_hda_mixer_bind_ctls_put,\ - .private_value = (long) (bindrec) } - /* * SPDIF I/O */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/include/hda_register.h oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/include/hda_register.h --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/include/hda_register.h 2017-03-09 03:02:29.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/include/hda_register.h 2017-06-26 03:02:27.000000000 +0000 @@ -106,8 +106,26 @@ #define AZX_REG_HSW_EM4 0x100c #define AZX_REG_HSW_EM5 0x1010 -/* Skylake/Broxton display HD-A controller Extended Mode registers */ -#define AZX_REG_SKL_EM4L 0x1040 +/* Skylake/Broxton vendor-specific registers */ +#define AZX_REG_VS_EM1 0x1000 +#define AZX_REG_VS_INRC 0x1004 +#define AZX_REG_VS_OUTRC 0x1008 +#define AZX_REG_VS_FIFOTRK 0x100C +#define AZX_REG_VS_FIFOTRK2 0x1010 +#define AZX_REG_VS_EM2 0x1030 +#define AZX_REG_VS_EM3L 0x1038 +#define AZX_REG_VS_EM3U 0x103C +#define AZX_REG_VS_EM4L 0x1040 +#define AZX_REG_VS_EM4U 0x1044 +#define AZX_REG_VS_LTRC 0x1048 +#define AZX_REG_VS_D0I3C 0x104A +#define AZX_REG_VS_PCE 0x104B +#define AZX_REG_VS_L2MAGC 0x1050 +#define AZX_REG_VS_L2LAHPT 0x1054 +#define AZX_REG_VS_SDXDPIB_XBASE 0x1084 +#define AZX_REG_VS_SDXDPIB_XINTERVAL 0x20 +#define AZX_REG_VS_SDXEFIFOS_XBASE 0x1094 +#define AZX_REG_VS_SDXEFIFOS_XINTERVAL 0x20 /* PCI space */ #define AZX_PCIREG_TCSEL 0x44 @@ -243,9 +261,11 @@ #define AZX_REG_ML_LOUTPAY 0x20 #define AZX_REG_ML_LINPAY 0x30 -#define AZX_MLCTL_SPA (1<<16) -#define AZX_MLCTL_CPA 23 - +#define ML_LCTL_SCF_MASK 0xF +#define AZX_MLCTL_SPA (0x1 << 16) +#define AZX_MLCTL_CPA (0x1 << 23) +#define AZX_MLCTL_SPA_SHIFT 16 +#define AZX_MLCTL_CPA_SHIFT 23 /* registers for DMA Resume Capability Structure */ #define AZX_DRSM_CAP_ID 0x5 diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/include/hdaudio.h oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/include/hdaudio.h --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/include/hdaudio.h 2017-03-09 03:02:29.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/include/hdaudio.h 2017-06-26 03:02:27.000000000 +0000 @@ -368,24 +368,32 @@ /* * macros for easy use */ -#define _snd_hdac_chip_write(type, chip, reg, value) \ - ((chip)->io_ops->reg_write ## type(value, (chip)->remap_addr + (reg))) -#define _snd_hdac_chip_read(type, chip, reg) \ - ((chip)->io_ops->reg_read ## type((chip)->remap_addr + (reg))) +#define _snd_hdac_chip_writeb(chip, reg, value) \ + ((chip)->io_ops->reg_writeb(value, (chip)->remap_addr + (reg))) +#define _snd_hdac_chip_readb(chip, reg) \ + ((chip)->io_ops->reg_readb((chip)->remap_addr + (reg))) +#define _snd_hdac_chip_writew(chip, reg, value) \ + ((chip)->io_ops->reg_writew(value, (chip)->remap_addr + (reg))) +#define _snd_hdac_chip_readw(chip, reg) \ + ((chip)->io_ops->reg_readw((chip)->remap_addr + (reg))) +#define _snd_hdac_chip_writel(chip, reg, value) \ + ((chip)->io_ops->reg_writel(value, (chip)->remap_addr + (reg))) +#define _snd_hdac_chip_readl(chip, reg) \ + ((chip)->io_ops->reg_readl((chip)->remap_addr + (reg))) /* read/write a register, pass without AZX_REG_ prefix */ #define snd_hdac_chip_writel(chip, reg, value) \ - _snd_hdac_chip_write(l, chip, AZX_REG_ ## reg, value) + _snd_hdac_chip_writel(chip, AZX_REG_ ## reg, value) #define snd_hdac_chip_writew(chip, reg, value) \ - _snd_hdac_chip_write(w, chip, AZX_REG_ ## reg, value) + _snd_hdac_chip_writew(chip, AZX_REG_ ## reg, value) #define snd_hdac_chip_writeb(chip, reg, value) \ - _snd_hdac_chip_write(b, chip, AZX_REG_ ## reg, value) + _snd_hdac_chip_writeb(chip, AZX_REG_ ## reg, value) #define snd_hdac_chip_readl(chip, reg) \ - _snd_hdac_chip_read(l, chip, AZX_REG_ ## reg) + _snd_hdac_chip_readl(chip, AZX_REG_ ## reg) #define snd_hdac_chip_readw(chip, reg) \ - _snd_hdac_chip_read(w, chip, AZX_REG_ ## reg) + _snd_hdac_chip_readw(chip, AZX_REG_ ## reg) #define snd_hdac_chip_readb(chip, reg) \ - _snd_hdac_chip_read(b, chip, AZX_REG_ ## reg) + _snd_hdac_chip_readb(chip, AZX_REG_ ## reg) /* update a register, pass without AZX_REG_ prefix */ #define snd_hdac_chip_updatel(chip, reg, mask, val) \ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_ca0132.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_ca0132.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_ca0132.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_ca0132.c 2017-06-26 03:02:08.000000000 +0000 @@ -857,7 +857,7 @@ chip_addx >> 16); } - spec->curr_chip_addx = (res < 0) ? ~0UL : chip_addx; + spec->curr_chip_addx = (res < 0) ? ~0U : chip_addx; return res; } @@ -882,7 +882,7 @@ /*If no error encountered, automatically increment the address as per chip behaviour*/ spec->curr_chip_addx = (res != -EIO) ? - (spec->curr_chip_addx + 4) : ~0UL; + (spec->curr_chip_addx + 4) : ~0U; return res; } @@ -933,7 +933,7 @@ /*If no error encountered, automatically increment the address as per chip behaviour*/ spec->curr_chip_addx = (res != -EIO) ? - (spec->curr_chip_addx + 4) : ~0UL; + (spec->curr_chip_addx + 4) : ~0U; return res; } @@ -1168,7 +1168,7 @@ int status = 0; unsigned int count; - if ((buffer == NULL)) + if (buffer == NULL) return -EINVAL; count = 0; @@ -1210,7 +1210,7 @@ unsigned int skip_count; unsigned int dummy; - if ((buffer == NULL)) + if (buffer == NULL) return -1; count = 0; @@ -2866,7 +2866,7 @@ #define CA0132_CODEC_MUTE(xname, nid, dir) \ CA0132_CODEC_MUTE_MONO(xname, nid, 3, dir) -/* The followings are for tuning of products */ +/* The following are for tuning of products */ #ifdef ENABLE_TUNING_CONTROLS static unsigned int voice_focus_vals_lookup[] = { diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_conexant.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_conexant.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_conexant.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_conexant.c 2017-06-26 03:02:08.000000000 +0000 @@ -52,6 +52,12 @@ bool dc_enable; unsigned int dc_input_bias; /* offset into olpc_xo_dc_bias */ struct nid_path *dc_mode_path; + + int mute_led_polarity; + unsigned int gpio_led; + unsigned int gpio_mute_led_mask; + unsigned int gpio_mic_led_mask; + }; @@ -261,8 +267,10 @@ CXT_FIXUP_HP_530, CXT_FIXUP_CAP_MIX_AMP_5047, CXT_FIXUP_MUTE_LED_EAPD, + CXT_FIXUP_HP_DOCK, CXT_FIXUP_HP_SPECTRE, CXT_FIXUP_HP_GATE_MIC, + CXT_FIXUP_MUTE_LED_GPIO, }; /* for hda_fixup_thinkpad_acpi() */ @@ -645,6 +653,74 @@ snd_hda_jack_set_gating_jack(codec, 0x19, 0x16); } +/* update LED status via GPIO */ +static void cxt_update_gpio_led(struct hda_codec *codec, unsigned int mask, + bool enabled) +{ + struct conexant_spec *spec = codec->spec; + unsigned int oldval = spec->gpio_led; + + if (spec->mute_led_polarity) + enabled = !enabled; + + if (enabled) + spec->gpio_led &= ~mask; + else + spec->gpio_led |= mask; + if (spec->gpio_led != oldval) + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, + spec->gpio_led); +} + +/* turn on/off mute LED via GPIO per vmaster hook */ +static void cxt_fixup_gpio_mute_hook(void *private_data, int enabled) +{ + struct hda_codec *codec = private_data; + struct conexant_spec *spec = codec->spec; + + cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled); +} + +/* turn on/off mic-mute LED via GPIO per capture hook */ +static void cxt_fixup_gpio_mic_mute_hook(struct hda_codec *codec, + struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct conexant_spec *spec = codec->spec; + + if (ucontrol) + cxt_update_gpio_led(codec, spec->gpio_mic_led_mask, + ucontrol->value.integer.value[0] || + ucontrol->value.integer.value[1]); +} + + +static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct conexant_spec *spec = codec->spec; + static const struct hda_verb gpio_init[] = { + { 0x01, AC_VERB_SET_GPIO_MASK, 0x03 }, + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03 }, + {} + }; + codec_info(codec, "action: %d gpio_led: %d\n", action, spec->gpio_led); + + if (action == HDA_FIXUP_ACT_PRE_PROBE) { + spec->gen.vmaster_mute.hook = cxt_fixup_gpio_mute_hook; + spec->gen.cap_sync_hook = cxt_fixup_gpio_mic_mute_hook; + spec->gpio_led = 0; + spec->mute_led_polarity = 0; + spec->gpio_mute_led_mask = 0x01; + spec->gpio_mic_led_mask = 0x02; + } + snd_hda_add_verbs(codec, gpio_init); + if (spec->gpio_led) + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, + spec->gpio_led); +} + + /* ThinkPad X200 & co with cxt5051 */ static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = { { 0x16, 0x042140ff }, /* HP (seq# overridden) */ @@ -778,6 +854,16 @@ .type = HDA_FIXUP_FUNC, .v.func = cxt_fixup_mute_led_eapd, }, + [CXT_FIXUP_HP_DOCK] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x16, 0x21011020 }, /* line-out */ + { 0x18, 0x2181103f }, /* line-in */ + { } + }, + .chained = true, + .chain_id = CXT_FIXUP_MUTE_LED_GPIO, + }, [CXT_FIXUP_HP_SPECTRE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { @@ -790,6 +876,10 @@ .type = HDA_FIXUP_FUNC, .v.func = cxt_fixup_hp_gate_mic_jack, }, + [CXT_FIXUP_MUTE_LED_GPIO] = { + .type = HDA_FIXUP_FUNC, + .v.func = cxt_fixup_mute_led_gpio, + }, }; static const struct snd_pci_quirk cxt5045_fixups[] = { @@ -839,8 +929,10 @@ SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC), SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_ASPIRE_DMIC), SND_PCI_QUIRK(0x1025, 0x054f, "Acer Aspire 4830T", CXT_FIXUP_ASPIRE_DMIC), + SND_PCI_QUIRK(0x103c, 0x8079, "HP EliteBook 840 G3", CXT_FIXUP_HP_DOCK), SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), + SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), @@ -871,6 +963,8 @@ { .id = CXT_PINCFG_LEMOTE_A1205, .name = "lemote-a1205" }, { .id = CXT_FIXUP_OLPC_XO, .name = "olpc-xo" }, { .id = CXT_FIXUP_MUTE_LED_EAPD, .name = "mute-led-eapd" }, + { .id = CXT_FIXUP_HP_DOCK, .name = "hp-dock" }, + { .id = CXT_FIXUP_MUTE_LED_GPIO, .name = "mute-led-gpio" }, {} }; diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_hdmi.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_hdmi.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_hdmi.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_hdmi.c 2017-06-26 03:02:08.000000000 +0000 @@ -177,6 +177,7 @@ bool i915_bound; /* was i915 bound in this driver? */ struct hdac_chmap chmap; + hda_nid_t vendor_nid; }; #ifdef CONFIG_SND_HDA_I915 @@ -2372,6 +2373,7 @@ } #define INTEL_VENDOR_NID 0x08 +#define INTEL_GLK_VENDOR_NID 0x0B #define INTEL_GET_VENDOR_VERB 0xf81 #define INTEL_SET_VENDOR_VERB 0x781 #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ @@ -2381,14 +2383,15 @@ bool update_tree) { unsigned int vendor_param; + struct hdmi_spec *spec = codec->spec; - vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, + vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, INTEL_GET_VENDOR_VERB, 0); if (vendor_param == -1 || vendor_param & INTEL_EN_ALL_PIN_CVTS) return; vendor_param |= INTEL_EN_ALL_PIN_CVTS; - vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, + vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, INTEL_SET_VENDOR_VERB, vendor_param); if (vendor_param == -1) return; @@ -2400,8 +2403,9 @@ static void intel_haswell_fixup_enable_dp12(struct hda_codec *codec) { unsigned int vendor_param; + struct hdmi_spec *spec = codec->spec; - vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, + vendor_param = snd_hda_codec_read(codec, spec->vendor_nid, 0, INTEL_GET_VENDOR_VERB, 0); if (vendor_param == -1 || vendor_param & INTEL_EN_DP12) return; @@ -2409,7 +2413,7 @@ /* enable DP1.2 mode */ vendor_param |= INTEL_EN_DP12; snd_hdac_regmap_add_vendor_verb(&codec->core, INTEL_SET_VENDOR_VERB); - snd_hda_codec_write_cache(codec, INTEL_VENDOR_NID, 0, + snd_hda_codec_write_cache(codec, spec->vendor_nid, 0, INTEL_SET_VENDOR_VERB, vendor_param); } @@ -2503,7 +2507,7 @@ } /* Intel Haswell and onwards; audio component with eld notifier */ -static int patch_i915_hsw_hdmi(struct hda_codec *codec) +static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) { struct hdmi_spec *spec; int err; @@ -2520,6 +2524,7 @@ spec = codec->spec; codec->dp_mst = true; spec->dyn_pcm_assign = true; + spec->vendor_nid = vendor_nid; intel_haswell_enable_all_pins(codec, true); intel_haswell_fixup_enable_dp12(codec); @@ -2548,6 +2553,16 @@ return 0; } +static int patch_i915_hsw_hdmi(struct hda_codec *codec) +{ + return intel_hsw_common_init(codec, INTEL_VENDOR_NID); +} + +static int patch_i915_glk_hdmi(struct hda_codec *codec) +{ + return intel_hsw_common_init(codec, INTEL_GLK_VENDOR_NID); +} + /* Intel Baytrail and Braswell; with eld notifier */ static int patch_i915_byt_hdmi(struct hda_codec *codec) { @@ -2767,21 +2782,21 @@ return 0; } -static unsigned int channels_2_6_8[] = { +static const unsigned int channels_2_6_8[] = { 2, 6, 8 }; -static unsigned int channels_2_8[] = { +static const unsigned int channels_2_8[] = { 2, 8 }; -static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = { +static const struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = { .count = ARRAY_SIZE(channels_2_6_8), .list = channels_2_6_8, .mask = 0, }; -static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = { +static const struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = { .count = ARRAY_SIZE(channels_2_8), .list = channels_2_8, .mask = 0, @@ -2792,7 +2807,7 @@ struct snd_pcm_substream *substream) { struct hdmi_spec *spec = codec->spec; - struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL; + const struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL; switch (codec->preset->vendor_id) { case 0x10de0002: @@ -3800,7 +3815,7 @@ HDA_CODEC_ENTRY(0x80862809, "Skylake HDMI", patch_i915_hsw_hdmi), HDA_CODEC_ENTRY(0x8086280a, "Broxton HDMI", patch_i915_hsw_hdmi), HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), -HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_hsw_hdmi), +HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi), diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_realtek.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_realtek.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_realtek.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_realtek.c 2017-06-26 03:02:08.000000000 +0000 @@ -1800,6 +1800,7 @@ ALC882_FIXUP_NO_PRIMARY_HP, ALC887_FIXUP_ASUS_BASS, ALC887_FIXUP_BASS_CHMAP, + ALC1220_FIXUP_GB_DUAL_CODECS, }; static void alc889_fixup_coef(struct hda_codec *codec, @@ -1962,6 +1963,61 @@ static void alc_fixup_bass_chmap(struct hda_codec *codec, const struct hda_fixup *fix, int action); +/* For dual-codec configuration, we need to disable some features to avoid + * conflicts of kctls and PCM streams + */ +static void alc_fixup_dual_codecs(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + struct alc_spec *spec = codec->spec; + + if (action != HDA_FIXUP_ACT_PRE_PROBE) + return; + /* disable vmaster */ + spec->gen.suppress_vmaster = 1; + /* auto-mute and auto-mic switch don't work with multiple codecs */ + spec->gen.suppress_auto_mute = 1; + spec->gen.suppress_auto_mic = 1; + /* disable aamix as well */ + spec->gen.mixer_nid = 0; + /* add location prefix to avoid conflicts */ + codec->force_pin_prefix = 1; +} + +static void rename_ctl(struct hda_codec *codec, const char *oldname, + const char *newname) +{ + struct snd_kcontrol *kctl; + + kctl = snd_hda_find_mixer_ctl(codec, oldname); + if (kctl) + strcpy(kctl->id.name, newname); +} + +static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + alc_fixup_dual_codecs(codec, fix, action); + switch (action) { + case HDA_FIXUP_ACT_PRE_PROBE: + /* override card longname to provide a unique UCM profile */ + strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs"); + break; + case HDA_FIXUP_ACT_BUILD: + /* rename Capture controls depending on the codec */ + rename_ctl(codec, "Capture Volume", + codec->addr == 0 ? + "Rear-Panel Capture Volume" : + "Front-Panel Capture Volume"); + rename_ctl(codec, "Capture Switch", + codec->addr == 0 ? + "Rear-Panel Capture Switch" : + "Front-Panel Capture Switch"); + break; + } +} + static const struct hda_fixup alc882_fixups[] = { [ALC882_FIXUP_ABIT_AW9D_MAX] = { .type = HDA_FIXUP_PINS, @@ -2198,6 +2254,10 @@ .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_bass_chmap, }, + [ALC1220_FIXUP_GB_DUAL_CODECS] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc1220_fixup_gb_dual_codecs, + }, }; static const struct snd_pci_quirk alc882_fixup_tbl[] = { @@ -2264,9 +2324,11 @@ SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), + SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), + SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), + SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), - SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), @@ -2281,6 +2343,7 @@ {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"}, {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"}, + {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"}, {} }; @@ -2512,18 +2575,37 @@ * ALC268 */ /* bind Beep switches of both NID 0x0f and 0x10 */ -static const struct hda_bind_ctls alc268_bind_beep_sw = { - .ops = &snd_hda_bind_sw, - .values = { - HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT), - HDA_COMPOSE_AMP_VAL(0x10, 3, 1, HDA_INPUT), - 0 - }, -}; +static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); + unsigned long pval; + int err; + + mutex_lock(&codec->control_mutex); + pval = kcontrol->private_value; + kcontrol->private_value = (pval & ~0xff) | 0x0f; + err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); + if (err >= 0) { + kcontrol->private_value = (pval & ~0xff) | 0x10; + err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); + } + kcontrol->private_value = pval; + mutex_unlock(&codec->control_mutex); + return err; +} static const struct snd_kcontrol_new alc268_beep_mixer[] = { HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT), - HDA_BIND_SW("Beep Playback Switch", &alc268_bind_beep_sw), + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "Beep Playback Switch", + .subdevice = HDA_SUBDEV_AMP_FLAG, + .info = snd_hda_mixer_amp_switch_info, + .get = snd_hda_mixer_amp_switch_get, + .put = alc268_beep_switch_put, + .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT) + }, { } }; @@ -2980,6 +3062,135 @@ alc_write_coef_idx(codec, 0x43, 0x9614); } +static void alc256_init(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; + bool hp_pin_sense; + + if (!hp_pin) + return; + + msleep(30); + + hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); + + if (hp_pin_sense) + msleep(2); + + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */ + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); + + if (hp_pin_sense) + msleep(85); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); + + if (hp_pin_sense) + msleep(100); + + alc_update_coef_idx(codec, 0x46, 3 << 12, 0); + alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */ +} + +static void alc256_shutup(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; + bool hp_pin_sense; + + if (!hp_pin) { + alc269_shutup(codec); + return; + } + + hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); + + if (hp_pin_sense) + msleep(2); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); + + if (hp_pin_sense) + msleep(85); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + + alc_update_coef_idx(codec, 0x46, 0, 3 << 12); /* 3k pull low control for Headset jack. */ + + if (hp_pin_sense) + msleep(100); + + alc_auto_setup_eapd(codec, false); + snd_hda_shutup_pins(codec); +} + +static void alc_default_init(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; + bool hp_pin_sense; + + if (!hp_pin) + return; + + msleep(30); + + hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); + + if (hp_pin_sense) + msleep(2); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); + + if (hp_pin_sense) + msleep(85); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); + + if (hp_pin_sense) + msleep(100); +} + +static void alc_default_shutup(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; + bool hp_pin_sense; + + if (!hp_pin) { + alc269_shutup(codec); + return; + } + + hp_pin_sense = snd_hda_jack_detect(codec, hp_pin); + + if (hp_pin_sense) + msleep(2); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); + + if (hp_pin_sense) + msleep(85); + + snd_hda_codec_write(codec, hp_pin, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); + + if (hp_pin_sense) + msleep(100); + + alc_auto_setup_eapd(codec, false); + snd_hda_shutup_pins(codec); +} + static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg, unsigned int val) { @@ -3691,6 +3902,16 @@ UPDATE_COEF(0x4a, 3<<10, 0), {} }; + static struct coef_fw coef0274[] = { + UPDATE_COEF(0x4a, 0x0100, 0), + UPDATE_COEFEX(0x57, 0x05, 0x4000, 0), + UPDATE_COEF(0x6b, 0xf000, 0x5000), + UPDATE_COEF(0x4a, 0x0010, 0), + UPDATE_COEF(0x4a, 0x0c00, 0x0c00), + WRITE_COEF(0x45, 0x5289), + UPDATE_COEF(0x4a, 0x0c00, 0), + {} + }; switch (codec->core.vendor_id) { case 0x10ec0255: @@ -3701,6 +3922,11 @@ alc_process_coef_fw(codec, coef0256); alc_process_coef_fw(codec, coef0255); break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_process_coef_fw(codec, coef0274); + break; case 0x10ec0233: case 0x10ec0283: alc_process_coef_fw(codec, coef0233); @@ -3778,7 +4004,12 @@ UPDATE_COEF(0x63, 3<<14, 0), {} }; - + static struct coef_fw coef0274[] = { + UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000), + UPDATE_COEF(0x4a, 0x0010, 0), + UPDATE_COEF(0x6b, 0xf000, 0), + {} + }; switch (codec->core.vendor_id) { case 0x10ec0255: @@ -3788,6 +4019,14 @@ alc_process_coef_fw(codec, coef0255); snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_write_coef_idx(codec, 0x45, 0x4689); + snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); + alc_process_coef_fw(codec, coef0274); + snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); + break; case 0x10ec0233: case 0x10ec0283: alc_write_coef_idx(codec, 0x45, 0xc429); @@ -3885,6 +4124,13 @@ WRITE_COEF(0xb7, 0x802b), {} }; + static struct coef_fw coef0274[] = { + WRITE_COEF(0x45, 0x4289), + UPDATE_COEF(0x4a, 0x0010, 0x0010), + UPDATE_COEF(0x6b, 0x0f00, 0), + UPDATE_COEF(0x49, 0x0300, 0x0300), + {} + }; switch (codec->core.vendor_id) { case 0x10ec0225: @@ -3896,6 +4142,11 @@ case 0x10ec0256: alc_process_coef_fw(codec, coef0255); break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_process_coef_fw(codec, coef0274); + break; case 0x10ec0233: case 0x10ec0283: alc_process_coef_fw(codec, coef0233); @@ -3981,6 +4232,11 @@ case 0x10ec0256: alc_process_coef_fw(codec, coef0256); break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_write_coef_idx(codec, 0x45, 0xd689); + break; case 0x10ec0233: case 0x10ec0283: alc_process_coef_fw(codec, coef0233); @@ -4075,6 +4331,11 @@ case 0x10ec0256: alc_process_coef_fw(codec, coef0256); break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_write_coef_idx(codec, 0x45, 0xe689); + break; case 0x10ec0233: case 0x10ec0283: alc_process_coef_fw(codec, coef0233); @@ -4138,6 +4399,13 @@ UPDATE_COEF(0x49, 1<<8, 1<<8), {} }; + static struct coef_fw coef0274[] = { + UPDATE_COEF(0x4a, 0x0010, 0), + UPDATE_COEF(0x4a, 0x8000, 0), + WRITE_COEF(0x45, 0xd289), + UPDATE_COEF(0x49, 0x0300, 0x0300), + {} + }; switch (codec->core.vendor_id) { case 0x10ec0255: @@ -4147,6 +4415,14 @@ val = alc_read_coef_idx(codec, 0x46); is_ctia = (val & 0x0070) == 0x0070; break; + case 0x10ec0234: + case 0x10ec0274: + case 0x10ec0294: + alc_process_coef_fw(codec, coef0274); + msleep(80); + val = alc_read_coef_idx(codec, 0x46); + is_ctia = (val & 0x00f0) == 0x00f0; + break; case 0x10ec0233: case 0x10ec0283: alc_write_coef_idx(codec, 0x45, 0xd029); @@ -4663,7 +4939,6 @@ { 0x1b, 0x21114000 }, /* dock speaker pin */ {} }; - struct snd_kcontrol *kctl; switch (action) { case HDA_FIXUP_ACT_PRE_PROBE: @@ -4678,12 +4953,10 @@ /* this is a bit tricky; give more sane names for the main * (tablet) speaker and the dock speaker, respectively */ - kctl = snd_hda_find_mixer_ctl(codec, "Speaker Playback Switch"); - if (kctl) - strcpy(kctl->id.name, "Dock Speaker Playback Switch"); - kctl = snd_hda_find_mixer_ctl(codec, "Bass Speaker Playback Switch"); - if (kctl) - strcpy(kctl->id.name, "Speaker Playback Switch"); + rename_ctl(codec, "Speaker Playback Switch", + "Dock Speaker Playback Switch"); + rename_ctl(codec, "Bass Speaker Playback Switch", + "Speaker Playback Switch"); break; } } @@ -4766,6 +5039,30 @@ } } +static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + alc_fixup_dual_codecs(codec, fix, action); + switch (action) { + case HDA_FIXUP_ACT_PRE_PROBE: + /* override card longname to provide a unique UCM profile */ + strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); + break; + case HDA_FIXUP_ACT_BUILD: + /* rename Capture controls depending on the codec */ + rename_ctl(codec, "Capture Volume", + codec->addr == 0 ? + "Rear-Panel Capture Volume" : + "Front-Panel Capture Volume"); + rename_ctl(codec, "Capture Switch", + codec->addr == 0 ? + "Rear-Panel Capture Switch" : + "Front-Panel Capture Switch"); + break; + } +} + /* for hda_fixup_thinkpad_acpi() */ #include "thinkpad_helper.c" @@ -4849,6 +5146,7 @@ ALC286_FIXUP_HP_GPIO_LED, ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, ALC280_FIXUP_HP_DOCK_PINS, + ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, ALC280_FIXUP_HP_9480M, ALC288_FIXUP_DELL_HEADSET_MODE, ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, @@ -4859,6 +5157,7 @@ ALC292_FIXUP_DISABLE_AAMIX, ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, ALC275_FIXUP_DELL_XPS, ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, ALC293_FIXUP_LENOVO_SPK_NOISE, @@ -4877,6 +5176,7 @@ ALC256_FIXUP_ASUS_AIO_GPIO2, ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, + ALC233_FIXUP_LENOVO_MULTI_CODECS, }; static const struct hda_fixup alc269_fixups[] = { @@ -5413,6 +5713,16 @@ .chained = true, .chain_id = ALC280_FIXUP_HP_GPIO4 }, + [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x1b, 0x21011020 }, /* line-out */ + { 0x18, 0x2181103f }, /* line-in */ + { }, + }, + .chained = true, + .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED + }, [ALC280_FIXUP_HP_9480M] = { .type = HDA_FIXUP_FUNC, .v.func = alc280_fixup_hp_9480m, @@ -5484,6 +5794,15 @@ .chained = true, .chain_id = ALC269_FIXUP_HEADSET_MODE }, + [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ + { } + }, + .chained = true, + .chain_id = ALC269_FIXUP_HEADSET_MODE + }, [ALC275_FIXUP_DELL_XPS] = { .type = HDA_FIXUP_VERBS, .v.verbs = (const struct hda_verb[]) { @@ -5556,7 +5875,7 @@ .type = HDA_FIXUP_FUNC, .v.func = alc298_fixup_speaker_volume, .chained = true, - .chain_id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, + .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, }, [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = { .type = HDA_FIXUP_PINS, @@ -5627,6 +5946,10 @@ .chained = true, .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE }, + [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc233_alc662_fixup_lenovo_dual_codecs, + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -5716,7 +6039,7 @@ SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), - SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), + SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED), SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), @@ -5744,7 +6067,11 @@ SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), + SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), @@ -5752,13 +6079,10 @@ SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), + SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), - SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), @@ -5781,6 +6105,7 @@ SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_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), SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), @@ -5897,6 +6222,7 @@ {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, + {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"}, @@ -5904,6 +6230,7 @@ {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, + {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, {} }; #define ALC225_STANDARD_PINS \ @@ -6191,6 +6518,8 @@ ALC295_STANDARD_PINS, {0x17, 0x21014040}, {0x18, 0x21a19050}), + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, + ALC295_STANDARD_PINS), SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, ALC298_STANDARD_PINS, {0x17, 0x90170110}), @@ -6268,7 +6597,8 @@ codec->patch_ops.suspend = alc269_suspend; codec->patch_ops.resume = alc269_resume; #endif - spec->shutup = alc269_shutup; + spec->shutup = alc_default_shutup; + spec->init_hook = alc_default_init; snd_hda_pick_fixup(codec, alc269_fixup_models, alc269_fixup_tbl, alc269_fixups); @@ -6308,6 +6638,7 @@ } if (err < 0) goto error; + spec->shutup = alc269_shutup; spec->init_hook = alc269_fill_coef; alc269_fill_coef(codec); break; @@ -6348,18 +6679,24 @@ break; case 0x10ec0256: spec->codec_variant = ALC269_TYPE_ALC256; + spec->shutup = alc256_shutup; + spec->init_hook = alc256_init; spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */ alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/ break; case 0x10ec0225: case 0x10ec0295: + spec->codec_variant = ALC269_TYPE_ALC225; + break; case 0x10ec0299: spec->codec_variant = ALC269_TYPE_ALC225; + spec->gen.mixer_nid = 0; /* no loopback on ALC299 */ break; case 0x10ec0234: case 0x10ec0274: case 0x10ec0294: spec->codec_variant = ALC269_TYPE_ALC294; + alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */ break; case 0x10ec0700: case 0x10ec0701: @@ -6791,6 +7128,7 @@ ALC668_FIXUP_DELL_DISABLE_AAMIX, ALC668_FIXUP_DELL_XPS13, ALC662_FIXUP_ASUS_Nx50, + ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, ALC668_FIXUP_ASUS_Nx51, ALC891_FIXUP_HEADSET_MODE, ALC891_FIXUP_DELL_MIC_NO_PRESENCE, @@ -6798,6 +7136,7 @@ ALC892_FIXUP_ASROCK_MOBO, ALC662_FIXUP_USI_FUNC, ALC662_FIXUP_USI_HEADSET_MODE, + ALC662_FIXUP_LENOVO_MULTI_CODECS, }; static const struct hda_fixup alc662_fixups[] = { @@ -7044,14 +7383,21 @@ .chained = true, .chain_id = ALC662_FIXUP_BASS_1A }, + [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_headset_mode_alc668, + .chain_id = ALC662_FIXUP_BASS_CHMAP + }, [ALC668_FIXUP_ASUS_Nx51] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl[]) { - {0x1a, 0x90170151}, /* bass speaker */ + { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */ + { 0x1a, 0x90170151 }, /* bass speaker */ + { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */ {} }, .chained = true, - .chain_id = ALC662_FIXUP_BASS_CHMAP, + .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE, }, [ALC891_FIXUP_HEADSET_MODE] = { .type = HDA_FIXUP_FUNC, @@ -7096,6 +7442,10 @@ .chained = true, .chain_id = ALC662_FIXUP_USI_FUNC }, + [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc233_alc662_fixup_lenovo_dual_codecs, + }, }; static const struct snd_pci_quirk alc662_fixup_tbl[] = { @@ -7133,6 +7483,7 @@ SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), + SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), @@ -7212,6 +7563,7 @@ {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"}, {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, + {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"}, {} }; diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_si3054.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_si3054.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_si3054.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_si3054.c 2017-06-26 03:02:08.000000000 +0000 @@ -169,8 +169,8 @@ struct hda_codec *codec, struct snd_pcm_substream *substream) { - static unsigned int rates[] = { 8000, 9600, 16000 }; - static struct snd_pcm_hw_constraint_list hw_constraints_rates = { + static const unsigned int rates[] = { 8000, 9600, 16000 }; + static const struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_sigmatel.c oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_sigmatel.c --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/hda-src-from-tree/patch_sigmatel.c 2017-03-09 03:02:08.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/hda-src-from-tree/patch_sigmatel.c 2017-06-26 03:02:08.000000000 +0000 @@ -1559,6 +1559,8 @@ "Dell Inspiron 1501", STAC_9200_DELL_M26), SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f6, "unknown Dell", STAC_9200_DELL_M26), + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0201, + "Dell Latitude D430", STAC_9200_DELL_M22), /* Panasonic */ SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-74", STAC_9200_PANASONIC), /* Gateway machines needs EAPD to be set on resume */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-trusty/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-trusty/series 2017-06-26 03:01:55.000000000 +0000 @@ -3,7 +3,6 @@ fix-implicit-declaration-snd_card_new.patch device.patch device_sysfs.patch -dell-wmi-helper-build.patch no_64bit_msi_build_error.patch trigger_timestamp_latched.patch hda_bind_build_fix.patch @@ -23,3 +22,6 @@ acpi_dev_present.patch pm_runtime_get_if_in_use.patch sync_time.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch +dell-wmi-helper-build.patch diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-utopic/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-utopic/series 2017-06-26 03:01:55.000000000 +0000 @@ -19,3 +19,5 @@ kbuild_modname_fix.patch acpi_dev_present.patch pm_runtime_get_if_in_use.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-vivid/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-vivid/series 2017-06-26 03:01:55.000000000 +0000 @@ -21,3 +21,5 @@ pm_runtime_get_if_in_use.patch non-skl-i915-vivid.patch sync_time.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-wily/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-wily/series 2017-06-26 03:01:55.000000000 +0000 @@ -9,3 +9,5 @@ acpi_dev_present.patch pm_runtime_get_if_in_use.patch sync_time_wily.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/mst-sync-audio-rate-get-eld.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/mst-sync-audio-rate-get-eld.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/mst-sync-audio-rate-get-eld.patch 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/mst-sync-audio-rate-get-eld.patch 2017-06-26 03:01:55.000000000 +0000 @@ -1,28 +1,45 @@ Index: oem-audio-hda-daily-0.1/hdacore/hdac_i915.c =================================================================== ---- oem-audio-hda-daily-0.1.orig/hdacore/hdac_i915.c 2017-03-08 09:27:18.670872147 +0800 -+++ oem-audio-hda-daily-0.1/hdacore/hdac_i915.c 2017-03-08 09:27:42.322870936 +0800 -@@ -215,7 +215,10 @@ +--- oem-audio-hda-daily-0.1.orig/hdacore/hdac_i915.c 2017-06-21 15:59:55.977045042 +0800 ++++ oem-audio-hda-daily-0.1/hdacore/hdac_i915.c 2017-06-21 16:00:32.361043520 +0800 +@@ -22,6 +22,8 @@ + #include "../include/hda_i915.h" + #include "../include/hda_register.h" + ++#include ++ + static struct i915_audio_component *hdac_acomp; + + /** +@@ -215,7 +217,14 @@ if (port < 0) return -EINVAL; pipe = dev_id; -- return acomp->ops->sync_audio_rate(acomp->dev, port, pipe, rate); ++#if UTS_UBUNTU_RELEASE_ABI >= 82 + return acomp->ops->sync_audio_rate(acomp->dev, port, pipe, rate); ++#else + if (pipe != 0) + return -EINVAL; + + return acomp->ops->sync_audio_rate(acomp->dev, port, rate); ++#endif } EXPORT_SYMBOL_GPL(snd_hdac_sync_audio_rate); -@@ -255,7 +258,10 @@ +@@ -255,8 +264,16 @@ return -EINVAL; pipe = dev_id; -- return acomp->ops->get_eld(acomp->dev, port, pipe, audio_enabled, ++#if UTS_UBUNTU_RELEASE_ABI >= 82 + return acomp->ops->get_eld(acomp->dev, port, pipe, audio_enabled, + buffer, max_bytes); ++#else + if (pipe != 0) + return -EINVAL; + + return acomp->ops->get_eld(acomp->dev, port, audio_enabled, - buffer, max_bytes); ++ buffer, max_bytes); ++#endif } EXPORT_SYMBOL_GPL(snd_hdac_acomp_get_eld); + diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/remove-para-pipe-for-mst.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/remove-para-pipe-for-mst.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/remove-para-pipe-for-mst.patch 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/remove-para-pipe-for-mst.patch 2017-06-26 03:01:55.000000000 +0000 @@ -1,18 +1,34 @@ Index: oem-audio-hda-daily-0.1/patch_hdmi.c =================================================================== ---- oem-audio-hda-daily-0.1.orig/patch_hdmi.c 2017-03-06 11:26:39.288707802 +0800 -+++ oem-audio-hda-daily-0.1/patch_hdmi.c 2017-03-06 11:28:01.928705301 +0800 -@@ -2428,11 +2428,11 @@ +--- oem-audio-hda-daily-0.1.orig/patch_hdmi.c 2017-06-21 16:00:44.605043008 +0800 ++++ oem-audio-hda-daily-0.1/patch_hdmi.c 2017-06-21 16:01:04.449042178 +0800 +@@ -44,6 +44,8 @@ + #include "hda_local.h" + #include "hda_jack.h" + ++#include ++ + static bool static_hdmi_pcm; + module_param(static_hdmi_pcm, bool, 0644); + MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); +@@ -2432,12 +2434,19 @@ snd_hda_codec_set_power_to_all(codec, fg, power_state); } --static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) ++#if UTS_UBUNTU_RELEASE_ABI >= 82 + static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) ++#else +static void intel_pin_eld_notify(void *audio_ptr, int port) ++#endif { struct hda_codec *codec = audio_ptr; int pin_nid; -- int dev_id = pipe; ++#if UTS_UBUNTU_RELEASE_ABI >= 82 + int dev_id = pipe; +- ++#else + int dev_id = 0; - ++#endif /* we assume only from port-B to port-D */ if (port < 1 || port > 3) + return; diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-xenial/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-xenial/series 2017-06-26 03:01:55.000000000 +0000 @@ -6,3 +6,5 @@ call_i915_bpo_for_xenial.patch mst-sync-audio-rate-get-eld.patch remove-para-pipe-for-mst.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/restore-cacheflush.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/restore-cacheflush.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/restore-cacheflush.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/restore-cacheflush.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,13 @@ +Index: oem-audio-hda-daily-0.1/hda_intel.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/hda_intel.c ++++ oem-audio-hda-daily-0.1/hda_intel.c +@@ -53,7 +53,7 @@ + #ifdef CONFIG_X86 + /* for snoop control */ + #include +-#include ++#include + #include + #endif + #include diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/restore-dell-led-wmi-helper.patch oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/restore-dell-led-wmi-helper.patch --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/restore-dell-led-wmi-helper.patch 1970-01-01 00:00:00.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/restore-dell-led-wmi-helper.patch 2017-06-26 03:01:55.000000000 +0000 @@ -0,0 +1,82 @@ +Index: oem-audio-hda-daily-0.1/dell_wmi_helper.c +=================================================================== +--- oem-audio-hda-daily-0.1.orig/dell_wmi_helper.c ++++ oem-audio-hda-daily-0.1/dell_wmi_helper.c +@@ -2,11 +2,11 @@ + * to be included from codec driver + */ + +-#if IS_ENABLED(CONFIG_DELL_LAPTOP) ++#if IS_ENABLED(CONFIG_LEDS_DELL_NETBOOKS) + #include + + static int dell_led_value; +-static int (*dell_micmute_led_set_func)(int); ++static int (*dell_led_set_func)(int, int); + static void (*dell_old_cap_hook)(struct hda_codec *, + struct snd_kcontrol *, + struct snd_ctl_elem_value *); +@@ -18,7 +18,7 @@ static void update_dell_wmi_micmute_led( + if (dell_old_cap_hook) + dell_old_cap_hook(codec, kcontrol, ucontrol); + +- if (!ucontrol || !dell_micmute_led_set_func) ++ if (!ucontrol || !dell_led_set_func) + return; + if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) { + /* TODO: How do I verify if it's a mono or stereo here? */ +@@ -26,8 +26,8 @@ static void update_dell_wmi_micmute_led( + if (val == dell_led_value) + return; + dell_led_value = val; +- if (dell_micmute_led_set_func) +- dell_micmute_led_set_func(dell_led_value); ++ if (dell_led_set_func) ++ dell_led_set_func(DELL_LED_MICMUTE, dell_led_value); + } + } + +@@ -39,15 +39,15 @@ static void alc_fixup_dell_wmi(struct hd + bool removefunc = false; + + if (action == HDA_FIXUP_ACT_PROBE) { +- if (!dell_micmute_led_set_func) +- dell_micmute_led_set_func = symbol_request(dell_micmute_led_set); +- if (!dell_micmute_led_set_func) { +- codec_warn(codec, "Failed to find dell wmi symbol dell_micmute_led_set\n"); ++ if (!dell_led_set_func) ++ dell_led_set_func = symbol_request(dell_app_wmi_led_set); ++ if (!dell_led_set_func) { ++ codec_warn(codec, "Failed to find dell wmi symbol dell_app_wmi_led_set\n"); + return; + } + + removefunc = true; +- if (dell_micmute_led_set_func(false) >= 0) { ++ if (dell_led_set_func(DELL_LED_MICMUTE, false) >= 0) { + dell_led_value = 0; + if (spec->gen.num_adc_nids > 1 && !spec->gen.dyn_adc_switch) + codec_dbg(codec, "Skipping micmute LED control due to several ADCs"); +@@ -60,17 +60,17 @@ static void alc_fixup_dell_wmi(struct hd + + } + +- if (dell_micmute_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { +- symbol_put(dell_micmute_led_set); +- dell_micmute_led_set_func = NULL; ++ if (dell_led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { ++ symbol_put(dell_app_wmi_led_set); ++ dell_led_set_func = NULL; + dell_old_cap_hook = NULL; + } + } + +-#else /* CONFIG_DELL_LAPTOP */ ++#else /* CONFIG_LEDS_DELL_NETBOOKS */ + static void alc_fixup_dell_wmi(struct hda_codec *codec, + const struct hda_fixup *fix, int action) + { + } + +-#endif /* CONFIG_DELL_LAPTOP */ ++#endif /* CONFIG_LEDS_DELL_NETBOOKS */ diff -Nru oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/series oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/series --- oem-audio-hda-daily-dkms-0.201703090302~ubuntu16.04.1/patches-yakkety/series 2017-03-09 03:02:03.000000000 +0000 +++ oem-audio-hda-daily-dkms-0.201706260301~ubuntu16.04.1/patches-yakkety/series 2017-06-26 03:01:55.000000000 +0000 @@ -3,3 +3,5 @@ include_dir.patch mst-sync-audio-rate-get-eld.patch remove-para-pipe-for-mst.patch +restore-cacheflush.patch +restore-dell-led-wmi-helper.patch