Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (7 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
6 deleted
25 edited
1 copied

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/hda/hda_auto_parser.c

    r717 r772  
    8585        /* In case one has boost and the other one has not,
    8686           pick the one with boost first. */
    87         return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
    88 }
    89 
     87        if (a->has_boost_on_pin != b->has_boost_on_pin)
     88                return (int)(b->has_boost_on_pin - a->has_boost_on_pin);
     89
     90        /* Keep the original order */
     91        return a->order - b->order;
     92}
     93
     94#ifdef TARGET_OS2
     95/**
     96 * swap - swap values of @a and @b
     97 * @a: first value
     98 * @b: second value
     99 */
     100#define swap(a, b) \
     101        do { u16 __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
     102#endif
    90103/* Reorder the surround channels
    91104 * ALSA sequence is front/surr/clfe/side
     
    97110static void reorder_outputs(unsigned int nums, hda_nid_t *pins)
    98111{
    99         hda_nid_t nid;
    100 
    101112        switch (nums) {
    102113        case 3:
    103114        case 4:
    104                 nid = pins[1];
    105                 pins[1] = pins[2];
    106                 pins[2] = nid;
     115                swap(pins[1], pins[2]);
    107116                break;
    108117        }
     
    409418
    410419        /* sort inputs in the order of AUTO_PIN_* type */
     420        for (i = 0; i < cfg->num_inputs; i++)
     421                cfg->inputs[i].order = i;
    411422        sort(cfg->inputs, cfg->num_inputs, sizeof(cfg->inputs[0]),
    412423             compare_input_type, NULL);
     
    965976EXPORT_SYMBOL_GPL(snd_hda_pick_pin_fixup);
    966977
     978/* check whether the given quirk entry matches with vendor/device pair */
     979static bool hda_quirk_match(u16 vendor, u16 device, const struct hda_quirk *q)
     980{
     981        if (q->subvendor != vendor)
     982                return false;
     983        return !q->subdevice ||
     984                (device & q->subdevice_mask) == q->subdevice;
     985}
     986
     987/* look through the quirk list and return the matching entry */
     988static const struct hda_quirk *
     989hda_quirk_lookup_id(u16 vendor, u16 device, const struct hda_quirk *list)
     990{
     991        const struct hda_quirk *q;
     992
     993        for (q = list; q->subvendor || q->subdevice; q++) {
     994                if (hda_quirk_match(vendor, device, q))
     995                        return q;
     996        }
     997        return NULL;
     998}
     999
    9671000/**
    9681001 * snd_hda_pick_fixup - Pick up a fixup matching with PCI/codec SSID or model string
     
    9841017void snd_hda_pick_fixup(struct hda_codec *codec,
    9851018                        const struct hda_model_fixup *models,
    986                         const struct snd_pci_quirk *quirk,
     1019                        const struct hda_quirk *quirk,
    9871020                        const struct hda_fixup *fixlist)
    9881021{
    989         const struct snd_pci_quirk *q;
     1022        const struct hda_quirk *q;
    9901023        int id = HDA_FIXUP_ID_NOT_SET;
    9911024        const char *name = NULL;
    9921025        const char *type = NULL;
    9931026        unsigned int vendor, device;
     1027        u16 pci_vendor, pci_device;
     1028        u16 codec_vendor, codec_device;
    9941029
    9951030        if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
     
    10221057                return;
    10231058
     1059        if (codec->bus->pci) {
     1060                pci_vendor = codec->bus->pci->subsystem_vendor;
     1061                pci_device = codec->bus->pci->subsystem_device;
     1062        }
     1063
     1064        codec_vendor = codec->core.subsystem_id >> 16;
     1065        codec_device = codec->core.subsystem_id & 0xffff;
     1066
    10241067        /* match with the SSID alias given by the model string "XXXX:YYYY" */
    10251068        if (codec->modelname &&
    10261069            sscanf(codec->modelname, "%04x:%04x", &vendor, &device) == 2) {
    1027                 q = snd_pci_quirk_lookup_id(vendor, device, quirk);
     1070                q = hda_quirk_lookup_id(vendor, device, quirk);
    10281071                if (q) {
    10291072                        type = "alias SSID";
     
    10321075        }
    10331076
    1034         /* match with the PCI SSID */
    1035         q = snd_pci_quirk_lookup(codec->bus->pci, quirk);
    1036         if (q) {
    1037                 type = "PCI SSID";
    1038                 goto found_device;
     1077        /* match primarily with the PCI SSID */
     1078        for (q = quirk; q->subvendor || q->subdevice; q++) {
     1079                /* if the entry is specific to codec SSID, check with it */
     1080                if (!codec->bus->pci || q->match_codec_ssid) {
     1081                        if (hda_quirk_match(codec_vendor, codec_device, q)) {
     1082                                type = "codec SSID";
     1083                                goto found_device;
     1084                        }
     1085                } else {
     1086                        if (hda_quirk_match(pci_vendor, pci_device, q)) {
     1087                                type = "PCI SSID";
     1088                                goto found_device;
     1089                        }
     1090                }
    10391091        }
    10401092
    10411093        /* match with the codec SSID */
    1042         q = snd_pci_quirk_lookup_id(codec->core.subsystem_id >> 16,
    1043                                     codec->core.subsystem_id & 0xffff,
    1044                                     quirk);
     1094        q = hda_quirk_lookup_id(codec_vendor, codec_device, quirk);
    10451095        if (q) {
    10461096                type = "codec SSID";
  • GPL/trunk/alsa-kernel/pci/hda/hda_auto_parser.h

    r695 r772  
    88#ifndef __SOUND_HDA_AUTO_PARSER_H
    99#define __SOUND_HDA_AUTO_PARSER_H
     10
     11#include "hda_local.h"
    1012
    1113/*
     
    3638        unsigned int is_headphone_mic:1; /* Mic-only in headphone jack */
    3739        unsigned int has_boost_on_pin:1;
     40        int order;
    3841};
    3942
  • GPL/trunk/alsa-kernel/pci/hda/hda_beep.h

    r679 r772  
    2626        unsigned int linear_tone:1;     /* linear tone for IDT/STAC codec */
    2727        unsigned int playing:1;
     28        unsigned int keep_power_at_enable:1;    /* set by driver */
    2829        struct work_struct beep_work; /* scheduled task for beep event */
    2930        struct mutex mutex;
  • GPL/trunk/alsa-kernel/pci/hda/hda_bind.c

    r717 r772  
    1111#include <linux/export.h>
    1212#include <linux/pm.h>
    13 #include <linux/pm_runtime.h>
    1413#include <sound/core.h>
    1514#include <sound/hda_codec.h>
    1615#include "hda_local.h"
     16#include "hda_jack.h"
    1717
    1818#pragma disable_message (201)
     
    146146 error:
    147147        snd_hda_codec_cleanup_for_unbind(codec);
     148        codec->preset = NULL;
    148149        return err;
    149150}
     
    159160        }
    160161
    161         refcount_dec(&codec->pcm_ref);
    162162        snd_hda_codec_disconnect_pcms(codec);
    163         wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref));
     163        snd_hda_jack_tbl_disconnect(codec);
     164        if (!refcount_dec_and_test(&codec->pcm_ref))
     165                wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref));
    164166        snd_power_sync_ref(codec->bus->card);
    165167
     
    167169                codec->patch_ops.free(codec);
    168170        snd_hda_codec_cleanup_for_unbind(codec);
     171        codec->preset = NULL;
    169172        module_put(dev->driver->owner);
    170173        return 0;
     
    238241static void codec_bind_module(struct hda_codec *codec)
    239242{
    240 #ifdef MODULE
     243//#ifdef MODULE
    241244        request_codec_module(codec);
    242245        if (codec_probed(codec))
    243246                return;
    244 #endif
    245 }
    246 
    247 #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI)
     247//#endif
     248}
     249
     250#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || defined(CONFIG_SND_HDA_CODEC_HDMI)
    248251/* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */
    249252static bool is_likely_hdmi_codec(struct hda_codec *codec)
    250253{
    251254        hda_nid_t nid;
     255
     256        /*
     257         * For ASoC users, if snd_hda_hdmi_codec module is denylisted and any
     258         * event causes i915 enumeration to fail, ->wcaps remains uninitialized.
     259         */
     260        if (!codec->wcaps)
     261                return true;
    252262
    253263        for_each_hda_codec_node(nid, codec) {
     
    327337                err = codec_bind_generic(codec);
    328338                if (err < 0) {
    329                         codec_dbg(codec, "Unable to bind the codec\n");
     339                        codec_dbg(codec, "Unable to bind the codec - err = %d\n",err);
    330340                        return err;
    331341                }
  • GPL/trunk/alsa-kernel/pci/hda/hda_codec.c

    r717 r772  
    779779}
    780780
     781/**
     782 * snd_hda_codec_cleanup_for_unbind - Prepare codec for removal
     783 * @codec: codec device to cleanup
     784 */
    781785void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec)
    782786{
    783         if (codec->registered) {
     787        if (codec->core.registered) {
    784788                /* pm_runtime_put() is called in snd_hdac_device_exit() */
    785789                pm_runtime_get_noresume(hda_codec_dev(codec));
    786790                pm_runtime_disable(hda_codec_dev(codec));
    787                 codec->registered = 0;
     791                codec->core.registered = 0;
    788792        }
    789793
     
    804808        snd_array_free(&codec->spdif_out);
    805809        snd_array_free(&codec->verbs);
    806         codec->preset = NULL;
    807810        codec->follower_dig_outs = NULL;
    808811        codec->spdif_status_reset = 0;
     
    826829}
    827830
    828 /* also called from hda_bind.c */
     831/**
     832 * snd_hda_codec_register - Finalize codec initialization
     833 * @codec: codec device to register
     834 *
     835 * Also called from hda_bind.c
     836 */
    829837void snd_hda_codec_register(struct hda_codec *codec)
    830838{
    831         if (codec->registered)
     839        if (codec->core.registered)
    832840                return;
    833841        if (device_is_registered(hda_codec_dev(codec))) {
     
    836844                /* it was powered up in snd_hda_codec_new(), now all done */
    837845                snd_hda_power_down(codec);
    838                 codec->registered = 1;
    839         }
    840 }
     846                codec->core.registered = 1;
     847        }
     848}
     849EXPORT_SYMBOL_GPL(snd_hda_codec_register);
    841850
    842851static int snd_hda_codec_dev_register(struct snd_device *device)
     
    846855}
    847856
    848 static int snd_hda_codec_dev_free(struct snd_device *device)
    849 {
    850         struct hda_codec *codec = device->device_data;
    851 
     857/**
     858 * snd_hda_codec_unregister - Unregister specified codec device
     859 * @codec: codec device to unregister
     860 */
     861void snd_hda_codec_unregister(struct hda_codec *codec)
     862{
    852863        codec->in_freeing = 1;
    853864        /*
     
    866877        if (codec->core.type == HDA_DEV_LEGACY)
    867878                put_device(hda_codec_dev(codec));
    868 
     879}
     880EXPORT_SYMBOL_GPL(snd_hda_codec_unregister);
     881
     882static int snd_hda_codec_dev_free(struct snd_device *device)
     883{
     884        snd_hda_codec_unregister(device->device_data);
    869885        return 0;
    870886}
     
    879895        kfree(codec->modelname);
    880896        kfree(codec->wcaps);
    881 
    882         /*
    883          * In the case of ASoC HD-audio, hda_codec is device managed.
    884          * It will be freed when the ASoC device is removed.
    885          */
    886         if (codec->core.type == HDA_DEV_LEGACY)
    887                 kfree(codec);
     897        kfree(codec);
    888898}
    889899
    890900#define DEV_NAME_LEN 31
    891901
    892 static int snd_hda_codec_device_init(struct hda_bus *bus, struct snd_card *card,
    893                         unsigned int codec_addr, struct hda_codec **codecp)
    894 {
     902/**
     903 * snd_hda_codec_device_init - allocate HDA codec device
     904 * @bus: codec's parent bus
     905 * @codec_addr: the codec address on the parent bus
     906 * @fmt: format string for the device's name
     907 *
     908 * Returns newly allocated codec device or ERR_PTR() on failure.
     909 */
     910struct hda_codec *
     911snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
     912                          const char *fmt, ...)
     913{
     914        va_list vargs;
    895915        char name[DEV_NAME_LEN];
    896916        struct hda_codec *codec;
    897917        int err;
    898918
    899         dev_dbg(card->dev, "%s: entry\n", __func__);
    900 
    901919        if (snd_BUG_ON(!bus))
    902                 return -EINVAL;
     920                return ERR_PTR(-EINVAL);
    903921        if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
    904                 return -EINVAL;
     922                return ERR_PTR(-EINVAL);
    905923
    906924        codec = kzalloc(sizeof(*codec), GFP_KERNEL);
    907925        if (!codec)
    908                 return -ENOMEM;
    909 
    910         sprintf(name, "hdaudioC%dD%d", card->number, codec_addr);
     926                return ERR_PTR(-ENOMEM);
     927
     928        va_start(vargs, fmt);
     929        vsprintf(name, fmt, vargs);
     930        va_end(vargs);
     931
    911932        err = snd_hdac_device_init(&codec->core, &bus->core, name, codec_addr);
    912933        if (err < 0) {
    913934                kfree(codec);
    914                 return err;
    915         }
    916 
     935                return ERR_PTR(err);
     936        }
     937
     938        codec->bus = bus;
     939        codec->depop_delay = -1;
     940        codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
     941        codec->core.dev.release = snd_hda_codec_dev_release;
    917942        codec->core.type = HDA_DEV_LEGACY;
    918         *codecp = codec;
    919 
    920         return err;
    921 }
    922 
    923 /**
    924  * snd_hda_codec_new - create a HDA codec
    925  * @bus: the bus to assign
    926  * @card: card for this codec
    927  * @codec_addr: the codec address
    928  * @codecp: the pointer to store the generated codec
    929  *
    930  * Returns 0 if successful, or a negative error code.
    931  */
    932 int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
    933                       unsigned int codec_addr, struct hda_codec **codecp)
    934 {
    935         int ret;
    936 
    937         ret = snd_hda_codec_device_init(bus, card, codec_addr, codecp);
    938         if (ret < 0)
    939                 return ret;
    940 
    941         return snd_hda_codec_device_new(bus, card, codec_addr, *codecp);
    942 }
    943 EXPORT_SYMBOL_GPL(snd_hda_codec_new);
    944 
    945 int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
    946                         unsigned int codec_addr, struct hda_codec *codec)
    947 {
    948         char component[31];
    949         hda_nid_t fg;
    950         int err;
    951         static const struct snd_device_ops dev_ops = {
    952                 .dev_register = snd_hda_codec_dev_register,
    953                 .dev_free = snd_hda_codec_dev_free,
    954         };
    955 
    956         dev_dbg(card->dev, "%s: entry\n", __func__);
    957 
    958         if (snd_BUG_ON(!bus))
    959                 return -EINVAL;
    960         if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
    961                 return -EINVAL;
    962 
    963         codec->core.dev.release = snd_hda_codec_dev_release;
    964         codec->core.exec_verb = codec_exec_verb;
    965 
    966         codec->bus = bus;
    967         codec->card = card;
    968         codec->addr = codec_addr;
     943
    969944        mutex_init(&codec->spdif_mutex);
    970945        mutex_init(&codec->control_mutex);
     
    979954        INIT_LIST_HEAD(&codec->conn_list);
    980955        INIT_LIST_HEAD(&codec->pcm_list_head);
     956        INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
    981957        refcount_set(&codec->pcm_ref, 1);
    982958        init_waitqueue_head(&codec->remove_sleep);
    983959
    984         INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work);
    985         codec->depop_delay = -1;
    986         codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
     960        return codec;
     961}
     962EXPORT_SYMBOL_GPL(snd_hda_codec_device_init);
     963
     964/**
     965 * snd_hda_codec_new - create a HDA codec
     966 * @bus: the bus to assign
     967 * @card: card for this codec
     968 * @codec_addr: the codec address
     969 * @codecp: the pointer to store the generated codec
     970 *
     971 * Returns 0 if successful, or a negative error code.
     972 */
     973int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
     974                      unsigned int codec_addr, struct hda_codec **codecp)
     975{
     976        struct hda_codec *codec;
     977        int ret;
     978
     979        codec = snd_hda_codec_device_init(bus, codec_addr, "hdaudioC%dD%d",
     980                                          card->number, codec_addr);
     981        if (IS_ERR(codec))
     982                return PTR_ERR(codec);
     983        *codecp = codec;
     984
     985        ret = snd_hda_codec_device_new(bus, card, codec_addr, *codecp, true);
     986        if (ret)
     987                put_device(hda_codec_dev(*codecp));
     988
     989        return ret;
     990}
     991EXPORT_SYMBOL_GPL(snd_hda_codec_new);
     992
     993int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
     994                        unsigned int codec_addr, struct hda_codec *codec,
     995                        bool snddev_managed)
     996{
     997        char component[31];
     998        hda_nid_t fg;
     999        int err;
     1000        static const struct snd_device_ops dev_ops = {
     1001                .dev_register = snd_hda_codec_dev_register,
     1002                .dev_free = snd_hda_codec_dev_free,
     1003        };
     1004
     1005        dev_dbg(card->dev, "%s: entry\n", __func__);
     1006
     1007        if (snd_BUG_ON(!bus))
     1008                return -EINVAL;
     1009        if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
     1010                return -EINVAL;
     1011
     1012        codec->core.exec_verb = codec_exec_verb;
     1013        codec->card = card;
     1014        codec->addr = codec_addr;
    9871015
    9881016#ifdef CONFIG_PM
     
    9941022        if (codec->bus->modelname) {
    9951023                codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
    996                 if (!codec->modelname) {
    997                         err = -ENOMEM;
    998                         goto error;
    999                 }
     1024                if (!codec->modelname)
     1025                        return -ENOMEM;
    10001026        }
    10011027
     
    10031029        err = read_widget_caps(codec, fg);
    10041030        if (err < 0)
    1005                 goto error;
     1031                return err;
    10061032        err = read_pin_defaults(codec);
    10071033        if (err < 0)
    1008                 goto error;
     1034                return err;
    10091035
    10101036        /* power-up all before initialization */
     
    10201046        snd_component_add(card, component);
    10211047
    1022         err = snd_device_new(card, SNDRV_DEV_CODEC, codec, &dev_ops);
    1023         if (err < 0)
    1024                 goto error;
    1025 
     1048        if (snddev_managed) {
     1049                /* ASoC features component management instead */
     1050                err = snd_device_new(card, SNDRV_DEV_CODEC, codec, &dev_ops);
     1051                if (err < 0)
     1052                        return err;
     1053        }
     1054
     1055#ifdef CONFIG_PM
    10261056        /* PM runtime needs to be enabled later after binding codec */
    1027         pm_runtime_forbid(&codec->core.dev);
    1028 
    1029         return 0;
    1030 
    1031  error:
    1032         put_device(hda_codec_dev(codec));
    1033         return err;
     1057        if (codec->core.dev.power.runtime_auto)
     1058                pm_runtime_forbid(&codec->core.dev);
     1059        else
     1060                /* Keep the usage_count consistent across subsequent probing */
     1061                pm_runtime_get_noresume(&codec->core.dev);
     1062#endif
     1063
     1064        return 0;
    10341065}
    10351066EXPORT_SYMBOL_GPL(snd_hda_codec_device_new);
     
    17511782        struct hda_nid_item *items = codec->mixers.list;
    17521783
    1753         down_write(&codec->card->controls_rwsem);
    17541784        for (i = 0; i < codec->mixers.used; i++)
    17551785                snd_ctl_remove(codec->card, items[i].kctl);
    1756         up_write(&codec->card->controls_rwsem);
    17571786        snd_array_free(&codec->mixers);
    17581787        snd_array_free(&codec->nids);
     
    24452474                /* suppose a single SPDIF device */
    24462475                for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
     2476                        struct snd_ctl_elem_id id;
     2477
    24472478                        kctl = find_mixer_ctl(codec, dig_mix->name, 0, 0);
    24482479                        if (!kctl)
    24492480                                break;
    2450                         kctl->id.index = spdif_index;
     2481                        id = kctl->id;
     2482                        id.index = spdif_index;
     2483                        err = snd_ctl_rename_id(codec->card, &kctl->id, &id);
     2484                        if (err < 0)
     2485                                return err;
    24512486                }
    24522487                bus->primary_dig_out_type = HDA_PCM_TYPE_HDMI;
     
    28722907        if (codec->patch_ops.suspend)
    28732908                codec->patch_ops.suspend(codec);
    2874         hda_cleanup_all_streams(codec);
     2909        if (!codec->no_stream_clean_at_suspend)
     2910                hda_cleanup_all_streams(codec);
    28752911        state = hda_set_power_state(codec, AC_PWRST_D3);
    28762912        update_power_acct(codec, true);
     
    29202956
    29212957        cancel_delayed_work_sync(&codec->jackpoll_work);
     2958
    29222959        state = hda_call_codec_suspend(codec);
    29232960        if (codec->link_down_at_suspend ||
     
    29262963                snd_hdac_codec_link_down(&codec->core);
    29272964        snd_hda_codec_display_power(codec, false);
     2965
     2966        if (codec->bus->jackpoll_in_suspend /*&&
     2967                (dev->power.power_state.event != PM_EVENT_SUSPEND)*/)
     2968                schedule_delayed_work(&codec->jackpoll_work,
     2969                                        codec->jackpoll_interval);
    29282970        return 0;
    29292971}
     
    29492991static int hda_codec_pm_prepare(struct device *dev)
    29502992{
     2993        struct hda_codec *codec = dev_to_hda_codec(dev);
     2994
     2995        cancel_delayed_work_sync(&codec->jackpoll_work);
    29512996        dev->power.power_state = PMSG_SUSPEND;
    29522997        return pm_runtime_suspended(dev);
     
    29823027static int hda_codec_pm_freeze(struct device *dev)
    29833028{
     3029        struct hda_codec *codec = dev_to_hda_codec(dev);
     3030
     3031        cancel_delayed_work_sync(&codec->jackpoll_work);
    29843032        dev->power.power_state = PMSG_FREEZE;
    29853033        return pm_runtime_force_suspend(dev);
     
    30213069
    30223070        /* Skip the shutdown if codec is not registered */
    3023         if (!codec->registered)
     3071        if (!codec->core.registered)
    30243072                return;
    30253073
     3074        cancel_delayed_work_sync(&codec->jackpoll_work);
    30263075        list_for_each_entry(cpcm, &codec->pcm_list_head, list, struct hda_pcm)
    30273076                snd_pcm_suspend_all(cpcm->pcm);
     
    31373186                                info->formats ? NULL : &info->formats,
    31383187                                info->maxbps ? NULL : &info->maxbps);
    3139                 if (err < 0)
    3140                         return err;
     3188                if (err < 0){
     3189                                codec_warn(codec,"exiting here\n");
     3190                        return err;}
    31413191        }
    31423192        if (info->ops.open == NULL)
     
    33643414                        if (!kctl)
    33653415                                return -ENOMEM;
    3366                         if (addr > 0)
     3416                        /* Do not use the id.device field for MIXER elements.
     3417                         * This field is for real device numbers (like PCM) but codecs
     3418                         * are hidden components from the user space view (unrelated
     3419                         * to the mixer element identification).
     3420                         */
     3421                        if (addr > 0 && codec->ctl_dev_id)
    33673422                                kctl->id.device = addr;
    33683423                        if (idx > 0)
     
    33753430                         * primary codec), then try another control index
    33763431                         */
    3377                         if (!addr && codec->core.addr)
     3432                        if (!addr && codec->core.addr) {
    33783433                                addr = codec->core.addr;
    3379                         else if (!idx && !knew->index) {
     3434                                if (!codec->ctl_dev_id)
     3435                                        idx += 10 * addr;
     3436                        } else if (!idx && !knew->index) {
    33803437                                idx = find_empty_mixer_ctl_idx(codec,
    33813438                                                               knew->name, 0);
     
    33913448
    33923449#ifdef CONFIG_PM
    3393 static void codec_set_power_save(struct hda_codec *codec, int delay)
     3450/**
     3451 * snd_hda_codec_set_power_save - Configure codec's runtime PM
     3452 * @codec: codec device to configure
     3453 * @delay: autosuspend delay
     3454 */
     3455void snd_hda_codec_set_power_save(struct hda_codec *codec, int delay)
    33943456{
    33953457        struct device *dev = hda_codec_dev(codec);
     
    34093471        }
    34103472}
     3473EXPORT_SYMBOL_GPL(snd_hda_codec_set_power_save);
    34113474
    34123475/**
     
    34223485
    34233486        list_for_each_codec(c, bus)
    3424                 codec_set_power_save(c, delay);
     3487                snd_hda_codec_set_power_save(c, delay);
    34253488}
    34263489EXPORT_SYMBOL_GPL(snd_hda_set_power_save);
  • GPL/trunk/alsa-kernel/pci/hda/hda_controller.c

    r717 r772  
    268268                if (start) {
    269269                        azx_dev->insufficient = 1;
    270                         snd_hdac_stream_start(azx_stream(azx_dev), true);
     270                        snd_hdac_stream_start(azx_stream(azx_dev));
    271271                } else {
    272272                        snd_hdac_stream_stop(azx_stream(azx_dev));
     
    10581058{
    10591059        struct hdac_bus *bus = azx_bus(chip);
    1060         struct hdac_stream *s;
    1061 
    1062         list_for_each_entry(s, &bus->stream_list, list, struct hdac_stream)
    1063                 snd_hdac_stream_stop(s);
     1060
     1061        snd_hdac_stop_streams(bus);
    10641062}
    10651063EXPORT_SYMBOL_GPL(azx_stop_all_streams);
     
    12631261                        codec->jackpoll_interval = chip->jackpoll_interval;
    12641262                        codec->beep_mode = chip->beep_mode;
     1263                        codec->ctl_dev_id = chip->ctl_dev_id;
    12651264                        codecs++;
    12661265                }
  • GPL/trunk/alsa-kernel/pci/hda/hda_controller.h

    r717 r772  
    125125        int  codec_probe_mask; /* copied from probe_mask option */
    126126        unsigned int beep_mode;
     127        bool ctl_dev_id;
    127128
    128129#ifdef CONFIG_SND_HDA_PATCH_LOADER
  • GPL/trunk/alsa-kernel/pci/hda/hda_eld.c

    r709 r772  
    252252#ifndef TARGET_OS2 //FIXME Error! E1029: Expression must be 'pointer to ...'
    253253        e->aud_synch_delay = GRAB_BITS(buf, 6, 0, 8) * 2;
     254#else
     255        int delay = GRAB_BITS(buf, 6, 0, 8);
     256        e->aud_synch_delay = delay *2;
    254257#endif
    255258        e->spk_alloc    = GRAB_BITS(buf, 7, 0, 7);
     
    448451
    449452void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
    450                              struct snd_info_buffer *buffer)
     453                             struct snd_info_buffer *buffer,
     454                             hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid)
    451455{
    452456        struct parsed_hdmi_eld *e = &eld->info;
     
    507511        snd_iprintf(buffer, "monitor_present\t\t%d\n", eld->monitor_present);
    508512        snd_iprintf(buffer, "eld_valid\t\t%d\n", eld->eld_valid);
     513        snd_iprintf(buffer, "codec_pin_nid\t\t0x%x\n", pin_nid);
     514        snd_iprintf(buffer, "codec_dev_id\t\t0x%x\n", dev_id);
     515        snd_iprintf(buffer, "codec_cvt_nid\t\t0x%x\n", cvt_nid);
    509516        if (!eld->eld_valid)
    510517                return;
  • GPL/trunk/alsa-kernel/pci/hda/hda_generic.c

    r717 r772  
    10021002{
    10031003        char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
    1004         snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
     1004        int len;
     1005
     1006        len = snprintf(name, sizeof(name), "%s %s %s", pfx, dir, sfx);
     1007        if (snd_BUG_ON(len >= sizeof(name)))
     1008                return -EINVAL;
    10051009        if (!add_control(spec, type, name, cidx, val))
    10061010                return -ENOMEM;
     
    11591163}
    11601164
    1161 static const char * const channel_name[4] = {
    1162         "Front", "Surround", "CLFE", "Side"
     1165static const char * const channel_name[] = {
     1166        "Front", "Surround", "CLFE", "Side", "Back",
    11631167};
    11641168
     
    11861190        /* multi-io channels */
    11871191        if (ch >= cfg->line_outs)
    1188                 return channel_name[ch];
     1192                goto fixed_name;
    11891193
    11901194        switch (cfg->line_out_type) {
     
    12381242                return "Line Out";
    12391243
     1244 fixed_name:
    12401245        if (ch >= ARRAY_SIZE(channel_name)) {
    12411246                snd_BUG();
     
    13821387                hda_nid_t pin = pins[i];
    13831388
    1384                 if (!spec->obey_preferred_dacs) {
     1389                if (!spec->preferred_dacs) {
    13851390                        path = snd_hda_get_path_from_idx(codec, path_idx[i]);
    13861391                        if (path) {
     
    13941399                        if (is_dac_already_used(codec, dacs[i]))
    13951400                                badness += bad->shared_primary;
    1396                 } else if (spec->obey_preferred_dacs) {
     1401                } else if (spec->preferred_dacs) {
    13971402                        badness += BAD_NO_PRIMARY_DAC;
    13981403                }
     
    49634968EXPORT_SYMBOL_GPL(snd_hda_gen_stream_pm);
    49644969
     4970/* forcibly mute the speaker output without caching; return true if updated */
     4971static bool force_mute_output_path(struct hda_codec *codec, hda_nid_t nid)
     4972{
     4973        if (!nid)
     4974                return false;
     4975        if (!nid_has_mute(codec, nid, HDA_OUTPUT))
     4976                return false; /* no mute, skip */
     4977        if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
     4978            snd_hda_codec_amp_read(codec, nid, 1, HDA_OUTPUT, 0) &
     4979            HDA_AMP_MUTE)
     4980                return false; /* both channels already muted, skip */
     4981
     4982        /* direct amp update without caching */
     4983        snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
     4984                            AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT |
     4985                            AC_AMP_SET_RIGHT | HDA_AMP_MUTE);
     4986        return true;
     4987}
     4988
     4989/**
     4990 * snd_hda_gen_shutup_speakers - Forcibly mute the speaker outputs
     4991 * @codec: the HDA codec
     4992 *
     4993 * Forcibly mute the speaker outputs, to be called at suspend or shutdown.
     4994 *
     4995 * The mute state done by this function isn't cached, hence the original state
     4996 * will be restored at resume.
     4997 *
     4998 * Return true if the mute state has been changed.
     4999 */
     5000bool snd_hda_gen_shutup_speakers(struct hda_codec *codec)
     5001{
     5002        struct hda_gen_spec *spec = codec->spec;
     5003        const int *paths;
     5004        const struct nid_path *path;
     5005        int i, p, num_paths;
     5006        bool updated = false;
     5007
     5008        /* if already powered off, do nothing */
     5009        if (!snd_hdac_is_power_on(&codec->core))
     5010                return false;
     5011
     5012        if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
     5013                paths = spec->out_paths;
     5014                num_paths = spec->autocfg.line_outs;
     5015        } else {
     5016                paths = spec->speaker_paths;
     5017                num_paths = spec->autocfg.speaker_outs;
     5018        }
     5019
     5020        for (i = 0; i < num_paths; i++) {
     5021                path = snd_hda_get_path_from_idx(codec, paths[i]);
     5022                if (!path)
     5023                        continue;
     5024                for (p = 0; p < path->depth; p++)
     5025                        if (force_mute_output_path(codec, path->path[p]))
     5026                                updated = true;
     5027        }
     5028
     5029        return updated;
     5030}
     5031EXPORT_SYMBOL_GPL(snd_hda_gen_shutup_speakers);
     5032
    49655033/**
    49665034 * snd_hda_gen_parse_auto_config - Parse the given BIOS configuration and
  • GPL/trunk/alsa-kernel/pci/hda/hda_generic.h

    r717 r772  
    1010
    1111#include <linux/leds.h>
     12#include "hda_auto_parser.h"
     13
     14struct hda_jack_callback;
    1215
    1316/* table entry for multi-io paths */
     
    184187
    185188        /* for pin sensing */
    186         /* current status; set in hda_geneic.c */
     189        /* current status; set in hda_generic.c */
    187190        unsigned int hp_jack_present:1;
    188191        unsigned int line_jack_present:1;
     
    353356                                     int (*callback)(struct led_classdev *,
    354357                                                     enum led_brightness));
     358bool snd_hda_gen_shutup_speakers(struct hda_codec *codec);
    355359
    356360#endif /* __SOUND_HDA_GENERIC_H */
  • GPL/trunk/alsa-kernel/pci/hda/hda_hwdep.c

    r679 r772  
    115115
    116116        /* for sysfs */
    117         hwdep->dev.groups = snd_hda_dev_attr_groups;
    118         dev_set_drvdata(&hwdep->dev, codec);
     117        hwdep->dev->groups = snd_hda_dev_attr_groups;
     118        dev_set_drvdata(hwdep->dev, codec);
    119119
    120120        return 0;
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.c

    r717 r772  
    5656#include <linux/vgaarb.h>
    5757#include <linux/vga_switcheroo.h>
     58#include <linux/apple-gmux.h>
    5859#include <linux/firmware.h>
    5960#include <sound/hda_codec.h>
     
    9798#define INTEL_SCH_HDA_DEVC_NOSNOOP       (0x1<<11)
    9899
    99 /* Define VIA HD Audio Device ID*/
    100 #define VIA_HDAC_DEVICE_ID              0x3288
    101 
    102100/* max number of SDs */
    103101/* ICH, ATI and VIA have 4 playback and 4 capture */
     
    112110#define ATIHDMI_NUM_CAPTURE     0
    113111#define ATIHDMI_NUM_PLAYBACK    8
    114 
    115 /* TERA has 4 playback and 3 capture */
    116 #define TERA_NUM_CAPTURE        3
    117 #define TERA_NUM_PLAYBACK       4
    118112
    119113
     
    143137#endif
    144138static bool dmic_detect = 1;
     139#ifndef TARGET_OS2
     140static bool ctl_dev_id = IS_ENABLED(CONFIG_SND_HDA_CTL_DEV_ID) ? 1 : 0;
     141#else
     142static bool ctl_dev_id = 0;
     143#endif
    145144
    146145module_param_array(index, int, NULL, 0444);
     
    181180                             "(0=off, 1=on) (default=1); "
    182181                 "deprecated, use snd-intel-dspcfg.dsp_driver option instead");
     182module_param(ctl_dev_id, bool, 0444);
     183MODULE_PARM_DESC(ctl_dev_id, "Use control device identifier (based on codec address).");
    183184
    184185#ifdef CONFIG_PM
     
    249250        AZX_DRIVER_ATIHDMI,
    250251        AZX_DRIVER_ATIHDMI_NS,
     252        AZX_DRIVER_GFHDMI,
    251253        AZX_DRIVER_VIA,
    252254        AZX_DRIVER_SIS,
     
    258260        AZX_DRIVER_CMEDIA,
    259261        AZX_DRIVER_ZHAOXIN,
     262        AZX_DRIVER_LOONGSON,
    260263        AZX_DRIVER_GENERIC,
    261264        AZX_NUM_DRIVERS, /* keep this as last entry */
     
    350353#endif
    351354
    352 #define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \
    353                                         ((pci)->device == 0x0c0c) || \
    354                                         ((pci)->device == 0x0d0c) || \
    355                                         ((pci)->device == 0x160c) || \
    356                                         ((pci)->device == 0x490d) || \
    357                                         ((pci)->device == 0x4f90) || \
    358                                         ((pci)->device == 0x4f91) || \
    359                                         ((pci)->device == 0x4f92))
    360 
    361 #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
    362 
    363355static const char * const driver_short_names[] = {
    364356        [AZX_DRIVER_ICH] = "HDA Intel",
     
    370362        [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI",
    371363        [AZX_DRIVER_ATIHDMI_NS] = "HDA ATI HDMI",
     364        [AZX_DRIVER_GFHDMI] = "HDA GF HDMI",
    372365        [AZX_DRIVER_VIA] = "HDA VIA VT82xx",
    373366        [AZX_DRIVER_SIS] = "HDA SIS966",
     
    379372        [AZX_DRIVER_CMEDIA] = "HDA C-Media",
    380373        [AZX_DRIVER_ZHAOXIN] = "HDA Zhaoxin",
     374        [AZX_DRIVER_LOONGSON] = "HDA Loongson",
    381375        [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
    382376};
     
    460454}
    461455
     456#ifndef TARGET_OS2
    462457/*
    463458 * In BXT-P A0, HD-Audio DMA requests is later than expected,
     
    475470        azx_writel(chip, VS_EM4L, val);
    476471}
     472#endif
    477473
    478474/*
     
    511507
    512508        /*
    513          * the codecs are sharing the first link setting by default
    514          * If other links are enabled for stream, they need similar fix
     509         * Changes to LCTL.SCF are only needed for the first multi-link dealing
     510         * with external codecs
    515511         */
    516512        val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    517         val &= ~AZX_MLCTL_SPA;
    518         val |= state << AZX_MLCTL_SPA_SHIFT;
     513        val &= ~AZX_ML_LCTL_SPA;
     514        val |= state << AZX_ML_LCTL_SPA_SHIFT;
    519515        writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    520516        /* wait for CPA */
     
    522518        while (timeout) {
    523519                if (((readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL)) &
    524                     AZX_MLCTL_CPA) == (state << AZX_MLCTL_CPA_SHIFT))
     520                    AZX_ML_LCTL_CPA) == (state << AZX_ML_LCTL_CPA_SHIFT))
    525521                        return 0;
    526522                timeout--;
     
    539535        /* 0. check lctl register value is correct or not */
    540536        val = readl(bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
    541         /* if SCF is already set, let's use it */
    542         if ((val & ML_LCTL_SCF_MASK) != 0)
     537        /* only perform additional configurations if the SCF is initially based on 6MHz */
     538        if ((val & AZX_ML_LCTL_SCF) != 0)
    543539                return;
    544540
     
    547543         * Any deviation may result in undefined behavior.
    548544         */
    549         if (((val & AZX_MLCTL_SPA) >> AZX_MLCTL_SPA_SHIFT) !=
    550                 ((val & AZX_MLCTL_CPA) >> AZX_MLCTL_CPA_SHIFT))
     545        if (((val & AZX_ML_LCTL_SPA) >> AZX_ML_LCTL_SPA_SHIFT) !=
     546                ((val & AZX_ML_LCTL_CPA) >> AZX_ML_LCTL_CPA_SHIFT))
    551547                return;
    552548
     
    557553                goto set_spa;
    558554
    559         /* 2. update SCF to select a properly audio clock*/
    560         val &= ~ML_LCTL_SCF_MASK;
     555        /* 2. update SCF to select an audio clock different from 6MHz */
     556        val &= ~AZX_ML_LCTL_SCF;
    561557        val |= intel_get_lctl_scf(chip);
    562558        writel(val, bus->mlcap + AZX_ML_BASE + AZX_REG_ML_LCTL);
     
    589585        snd_hdac_set_codec_wakeup(bus, false);
    590586
     587#ifndef TARGET_OS2
    591588        /* reduce dma latency to avoid noise */
    592         if (IS_BXT(pci))
     589        if (HDA_CONTROLLER_IS_APL(pci))
    593590                bxt_reduce_dma_latency(chip);
    594 
     591#endif
    595592        if (bus->mlcap != NULL)
    596593                intel_init_lctl(chip);
     
    671668        unsigned int pos;
    672669        snd_pcm_uframes_t hwptr, target;
     670
     671        /*
     672         * The value of the WALLCLK register is always 0
     673         * on the Loongson controller, so we return directly.
     674         */
     675        if (chip->driver_type == AZX_DRIVER_LOONGSON)
     676                return 1;
    673677
    674678        wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk;
     
    13821386                return;
    13831387
    1384         if (azx_has_pm_runtime(chip) && chip->running)
     1388        if (azx_has_pm_runtime(chip) && chip->running) {
    13851389                pm_runtime_get_noresume(&pci->dev);
     1390                pm_runtime_forbid(&pci->dev);
     1391                pm_runtime_dont_use_autosuspend(&pci->dev);
     1392        }
     1393
    13861394        chip->running = 0;
    13871395
     
    15001508                                 */
    15011509                                if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
    1502                                     atpx_present())
     1510                                    (atpx_present() || apple_gmux_detect(NULL, NULL)))
    15031511                                        return p;
    15041512                                pci_dev_put(p);
     
    17681776        if (chip->pci->vendor == PCI_VENDOR_ID_INTEL) {
    17691777                switch (chip->pci->device) {
    1770                 case 0x0f04: /* Baytrail */
    1771                 case 0x2284: /* Braswell */
     1778                case PCI_DEVICE_ID_INTEL_HDA_BYT:
     1779                case PCI_DEVICE_ID_INTEL_HDA_BSW:
    17721780                        return 32;
     1781                case PCI_DEVICE_ID_INTEL_HDA_APL:
     1782                        return 64;
    17731783                }
    17741784        }
    17751785
    17761786        switch (chip->driver_type) {
     1787        /*
     1788         * increase the bdl size for Glenfly Gpus for hardware
     1789         * limitation on hdac interrupt interval
     1790         */
     1791        case AZX_DRIVER_GFHDMI:
     1792                return 128;
    17771793        case AZX_DRIVER_ICH:
    17781794        case AZX_DRIVER_PCH:
     
    18021818        *rchip = NULL;
    18031819
    1804         err = pci_enable_device(pci);
     1820        err = pcim_enable_device(pci);
    18051821        if (err < 0)
    18061822                return err;
    18071823
    1808 #ifndef TARGET_OS2
    18091824        hda = devm_kzalloc(&pci->dev, sizeof(*hda), GFP_KERNEL);
    1810 #else
    1811         hda = kzalloc(sizeof(*hda), GFP_KERNEL);
    1812 #endif
    18131825        if (!hda)
    18141826                return -ENOMEM;
     
    18511863        /* use the non-cached pages in non-snoop mode */
    18521864        if (!azx_snoop(chip))
    1853                 azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC;
     1865                azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC_SG;
    18541866
    18551867        if (chip->driver_type == AZX_DRIVER_NVIDIA) {
     
    18941906        }
    18951907#endif
    1896 
    1897 #ifndef TARGET_OS2
     1908        /*
     1909         * Fix response write request not synced to memory when handle
     1910         * hdac interrupt on Glenfly Gpus
     1911         */
     1912        if (chip->driver_type == AZX_DRIVER_GFHDMI)
     1913                bus->polling_mode = 1;
     1914
     1915        if (chip->driver_type == AZX_DRIVER_LOONGSON) {
     1916                bus->polling_mode = 1;
     1917                bus->not_use_interrupts = 1;
     1918                bus->access_sdnctl_in_dword = 1;
     1919        }
     1920
    18981921        err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");
    1899 #else
    1900         err = pci_request_regions(pci, "ICH HD audio");
    1901 #endif
    19021922        if (err < 0)
    19031923                return err;
    19041924
    19051925        bus->addr = pci_resource_start(pci, 0);
    1906 #ifndef TARGET_OS2
    19071926        bus->remap_addr = pcim_iomap_table(pci)[0];
    1908 #else
    1909         bus->remap_addr = pci_ioremap_bar(pci, 0);
    1910 #endif
    19111927        if (chip->driver_type == AZX_DRIVER_SKL)
    19121928                snd_hdac_bus_parse_capabilities(bus);
     
    19821998        if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits)))
    19831999                dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
     2000        dma_set_max_seg_size(&pci->dev, UINT_MAX);
    19842001
    19852002        /* read number of streams from GCAP register instead of using
     
    20012018                        chip->capture_streams = ATIHDMI_NUM_CAPTURE;
    20022019                        break;
     2020                case AZX_DRIVER_GFHDMI:
    20032021                case AZX_DRIVER_GENERIC:
    20042022                default:
     
    21062124};
    21072125
     2126static DECLARE_BITMAP(probed_devs, SNDRV_CARDS);
     2127
    21082128static int azx_probe(struct pci_dev *pci,
    21092129                     const struct pci_device_id *pci_id)
    21102130{
     2131#ifdef TARGET_OS2
    21112132        static int dev;
     2133#endif
    21122134        struct snd_card *card;
    21132135        struct hda_intel *hda;
    21142136        struct azx *chip;
    21152137        bool schedule_probe;
     2138#ifndef TARGET_OS2
     2139        int dev;
     2140#endif
    21162141        int err;
    21172142
     
    21212146        }
    21222147
    2123         if (dev >= SNDRV_CARDS)
    2124                 return -ENODEV;
     2148#ifndef TARGET_OS2
     2149        dev = find_first_zero_bit(probed_devs, SNDRV_CARDS);
     2150#endif
     2151        if (dev >= SNDRV_CARDS){
     2152                return -ENODEV;}
    21252153        if (!enable[dev]) {
     2154#ifdef TARGET_OS2
    21262155                dev++;
     2156#else
     2157                set_bit(dev, probed_devs);
     2158#endif
    21272159                return -ENOENT;
    21282160        }
     
    21832215#endif /* CONFIG_SND_HDA_PATCH_LOADER */
    21842216
    2185 #ifndef CONFIG_SND_HDA_I915
    2186         if (CONTROLLER_IN_GPU(pci))
     2217#if !defined(CONFIG_SND_HDA_I915) && !defined(TARGET_OS2)
     2218        if (HDA_CONTROLLER_IN_GPU(pci))
    21872219                dev_err(card->dev, "Haswell/Broadwell HDMI/DP must build in CONFIG_SND_HDA_I915\n");
    21882220#endif
     
    21992231#endif
    22002232
    2201         dev++;
     2233        set_bit(dev, probed_devs);
    22022234        if (chip->disabled)
    22032235                complete_all(&hda->probe_wait);
     
    22402272        /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */
    22412273        SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0),
     2274        SND_PCI_QUIRK(0x17aa, 0x316e, "Lenovo ThinkCentre M70q", 0),
    22422275        /* https://bugzilla.redhat.com/show_bug.cgi?id=1689623 */
    22432276        SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),
     
    22462279        /* https://bugs.launchpad.net/bugs/1821663 */
    22472280        SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0),
     2281        /* KONTRON SinglePC may cause a stall at runtime resume */
     2282        SND_PCI_QUIRK(0x1734, 0x1232, "KONTRON SinglePC", 0),
     2283        /* Dell ALC3271 */
     2284        SND_PCI_QUIRK(0x1028, 0x0962, "Dell ALC3271", 0),
    22482285        {0}
    22492286};
     
    23002337                         * codecs can be on the same link.
    23012338                         */
    2302                         if (CONTROLLER_IN_GPU(pci)) {
     2339                        if (HDA_CONTROLLER_IN_GPU(pci)) {
    23032340                                dev_err(chip->card->dev,
    23042341                                        "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n");
     
    23112348
    23122349                /* HSW/BDW controllers need this power */
    2313                 if (CONTROLLER_IN_GPU(pci))
     2350                if (HDA_CONTROLLER_IN_GPU(pci))
    23142351                        hda->need_i915_power = true;
    23152352        }
     
    23292366        chip->beep_mode = beep_mode[dev];
    23302367#endif
     2368
     2369        chip->ctl_dev_id = ctl_dev_id;
    23312370
    23322371        /* create codec instances */
     
    24222461                device_lock(&pci->dev);
    24232462
     2463                clear_bit(chip->dev_index, probed_devs);
     2464                pci_set_drvdata(pci, NULL);
    24242465                snd_card_free(card);
    24252466        }
     
    24412482static const struct pci_device_id azx_ids[] = {
    24422483        /* CPT */
    2443         { PCI_DEVICE(0x8086, 0x1c20),
    2444           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
     2484        { PCI_DEVICE_DATA(INTEL, HDA_CPT, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM) },
    24452485        /* PBG */
    2446         { PCI_DEVICE(0x8086, 0x1d20),
    2447           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
     2486        { PCI_DEVICE_DATA(INTEL, HDA_PBG, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM) },
    24482487        /* Panther Point */
    2449         { PCI_DEVICE(0x8086, 0x1e20),
    2450           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM },
     2488        { PCI_DEVICE_DATA(INTEL, HDA_PPT, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM) },
    24512489        /* Lynx Point */
    2452         { PCI_DEVICE(0x8086, 0x8c20),
    2453           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
     2490        { PCI_DEVICE_DATA(INTEL, HDA_LPT, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
    24542491        /* 9 Series */
    2455         { PCI_DEVICE(0x8086, 0x8ca0),
    2456           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
     2492        { PCI_DEVICE_DATA(INTEL, HDA_9_SERIES, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
    24572493        /* Wellsburg */
    2458         { PCI_DEVICE(0x8086, 0x8d20),
    2459           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
    2460         { PCI_DEVICE(0x8086, 0x8d21),
    2461           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
     2494        { PCI_DEVICE_DATA(INTEL, HDA_WBG_0, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
     2495        { PCI_DEVICE_DATA(INTEL, HDA_WBG_1, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
    24622496        /* Lewisburg */
    2463         { PCI_DEVICE(0x8086, 0xa1f0),
    2464           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
    2465         { PCI_DEVICE(0x8086, 0xa270),
    2466           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
     2497        { PCI_DEVICE_DATA(INTEL, HDA_LBG_0, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE) },
     2498        { PCI_DEVICE_DATA(INTEL, HDA_LBG_1, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE) },
    24672499        /* Lynx Point-LP */
    2468         { PCI_DEVICE(0x8086, 0x9c20),
    2469           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
     2500        { PCI_DEVICE_DATA(INTEL, HDA_LPT_LP_0, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
    24702501        /* Lynx Point-LP */
    2471         { PCI_DEVICE(0x8086, 0x9c21),
    2472           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
     2502        { PCI_DEVICE_DATA(INTEL, HDA_LPT_LP_1, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
    24732503        /* Wildcat Point-LP */
    2474         { PCI_DEVICE(0x8086, 0x9ca0),
    2475           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
    2476         /* Sunrise Point */
    2477         { PCI_DEVICE(0x8086, 0xa170),
    2478           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE },
    2479         /* Sunrise Point-LP */
    2480         { PCI_DEVICE(0x8086, 0x9d70),
    2481           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE },
     2504        { PCI_DEVICE_DATA(INTEL, HDA_WPT_LP, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH) },
     2505        /* Skylake (Sunrise Point) */
     2506        { PCI_DEVICE_DATA(INTEL, HDA_SKL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2507        /* Skylake-LP (Sunrise Point-LP) */
     2508        { PCI_DEVICE_DATA(INTEL, HDA_SKL_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24822509        /* Kabylake */
    2483         { PCI_DEVICE(0x8086, 0xa171),
    2484           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE },
     2510        { PCI_DEVICE_DATA(INTEL, HDA_KBL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24852511        /* Kabylake-LP */
    2486         { PCI_DEVICE(0x8086, 0x9d71),
    2487           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE },
     2512        { PCI_DEVICE_DATA(INTEL, HDA_KBL_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24882513        /* Kabylake-H */
    2489         { PCI_DEVICE(0x8086, 0xa2f0),
    2490           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE },
     2514        { PCI_DEVICE_DATA(INTEL, HDA_KBL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24912515        /* Coffelake */
    2492         { PCI_DEVICE(0x8086, 0xa348),
    2493           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2516        { PCI_DEVICE_DATA(INTEL, HDA_CNL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24942517        /* Cannonlake */
    2495         { PCI_DEVICE(0x8086, 0x9dc8),
    2496           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2518        { PCI_DEVICE_DATA(INTEL, HDA_CNL_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    24972519        /* CometLake-LP */
    2498         { PCI_DEVICE(0x8086, 0x02C8),
    2499           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2520        { PCI_DEVICE_DATA(INTEL, HDA_CML_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25002521        /* CometLake-H */
    2501         { PCI_DEVICE(0x8086, 0x06C8),
    2502           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2503         { PCI_DEVICE(0x8086, 0xf1c8),
    2504           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2522        { PCI_DEVICE_DATA(INTEL, HDA_CML_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2523        { PCI_DEVICE_DATA(INTEL, HDA_RKL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25052524        /* CometLake-S */
    2506         { PCI_DEVICE(0x8086, 0xa3f0),
    2507           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2525        { PCI_DEVICE_DATA(INTEL, HDA_CML_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25082526        /* CometLake-R */
    2509         { PCI_DEVICE(0x8086, 0xf0c8),
    2510           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2527        { PCI_DEVICE_DATA(INTEL, HDA_CML_R, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25112528        /* Icelake */
    2512         { PCI_DEVICE(0x8086, 0x34c8),
    2513           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2529        { PCI_DEVICE_DATA(INTEL, HDA_ICL_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25142530        /* Icelake-H */
    2515         { PCI_DEVICE(0x8086, 0x3dc8),
    2516           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2531        { PCI_DEVICE_DATA(INTEL, HDA_ICL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25172532        /* Jasperlake */
    2518         { PCI_DEVICE(0x8086, 0x38c8),
    2519           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2520         { PCI_DEVICE(0x8086, 0x4dc8),
    2521           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2533        { PCI_DEVICE_DATA(INTEL, HDA_ICL_N, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2534        { PCI_DEVICE_DATA(INTEL, HDA_JSL_N, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25222535        /* Tigerlake */
    2523         { PCI_DEVICE(0x8086, 0xa0c8),
    2524           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2536        { PCI_DEVICE_DATA(INTEL, HDA_TGL_LP, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25252537        /* Tigerlake-H */
    2526         { PCI_DEVICE(0x8086, 0x43c8),
    2527           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2538        { PCI_DEVICE_DATA(INTEL, HDA_TGL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25282539        /* DG1 */
    2529         { PCI_DEVICE(0x8086, 0x490d),
    2530           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2540        { PCI_DEVICE_DATA(INTEL, HDA_DG1, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25312541        /* DG2 */
    2532         { PCI_DEVICE(0x8086, 0x4f90),
    2533           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2534         { PCI_DEVICE(0x8086, 0x4f91),
    2535           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2536         { PCI_DEVICE(0x8086, 0x4f92),
    2537           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2542        { PCI_DEVICE_DATA(INTEL, HDA_DG2_0, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2543        { PCI_DEVICE_DATA(INTEL, HDA_DG2_1, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2544        { PCI_DEVICE_DATA(INTEL, HDA_DG2_2, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25382545        /* Alderlake-S */
    2539         { PCI_DEVICE(0x8086, 0x7ad0),
    2540           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2546        { PCI_DEVICE_DATA(INTEL, HDA_ADL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25412547        /* Alderlake-P */
    2542         { PCI_DEVICE(0x8086, 0x51c8),
    2543           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2548        { PCI_DEVICE_DATA(INTEL, HDA_ADL_P, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2549        { PCI_DEVICE_DATA(INTEL, HDA_ADL_PS, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2550        { PCI_DEVICE_DATA(INTEL, HDA_ADL_PX, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25442551        /* Alderlake-M */
    2545         { PCI_DEVICE(0x8086, 0x51cc),
    2546           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
     2552        { PCI_DEVICE_DATA(INTEL, HDA_ADL_M, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2553        /* Alderlake-N */
     2554        { PCI_DEVICE_DATA(INTEL, HDA_ADL_N, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25472555        /* Elkhart Lake */
    2548         { PCI_DEVICE(0x8086, 0x4b55),
    2549           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2550         { PCI_DEVICE(0x8086, 0x4b58),
    2551           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
    2552         /* Broxton-P(Apollolake) */
    2553         { PCI_DEVICE(0x8086, 0x5a98),
    2554           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON },
    2555         /* Broxton-T */
    2556         { PCI_DEVICE(0x8086, 0x1a98),
    2557           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON },
     2556        { PCI_DEVICE_DATA(INTEL, HDA_EHL_0, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2557        { PCI_DEVICE_DATA(INTEL, HDA_EHL_3, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2558        /* Raptor Lake */
     2559        { PCI_DEVICE_DATA(INTEL, HDA_RPL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2560        { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_0, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2561        { PCI_DEVICE_DATA(INTEL, HDA_RPL_P_1, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2562        { PCI_DEVICE_DATA(INTEL, HDA_RPL_M, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2563        { PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2564        { PCI_DEVICE_DATA(INTEL, HDA_MTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2565        /* Lunarlake-P */
     2566        { PCI_DEVICE_DATA(INTEL, HDA_LNL_P, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2567        /* Arrow Lake-S */
     2568        { PCI_DEVICE_DATA(INTEL, HDA_ARL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2569        /* Arrow Lake */
     2570        { PCI_DEVICE_DATA(INTEL, HDA_ARL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2571        /* Apollolake (Broxton-P) */
     2572        { PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) },
    25582573        /* Gemini-Lake */
    2559         { PCI_DEVICE(0x8086, 0x3198),
    2560           .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON },
     2574        { PCI_DEVICE_DATA(INTEL, HDA_GML, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) },
    25612575        /* Haswell */
    2562         { PCI_DEVICE(0x8086, 0x0a0c),
    2563           .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
    2564         { PCI_DEVICE(0x8086, 0x0c0c),
    2565           .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
    2566         { PCI_DEVICE(0x8086, 0x0d0c),
    2567           .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
     2576        { PCI_DEVICE_DATA(INTEL, HDA_HSW_0, AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL) },
     2577        { PCI_DEVICE_DATA(INTEL, HDA_HSW_2, AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL) },
     2578        { PCI_DEVICE_DATA(INTEL, HDA_HSW_3, AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL) },
    25682579        /* Broadwell */
    2569         { PCI_DEVICE(0x8086, 0x160c),
    2570           .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_BROADWELL },
     2580        { PCI_DEVICE_DATA(INTEL, HDA_BDW, AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_BROADWELL) },
    25712581        /* 5 Series/3400 */
    2572         { PCI_DEVICE(0x8086, 0x3b56),
    2573           .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
     2582        { PCI_DEVICE_DATA(INTEL, HDA_5_3400_SERIES_0, AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM) },
     2583        { PCI_DEVICE_DATA(INTEL, HDA_5_3400_SERIES_1, AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM) },
    25742584        /* Poulsbo */
    2575         { PCI_DEVICE(0x8086, 0x811b),
    2576           .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE },
     2585        { PCI_DEVICE_DATA(INTEL, HDA_POULSBO, AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE |
     2586          AZX_DCAPS_POSFIX_LPIB) },
    25772587        /* Oaktrail */
    2578         { PCI_DEVICE(0x8086, 0x080a),
    2579           .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE },
     2588        { PCI_DEVICE_DATA(INTEL, HDA_OAKTRAIL, AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE) },
    25802589        /* BayTrail */
    2581         { PCI_DEVICE(0x8086, 0x0f04),
    2582           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BAYTRAIL },
     2590        { PCI_DEVICE_DATA(INTEL, HDA_BYT, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BAYTRAIL) },
    25832591        /* Braswell */
    2584         { PCI_DEVICE(0x8086, 0x2284),
    2585           .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BRASWELL },
     2592        { PCI_DEVICE_DATA(INTEL, HDA_BSW, AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BRASWELL) },
    25862593        /* ICH6 */
    2587         { PCI_DEVICE(0x8086, 0x2668),
    2588           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2594        { PCI_DEVICE_DATA(INTEL, HDA_ICH6, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    25892595        /* ICH7 */
    2590         { PCI_DEVICE(0x8086, 0x27d8),
    2591           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2596        { PCI_DEVICE_DATA(INTEL, HDA_ICH7, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    25922597        /* ESB2 */
    2593         { PCI_DEVICE(0x8086, 0x269a),
    2594           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2598        { PCI_DEVICE_DATA(INTEL, HDA_ESB2, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    25952599        /* ICH8 */
    2596         { PCI_DEVICE(0x8086, 0x284b),
    2597           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2600        { PCI_DEVICE_DATA(INTEL, HDA_ICH8, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    25982601        /* ICH9 */
    2599         { PCI_DEVICE(0x8086, 0x293e),
    2600           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2602        { PCI_DEVICE_DATA(INTEL, HDA_ICH9_0, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    26012603        /* ICH9 */
    2602         { PCI_DEVICE(0x8086, 0x293f),
    2603           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2604        { PCI_DEVICE_DATA(INTEL, HDA_ICH9_1, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    26042605        /* ICH10 */
    2605         { PCI_DEVICE(0x8086, 0x3a3e),
    2606           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2606        { PCI_DEVICE_DATA(INTEL, HDA_ICH10_0, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    26072607        /* ICH10 */
    2608         { PCI_DEVICE(0x8086, 0x3a6e),
    2609           .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH },
     2608        { PCI_DEVICE_DATA(INTEL, HDA_ICH10_1, AZX_DRIVER_ICH | AZX_DCAPS_INTEL_ICH) },
    26102609        /* Generic Intel */
    26112610        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID),
     
    26142613          .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_NO_ALIGN_BUFSIZE },
    26152614        /* ATI SB 450/600/700/800/900 */
    2616         { PCI_DEVICE(0x1002, 0x437b),
     2615        { PCI_VDEVICE(ATI, 0x437b),
    26172616          .driver_data = AZX_DRIVER_ATI | AZX_DCAPS_PRESET_ATI_SB },
    2618         { PCI_DEVICE(0x1002, 0x4383),
     2617        { PCI_VDEVICE(ATI, 0x4383),
    26192618          .driver_data = AZX_DRIVER_ATI | AZX_DCAPS_PRESET_ATI_SB },
    26202619        /* AMD Hudson */
    2621         { PCI_DEVICE(0x1022, 0x780d),
     2620        { PCI_VDEVICE(AMD, 0x780d),
    26222621          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
    26232622        /* AMD, X370 & co */
    2624         { PCI_DEVICE(0x1022, 0x1457),
     2623        { PCI_VDEVICE(AMD, 0x1457),
    26252624          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_AMD_SB },
    26262625        /* AMD, X570 & co */
    2627         { PCI_DEVICE(0x1022, 0x1487),
     2626        { PCI_VDEVICE(AMD, 0x1487),
    26282627          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_AMD_SB },
    26292628        /* AMD Stoney */
    2630         { PCI_DEVICE(0x1022, 0x157a),
     2629        { PCI_VDEVICE(AMD, 0x157a),
    26312630          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB |
    26322631                         AZX_DCAPS_PM_RUNTIME },
    26332632        /* AMD Raven */
    2634         { PCI_DEVICE(0x1022, 0x15e3),
     2633        { PCI_VDEVICE(AMD, 0x15e3),
    26352634          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_AMD_SB },
    26362635        /* ATI HDMI */
    2637         { PCI_DEVICE(0x1002, 0x0002),
     2636        { PCI_VDEVICE(ATI, 0x0002),
    26382637          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    26392638          AZX_DCAPS_PM_RUNTIME },
    2640         { PCI_DEVICE(0x1002, 0x1308),
     2639        { PCI_VDEVICE(ATI, 0x1308),
    26412640          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2642         { PCI_DEVICE(0x1002, 0x157a),
     2641        { PCI_VDEVICE(ATI, 0x157a),
    26432642          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2644         { PCI_DEVICE(0x1002, 0x15b3),
     2643        { PCI_VDEVICE(ATI, 0x15b3),
    26452644          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2646         { PCI_DEVICE(0x1002, 0x793b),
     2645        { PCI_VDEVICE(ATI, 0x793b),
    26472646          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2648         { PCI_DEVICE(0x1002, 0x7919),
     2647        { PCI_VDEVICE(ATI, 0x7919),
    26492648          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2650         { PCI_DEVICE(0x1002, 0x960f),
     2649        { PCI_VDEVICE(ATI, 0x960f),
    26512650          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2652         { PCI_DEVICE(0x1002, 0x970f),
     2651        { PCI_VDEVICE(ATI, 0x970f),
    26532652          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2654         { PCI_DEVICE(0x1002, 0x9840),
     2653        { PCI_VDEVICE(ATI, 0x9840),
    26552654          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2656         { PCI_DEVICE(0x1002, 0xaa00),
     2655        { PCI_VDEVICE(ATI, 0xaa00),
    26572656          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2658         { PCI_DEVICE(0x1002, 0xaa08),
     2657        { PCI_VDEVICE(ATI, 0xaa08),
    26592658          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2660         { PCI_DEVICE(0x1002, 0xaa10),
     2659        { PCI_VDEVICE(ATI, 0xaa10),
    26612660          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2662         { PCI_DEVICE(0x1002, 0xaa18),
     2661        { PCI_VDEVICE(ATI, 0xaa18),
    26632662          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2664         { PCI_DEVICE(0x1002, 0xaa20),
     2663        { PCI_VDEVICE(ATI, 0xaa20),
    26652664          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2666         { PCI_DEVICE(0x1002, 0xaa28),
     2665        { PCI_VDEVICE(ATI, 0xaa28),
    26672666          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2668         { PCI_DEVICE(0x1002, 0xaa30),
     2667        { PCI_VDEVICE(ATI, 0xaa30),
    26692668          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2670         { PCI_DEVICE(0x1002, 0xaa38),
     2669        { PCI_VDEVICE(ATI, 0xaa38),
    26712670          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2672         { PCI_DEVICE(0x1002, 0xaa40),
     2671        { PCI_VDEVICE(ATI, 0xaa40),
    26732672          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2674         { PCI_DEVICE(0x1002, 0xaa48),
     2673        { PCI_VDEVICE(ATI, 0xaa48),
    26752674          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2676         { PCI_DEVICE(0x1002, 0xaa50),
     2675        { PCI_VDEVICE(ATI, 0xaa50),
    26772676          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2678         { PCI_DEVICE(0x1002, 0xaa58),
     2677        { PCI_VDEVICE(ATI, 0xaa58),
    26792678          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2680         { PCI_DEVICE(0x1002, 0xaa60),
     2679        { PCI_VDEVICE(ATI, 0xaa60),
    26812680          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2682         { PCI_DEVICE(0x1002, 0xaa68),
     2681        { PCI_VDEVICE(ATI, 0xaa68),
    26832682          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2684         { PCI_DEVICE(0x1002, 0xaa80),
     2683        { PCI_VDEVICE(ATI, 0xaa80),
    26852684          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2686         { PCI_DEVICE(0x1002, 0xaa88),
     2685        { PCI_VDEVICE(ATI, 0xaa88),
    26872686          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2688         { PCI_DEVICE(0x1002, 0xaa90),
     2687        { PCI_VDEVICE(ATI, 0xaa90),
    26892688          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2690         { PCI_DEVICE(0x1002, 0xaa98),
     2689        { PCI_VDEVICE(ATI, 0xaa98),
    26912690          .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
    2692         { PCI_DEVICE(0x1002, 0x9902),
     2691        { PCI_VDEVICE(ATI, 0x9902),
    26932692          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2694         { PCI_DEVICE(0x1002, 0xaaa0),
     2693        { PCI_VDEVICE(ATI, 0xaaa0),
    26952694          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2696         { PCI_DEVICE(0x1002, 0xaaa8),
     2695        { PCI_VDEVICE(ATI, 0xaaa8),
    26972696          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2698         { PCI_DEVICE(0x1002, 0xaab0),
     2697        { PCI_VDEVICE(ATI, 0xaab0),
    26992698          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
    2700         { PCI_DEVICE(0x1002, 0xaac0),
     2699        { PCI_VDEVICE(ATI, 0xaac0),
    27012700          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27022701          AZX_DCAPS_PM_RUNTIME },
    2703         { PCI_DEVICE(0x1002, 0xaac8),
     2702        { PCI_VDEVICE(ATI, 0xaac8),
    27042703          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27052704          AZX_DCAPS_PM_RUNTIME },
    2706         { PCI_DEVICE(0x1002, 0xaad8),
     2705        { PCI_VDEVICE(ATI, 0xaad8),
    27072706          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27082707          AZX_DCAPS_PM_RUNTIME },
    2709         { PCI_DEVICE(0x1002, 0xaae0),
     2708        { PCI_VDEVICE(ATI, 0xaae0),
    27102709          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27112710          AZX_DCAPS_PM_RUNTIME },
    2712         { PCI_DEVICE(0x1002, 0xaae8),
     2711        { PCI_VDEVICE(ATI, 0xaae8),
    27132712          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27142713          AZX_DCAPS_PM_RUNTIME },
    2715         { PCI_DEVICE(0x1002, 0xaaf0),
     2714        { PCI_VDEVICE(ATI, 0xaaf0),
    27162715          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27172716          AZX_DCAPS_PM_RUNTIME },
    2718         { PCI_DEVICE(0x1002, 0xaaf8),
     2717        { PCI_VDEVICE(ATI, 0xaaf8),
    27192718          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27202719          AZX_DCAPS_PM_RUNTIME },
    2721         { PCI_DEVICE(0x1002, 0xab00),
     2720        { PCI_VDEVICE(ATI, 0xab00),
    27222721          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27232722          AZX_DCAPS_PM_RUNTIME },
    2724         { PCI_DEVICE(0x1002, 0xab08),
     2723        { PCI_VDEVICE(ATI, 0xab08),
    27252724          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27262725          AZX_DCAPS_PM_RUNTIME },
    2727         { PCI_DEVICE(0x1002, 0xab10),
     2726        { PCI_VDEVICE(ATI, 0xab10),
    27282727          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27292728          AZX_DCAPS_PM_RUNTIME },
    2730         { PCI_DEVICE(0x1002, 0xab18),
     2729        { PCI_VDEVICE(ATI, 0xab18),
    27312730          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27322731          AZX_DCAPS_PM_RUNTIME },
    2733         { PCI_DEVICE(0x1002, 0xab20),
     2732        { PCI_VDEVICE(ATI, 0xab20),
    27342733          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27352734          AZX_DCAPS_PM_RUNTIME },
    2736         { PCI_DEVICE(0x1002, 0xab28),
     2735        { PCI_VDEVICE(ATI, 0xab28),
    27372736          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27382737          AZX_DCAPS_PM_RUNTIME },
    2739         { PCI_DEVICE(0x1002, 0xab38),
     2738        { PCI_VDEVICE(ATI, 0xab30),
    27402739          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
    27412740          AZX_DCAPS_PM_RUNTIME },
     2741        { PCI_VDEVICE(ATI, 0xab38),
     2742          .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
     2743          AZX_DCAPS_PM_RUNTIME },
     2744        /* GLENFLY */
     2745        { PCI_DEVICE(PCI_VENDOR_ID_GLENFLY, PCI_ANY_ID),
     2746          .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
     2747          .class_mask = 0xffffff,
     2748          .driver_data = AZX_DRIVER_GFHDMI | AZX_DCAPS_POSFIX_LPIB |
     2749          AZX_DCAPS_NO_MSI | AZX_DCAPS_NO_64BIT },
    27422750        /* VIA VT8251/VT8237A */
    2743         { PCI_DEVICE(0x1106, 0x3288), .driver_data = AZX_DRIVER_VIA },
     2751        { PCI_VDEVICE(VIA, 0x3288), .driver_data = AZX_DRIVER_VIA },
    27442752        /* VIA GFX VT7122/VX900 */
    2745         { PCI_DEVICE(0x1106, 0x9170), .driver_data = AZX_DRIVER_GENERIC },
     2753        { PCI_VDEVICE(VIA, 0x9170), .driver_data = AZX_DRIVER_GENERIC },
    27462754        /* VIA GFX VT6122/VX11 */
    2747         { PCI_DEVICE(0x1106, 0x9140), .driver_data = AZX_DRIVER_GENERIC },
     2755        { PCI_VDEVICE(VIA, 0x9140), .driver_data = AZX_DRIVER_GENERIC },
    27482756        /* SIS966 */
    2749         { PCI_DEVICE(0x1039, 0x7502), .driver_data = AZX_DRIVER_SIS },
     2757        { PCI_VDEVICE(SI, 0x7502), .driver_data = AZX_DRIVER_SIS },
    27502758        /* ULI M5461 */
    2751         { PCI_DEVICE(0x10b9, 0x5461), .driver_data = AZX_DRIVER_ULI },
     2759        { PCI_VDEVICE(AL, 0x5461), .driver_data = AZX_DRIVER_ULI },
    27522760        /* NVIDIA MCP */
    27532761        { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
     
    27622770        /* Creative X-Fi (CA0110-IBG) */
    27632771        /* CTHDA chips */
    2764         { PCI_DEVICE(0x1102, 0x0010),
     2772        { PCI_VDEVICE(CREATIVE, 0x0010),
    27652773          .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
    2766         { PCI_DEVICE(0x1102, 0x0012),
     2774        { PCI_VDEVICE(CREATIVE, 0x0012),
    27672775          .driver_data = AZX_DRIVER_CTHDA | AZX_DCAPS_PRESET_CTHDA },
    27682776#if !IS_ENABLED(CONFIG_SND_CTXFI)
     
    27782786#else
    27792787        /* this entry seems still valid -- i.e. without emu20kx chip */
    2780         { PCI_DEVICE(0x1102, 0x0009),
     2788        { PCI_VDEVICE(CREATIVE, 0x0009),
    27812789          .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND |
    27822790          AZX_DCAPS_NO_64BIT | AZX_DCAPS_POSFIX_LPIB },
    27832791#endif
    27842792        /* CM8888 */
    2785         { PCI_DEVICE(0x13f6, 0x5011),
     2793        { PCI_VDEVICE(CMEDIA, 0x5011),
    27862794          .driver_data = AZX_DRIVER_CMEDIA |
    27872795          AZX_DCAPS_NO_MSI | AZX_DCAPS_POSFIX_LPIB | AZX_DCAPS_SNOOP_OFF },
    27882796        /* Vortex86MX */
    2789         { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
     2797        { PCI_VDEVICE(RDC, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
    27902798        /* VMware HDAudio */
    2791         { PCI_DEVICE(0x15ad, 0x1977), .driver_data = AZX_DRIVER_GENERIC },
     2799        { PCI_VDEVICE(VMWARE, 0x1977), .driver_data = AZX_DRIVER_GENERIC },
    27922800        /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */
    27932801        { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
     
    28002808          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_HDMI },
    28012809        /* Zhaoxin */
    2802         { PCI_DEVICE(0x1d17, 0x3288), .driver_data = AZX_DRIVER_ZHAOXIN },
     2810        { PCI_VDEVICE(ZHAOXIN, 0x3288), .driver_data = AZX_DRIVER_ZHAOXIN },
     2811        /* Loongson HDAudio*/
     2812        { PCI_VDEVICE(LOONGSON, PCI_DEVICE_ID_LOONGSON_HDA),
     2813          .driver_data = AZX_DRIVER_LOONGSON },
     2814        { PCI_VDEVICE(LOONGSON, PCI_DEVICE_ID_LOONGSON_HDMI),
     2815          .driver_data = AZX_DRIVER_LOONGSON },
    28032816        { 0, }
    28042817};
  • GPL/trunk/alsa-kernel/pci/hda/hda_jack.c

    r695 r772  
    157157
    158158        return jack;
     159}
     160
     161void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
     162{
     163        struct hda_jack_tbl *jack = codec->jacktbl.list;
     164        int i;
     165
     166        for (i = 0; i < codec->jacktbl.used; i++, jack++) {
     167                if (!codec->bus->shutdown && jack->jack)
     168                        snd_device_disconnect(codec->card, jack->jack);
     169        }
    159170}
    160171
  • GPL/trunk/alsa-kernel/pci/hda/hda_jack.h

    r695 r772  
    7070                              unsigned char tag, int dev_id);
    7171
     72void snd_hda_jack_tbl_disconnect(struct hda_codec *codec);
    7273void snd_hda_jack_tbl_clear(struct hda_codec *codec);
    7374
  • GPL/trunk/alsa-kernel/pci/hda/hda_local.h

    r717 r772  
    136136        __snd_hda_add_vmaster(codec, name, tlv, followers, suffix, true, access, NULL)
    137137int snd_hda_codec_reset(struct hda_codec *codec);
    138 void snd_hda_codec_register(struct hda_codec *codec);
    139 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec);
    140138void snd_hda_codec_disconnect_pcms(struct hda_codec *codec);
    141139
     
    299297};
    300298
     299/*
     300 * extended form of snd_pci_quirk:
     301 * for PCI SSID matching, use SND_PCI_QUIRK() like before;
     302 * for codec SSID matching, use the new HDA_CODEC_QUIRK() instead
     303 */
     304struct hda_quirk {
     305        unsigned short subvendor;       /* PCI subvendor ID */
     306        unsigned short subdevice;       /* PCI subdevice ID */
     307        unsigned short subdevice_mask;  /* bitmask to match */
     308        bool match_codec_ssid;          /* match only with codec SSID */
     309        int value;                      /* value */
     310#ifdef CONFIG_SND_DEBUG_VERBOSE
     311        const char *name;               /* name of the device (optional) */
     312#endif
     313};
     314
     315#ifdef CONFIG_SND_DEBUG_VERBOSE
     316#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
     317        { _SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname),\
     318                        .match_codec_ssid = true }
     319#else
     320#define HDA_CODEC_QUIRK(vend, dev, xname, val) \
     321        { _SND_PCI_QUIRK_ID(vend, dev), .value = (val), \
     322                        .match_codec_ssid = true }
     323#endif
     324
    301325struct snd_hda_pin_quirk {
    302326        unsigned int codec;             /* Codec vendor/device ID */
     
    368392void snd_hda_pick_fixup(struct hda_codec *codec,
    369393                        const struct hda_model_fixup *models,
    370                         const struct snd_pci_quirk *quirk,
     394                        const struct hda_quirk *quirk,
    371395                        const struct hda_fixup *fixlist);
    372396void snd_hda_pick_pin_fixup(struct hda_codec *codec,
     
    729753#ifdef CONFIG_SND_PROC_FS
    730754void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
    731                              struct snd_info_buffer *buffer);
     755                             struct snd_info_buffer *buffer,
     756                             hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid);
    732757void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
    733758                             struct snd_info_buffer *buffer);
  • GPL/trunk/alsa-kernel/pci/hda/hda_sysfs.c

    r679 r772  
    2121#include <sound/minors.h>
    2222
     23extern int sysfs_emit(char *buf, const char *fmt, ...);
     24extern int sysfs_emit_at(char *buf, int at, const char *fmt, ...);
     25
    2326/* hint string pair */
    2427struct hda_hint {
     
    3437        struct hda_codec *codec = dev_get_drvdata(dev);
    3538        snd_hda_update_power_acct(codec);
    36         return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct));
     39        return sysfs_emit(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct));
    3740}
    3841
     
    4346        struct hda_codec *codec = dev_get_drvdata(dev);
    4447        snd_hda_update_power_acct(codec);
    45         return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct));
     48        return sysfs_emit(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct));
    4649}
    4750
     
    5659{                                                               \
    5760        struct hda_codec *codec = dev_get_drvdata(dev);         \
    58         return sprintf(buf, "0x%x\n", codec->field);            \
     61        return sysfs_emit(buf, "0x%x\n", codec->field);         \
    5962}
    6063
     
    6568{                                                               \
    6669        struct hda_codec *codec = dev_get_drvdata(dev);         \
    67         return sprintf(buf, "%s\n",                             \
    68                        codec->field ? codec->field : "");       \
     70        return sysfs_emit(buf, "%s\n",                          \
     71                          codec->field ? codec->field : "");    \
    6972}
    7073
     
    8689        mutex_lock(&codec->user_mutex);
    8790        snd_array_for_each(list, i, pin) {
    88                 len += sprintf(buf + len, "0x%02x 0x%08x\n",
    89                                pin->nid, pin->cfg);
     91                len += sysfs_emit_at(buf, len, "0x%02x 0x%08x\n",
     92                                     pin->nid, pin->cfg);
    9093        }
    9194        mutex_unlock(&codec->user_mutex);
     
    223226        mutex_lock(&codec->user_mutex);
    224227        snd_array_for_each(&codec->init_verbs, i, v) {
    225                 len += scnprintf(buf + len, PAGE_SIZE - len,
    226                                 "0x%02x 0x%03x 0x%04x\n",
    227                                 v->nid, v->verb, v->param);
     228                len += sysfs_emit_at(buf, len, "0x%02x 0x%03x 0x%04x\n",
     229                                     v->nid, v->verb, v->param);
    228230        }
    229231        mutex_unlock(&codec->user_mutex);
     
    273275        mutex_lock(&codec->user_mutex);
    274276        snd_array_for_each(&codec->hints, i, hint) {
    275                 len += scnprintf(buf + len, PAGE_SIZE - len,
    276                                 "%s = %s\n", hint->key, hint->val);
     277                len += sysfs_emit_at(buf, len, "%s = %s\n",
     278                                    hint->key, hint->val);
    277279        }
    278280        mutex_unlock(&codec->user_mutex);
     
    376378        return pin_configs_show(codec, &codec->user_pins, buf);
    377379}
    378 
    379 #define MAX_PIN_CONFIGS         32
    380380
    381381static int parse_user_pin_configs(struct hda_codec *codec, const char *buf)
  • GPL/trunk/alsa-kernel/pci/hda/patch_analog.c

    r717 r772  
    436436};
    437437
    438 static const struct snd_pci_quirk ad1986a_fixup_tbl[] = {
     438static const struct hda_quirk ad1986a_fixup_tbl[] = {
    439439        SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC),
    440440        SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9V", AD1986A_FIXUP_LAPTOP_IMIC),
     
    679679};
    680680
    681 static const struct snd_pci_quirk ad1981_fixup_tbl[] = {
     681static const struct hda_quirk ad1981_fixup_tbl[] = {
    682682        SND_PCI_QUIRK_VENDOR(0x1014, "Lenovo", AD1981_FIXUP_AMP_OVERRIDE),
    683683        SND_PCI_QUIRK_VENDOR(0x103c, "HP", AD1981_FIXUP_HP_EAPD),
     
    11721172};
    11731173
    1174 static const struct snd_pci_quirk ad1884_fixup_tbl[] = {
     1174static const struct hda_quirk ad1884_fixup_tbl[] = {
    11751175        SND_PCI_QUIRK(0x103c, 0x2a82, "HP Touchsmart", AD1884_FIXUP_HP_TOUCHSMART),
    11761176        SND_PCI_QUIRK_VENDOR(0x103c, "HP", AD1884_FIXUP_HP_EAPD),
  • GPL/trunk/alsa-kernel/pci/hda/patch_ca0132.c

    r717 r772  
    11401140        struct hda_codec *codec;
    11411141        struct delayed_work unsol_hp_work;
    1142         int quirk;
    11431142
    11441143#ifdef ENABLE_TUNING_CONTROLS
     
    11721171 */
    11731172enum {
    1174         QUIRK_NONE,
    11751173        QUIRK_ALIENWARE,
    11761174        QUIRK_ALIENWARE_M17XR4,
     
    11821180        QUIRK_AE5,
    11831181        QUIRK_AE7,
     1182        QUIRK_NONE = HDA_FIXUP_ID_NOT_SET,
    11841183};
    11851184
    11861185#ifdef CONFIG_PCI
    1187 #define ca0132_quirk(spec)              ((spec)->quirk)
     1186#define ca0132_quirk(spec)              ((spec)->codec->fixup_id)
    11881187#define ca0132_use_pci_mmio(spec)       ((spec)->use_pci_mmio)
    11891188#define ca0132_use_alt_functions(spec)  ((spec)->use_alt_functions)
     
    12991298};
    13001299
    1301 static const struct snd_pci_quirk ca0132_quirks[] = {
     1300static const struct hda_quirk ca0132_quirks[] = {
    13021301        SND_PCI_QUIRK(0x1028, 0x057b, "Alienware M17x R4", QUIRK_ALIENWARE_M17XR4),
    13031302        SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE),
     
    13121311        SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
    13131312        SND_PCI_QUIRK(0x3842, 0x1038, "EVGA X99 Classified", QUIRK_R3DI),
     1313        SND_PCI_QUIRK(0x3842, 0x104b, "EVGA X299 Dark", QUIRK_R3DI),
     1314        SND_PCI_QUIRK(0x3842, 0x1055, "EVGA Z390 DARK", QUIRK_R3DI),
    13141315        SND_PCI_QUIRK(0x1102, 0x0013, "Recon3D", QUIRK_R3D),
    13151316        SND_PCI_QUIRK(0x1102, 0x0018, "Recon3D", QUIRK_R3D),
     
    13171318        SND_PCI_QUIRK(0x1102, 0x0191, "Sound Blaster AE-5 Plus", QUIRK_AE5),
    13181319        SND_PCI_QUIRK(0x1102, 0x0081, "Sound Blaster AE-7", QUIRK_AE7),
     1320        {0}
     1321};
     1322
     1323static const struct hda_model_fixup ca0132_quirk_models[] = {
     1324        { .id = QUIRK_ALIENWARE, .name = "alienware" },
     1325        { .id = QUIRK_ALIENWARE_M17XR4, .name = "alienware-m17xr4" },
     1326        { .id = QUIRK_SBZ, .name = "sbz" },
     1327        { .id = QUIRK_ZXR, .name = "zxr" },
     1328        { .id = QUIRK_ZXR_DBPRO, .name = "zxr-dbpro" },
     1329        { .id = QUIRK_R3DI, .name = "r3di" },
     1330        { .id = QUIRK_R3D, .name = "r3d" },
     1331        { .id = QUIRK_AE5, .name = "ae5" },
     1332        { .id = QUIRK_AE7, .name = "ae7" },
    13191333        {0}
    13201334};
     
    24602474{
    24612475        int status = 0;
    2462         unsigned int size = sizeof(dma_chan);
     2476        unsigned int size = sizeof(*dma_chan);
    24632477
    24642478        codec_dbg(codec, "     dspio_alloc_dma_chan() -- begin\n");
     
    29682982                        unsigned int *port_map)
    29692983{
    2970         int status;
    29712984        unsigned int num_chans;
    29722985
     
    29822995        num_chans = get_hdafmt_chs(fmt) + 1;
    29832996
    2984         status = dsp_allocate_ports(codec, num_chans, rate_multi, port_map);
    2985 
    2986         return status;
     2997        return dsp_allocate_ports(codec, num_chans, rate_multi, port_map);
    29872998}
    29882999
     
    42424253        for (i = 0; i < TUNING_CTLS_COUNT; i++)
    42434254                if (nid == ca0132_tuning_ctls[i].nid)
    4244                         break;
    4245 
     4255                        goto found;
     4256
     4257        return -EINVAL;
     4258found:
    42464259        snd_hda_power_up(codec);
    42474260        dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20,
     
    66746687        };
    66756688        knew.name = namestr;
    6676         knew.private_value = ((nid) | ((1)<<16) | ((type)<<18) | ((0)<<19) | ((0)<<23)) | 0;
     6689        knew.private_value = HDA_COMPOSE_AMP_VAL(nid, 1, 0, type) | 0;
    66776690#endif
    66786691        sprintf(namestr, "FX: %s %s Volume", pfx, dirstr[dir]);
     
    1006110074static void sbz_detect_quirk(struct hda_codec *codec)
    1006210075{
    10063         struct ca0132_spec *spec = codec->spec;
    10064 
    1006510076        switch (codec->core.subsystem_id) {
    1006610077        case 0x11020033:
    10067                 spec->quirk = QUIRK_ZXR;
     10078                codec->fixup_id = QUIRK_ZXR;
    1006810079                break;
    1006910080        case 0x1102003f:
    10070                 spec->quirk = QUIRK_ZXR_DBPRO;
     10081                codec->fixup_id = QUIRK_ZXR_DBPRO;
    1007110082                break;
    1007210083        default:
    10073                 spec->quirk = QUIRK_SBZ;
     10084                codec->fixup_id = QUIRK_SBZ;
    1007410085                break;
    1007510086        }
     
    1008010091        struct ca0132_spec *spec;
    1008110092        int err;
    10082         const struct snd_pci_quirk *quirk;
    1008310093
    1008410094        codec_dbg(codec, "patch_ca0132\n");
     
    1009110101
    1009210102        /* Detect codec quirk */
    10093         quirk = snd_pci_quirk_lookup(codec->bus->pci, ca0132_quirks);
    10094         if (quirk)
    10095                 spec->quirk = quirk->value;
    10096         else
    10097                 spec->quirk = QUIRK_NONE;
     10103        snd_hda_pick_fixup(codec, ca0132_quirk_models, ca0132_quirks, NULL);
    1009810104        if (ca0132_quirk(spec) == QUIRK_SBZ)
    1009910105                sbz_detect_quirk(codec);
     
    1017210178                if (spec->mem_base == NULL) {
    1017310179                        codec_warn(codec, "pci_iomap failed! Setting quirk to QUIRK_NONE.");
    10174                         spec->quirk = QUIRK_NONE;
     10180                        codec->fixup_id = QUIRK_NONE;
    1017510181                }
    1017610182        }
  • GPL/trunk/alsa-kernel/pci/hda/patch_cirrus.c

    r717 r772  
    390390};
    391391
    392 static const struct snd_pci_quirk cs420x_fixup_tbl[] = {
     392static const struct hda_quirk cs420x_fixup_tbl[] = {
    393393        SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53),
    394394        SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55),
     
    400400        /* codec SSID */
    401401        SND_PCI_QUIRK(0x106b, 0x0600, "iMac 14,1", CS420X_IMAC27_122),
     402        SND_PCI_QUIRK(0x106b, 0x0900, "iMac 12,1", CS420X_IMAC27_122),
    402403        SND_PCI_QUIRK(0x106b, 0x1c00, "MacBookPro 8,1", CS420X_MBP81),
    403404        SND_PCI_QUIRK(0x106b, 0x2000, "iMac 12,2", CS420X_IMAC27_122),
     
    640641};
    641642
    642 static const struct snd_pci_quirk cs4208_fixup_tbl[] = {
     643static const struct hda_quirk cs4208_fixup_tbl[] = {
    643644        SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_MAC_AUTO),
    644645        {0} /* terminator */
     
    646647
    647648/* codec SSID matching */
    648 static const struct snd_pci_quirk cs4208_mac_fixup_tbl[] = {
     649static const struct hda_quirk cs4208_mac_fixup_tbl[] = {
    649650        SND_PCI_QUIRK(0x106b, 0x5e00, "MacBookPro 11,2", CS4208_MBP11),
    650651        SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI),
     
    824825};
    825826
    826 static const struct snd_pci_quirk cs421x_fixup_tbl[] = {
     827static const struct hda_quirk cs421x_fixup_tbl[] = {
    827828        /* Test Intel board + CDB2410  */
    828829        SND_PCI_QUIRK(0x8086, 0x5001, "DP45SG/CDB4210", CS421X_CDB4210),
  • GPL/trunk/alsa-kernel/pci/hda/patch_conexant.c

    r717 r772  
    4747        unsigned int gpio_mute_led_mask;
    4848        unsigned int gpio_mic_led_mask;
    49 
     49        bool is_cx8070_sn6140;
    5050};
    5151
     
    171171}
    172172
     173static void cx_fixup_headset_recog(struct hda_codec *codec)
     174{
     175        unsigned int mic_persent;
     176
     177        /* fix some headset type recognize fail issue, such as EDIFIER headset */
     178        /* set micbiasd output current comparator threshold from 66% to 55%. */
     179        snd_hda_codec_write(codec, 0x1c, 0, 0x320, 0x010);
     180        /* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias registor
     181         * value adjustment trim from 2.2K ohms to 2.0K ohms.
     182         */
     183        snd_hda_codec_write(codec, 0x1c, 0, 0x3b0, 0xe10);
     184        /* fix reboot headset type recognize fail issue */
     185        mic_persent = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
     186        if (mic_persent & AC_PINSENSE_PRESENCE)
     187                /* enable headset mic VREF */
     188                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
     189        else
     190                /* disable headset mic VREF */
     191                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20);
     192}
     193
    173194static int cx_auto_init(struct hda_codec *codec)
    174195{
     
    181202        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
    182203
     204        if (spec->is_cx8070_sn6140)
     205                cx_fixup_headset_recog(codec);
     206
    183207        return 0;
    184208}
     
    197221        cx_auto_shutdown(codec);
    198222        snd_hda_gen_free(codec);
     223}
     224
     225static void cx_process_headset_plugin(struct hda_codec *codec)
     226{
     227        unsigned int val;
     228        unsigned int count = 0;
     229
     230        /* Wait headset detect done. */
     231        do {
     232                val = snd_hda_codec_read(codec, 0x1c, 0, 0xca0, 0x0);
     233                if (val & 0x080) {
     234                        codec_dbg(codec, "headset type detect done!\n");
     235                        break;
     236                }
     237                msleep(20);
     238                count++;
     239        } while (count < 3);
     240        val = snd_hda_codec_read(codec, 0x1c, 0, 0xcb0, 0x0);
     241        if (val & 0x800) {
     242                codec_dbg(codec, "headset plugin, type is CTIA\n");
     243                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
     244        } else if (val & 0x400) {
     245                codec_dbg(codec, "headset plugin, type is OMTP\n");
     246                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
     247        } else {
     248                codec_dbg(codec, "headphone plugin\n");
     249        }
     250}
     251
     252static void cx_update_headset_mic_vref(struct hda_codec *codec, struct hda_jack_callback *event)
     253{
     254        unsigned int mic_present;
     255
     256        /* In cx8070 and sn6140, the node 16 can only be config to headphone or disabled,
     257         * the node 19 can only be config to microphone or disabled.
     258         * Check hp&mic tag to process headset pulgin&plugout.
     259         */
     260        mic_present = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
     261        if (!(mic_present & AC_PINSENSE_PRESENCE)) /* mic plugout */
     262                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20);
     263        else
     264                cx_process_headset_plugin(codec);
    199265}
    200266
     
    229295        CXT_PINCFG_COMPAQ_CQ60,
    230296        CXT_FIXUP_STEREO_DMIC,
     297        CXT_PINCFG_LENOVO_NOTEBOOK,
    231298        CXT_FIXUP_INC_MIC_BOOST,
    232299        CXT_FIXUP_HEADPHONE_MIC_PIN,
     
    245312        CXT_FIXUP_HP_GATE_MIC,
    246313        CXT_FIXUP_MUTE_LED_GPIO,
     314        CXT_FIXUP_HP_ELITEONE_OUT_DIS,
    247315        CXT_FIXUP_HP_ZBOOK_MUTE_LED,
    248316        CXT_FIXUP_HEADSET_MIC,
    249317        CXT_FIXUP_HP_MIC_NO_PRESENCE,
     318        CXT_PINCFG_SWS_JS201D,
     319        CXT_PINCFG_TOP_SPEAKER,
     320        CXT_FIXUP_HP_A_U,
    250321};
    251322
     
    258329        struct conexant_spec *spec = codec->spec;
    259330        spec->gen.inv_dmic_split = 1;
     331}
     332
     333/* fix widget control pin settings */
     334static void cxt_fixup_update_pinctl(struct hda_codec *codec,
     335                                   const struct hda_fixup *fix, int action)
     336{
     337        if (action == HDA_FIXUP_ACT_PROBE) {
     338                /* Unset OUT_EN for this Node pin, leaving only HP_EN.
     339                 * This is the value stored in the codec register after
     340                 * the correct initialization of the previous windows boot.
     341                 */
     342                snd_hda_set_pin_ctl_cache(codec, 0x1d, AC_PINCTL_HP_EN);
     343        }
    260344}
    261345
     
    708792}
    709793
     794#ifndef TARGET_OS2
     795static void cxt_setup_gpio_unmute(struct hda_codec *codec,
     796                                  unsigned int gpio_mute_mask)
     797{
     798        if (gpio_mute_mask) {
     799                // set gpio data to 0.
     800                snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
     801                snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, gpio_mute_mask);
     802                snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, gpio_mute_mask);
     803                snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_STICKY_MASK, 0);
     804        }
     805}
     806#endif
     807
    710808static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
    711809                                const struct hda_fixup *fix, int action)
     
    721819                cxt_setup_mute_led(codec, 0x10, 0x20);
    722820}
     821
     822#ifndef TARGET_OS2
     823static void cxt_fixup_hp_a_u(struct hda_codec *codec,
     824                             const struct hda_fixup *fix, int action)
     825{
     826        // Init vers in BIOS mute the spk/hp by set gpio high to avoid pop noise,
     827        // so need to unmute once by clearing the gpio data when runs into the system.
     828        if (action == HDA_FIXUP_ACT_INIT)
     829                cxt_setup_gpio_unmute(codec, 0x2);
     830}
     831#endif
    723832
    724833/* ThinkPad X200 & co with cxt5051 */
     
    775884                        {0}
    776885};
     886#endif /* TARGET_OS2 */
     887
     888#ifndef TARGET_OS2
     889/* SuoWoSi/South-holding JS201D with sn6140 */
     890static const struct hda_pintbl cxt_pincfg_sws_js201d[] = {
     891        { 0x16, 0x03211040 }, /* hp out */
     892        { 0x17, 0x91170110 }, /* SPK/Class_D */
     893        { 0x18, 0x95a70130 }, /* Internal mic */
     894        { 0x19, 0x03a11020 }, /* Headset Mic */
     895        { 0x1a, 0x40f001f0 }, /* Not used */
     896        { 0x21, 0x40f001f0 }, /* Not used */
     897        {0}
     898};
    777899#endif
    778900
     
    798920                .v.pins = cxt_pincfg_lemote,
    799921        },
    800 #ifdef TARGET_OS2xxx
     922#ifdef NOT_USED
    801923        [CXT_PINCFG_COMPAQ_CQ60] = {
    802924                .type = HDA_FIXUP_PINS,
     
    813935                .v.func = cxt_fixup_stereo_dmic,
    814936        },
     937#ifdef NOT_USED
     938        [CXT_PINCFG_LENOVO_NOTEBOOK] = {
     939                .type = HDA_FIXUP_PINS,
     940                .v.pins = (const struct hda_pintbl[]) {
     941                        { 0x1a, 0x05d71030 },
     942                        { }
     943                },
     944                .chain_id = CXT_FIXUP_STEREO_DMIC,
     945        },
     946#endif
    815947        [CXT_FIXUP_INC_MIC_BOOST] = {
    816948                .type = HDA_FIXUP_FUNC,
     
    8991031                .v.func = cxt_fixup_mute_led_eapd,
    9001032        },
    901 #ifdef TARGET_OS2xxx
     1033#ifdef NOT_USED
    9021034        [CXT_FIXUP_HP_DOCK] = {
    9031035                .type = HDA_FIXUP_PINS,
     
    9271059                .v.func = cxt_fixup_mute_led_gpio,
    9281060        },
     1061        [CXT_FIXUP_HP_ELITEONE_OUT_DIS] = {
     1062                .type = HDA_FIXUP_FUNC,
     1063                .v.func = cxt_fixup_update_pinctl,
     1064        },
    9291065        [CXT_FIXUP_HP_ZBOOK_MUTE_LED] = {
    9301066                .type = HDA_FIXUP_FUNC,
     
    9351071                .v.func = cxt_fixup_headset_mic,
    9361072        },
    937 #ifdef TARGET_OS2xxx
     1073#ifdef NOT_USED
    9381074        [CXT_FIXUP_HP_MIC_NO_PRESENCE] = {
    9391075                .type = HDA_FIXUP_PINS,
     
    9451081                .chain_id = CXT_FIXUP_HEADSET_MIC,
    9461082        },
    947 #endif
    948 };
    949 
    950 static const struct snd_pci_quirk cxt5045_fixups[] = {
     1083        [CXT_PINCFG_SWS_JS201D] = {
     1084                .type = HDA_FIXUP_PINS,
     1085                .v.pins = cxt_pincfg_sws_js201d,
     1086        },
     1087        [CXT_PINCFG_TOP_SPEAKER] = {
     1088                .type = HDA_FIXUP_PINS,
     1089                .v.pins = (const struct hda_pintbl[]) {
     1090                        { 0x1d, 0x82170111 },
     1091                        { }
     1092                },
     1093        },
     1094        [CXT_FIXUP_HP_A_U] = {
     1095                .type = HDA_FIXUP_FUNC,
     1096                .v.func = cxt_fixup_hp_a_u,
     1097        },
     1098#endif
     1099};
     1100
     1101static const struct hda_quirk cxt5045_fixups[] = {
    9511102        SND_PCI_QUIRK(0x103c, 0x30d5, "HP 530", CXT_FIXUP_HP_530),
    9521103        SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P105", CXT_FIXUP_TOSHIBA_P105),
     
    9681119};
    9691120
    970 static const struct snd_pci_quirk cxt5047_fixups[] = {
     1121static const struct hda_quirk cxt5047_fixups[] = {
    9711122        /* HP laptops have really bad sound over 0 dB on NID 0x10.
    9721123         */
     
    9801131};
    9811132
    982 static const struct snd_pci_quirk cxt5051_fixups[] = {
     1133static const struct hda_quirk cxt5051_fixups[] = {
    9831134        SND_PCI_QUIRK(0x103c, 0x360b, "Compaq CQ60", CXT_PINCFG_COMPAQ_CQ60),
    9841135        SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT_PINCFG_LENOVO_X200),
     
    9911142};
    9921143
    993 static const struct snd_pci_quirk cxt5066_fixups[] = {
     1144static const struct hda_quirk cxt5066_fixups[] = {
    9941145        SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC),
    9951146        SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_ASPIRE_DMIC),
     
    10021153        SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
    10031154        SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO),
     1155        SND_PCI_QUIRK(0x103c, 0x8231, "HP ProBook 450 G4", CXT_FIXUP_MUTE_LED_GPIO),
    10041156        SND_PCI_QUIRK(0x103c, 0x828c, "HP EliteBook 840 G4", CXT_FIXUP_HP_DOCK),
    10051157        SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
     
    10111163        SND_PCI_QUIRK(0x103c, 0x83b3, "HP EliteBook 830 G5", CXT_FIXUP_HP_DOCK),
    10121164        SND_PCI_QUIRK(0x103c, 0x83d3, "HP ProBook 640 G4", CXT_FIXUP_HP_DOCK),
     1165        SND_PCI_QUIRK(0x103c, 0x83e5, "HP EliteOne 1000 G2", CXT_FIXUP_HP_ELITEONE_OUT_DIS),
    10131166        SND_PCI_QUIRK(0x103c, 0x8402, "HP ProBook 645 G4", CXT_FIXUP_MUTE_LED_GPIO),
    10141167        SND_PCI_QUIRK(0x103c, 0x8427, "HP ZBook Studio G5", CXT_FIXUP_HP_ZBOOK_MUTE_LED),
     
    10191172        SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE),
    10201173        SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
     1174        SND_PCI_QUIRK(0x14f1, 0x0252, "MBX-Z60MR100", CXT_FIXUP_HP_A_U),
     1175        SND_PCI_QUIRK(0x14f1, 0x0265, "SWS JS201D", CXT_PINCFG_SWS_JS201D),
    10211176        SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
    10221177        SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
     
    10321187        SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
    10331188        SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
     1189        /* NOTE: we'd need to extend the quirk for 17aa:3977 as the same
     1190         * PCI SSID is used on multiple Lenovo models
     1191         */
    10341192        SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
    10351193        SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo G50-70", CXT_FIXUP_STEREO_DMIC),
     
    10381196        SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
    10391197        SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
     1198        HDA_CODEC_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER),
     1199        HDA_CODEC_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER),
    10401200        {0}
    10411201};
     
    10551215        { .id = CXT_FIXUP_HP_ZBOOK_MUTE_LED, .name = "hp-zbook-mute-led" },
    10561216        { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" },
     1217        { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" },
     1218        { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" },
     1219        { .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" },
     1220        { .id = CXT_FIXUP_HP_A_U, .name = "HP-U-support" },
    10571221        {0}
    10581222};
     
    10891253        codec->spec = spec;
    10901254        codec->patch_ops = cx_auto_patch_ops;
     1255
     1256        /* init cx8070/sn6140 flag and reset headset_present_flag */
     1257        switch (codec->core.vendor_id) {
     1258        case 0x14f11f86:
     1259        case 0x14f11f87:
     1260                spec->is_cx8070_sn6140 = true;
     1261                snd_hda_jack_detect_enable_callback(codec, 0x19, cx_update_headset_mic_vref);
     1262                break;
     1263        }
    10911264
    10921265        cx_auto_parse_eapd(codec);
     
    11741347static const struct hda_device_id snd_hda_id_conexant[] = {
    11751348        HDA_CODEC_ENTRY(0x14f11f86, "CX8070", patch_conexant_auto),
     1349        HDA_CODEC_ENTRY(0x14f11f87, "SN6140", patch_conexant_auto),
    11761350        HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto),
    11771351        HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto),
     1352        HDA_CODEC_ENTRY(0x14f120d1, "SN6180", patch_conexant_auto),
    11781353        HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto),
    11791354        HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto),
  • GPL/trunk/alsa-kernel/pci/hda/patch_hdmi.c

    r717 r772  
    6666struct hdmi_spec_per_cvt {
    6767        hda_nid_t cvt_nid;
    68         int assigned;
     68        bool assigned;          /* the stream has been assigned */
     69        bool silent_stream;     /* silent stream activated */
    6970        unsigned int channels_min;
    7071        unsigned int channels_max;
     
    9394        struct hdmi_pcm *pcm; /* pointer to spec->pcm_rec[n] dynamically*/
    9495        int pcm_idx; /* which pcm is attached. -1 means no pcm is attached */
     96        int prev_pcm_idx; /* previously assigned pcm index */
    9597        int repoll_count;
    9698        bool setup; /* the stream has been set up by prepare callback */
     
    131133        struct snd_jack *jack;
    132134        struct snd_kcontrol *eld_ctl;
     135};
     136
     137enum {
     138        SILENT_STREAM_OFF = 0,
     139        SILENT_STREAM_KAE,      /* use standard HDA Keep-Alive */
     140        SILENT_STREAM_I915,     /* Intel i915 extension */
    133141};
    134142
     
    157165        int dev_num;
    158166        struct snd_array pins; /* struct hdmi_spec_per_pin */
    159         struct hdmi_pcm pcm_rec[16];
     167        struct hdmi_pcm pcm_rec[8];
    160168        struct mutex pcm_lock;
    161169        struct mutex bind_lock; /* for audio component binding */
     
    173181
    174182        bool dyn_pin_out;
    175         bool dyn_pcm_assign;
    176         bool dyn_pcm_no_legacy;
     183        bool static_pcm_mapping;
     184        /* hdmi interrupt trigger control flag for Nvidia codec */
     185        bool hdmi_intr_trig_ctrl;
     186        bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */
     187
    177188        bool intel_hsw_fixup;   /* apply Intel platform-specific fixups */
    178189        /*
     
    192203        const int *port_map;
    193204        int port_num;
    194         bool send_silent_stream; /* Flag to enable silent stream feature */
     205        int silent_stream_type;
    195206};
    196207
     
    234245        struct hdmi_audio_infoframe hdmi;
    235246        struct dp_audio_infoframe dp;
     247#ifndef TARGET_OS2
     248        DECLARE_FLEX_ARRAY(u8, bytes);
     249#else
    236250        u8 bytes[1];
     251#endif
    237252};
    238253
     
    498513
    499514        mutex_lock(&per_pin->lock);
    500         snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer);
     515        snd_hdmi_print_eld_info(&per_pin->sink_eld, buffer, per_pin->pin_nid,
     516                                per_pin->dev_id, per_pin->cvt_nid);
    501517        mutex_unlock(&per_pin->lock);
    502518}
     
    684700                                     int conn_type)
    685701{
     702        struct hdmi_spec *spec = codec->spec;
    686703        union audio_infoframe ai;
    687704
    688705        memset(&ai, 0, sizeof(ai));
    689         if (conn_type == 0) { /* HDMI */
     706        if ((conn_type == 0) || /* HDMI */
     707                /* Nvidia DisplayPort: Nvidia HW expects same layout as HDMI */
     708                (conn_type == 1 && spec->nv_dp_workaround)) {
    690709                struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi;
    691710
    692                 hdmi_ai->type           = 0x84;
    693                 hdmi_ai->ver            = 0x01;
    694                 hdmi_ai->len            = 0x0a;
     711                if (conn_type == 0) { /* HDMI */
     712                        hdmi_ai->type           = 0x84;
     713                        hdmi_ai->ver            = 0x01;
     714                        hdmi_ai->len            = 0x0a;
     715                } else {/* Nvidia DP */
     716                        hdmi_ai->type           = 0x84;
     717                        hdmi_ai->ver            = 0x1b;
     718                        hdmi_ai->len            = 0x11 << 2;
     719                }
    695720                hdmi_ai->CC02_CT47      = active_channels - 1;
    696721                hdmi_ai->CA             = ca;
     
    9821007 */
    9831008static int hdmi_choose_cvt(struct hda_codec *codec,
    984                            int pin_idx, int *cvt_id)
     1009                           int pin_idx, int *cvt_id,
     1010                           bool silent)
    9851011{
    9861012        struct hdmi_spec *spec = codec->spec;
     
    9971023        if (per_pin && per_pin->silent_stream) {
    9981024                cvt_idx = cvt_nid_to_cvt_index(codec, per_pin->cvt_nid);
     1025                per_cvt = get_cvt(spec, cvt_idx);
     1026                if (per_cvt->assigned && !silent)
     1027                        return -EBUSY;
    9991028                if (cvt_id)
    10001029                        *cvt_id = cvt_idx;
     
    10071036
    10081037                /* Must not already be assigned */
    1009                 if (per_cvt->assigned)
     1038                if (per_cvt->assigned || per_cvt->silent_stream)
    10101039                        continue;
    10111040                if (per_pin == NULL)
     
    11761205}
    11771206
    1178 /* called in hdmi_pcm_open when no pin is assigned to the PCM
    1179  * in dyn_pcm_assign mode.
    1180  */
     1207/* called in hdmi_pcm_open when no pin is assigned to the PCM */
    11811208static int hdmi_pcm_open_no_pin(struct hda_pcm_stream *hinfo,
    11821209                         struct hda_codec *codec,
     
    11931220                return -EINVAL;
    11941221
    1195         err = hdmi_choose_cvt(codec, -1, &cvt_idx);
     1222        err = hdmi_choose_cvt(codec, -1, &cvt_idx, false);
    11961223        if (err)
    11971224                return err;
    11981225
    11991226        per_cvt = get_cvt(spec, cvt_idx);
    1200         per_cvt->assigned = 1;
     1227        per_cvt->assigned = true;
    12011228        hinfo->nid = per_cvt->cvt_nid;
    12021229
     
    12461273        mutex_lock(&spec->pcm_lock);
    12471274        pin_idx = hinfo_to_pin_index(codec, hinfo);
    1248         if (!spec->dyn_pcm_assign) {
    1249                 if (snd_BUG_ON(pin_idx < 0)) {
    1250                         err = -EINVAL;
    1251                         goto unlock;
    1252                 }
    1253         } else {
    1254                 /* no pin is assigned to the PCM
    1255                  * PA need pcm open successfully when probe
    1256                  */
    1257                 if (pin_idx < 0) {
    1258                         err = hdmi_pcm_open_no_pin(hinfo, codec, substream);
    1259                         goto unlock;
    1260                 }
    1261         }
    1262 
    1263         err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx);
     1275        /* no pin is assigned to the PCM
     1276         * PA need pcm open successfully when probe
     1277         */
     1278        if (pin_idx < 0) {
     1279                err = hdmi_pcm_open_no_pin(hinfo, codec, substream);
     1280                goto unlock;
     1281        }
     1282
     1283        err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx, false);
    12641284        if (err < 0)
    12651285                goto unlock;
     
    12671287        per_cvt = get_cvt(spec, cvt_idx);
    12681288        /* Claim converter */
    1269         per_cvt->assigned = 1;
     1289        per_cvt->assigned = true;
    12701290
    12711291        set_bit(pcm_idx, &spec->pcm_in_use);
     
    13011321                if (hinfo->channels_min > hinfo->channels_max ||
    13021322                    !hinfo->rates || !hinfo->formats) {
    1303                         per_cvt->assigned = 0;
     1323                        per_cvt->assigned = false;
    13041324                        hinfo->nid = 0;
    13051325                        snd_hda_spdif_ctls_unassign(codec, pcm_idx);
     
    13631383        int i;
    13641384
    1365         /* on the new machines, try to assign the pcm slot dynamically,
    1366          * not use the preferred fixed map (legacy way) anymore.
    1367          */
    1368         if (spec->dyn_pcm_no_legacy)
    1369                 goto last_try;
    1370 
    1371         /*
    1372          * generic_hdmi_build_pcms() may allocate extra PCMs on some
    1373          * platforms (with maximum of 'num_nids + dev_num - 1')
    1374          *
    1375          * The per_pin of pin_nid_idx=n and dev_id=m prefers to get pcm-n
    1376          * if m==0. This guarantees that dynamic pcm assignments are compatible
    1377          * with the legacy static per_pin-pcm assignment that existed in the
    1378          * days before DP-MST.
    1379          *
    1380          * Intel DP-MST prefers this legacy behavior for compatibility, too.
    1381          *
    1382          * per_pin of m!=0 prefers to get pcm=(num_nids + (m - 1)).
    1383          */
    1384 
    1385         if (per_pin->dev_id == 0 || spec->intel_hsw_fixup) {
    1386                 if (!test_bit(per_pin->pin_nid_idx, &spec->pcm_bitmap))
    1387                         return per_pin->pin_nid_idx;
    1388         } else {
    1389                 i = spec->num_nids + (per_pin->dev_id - 1);
    1390                 if (i < spec->pcm_used && !(test_bit(i, &spec->pcm_bitmap)))
    1391                         return i;
    1392         }
    1393 
    1394         /* have a second try; check the area over num_nids */
    1395         for (i = spec->num_nids; i < spec->pcm_used; i++) {
    1396                 if (!test_bit(i, &spec->pcm_bitmap))
    1397                         return i;
    1398         }
    1399 
    1400  last_try:
    1401         /* the last try; check the empty slots in pins */
    14021385        for (i = 0; i < spec->pcm_used; i++) {
    14031386                if (!test_bit(i, &spec->pcm_bitmap))
     
    14151398        if (per_pin->pcm)
    14161399                return;
     1400        /* try the previously used slot at first */
     1401        idx = per_pin->prev_pcm_idx;
     1402        if (idx >= 0) {
     1403                if (!test_bit(idx, &spec->pcm_bitmap))
     1404                        goto found;
     1405                per_pin->prev_pcm_idx = -1; /* no longer valid, clear it */
     1406        }
    14171407        idx = hdmi_find_pcm_slot(spec, per_pin);
    14181408        if (idx == -EBUSY)
    14191409                return;
     1410 found:
    14201411        per_pin->pcm_idx = idx;
    14211412        per_pin->pcm = get_hdmi_pcm(spec, idx);
     
    14331424        idx = per_pin->pcm_idx;
    14341425        per_pin->pcm_idx = -1;
     1426        per_pin->prev_pcm_idx = idx; /* remember the previous index */
    14351427        per_pin->pcm = NULL;
    14361428        if (idx >= 0 && idx < spec->pcm_used)
     
    14611453        bool non_pcm;
    14621454
    1463         if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used)
    1464                 pcm = get_pcm_rec(spec, per_pin->pcm_idx);
    1465         else
     1455        if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used)
    14661456                return;
     1457        pcm = get_pcm_rec(spec, per_pin->pcm_idx);
    14671458        if (!pcm->pcm)
    14681459                return;
     
    15481539        }
    15491540
    1550         if (!eld->eld_valid || eld->eld_size <= 0) {
     1541        if (!eld->eld_valid || eld->eld_size <= 0 || eld->info.sad_count <= 0) {
    15511542                eld->eld_valid = false;
    15521543                eld->eld_size = 0;
     
    15621553        pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
    15631554
    1564         if (spec->dyn_pcm_assign) {
     1555        if (!spec->static_pcm_mapping) {
    15651556                if (eld->eld_valid) {
    15661557                        hdmi_attach_hda_pcm(spec, per_pin);
     
    15711562                }
    15721563        }
     1564
    15731565        /* if pcm_idx == -1, it means this is in monitor connection event
    15741566         * we can get the correct pcm_idx now.
     
    16841676#define I915_SILENT_FMT_MASK            0xf
    16851677
    1686 static void silent_stream_enable(struct hda_codec *codec,
    1687                                  struct hdmi_spec_per_pin *per_pin)
    1688 {
    1689         struct hdmi_spec *spec = codec->spec;
    1690         struct hdmi_spec_per_cvt *per_cvt;
    1691         int cvt_idx, pin_idx, err;
     1678static void silent_stream_enable_i915(struct hda_codec *codec,
     1679                                      struct hdmi_spec_per_pin *per_pin)
     1680{
    16921681        unsigned int format;
    1693 
    1694         mutex_lock(&per_pin->lock);
    1695 
    1696         if (per_pin->setup) {
    1697                 codec_dbg(codec, "hdmi: PCM already open, no silent stream\n");
    1698                 goto unlock_out;
    1699         }
    1700 
    1701         pin_idx = pin_id_to_pin_index(codec, per_pin->pin_nid, per_pin->dev_id);
    1702         err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx);
    1703         if (err) {
    1704                 codec_err(codec, "hdmi: no free converter to enable silent mode\n");
    1705                 goto unlock_out;
    1706         }
    1707 
    1708         per_cvt = get_cvt(spec, cvt_idx);
    1709         per_cvt->assigned = 1;
    1710         per_pin->cvt_nid = per_cvt->cvt_nid;
    1711         per_pin->silent_stream = true;
    1712 
    1713         codec_dbg(codec, "hdmi: enabling silent stream pin-NID=0x%x cvt-NID=0x%x\n",
    1714                   per_pin->pin_nid, per_cvt->cvt_nid);
    1715 
    1716         snd_hda_set_dev_select(codec, per_pin->pin_nid, per_pin->dev_id);
    1717         snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0,
    1718                                   AC_VERB_SET_CONNECT_SEL,
    1719                                   per_pin->mux_idx);
    1720 
    1721         /* configure unused pins to choose other converters */
    1722         pin_cvt_fixup(codec, per_pin, 0);
    17231682
    17241683        snd_hdac_sync_audio_rate(&codec->core, per_pin->pin_nid,
     
    17351694        per_pin->channels = I915_SILENT_CHANNELS;
    17361695        hdmi_setup_audio_infoframe(codec, per_pin, per_pin->non_pcm);
     1696}
     1697
     1698static void silent_stream_set_kae(struct hda_codec *codec,
     1699                                  struct hdmi_spec_per_pin *per_pin,
     1700                                  bool enable)
     1701{
     1702        unsigned int param;
     1703
     1704        codec_dbg(codec, "HDMI: KAE %d cvt-NID=0x%x\n", enable, per_pin->cvt_nid);
     1705
     1706        param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0, AC_VERB_GET_DIGI_CONVERT_1, 0);
     1707        param = (param >> 16) & 0xff;
     1708
     1709        if (enable)
     1710                param |= AC_DIG3_KAE;
     1711        else
     1712                param &= ~AC_DIG3_KAE;
     1713
     1714        snd_hda_codec_write(codec, per_pin->cvt_nid, 0, AC_VERB_SET_DIGI_CONVERT_3, param);
     1715}
     1716
     1717static void silent_stream_enable(struct hda_codec *codec,
     1718                                 struct hdmi_spec_per_pin *per_pin)
     1719{
     1720        struct hdmi_spec *spec = codec->spec;
     1721        struct hdmi_spec_per_cvt *per_cvt;
     1722        int cvt_idx, pin_idx, err;
     1723        int keep_power = 0;
     1724
     1725        /*
     1726         * Power-up will call hdmi_present_sense, so the PM calls
     1727         * have to be done without mutex held.
     1728         */
     1729
     1730        err = snd_hda_power_up_pm(codec);
     1731        if (err < 0 && err != -EACCES) {
     1732                codec_err(codec,
     1733                          "Failed to power up codec for silent stream enable ret=[%d]\n", err);
     1734                snd_hda_power_down_pm(codec);
     1735                return;
     1736        }
     1737
     1738        mutex_lock(&per_pin->lock);
     1739
     1740        if (per_pin->setup) {
     1741                codec_dbg(codec, "hdmi: PCM already open, no silent stream\n");
     1742                err = -EBUSY;
     1743                goto unlock_out;
     1744        }
     1745
     1746        pin_idx = pin_id_to_pin_index(codec, per_pin->pin_nid, per_pin->dev_id);
     1747        err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx, true);
     1748        if (err) {
     1749                codec_err(codec, "hdmi: no free converter to enable silent mode\n");
     1750                goto unlock_out;
     1751        }
     1752
     1753        per_cvt = get_cvt(spec, cvt_idx);
     1754        per_cvt->silent_stream = true;
     1755        per_pin->cvt_nid = per_cvt->cvt_nid;
     1756        per_pin->silent_stream = true;
     1757
     1758        codec_dbg(codec, "hdmi: enabling silent stream pin-NID=0x%x cvt-NID=0x%x\n",
     1759                  per_pin->pin_nid, per_cvt->cvt_nid);
     1760
     1761        snd_hda_set_dev_select(codec, per_pin->pin_nid, per_pin->dev_id);
     1762        snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0,
     1763                                  AC_VERB_SET_CONNECT_SEL,
     1764                                  per_pin->mux_idx);
     1765
     1766        /* configure unused pins to choose other converters */
     1767        pin_cvt_fixup(codec, per_pin, 0);
     1768
     1769        switch (spec->silent_stream_type) {
     1770        case SILENT_STREAM_KAE:
     1771                silent_stream_enable_i915(codec, per_pin);
     1772                silent_stream_set_kae(codec, per_pin, true);
     1773                break;
     1774        case SILENT_STREAM_I915:
     1775                silent_stream_enable_i915(codec, per_pin);
     1776                keep_power = 1;
     1777                break;
     1778        default:
     1779                break;
     1780        }
    17371781
    17381782 unlock_out:
    17391783        mutex_unlock(&per_pin->lock);
     1784
     1785        if (err || !keep_power)
     1786                snd_hda_power_down_pm(codec);
    17401787}
    17411788
     
    17451792        struct hdmi_spec *spec = codec->spec;
    17461793        struct hdmi_spec_per_cvt *per_cvt;
    1747         int cvt_idx;
     1794        int cvt_idx, err;
     1795
     1796        err = snd_hda_power_up_pm(codec);
     1797        if (err < 0 && err != -EACCES) {
     1798                codec_err(codec,
     1799                          "Failed to power up codec for silent stream disable ret=[%d]\n",
     1800                          err);
     1801                snd_hda_power_down_pm(codec);
     1802                return;
     1803        }
    17481804
    17491805        mutex_lock(&per_pin->lock);
     
    17571813        if (cvt_idx >= 0 && cvt_idx < spec->num_cvts) {
    17581814                per_cvt = get_cvt(spec, cvt_idx);
    1759                 per_cvt->assigned = 0;
     1815                per_cvt->silent_stream = false;
     1816        }
     1817
     1818        if (spec->silent_stream_type == SILENT_STREAM_I915) {
     1819                /* release ref taken in silent_stream_enable() */
     1820                snd_hda_power_down_pm(codec);
     1821        } else if (spec->silent_stream_type == SILENT_STREAM_KAE) {
     1822                silent_stream_set_kae(codec, per_pin, false);
    17601823        }
    17611824
     
    17651828 unlock_out:
    17661829        mutex_unlock(&per_pin->lock);
     1830
     1831        snd_hda_power_down_pm(codec);
    17671832}
    17681833
     
    17861851        mutex_unlock(&per_pin->lock);
    17871852
    1788         /*
    1789          * Power-up will call hdmi_present_sense, so the PM calls
    1790          * have to be done without mutex held.
    1791          */
    1792 
    1793         if (spec->send_silent_stream) {
    1794                 int pm_ret;
    1795 
    1796                 if (!monitor_prev && monitor_next) {
    1797                         pm_ret = snd_hda_power_up_pm(codec);
    1798                         if (pm_ret < 0)
    1799                                 codec_err(codec,
    1800                                 "Monitor plugged-in, Failed to power up codec ret=[%d]\n",
    1801                                 pm_ret);
     1853        if (spec->silent_stream_type) {
     1854                if (!monitor_prev && monitor_next)
    18021855                        silent_stream_enable(codec, per_pin);
    1803                 } else if (monitor_prev && !monitor_next) {
     1856                else if (monitor_prev && !monitor_next)
    18041857                        silent_stream_disable(codec, per_pin);
    1805                         pm_ret = snd_hda_power_down_pm(codec);
    1806                         if (pm_ret < 0)
    1807                                 codec_err(codec,
    1808                                 "Monitor plugged-out, Failed to power down codec ret=[%d]\n",
    1809                                 pm_ret);
    1810                 }
    18111858        }
    18121859}
     
    18771924                 */
    18781925                dev_num = spec->dev_num;
    1879         } else if (spec->dyn_pcm_assign && codec->dp_mst) {
     1926        } else if (codec->dp_mst) {
    18801927                dev_num = snd_hda_get_num_devices(codec, pin_nid) + 1;
    18811928                /*
     
    19021949                        return -ENOMEM;
    19031950
    1904                 if (spec->dyn_pcm_assign) {
    1905                         per_pin->pcm = NULL;
    1906                         per_pin->pcm_idx = -1;
    1907                 } else {
    1908                         per_pin->pcm = get_hdmi_pcm(spec, pin_idx);
    1909                         per_pin->pcm_idx = pin_idx;
    1910                 }
     1951                per_pin->pcm = NULL;
     1952                per_pin->pcm_idx = -1;
     1953                per_pin->prev_pcm_idx = -1;
    19111954                per_pin->pin_nid = pin_nid;
    19121955                per_pin->pin_nid_idx = spec->num_nids;
     
    19171960                if (err < 0)
    19181961                        return err;
     1962                if (!is_jack_detectable(codec, pin_nid))
     1963                        codec_warn(codec, "HDMI: pin NID 0x%x - jack not detectable\n", pin_nid);
    19191964                spec->num_pins++;
    19201965        }
     
    19612006
    19622007static const struct snd_pci_quirk force_connect_list[] = {
     2008        SND_PCI_QUIRK(0x103c, 0x83e2, "HP EliteDesk 800 G4", 1),
     2009        SND_PCI_QUIRK(0x103c, 0x83ef, "HP MP9 G4 Retail System AMS", 1),
    19632010        SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1),
    19642011        SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
     2012        SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),
     2013        SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1),
     2014        SND_PCI_QUIRK(0x1043, 0x86ae, "ASUS", 1),  /* Z170 PRO */
     2015        SND_PCI_QUIRK(0x1043, 0x86c7, "ASUS", 1),  /* Z170M PLUS */
    19652016        SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
     2017        SND_PCI_QUIRK(0x8086, 0x2060, "Intel NUC5CPYB", 1),
    19662018        SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1),
    19672019        {0}
     
    20682120        mutex_lock(&spec->pcm_lock);
    20692121        pin_idx = hinfo_to_pin_index(codec, hinfo);
    2070         if (spec->dyn_pcm_assign && pin_idx < 0) {
    2071                 /* when dyn_pcm_assign and pcm is not bound to a pin
    2072                  * skip pin setup and return 0 to make audio playback
    2073                  * be ongoing
     2122        if (pin_idx < 0) {
     2123                /* when pcm is not bound to a pin skip pin setup and return 0
     2124                 * to make audio playback be ongoing
    20742125                 */
    20752126                pin_cvt_fixup(codec, NULL, cvt_nid);
     
    20792130        }
    20802131
    2081         if (snd_BUG_ON(pin_idx < 0)) {
    2082                 err = -EINVAL;
    2083                 goto unlock;
    2084         }
    20852132        per_pin = get_pin(spec, pin_idx);
    20862133
     
    21682215                }
    21692216                per_cvt = get_cvt(spec, cvt_idx);
    2170                 per_cvt->assigned = 0;
     2217                per_cvt->assigned = false;
    21712218                hinfo->nid = 0;
    21722219
     
    21762223                clear_bit(pcm_idx, &spec->pcm_in_use);
    21772224                pin_idx = hinfo_to_pin_index(codec, hinfo);
    2178                 if (spec->dyn_pcm_assign && pin_idx < 0)
     2225                /*
     2226                 * In such a case, return 0 to match the behavior in
     2227                 * hdmi_pcm_open()
     2228                 */
     2229                if (pin_idx < 0)
    21792230                        goto unlock;
    21802231
    2181                 if (snd_BUG_ON(pin_idx < 0)) {
    2182                         err = -EINVAL;
    2183                         goto unlock;
    2184                 }
    21852232                per_pin = get_pin(spec, pin_idx);
    21862233
     
    22742321        int idx, pcm_num;
    22752322
    2276         /*
    2277          * for non-mst mode, pcm number is the same as before
    2278          * for DP MST mode without extra PCM, pcm number is same
    2279          * for DP MST mode with extra PCMs, pcm number is
    2280          *  (nid number + dev_num - 1)
    2281          * dev_num is the device entry number in a pin
    2282          */
    2283 
    2284         if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms)
    2285                 pcm_num = spec->num_cvts;
    2286         else if (codec->mst_no_extra_pcms)
    2287                 pcm_num = spec->num_nids;
    2288         else
    2289                 pcm_num = spec->num_nids + spec->dev_num - 1;
    2290 
     2323        /* limit the PCM devices to the codec converters or available PINs */
     2324        pcm_num = min(spec->num_cvts, spec->num_pins);
    22912325        codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
    22922326
    22932327        for (idx = 0; idx < pcm_num; idx++) {
     2328                struct hdmi_spec_per_cvt *per_cvt;
    22942329                struct hda_pcm *info;
    22952330                struct hda_pcm_stream *pstr;
     
    23072342                pstr->substreams = 1;
    23082343                pstr->ops = generic_ops;
    2309                 /* pcm number is less than 16 */
    2310                 if (spec->pcm_used >= 16)
     2344
     2345                per_cvt = get_cvt(spec, 0);
     2346                pstr->channels_min = per_cvt->channels_min;
     2347                pstr->channels_max = per_cvt->channels_max;
     2348
     2349                /* pcm number is less than pcm_rec array size */
     2350                if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
    23112351                        break;
    23122352                /* other pstr fields are set in open */
     
    23272367        char hdmi_str[32] = "HDMI/DP";
    23282368        struct hdmi_spec *spec = codec->spec;
    2329         struct hdmi_spec_per_pin *per_pin = get_pin(spec, pcm_idx);
    23302369        struct snd_jack *jack;
    23312370        int pcmdev = get_pcm_rec(spec, pcm_idx)->device;
     
    23342373        if (pcmdev > 0)
    23352374                sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev);
    2336         if (!spec->dyn_pcm_assign &&
    2337             !is_jack_detectable(codec, per_pin->pin_nid))
    2338                 strncat(hdmi_str, " Phantom",
    2339                         sizeof(hdmi_str) - strlen(hdmi_str) - 1);
    23402375
    23412376        err = snd_jack_new(codec->card, hdmi_str, SND_JACK_AVOUT, &jack,
     
    23702405                 * pin will be bound when monitor is connected
    23712406                 */
    2372                 if (spec->dyn_pcm_assign)
    2373                         err = snd_hda_create_dig_out_ctls(codec,
     2407                err = snd_hda_create_dig_out_ctls(codec,
    23742408                                          0, spec->cvt_nids[0],
    23752409                                          HDA_PCM_TYPE_HDMI);
    2376                 else {
    2377                         struct hdmi_spec_per_pin *per_pin =
    2378                                 get_pin(spec, pcm_idx);
    2379                         err = snd_hda_create_dig_out_ctls(codec,
    2380                                                   per_pin->pin_nid,
    2381                                                   per_pin->mux_nids[0],
    2382                                                   HDA_PCM_TYPE_HDMI);
    2383                 }
    23842410                if (err < 0)
    23852411                        return err;
     
    23992425                struct hdmi_eld *pin_eld = &per_pin->sink_eld;
    24002426
     2427                if (spec->static_pcm_mapping) {
     2428                        hdmi_attach_hda_pcm(spec, per_pin);
     2429                        hdmi_pcm_setup_pin(spec, per_pin);
     2430                }
     2431
    24012432                pin_eld->eld_valid = false;
    24022433                hdmi_present_sense(per_pin, 0);
     
    25032534                if (spec->pcm_rec[pcm_idx].jack == NULL)
    25042535                        continue;
    2505                 if (spec->dyn_pcm_assign)
    2506                         snd_device_free(codec->card,
    2507                                         spec->pcm_rec[pcm_idx].jack);
    2508                 else
    2509                         spec->pcm_rec[pcm_idx].jack = NULL;
     2536                snd_device_free(codec->card, spec->pcm_rec[pcm_idx].jack);
    25102537        }
    25112538
     
    26962723                return;
    26972724#endif
    2698         /* ditto during suspend/resume process itself */
    2699         if (snd_hdac_is_in_pm(&codec->core))
    2700                 return;
    27012725
    27022726        check_presence_and_report(codec, pin_nid, dev_id);
     
    28842908                return;
    28852909#endif
    2886         /* ditto during suspend/resume process itself */
    2887         if (snd_hdac_is_in_pm(&codec->core))
    2888                 return;
    28892910
    28902911        snd_hdac_i915_set_bclk(&codec->bus->core);
     
    29162937                                 int format)
    29172938{
     2939        struct hdmi_spec *spec = codec->spec;
     2940        int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id);
     2941        struct hdmi_spec_per_pin *per_pin;
     2942        int res;
     2943
     2944        if (pin_idx < 0)
     2945                per_pin = NULL;
     2946        else
     2947                per_pin = get_pin(spec, pin_idx);
     2948
    29182949        haswell_verify_D0(codec, cvt_nid, pin_nid);
    2919         return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
    2920                                  stream_tag, format);
     2950
     2951        if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
     2952                silent_stream_set_kae(codec, per_pin, false);
     2953                /* wait for pending transfers in codec to clear */
     2954                usleep_range(100, 200);
     2955        }
     2956
     2957        res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
     2958                                stream_tag, format);
     2959
     2960        if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
     2961                usleep_range(100, 200);
     2962                silent_stream_set_kae(codec, per_pin, true);
     2963        }
     2964
     2965        return res;
    29212966}
    29222967
     
    29382983}
    29392984
     2985#ifdef CONFIG_PM
     2986static int i915_adlp_hdmi_suspend(struct hda_codec *codec)
     2987{
     2988        struct hdmi_spec *spec = codec->spec;
     2989        bool silent_streams = false;
     2990        int pin_idx, res;
     2991
     2992        res = generic_hdmi_suspend(codec);
     2993
     2994        for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
     2995                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
     2996
     2997                if (per_pin->silent_stream) {
     2998                        silent_streams = true;
     2999                        break;
     3000                }
     3001        }
     3002
     3003        if (silent_streams && spec->silent_stream_type == SILENT_STREAM_KAE) {
     3004                /*
     3005                 * stream-id should remain programmed when codec goes
     3006                 * to runtime suspend
     3007                 */
     3008                codec->no_stream_clean_at_suspend = 1;
     3009
     3010                /*
     3011                 * the system might go to S3, in which case keep-alive
     3012                 * must be reprogrammed upon resume
     3013                 */
     3014                codec->forced_resume = 1;
     3015
     3016                codec_dbg(codec, "HDMI: KAE active at suspend\n");
     3017        } else {
     3018                codec->no_stream_clean_at_suspend = 0;
     3019                codec->forced_resume = 0;
     3020        }
     3021
     3022        return res;
     3023}
     3024
     3025static int i915_adlp_hdmi_resume(struct hda_codec *codec)
     3026{
     3027        struct hdmi_spec *spec = codec->spec;
     3028        int pin_idx, res;
     3029
     3030        res = generic_hdmi_resume(codec);
     3031
     3032        /* KAE not programmed at suspend, nothing to do here */
     3033        if (!codec->no_stream_clean_at_suspend)
     3034                return res;
     3035
     3036        for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
     3037                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
     3038
     3039                /*
     3040                 * If system was in suspend with monitor connected,
     3041                 * the codec setting may have been lost. Re-enable
     3042                 * keep-alive.
     3043                 */
     3044                if (per_pin->silent_stream) {
     3045                        unsigned int param;
     3046
     3047                        param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0,
     3048                                                   AC_VERB_GET_CONV, 0);
     3049                        if (!param) {
     3050                                codec_dbg(codec, "HDMI: KAE: restore stream id\n");
     3051                                silent_stream_enable_i915(codec, per_pin);
     3052                        }
     3053
     3054                        param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0,
     3055                                                   AC_VERB_GET_DIGI_CONVERT_1, 0);
     3056                        if (!(param & (AC_DIG3_KAE << 16))) {
     3057                                codec_dbg(codec, "HDMI: KAE: restore DIG3_KAE\n");
     3058                                silent_stream_set_kae(codec, per_pin, true);
     3059                        }
     3060                }
     3061        }
     3062
     3063        return res;
     3064}
     3065#endif
     3066
    29403067/* precondition and allocation for Intel codecs */
    29413068static int alloc_intel_hdmi(struct hda_codec *codec)
     
    29913118        spec = codec->spec;
    29923119        codec->dp_mst = true;
    2993         spec->dyn_pcm_assign = true;
    29943120        spec->vendor_nid = vendor_nid;
    29953121        spec->port_map = port_map;
     
    30153141         */
    30163142        if (send_silent_stream)
    3017                 spec->send_silent_stream = true;
     3143                spec->silent_stream_type = SILENT_STREAM_I915;
    30183144
    30193145        return parse_intel_hdmi(codec);
     
    30553181         */
    30563182        static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
    3057         int ret;
    3058 
    3059         ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
    3060                                     enable_silent_stream);
    3061         if (!ret) {
    3062                 struct hdmi_spec *spec = codec->spec;
    3063 
    3064                 spec->dyn_pcm_no_legacy = true;
    3065         }
    3066 
    3067         return ret;
     3183
     3184        return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
     3185                                     enable_silent_stream);
     3186}
     3187
     3188static int patch_i915_adlp_hdmi(struct hda_codec *codec)
     3189{
     3190        struct hdmi_spec *spec;
     3191        int res;
     3192
     3193        res = patch_i915_tgl_hdmi(codec);
     3194        if (!res) {
     3195                spec = codec->spec;
     3196
     3197                if (spec->silent_stream_type) {
     3198                        spec->silent_stream_type = SILENT_STREAM_KAE;
     3199
     3200#ifdef CONFIG_PM
     3201                        codec->patch_ops.resume = i915_adlp_hdmi_resume;
     3202                        codec->patch_ops.suspend = i915_adlp_hdmi_suspend;
     3203#endif
     3204                }
     3205        }
     3206
     3207        return res;
    30683208}
    30693209
     
    35643704        spec->pcm_playback.maxbps = SUPPORTED_MAXBPS;
    35653705        spec->pcm_playback.formats = SUPPORTED_FORMATS;
     3706        spec->nv_dp_workaround = true;
    35663707        return 0;
    35673708}
     
    36883829
    36893830        spec = codec->spec;
    3690         spec->dyn_pcm_assign = true;
    36913831
    36923832        err = hdmi_parse_codec(codec);
     
    37033843                nvhdmi_chmap_cea_alloc_validate_get_type;
    37043844        spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
     3845        spec->nv_dp_workaround = true;
    37053846
    37063847        codec->link_down_at_suspend = 1;
     
    37263867                nvhdmi_chmap_cea_alloc_validate_get_type;
    37273868        spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
     3869        spec->nv_dp_workaround = true;
    37283870
    37293871        codec->link_down_at_suspend = 1;
     
    37543896 *
    37553897 * Note that for the trigger bit to take effect it needs to change value
    3756  * (i.e. it needs to be toggled).
     3898 * (i.e. it needs to be toggled). The trigger bit is not applicable from
     3899 * TEGRA234 chip onwards, as new verb id 0xf80 will be used for interrupt
     3900 * trigger to hdmi.
    37573901 */
     3902#define NVIDIA_SET_HOST_INTR            0xf80
    37583903#define NVIDIA_GET_SCRATCH0             0xfa6
    37593904#define NVIDIA_SET_SCRATCH0_BYTE0       0xfa7
     
    37743919 * the format is invalidated so that the HDMI codec can be disabled.
    37753920 */
    3776 static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
     3921static void tegra_hdmi_set_format(struct hda_codec *codec,
     3922                                  hda_nid_t cvt_nid,
     3923                                  unsigned int format)
    37773924{
    37783925        unsigned int value;
     3926        unsigned int nid = NVIDIA_AFG_NID;
     3927        struct hdmi_spec *spec = codec->spec;
     3928
     3929        /*
     3930         * Tegra HDA codec design from TEGRA234 chip onwards support DP MST.
     3931         * This resulted in moving scratch registers from audio function
     3932         * group to converter widget context. So CVT NID should be used for
     3933         * scratch register read/write for DP MST supported Tegra HDA codec.
     3934         */
     3935        if (codec->dp_mst)
     3936                nid = cvt_nid;
    37793937
    37803938        /* bits [31:30] contain the trigger and valid bits */
    3781         value = snd_hda_codec_read(codec, NVIDIA_AFG_NID, 0,
     3939        value = snd_hda_codec_read(codec, nid, 0,
    37823940                                   NVIDIA_GET_SCRATCH0, 0);
    37833941        value = (value >> 24) & 0xff;
    37843942
    37853943        /* bits [15:0] are used to store the HDA format */
    3786         snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
     3944        snd_hda_codec_write(codec, nid, 0,
    37873945                            NVIDIA_SET_SCRATCH0_BYTE0,
    37883946                            (format >> 0) & 0xff);
    3789         snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
     3947        snd_hda_codec_write(codec, nid, 0,
    37903948                            NVIDIA_SET_SCRATCH0_BYTE1,
    37913949                            (format >> 8) & 0xff);
    37923950
    37933951        /* bits [16:24] are unused */
    3794         snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
     3952        snd_hda_codec_write(codec, nid, 0,
    37953953                            NVIDIA_SET_SCRATCH0_BYTE2, 0);
    37963954
     
    38043962                value |= NVIDIA_SCRATCH_VALID;
    38053963
    3806         /*
    3807          * Whenever the trigger bit is toggled, an interrupt is raised in the
    3808          * HDMI codec. The HDMI driver will use that as trigger to update its
    3809          * configuration.
    3810          */
    3811         value ^= NVIDIA_SCRATCH_TRIGGER;
    3812 
    3813         snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
    3814                             NVIDIA_SET_SCRATCH0_BYTE3, value);
     3964        if (spec->hdmi_intr_trig_ctrl) {
     3965                /*
     3966                 * For Tegra HDA Codec design from TEGRA234 onwards, the
     3967                 * Interrupt to hdmi driver is triggered by writing
     3968                 * non-zero values to verb 0xF80 instead of 31st bit of
     3969                 * scratch register.
     3970                 */
     3971                snd_hda_codec_write(codec, nid, 0,
     3972                                NVIDIA_SET_SCRATCH0_BYTE3, value);
     3973                snd_hda_codec_write(codec, nid, 0,
     3974                                NVIDIA_SET_HOST_INTR, 0x1);
     3975        } else {
     3976                /*
     3977                 * Whenever the 31st trigger bit is toggled, an interrupt is raised
     3978                 * in the HDMI codec. The HDMI driver will use that as trigger
     3979                 * to update its configuration.
     3980                 */
     3981                value ^= NVIDIA_SCRATCH_TRIGGER;
     3982
     3983                snd_hda_codec_write(codec, nid, 0,
     3984                                NVIDIA_SET_SCRATCH0_BYTE3, value);
     3985        }
    38153986}
    38163987
     
    38294000
    38304001        /* notify the HDMI codec of the format change */
    3831         tegra_hdmi_set_format(codec, format);
     4002        tegra_hdmi_set_format(codec, hinfo->nid, format);
    38324003
    38334004        return 0;
     
    38394010{
    38404011        /* invalidate the format in the HDMI codec */
    3841         tegra_hdmi_set_format(codec, 0);
     4012        tegra_hdmi_set_format(codec, hinfo->nid, 0);
    38424013
    38434014        return generic_hdmi_playback_pcm_cleanup(hinfo, codec, substream);
     
    38844055}
    38854056
    3886 static int patch_tegra_hdmi(struct hda_codec *codec)
    3887 {
    3888         struct hdmi_spec *spec;
    3889         int err;
    3890 
    3891         err = patch_generic_hdmi(codec);
    3892         if (err)
     4057static int tegra_hdmi_init(struct hda_codec *codec)
     4058{
     4059        struct hdmi_spec *spec = codec->spec;
     4060        int i, err;
     4061
     4062        err = hdmi_parse_codec(codec);
     4063        if (err < 0) {
     4064                generic_spec_free(codec);
    38934065                return err;
    3894 
     4066        }
     4067
     4068        for (i = 0; i < spec->num_cvts; i++)
     4069                snd_hda_codec_write(codec, spec->cvt_nids[i], 0,
     4070                                        AC_VERB_SET_DIGI_CONVERT_1,
     4071                                        AC_DIG1_ENABLE);
     4072
     4073        generic_hdmi_init_per_pins(codec);
     4074
     4075        codec->depop_delay = 10;
    38954076        codec->patch_ops.build_pcms = tegra_hdmi_build_pcms;
    3896         spec = codec->spec;
    38974077        spec->chmap.ops.chmap_cea_alloc_validate_get_type =
    38984078                nvhdmi_chmap_cea_alloc_validate_get_type;
    38994079        spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
    39004080
     4081        spec->chmap.ops.chmap_cea_alloc_validate_get_type =
     4082                nvhdmi_chmap_cea_alloc_validate_get_type;
     4083        spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
     4084        spec->nv_dp_workaround = true;
     4085
    39014086        return 0;
     4087}
     4088
     4089static int patch_tegra_hdmi(struct hda_codec *codec)
     4090{
     4091        int err;
     4092
     4093        err = alloc_generic_hdmi(codec);
     4094        if (err < 0)
     4095                return err;
     4096
     4097        return tegra_hdmi_init(codec);
     4098}
     4099
     4100static int patch_tegra234_hdmi(struct hda_codec *codec)
     4101{
     4102        struct hdmi_spec *spec;
     4103        int err;
     4104
     4105        err = alloc_generic_hdmi(codec);
     4106        if (err < 0)
     4107                return err;
     4108
     4109        codec->dp_mst = true;
     4110        spec = codec->spec;
     4111        spec->dyn_pin_out = true;
     4112        spec->hdmi_intr_trig_ctrl = true;
     4113
     4114        return tegra_hdmi_init(codec);
    39024115}
    39034116
     
    42634476        spec = codec->spec;
    42644477
     4478        spec->static_pcm_mapping = true;
     4479
    42654480        spec->ops.pin_get_eld = atihdmi_pin_get_eld;
    42664481        spec->ops.pin_setup_infoframe = atihdmi_pin_setup_infoframe;
     
    43104525}
    43114526
     4527static int patch_gf_hdmi(struct hda_codec *codec)
     4528{
     4529        int err;
     4530
     4531        err = patch_generic_hdmi(codec);
     4532        if (err)
     4533                return err;
     4534
     4535        /*
     4536         * Glenfly GPUs have two codecs, stream switches from one codec to
     4537         * another, need to do actual clean-ups in codec_cleanup_stream
     4538         */
     4539        codec->no_sticky_stream = 1;
     4540        return 0;
     4541}
     4542
    43124543/*
    43134544 * patch entries
    43144545 */
    43154546static const struct hda_device_id snd_hda_id_hdmi[] = {
     4547HDA_CODEC_ENTRY(0x00147a47, "Loongson HDMI",    patch_generic_hdmi),
    43164548HDA_CODEC_ENTRY(0x1002793c, "RS600 HDMI",       patch_atihdmi),
    43174549HDA_CODEC_ENTRY(0x10027919, "RS600 HDMI",       patch_atihdmi),
     
    43554587HDA_CODEC_ENTRY(0x10de002f, "Tegra194 HDMI/DP2", patch_tegra_hdmi),
    43564588HDA_CODEC_ENTRY(0x10de0030, "Tegra194 HDMI/DP3", patch_tegra_hdmi),
     4589HDA_CODEC_ENTRY(0x10de0031, "Tegra234 HDMI/DP", patch_tegra234_hdmi),
    43574590HDA_CODEC_ENTRY(0x10de0040, "GPU 40 HDMI/DP",   patch_nvhdmi),
    43584591HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP",   patch_nvhdmi),
     
    43974630HDA_CODEC_ENTRY(0x10de009f, "GPU 9f HDMI/DP",   patch_nvhdmi),
    43984631HDA_CODEC_ENTRY(0x10de00a0, "GPU a0 HDMI/DP",   patch_nvhdmi),
     4632HDA_CODEC_ENTRY(0x10de00a3, "GPU a3 HDMI/DP",   patch_nvhdmi),
     4633HDA_CODEC_ENTRY(0x10de00a4, "GPU a4 HDMI/DP",   patch_nvhdmi),
     4634HDA_CODEC_ENTRY(0x10de00a5, "GPU a5 HDMI/DP",   patch_nvhdmi),
     4635HDA_CODEC_ENTRY(0x10de00a6, "GPU a6 HDMI/DP",   patch_nvhdmi),
     4636HDA_CODEC_ENTRY(0x10de00a7, "GPU a7 HDMI/DP",   patch_nvhdmi),
    43994637HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI",       patch_nvhdmi_2ch),
    44004638HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI",    patch_nvhdmi_2ch),
     4639HDA_CODEC_ENTRY(0x67663d82, "Arise 82 HDMI/DP", patch_gf_hdmi),
     4640HDA_CODEC_ENTRY(0x67663d83, "Arise 83 HDMI/DP", patch_gf_hdmi),
     4641HDA_CODEC_ENTRY(0x67663d84, "Arise 84 HDMI/DP", patch_gf_hdmi),
     4642HDA_CODEC_ENTRY(0x67663d85, "Arise 85 HDMI/DP", patch_gf_hdmi),
     4643HDA_CODEC_ENTRY(0x67663d86, "Arise 86 HDMI/DP", patch_gf_hdmi),
     4644HDA_CODEC_ENTRY(0x67663d87, "Arise 87 HDMI/DP", patch_gf_hdmi),
    44014645HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP",    patch_via_hdmi),
    44024646HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP",    patch_via_hdmi),
     
    44234667HDA_CODEC_ENTRY(0x80862815, "Alderlake HDMI",   patch_i915_tgl_hdmi),
    44244668HDA_CODEC_ENTRY(0x80862816, "Rocketlake HDMI",  patch_i915_tgl_hdmi),
     4669HDA_CODEC_ENTRY(0x80862818, "Raptorlake HDMI",  patch_i915_tgl_hdmi),
    44254670HDA_CODEC_ENTRY(0x80862819, "DG2 HDMI", patch_i915_tgl_hdmi),
    44264671HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI",  patch_i915_icl_hdmi),
    44274672HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI", patch_i915_icl_hdmi),
    4428 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_tgl_hdmi),
     4673HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi),
     4674HDA_CODEC_ENTRY(0x8086281d, "Meteor Lake HDMI", patch_i915_adlp_hdmi),
     4675HDA_CODEC_ENTRY(0x8086281f, "Raptor Lake P HDMI",       patch_i915_adlp_hdmi),
     4676HDA_CODEC_ENTRY(0x80862820, "Lunar Lake HDMI",  patch_i915_adlp_hdmi),
     4677HDA_CODEC_ENTRY(0x80862822, "Panther Lake HDMI",        patch_i915_adlp_hdmi),
    44294678HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI",  patch_generic_hdmi),
    44304679HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi),
  • GPL/trunk/alsa-kernel/pci/hda/patch_realtek.c

    r717 r772  
    1919#include <linux/input.h>
    2020#include <linux/leds.h>
     21#include <linux/ctype.h>
    2122#include <sound/core.h>
    2223#include <sound/jack.h>
     
    2627#include "hda_jack.h"
    2728#include "hda_generic.h"
     29#ifndef TARGET_OS2
     30#include "hda_component.h"
     31#else
     32#include "hda_component2.h"
     33#endif
    2834
    2935#ifdef TARGET_OS2
     
    126132        unsigned int has_hs_key:1;
    127133        unsigned int no_internal_mic_pin:1;
     134        unsigned int en_3kpull_low:1;
    128135
    129136        /* for PLL fix */
     
    133140        struct input_dev *kb_dev;
    134141        u8 alc_mute_keycode_map[1];
     142
     143        /* component binding */
     144        struct component_match *match;
     145        struct hda_component comps[HDA_MAX_COMPONENTS];
    135146};
    136147
     
    439450                fallthrough;
    440451        case 0x10ec0215:
     452        case 0x10ec0285:
     453        case 0x10ec0289:
     454                alc_update_coef_idx(codec, 0x36, 1<<13, 0);
     455                fallthrough;
    441456        case 0x10ec0230:
    442457        case 0x10ec0233:
     
    452467        case 0x10ec0286:
    453468        case 0x10ec0288:
    454         case 0x10ec0285:
    455469        case 0x10ec0298:
    456         case 0x10ec0289:
    457470        case 0x10ec0300:
    458471                alc_update_coef_idx(codec, 0x10, 1<<9, 0);
     
    470483        case 0x10ec0234:
    471484        case 0x10ec0274:
     485                alc_write_coef_idx(codec, 0x6e, 0x0c25);
     486                fallthrough;
    472487        case 0x10ec0294:
    473488        case 0x10ec0700:
     
    584599        case 0x10ec0236:
    585600        case 0x10ec0256:
     601        case 0x10ec0257:
    586602        case 0x19e58326:
    587603        case 0x10ec0283:
     604        case 0x10ec0285:
    588605        case 0x10ec0286:
     606        case 0x10ec0287:
    589607        case 0x10ec0288:
     608        case 0x10ec0295:
    590609        case 0x10ec0298:
    591610                alc_headset_mic_no_shutup(codec);
     
    834853                        break;
    835854                case 7:
    836                         alc_setup_gpio(codec, 0x03);
     855                        alc_setup_gpio(codec, 0x04);
    837856                        break;
    838857                case 5:
     
    18421861};
    18431862
    1844 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
     1863static const struct hda_quirk alc880_fixup_tbl[] = {
    18451864        SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
    18461865        SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
     
    22112230};
    22122231
    2213 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
     2232static const struct hda_quirk alc260_fixup_tbl[] = {
    22142233        SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
    22152234        SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
     
    23402359        ALC887_FIXUP_ASUS_HMIC,
    23412360        ALCS1200A_FIXUP_MIC_VREF,
     2361        ALC888VD_FIXUP_MIC_100VREF,
    23422362};
    23432363
     
    24972517        kctl = snd_hda_find_mixer_ctl(codec, oldname);
    24982518        if (kctl)
    2499                 strcpy(kctl->id.name, newname);
     2519                snd_ctl_rename(codec->card, kctl, newname);
    25002520}
    25012521
     
    30483068                .v.func = alc1220_fixup_clevo_pb51ed,
    30493069        },
    3050 #ifdef TARGET_OS2xxx
     3070#ifdef NOT_USED
    30513071        [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
    30523072                .type = HDA_FIXUP_PINS,
     
    30733093                .chain_id = ALC887_FIXUP_ASUS_AUDIO,
    30743094        },
    3075 #ifdef TARGET_OS2xxx
     3095#ifdef NOT_USED
    30763096        [ALCS1200A_FIXUP_MIC_VREF] = {
    30773097                .type = HDA_FIXUP_PINCTLS,
     
    30853105};
    30863106
    3087 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
     3107static const struct hda_quirk alc882_fixup_tbl[] = {
    30883108        SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
    30893109        SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
     
    31523172
    31533173        SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
     3174        SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
    31543175        SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
    31553176        SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
     
    31693190        SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
    31703191        SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
     3192        SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31713193        SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31723194        SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     
    31763198        SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31773199        SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     3200        SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     3201        SND_PCI_QUIRK(0x1558, 0x66a6, "Clevo PE60SN[CDE]-[GS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31783202        SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31793203        SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
     
    31963220        SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
    31973221        SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
     3222        SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
    31983223        SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
    31993224        SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
     
    34943519                .v.func = alc_fixup_no_depop_delay,
    34953520        },
     3521#ifdef NOT_USED
     3522        [ALC888VD_FIXUP_MIC_100VREF] = {
     3523                .type = HDA_FIXUP_PINCTLS,
     3524                .v.pins = (const struct hda_pintbl[]) {
     3525                        { 0x18, PIN_VREF100 }, /* headset mic */
     3526                        {}
     3527                }
     3528        },
     3529#endif
    34963530};
    34973531
    3498 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
     3532static const struct hda_quirk alc262_fixup_tbl[] = {
    34993533        SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
    35003534        SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
     
    36783712};
    36793713
    3680 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
     3714static const struct hda_quirk alc268_fixup_tbl[] = {
    36813715        SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
    36823716        SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
     
    38913925        case 0x10ec0236:
    38923926        case 0x10ec0256:
     3927        case 0x10ec0257:
    38933928        case 0x19e58326:
    38943929                alc_write_coef_idx(codec, 0x48, 0x0);
     
    39203955        case 0x10ec0236:
    39213956        case 0x10ec0256:
     3957        case 0x10ec0257:
    39223958        case 0x19e58326:
    39233959                alc_write_coef_idx(codec, 0x48, 0xd011);
     
    42044240        bool hp_pin_sense;
    42054241
    4206         if (!hp_pin)
    4207                 hp_pin = 0x21;
    4208 
    4209         msleep(30);
    4210 
    4211         hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    4212 
    4213         if (hp_pin_sense)
    4214                 msleep(2);
    4215 
    4216         alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    42174242        if (spec->ultra_low_power) {
    42184243                alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
     
    42244249        }
    42254250
    4226         snd_hda_codec_write(codec, hp_pin, 0,
    4227                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4228 
    4229         if (hp_pin_sense || spec->ultra_low_power)
    4230                 msleep(85);
    4231 
    4232         snd_hda_codec_write(codec, hp_pin, 0,
     4251        if (!hp_pin)
     4252                hp_pin = 0x21;
     4253
     4254        msleep(30);
     4255
     4256        hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
     4257
     4258        if (hp_pin_sense) {
     4259                msleep(2);
     4260                alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
     4261
     4262                snd_hda_codec_write(codec, hp_pin, 0,
    42334263                            AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    42344264
    4235         if (hp_pin_sense || spec->ultra_low_power)
    4236                 msleep(100);
    4237 
     4265                msleep(75);
     4266
     4267                snd_hda_codec_write(codec, hp_pin, 0,
     4268                            AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4269
     4270                msleep(75);
     4271                alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
     4272        }
    42384273        alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
    4239         alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
    42404274        alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
    42414275        alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
     
    42584292                hp_pin = 0x21;
    42594293
     4294        alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    42604295        hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    42614296
    4262         if (hp_pin_sense)
     4297        if (hp_pin_sense) {
    42634298                msleep(2);
    42644299
    4265         snd_hda_codec_write(codec, hp_pin, 0,
     4300                snd_hda_codec_write(codec, hp_pin, 0,
    42664301                            AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    42674302
    4268         if (hp_pin_sense || spec->ultra_low_power)
    4269                 msleep(85);
     4303                msleep(75);
    42704304
    42714305        /* 3k pull low control for Headset jack. */
     
    42744308         * when booting with headset plugged. So skip setting it for the codec alc257
    42754309         */
    4276         if (codec->core.vendor_id != 0x10ec0236 &&
    4277             codec->core.vendor_id != 0x10ec0257)
    4278                 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
    4279 
    4280         if (!spec->no_shutup_pins)
    4281                 snd_hda_codec_write(codec, hp_pin, 0,
     4310                if (spec->en_3kpull_low)
     4311                        alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
     4312
     4313                if (!spec->no_shutup_pins)
     4314                        snd_hda_codec_write(codec, hp_pin, 0,
    42824315                                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    42834316
    4284         if (hp_pin_sense || spec->ultra_low_power)
    4285                 msleep(100);
     4317                msleep(75);
     4318        }
    42864319
    42874320        alc_auto_setup_eapd(codec, false);
     
    43054338        int coef38, coef0d, coef36;
    43064339
     4340        alc_write_coefex_idx(codec, 0x58, 0x00, 0x1888); /* write default value */
    43074341        alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
    43084342        coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
     
    43524386        hda_nid_t hp_pin = alc_get_hp_pin(spec);
    43534387        bool hp1_pin_sense, hp2_pin_sense;
     4388
     4389        if (spec->ultra_low_power) {
     4390                alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
     4391                alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
     4392                alc_update_coef_idx(codec, 0x33, 1<<11, 0);
     4393                msleep(30);
     4394        }
    43544395
    43554396        if (spec->codec_variant != ALC269_TYPE_ALC287 &&
     
    43754416        hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
    43764417
    4377         if (hp1_pin_sense || hp2_pin_sense)
     4418        if (hp1_pin_sense || hp2_pin_sense) {
    43784419                msleep(2);
    4379 
    4380         alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    4381         if (spec->ultra_low_power) {
    4382                 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
    4383                 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
    4384                 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
    4385                 msleep(30);
    4386         }
    4387 
    4388         if (hp1_pin_sense || spec->ultra_low_power)
    4389                 snd_hda_codec_write(codec, hp_pin, 0,
    4390                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4391         if (hp2_pin_sense)
    4392                 snd_hda_codec_write(codec, 0x16, 0,
    4393                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4394 
    4395         if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
    4396                 msleep(85);
    4397 
    4398         if (hp1_pin_sense || spec->ultra_low_power)
    4399                 snd_hda_codec_write(codec, hp_pin, 0,
    4400                             AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    4401         if (hp2_pin_sense)
    4402                 snd_hda_codec_write(codec, 0x16, 0,
    4403                             AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    4404 
    4405         if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
    4406                 msleep(100);
    4407 
    4408         alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
    4409         alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
     4420                alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
     4421
     4422                if (hp1_pin_sense)
     4423                        snd_hda_codec_write(codec, hp_pin, 0,
     4424                                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     4425                if (hp2_pin_sense)
     4426                        snd_hda_codec_write(codec, 0x16, 0,
     4427                                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     4428                msleep(75);
     4429
     4430                if (hp1_pin_sense)
     4431                        snd_hda_codec_write(codec, hp_pin, 0,
     4432                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4433                if (hp2_pin_sense)
     4434                        snd_hda_codec_write(codec, 0x16, 0,
     4435                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4436
     4437                msleep(75);
     4438                alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
     4439                alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
     4440        }
    44104441}
    44114442
     
    44194450                hp_pin = 0x21;
    44204451
    4421         alc_disable_headset_jack_key(codec);
    4422         /* 3k pull low control for Headset jack. */
    4423         alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
    4424 
    44254452        hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    44264453        hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
    44274454
    4428         if (hp1_pin_sense || hp2_pin_sense)
     4455        if (hp1_pin_sense || hp2_pin_sense) {
     4456                alc_disable_headset_jack_key(codec);
     4457                /* 3k pull low control for Headset jack. */
     4458                alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
    44294459                msleep(2);
    44304460
    4431         if (hp1_pin_sense || spec->ultra_low_power)
    4432                 snd_hda_codec_write(codec, hp_pin, 0,
    4433                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4434         if (hp2_pin_sense)
    4435                 snd_hda_codec_write(codec, 0x16, 0,
    4436                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4437 
    4438         if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
    4439                 msleep(85);
    4440 
    4441         if (hp1_pin_sense || spec->ultra_low_power)
    4442                 snd_hda_codec_write(codec, hp_pin, 0,
    4443                             AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    4444         if (hp2_pin_sense)
    4445                 snd_hda_codec_write(codec, 0x16, 0,
    4446                             AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    4447 
    4448         if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
    4449                 msleep(100);
    4450 
     4461                if (hp1_pin_sense)
     4462                        snd_hda_codec_write(codec, hp_pin, 0,
     4463                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4464                if (hp2_pin_sense)
     4465                        snd_hda_codec_write(codec, 0x16, 0,
     4466                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4467
     4468                msleep(75);
     4469
     4470                if (hp1_pin_sense)
     4471                        snd_hda_codec_write(codec, hp_pin, 0,
     4472                                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4473                if (hp2_pin_sense)
     4474                        snd_hda_codec_write(codec, 0x16, 0,
     4475                                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4476
     4477                msleep(75);
     4478                alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
     4479                alc_enable_headset_jack_key(codec);
     4480        }
    44514481        alc_auto_setup_eapd(codec, false);
    44524482        alc_shutup_pins(codec);
     
    44594489                msleep(30);
    44604490        }
    4461 
    4462         alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
    4463         alc_enable_headset_jack_key(codec);
     4491}
     4492
     4493static void alc222_init(struct hda_codec *codec)
     4494{
     4495        struct alc_spec *spec = codec->spec;
     4496        hda_nid_t hp_pin = alc_get_hp_pin(spec);
     4497        bool hp1_pin_sense, hp2_pin_sense;
     4498
     4499        if (!hp_pin)
     4500                return;
     4501
     4502        msleep(30);
     4503
     4504        hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
     4505        hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
     4506
     4507        if (hp1_pin_sense || hp2_pin_sense) {
     4508                msleep(2);
     4509
     4510                if (hp1_pin_sense)
     4511                        snd_hda_codec_write(codec, hp_pin, 0,
     4512                                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     4513                if (hp2_pin_sense)
     4514                        snd_hda_codec_write(codec, 0x14, 0,
     4515                                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     4516                msleep(75);
     4517
     4518                if (hp1_pin_sense)
     4519                        snd_hda_codec_write(codec, hp_pin, 0,
     4520                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4521                if (hp2_pin_sense)
     4522                        snd_hda_codec_write(codec, 0x14, 0,
     4523                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4524
     4525                msleep(75);
     4526        }
     4527}
     4528
     4529static void alc222_shutup(struct hda_codec *codec)
     4530{
     4531        struct alc_spec *spec = codec->spec;
     4532        hda_nid_t hp_pin = alc_get_hp_pin(spec);
     4533        bool hp1_pin_sense, hp2_pin_sense;
     4534
     4535        if (!hp_pin)
     4536                hp_pin = 0x21;
     4537
     4538        hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
     4539        hp2_pin_sense = snd_hda_jack_detect(codec, 0x14);
     4540
     4541        if (hp1_pin_sense || hp2_pin_sense) {
     4542                msleep(2);
     4543
     4544                if (hp1_pin_sense)
     4545                        snd_hda_codec_write(codec, hp_pin, 0,
     4546                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4547                if (hp2_pin_sense)
     4548                        snd_hda_codec_write(codec, 0x14, 0,
     4549                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4550
     4551                msleep(75);
     4552
     4553                if (hp1_pin_sense)
     4554                        snd_hda_codec_write(codec, hp_pin, 0,
     4555                                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4556                if (hp2_pin_sense)
     4557                        snd_hda_codec_write(codec, 0x14, 0,
     4558                                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4559
     4560                msleep(75);
     4561        }
     4562        alc_auto_setup_eapd(codec, false);
     4563        alc_shutup_pins(codec);
    44644564}
    44654565
     
    44774577        hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    44784578
    4479         if (hp_pin_sense)
     4579        if (hp_pin_sense) {
    44804580                msleep(2);
    44814581
    4482         snd_hda_codec_write(codec, hp_pin, 0,
    4483                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4484 
    4485         if (hp_pin_sense)
    4486                 msleep(85);
    4487 
    4488         snd_hda_codec_write(codec, hp_pin, 0,
    4489                             AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    4490 
    4491         if (hp_pin_sense)
    4492                 msleep(100);
     4582                snd_hda_codec_write(codec, hp_pin, 0,
     4583                                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     4584
     4585                msleep(75);
     4586
     4587                snd_hda_codec_write(codec, hp_pin, 0,
     4588                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     4589                msleep(75);
     4590        }
    44934591}
    44944592
     
    45064604        hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    45074605
    4508         if (hp_pin_sense)
     4606        if (hp_pin_sense) {
    45094607                msleep(2);
    45104608
    4511         snd_hda_codec_write(codec, hp_pin, 0,
    4512                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    4513 
    4514         if (hp_pin_sense)
    4515                 msleep(85);
    4516 
    4517         if (!spec->no_shutup_pins)
    45184609                snd_hda_codec_write(codec, hp_pin, 0,
    4519                                     AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    4520 
    4521         if (hp_pin_sense)
    4522                 msleep(100);
    4523 
     4610                                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4611
     4612                msleep(75);
     4613
     4614                if (!spec->no_shutup_pins)
     4615                        snd_hda_codec_write(codec, hp_pin, 0,
     4616                                            AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4617
     4618                msleep(75);
     4619        }
    45244620        alc_auto_setup_eapd(codec, false);
    45254621        alc_shutup_pins(codec);
     
    46714767        if (spec->has_alc5505_dsp)
    46724768                alc5505_dsp_suspend(codec);
     4769
    46734770#endif
    46744771        return alc_suspend(codec);
     
    51995296}
    52005297
    5201 #ifdef NOT_USED
     5298#ifndef TARGET_OS2
    52025299/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
    52035300static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
     
    52895386}
    52905387
     5388static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
     5389                                          const struct hda_fixup *fix, int action)
     5390{
     5391        struct alc_spec *spec = codec->spec;
     5392
     5393        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     5394                spec->mute_led_polarity = 0;
     5395                spec->mute_led_coef.idx = 0x07;
     5396                spec->mute_led_coef.mask = 1;
     5397                spec->mute_led_coef.on = 1;
     5398                spec->mute_led_coef.off = 0;
     5399#ifdef CONFIG_SND_HDA_GENERIC_LEDS
     5400                snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
     5401#endif
     5402        }
     5403}
     5404
     5405static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
     5406                                          const struct hda_fixup *fix,
     5407                                          int action)
     5408{
     5409        struct alc_spec *spec = codec->spec;
     5410
     5411        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     5412                spec->mute_led_polarity = 0;
     5413                spec->mute_led_coef.idx = 0x0b;
     5414                spec->mute_led_coef.mask = 3 << 2;
     5415                spec->mute_led_coef.on = 2 << 2;
     5416                spec->mute_led_coef.off = 1 << 2;
     5417#ifdef CONFIG_SND_HDA_GENERIC_LEDS
     5418                snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
     5419#endif
     5420        }
     5421}
     5422
    52915423#ifdef NOT_USED
    52925424/* turn on/off mic-mute LED per capture hook by coef bit */
     
    53195451}
    53205452
     5453static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
     5454                                const struct hda_fixup *fix, int action)
     5455{
     5456        struct alc_spec *spec = codec->spec;
     5457
     5458        if (action == HDA_FIXUP_ACT_PRE_PROBE)
     5459                spec->micmute_led_polarity = 1;
     5460        alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
     5461}
     5462
    53215463static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
    53225464                                const struct hda_fixup *fix, int action)
     
    53425484}
    53435485
     5486static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
     5487                                const struct hda_fixup *fix, int action)
     5488{
     5489        alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
     5490        alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
     5491}
     5492
    53445493static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
    53455494                                const struct hda_fixup *fix, int action)
     
    53705519}
    53715520
    5372 #if IS_REACHABLE(CONFIG_INPUT)
     5521static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
     5522                                                  const unsigned short coefs[2])
     5523{
     5524        alc_write_coef_idx(codec, 0x23, coefs[0]);
     5525        alc_write_coef_idx(codec, 0x25, coefs[1]);
     5526        alc_write_coef_idx(codec, 0x26, 0xb011);
     5527}
     5528
     5529struct alc298_samsung_amp_desc {
     5530        unsigned char nid;
     5531        unsigned short init_seq[2][2];
     5532};
     5533
     5534static void alc298_fixup_samsung_amp(struct hda_codec *codec,
     5535                                     const struct hda_fixup *fix, int action)
     5536{
     5537        int i, j;
     5538        static const unsigned short init_seq[][2] = {
     5539                { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
     5540                { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
     5541                { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
     5542                { 0x41, 0x07 }, { 0x400, 0x1 }
     5543        };
     5544        static const struct alc298_samsung_amp_desc amps[] = {
     5545                { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
     5546                { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
     5547        };
     5548
     5549        if (action != HDA_FIXUP_ACT_INIT)
     5550                return;
     5551
     5552        for (i = 0; i < ARRAY_SIZE(amps); i++) {
     5553                alc_write_coef_idx(codec, 0x22, amps[i].nid);
     5554
     5555                for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
     5556                        alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
     5557
     5558                for (j = 0; j < ARRAY_SIZE(init_seq); j++)
     5559                        alc298_samsung_write_coef_pack(codec, init_seq[j]);
     5560        }
     5561}
     5562
     5563#ifndef TARGET_OS2
    53735564static void gpio2_mic_hotkey_event(struct hda_codec *codec,
    53745565                                   struct hda_jack_callback *event)
     
    54175608        return 0;
    54185609}
     5610#endif /* TARGET_OS2 */
    54195611
    54205612/* GPIO1 = set according to SKU external amp
     
    54265618                                             const struct hda_fixup *fix, int action)
    54275619{
    5428 #if IS_ENABLED(CONFIG_INPUT)
     5620#if IS_ENABLED(CONFIG_INPUT) && !defined(TARGET_OS2)
    54295621        struct alc_spec *spec = codec->spec;
    54305622
     
    54625654                                             const struct hda_fixup *fix, int action)
    54635655{
     5656#if IS_ENABLED(CONFIG_INPUT)
    54645657        struct alc_spec *spec = codec->spec;
    54655658
     
    54835676                spec->kb_dev = NULL;
    54845677        }
    5485 }
    5486 #else /* INPUT */
    5487 #define alc280_fixup_hp_gpio2_mic_hotkey        NULL
    5488 #define alc233_fixup_lenovo_line2_mic_hotkey    NULL
    5489 #endif /* INPUT */
     5678#endif
     5679}
    54905680
    54915681static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
     
    55015691#endif
    55025692        }
     5693}
     5694
     5695static void alc233_fixup_lenovo_low_en_micmute_led(struct hda_codec *codec,
     5696                                const struct hda_fixup *fix, int action)
     5697{
     5698        struct alc_spec *spec = codec->spec;
     5699
     5700        if (action == HDA_FIXUP_ACT_PRE_PROBE)
     5701                spec->micmute_led_polarity = 1;
     5702        alc233_fixup_lenovo_line2_mic_hotkey(codec, fix, action);
     5703}
     5704
     5705static void alc_hp_mute_disable(struct hda_codec *codec, unsigned int delay)
     5706{
     5707        if (delay == 0)
     5708                delay = 75;
     5709        snd_hda_codec_write(codec, 0x21, 0,
     5710                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     5711        msleep(delay);
     5712        snd_hda_codec_write(codec, 0x21, 0,
     5713                    AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     5714        msleep(delay);
     5715}
     5716
     5717static void alc_hp_enable_unmute(struct hda_codec *codec, unsigned int delay)
     5718{
     5719        if (delay == 0)
     5720                delay = 75;
     5721        snd_hda_codec_write(codec, 0x21, 0,
     5722                    AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
     5723        msleep(delay);
     5724        snd_hda_codec_write(codec, 0x21, 0,
     5725                    AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
     5726        msleep(delay);
    55035727}
    55045728
     
    56045828        case 0x10ec0256:
    56055829        case 0x19e58326:
     5830                alc_hp_mute_disable(codec, 75);
    56065831                alc_process_coef_fw(codec, coef0256);
    56075832                break;
     
    56385863        case 0x10ec0289:
    56395864        case 0x10ec0299:
     5865                alc_hp_mute_disable(codec, 75);
    56405866                alc_process_coef_fw(codec, alc225_pre_hsmode);
    56415867                alc_process_coef_fw(codec, coef0225);
     
    58636089                alc_process_coef_fw(codec, alc225_pre_hsmode);
    58646090                alc_process_coef_fw(codec, coef0225);
     6091                alc_hp_enable_unmute(codec, 75);
    58656092                break;
    58666093        case 0x10ec0255:
     
    58756102                msleep(50);
    58766103                alc_process_coef_fw(codec, coef0256);
     6104                alc_hp_enable_unmute(codec, 75);
    58776105                break;
    58786106        case 0x10ec0234:
     
    59726200        case 0x19e58326:
    59736201                alc_process_coef_fw(codec, coef0256);
     6202                alc_hp_enable_unmute(codec, 75);
    59746203                break;
    59756204        case 0x10ec0234:
     
    60206249                else
    60216250                        alc_process_coef_fw(codec, coef0225_1);
     6251                alc_hp_enable_unmute(codec, 75);
    60226252                break;
    60236253        case 0x10ec0867:
     
    60876317        case 0x19e58326:
    60886318                alc_process_coef_fw(codec, coef0256);
     6319                alc_hp_enable_unmute(codec, 75);
    60896320                break;
    60906321        case 0x10ec0234:
     
    61246355        case 0x10ec0299:
    61256356                alc_process_coef_fw(codec, coef0225);
     6357                alc_hp_enable_unmute(codec, 75);
    61266358                break;
    61276359        }
     
    61926424                alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
    61936425
    6194                 snd_hda_codec_write(codec, 0x21, 0,
    6195                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    6196                 msleep(80);
    6197                 snd_hda_codec_write(codec, 0x21, 0,
    6198                             AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    6199 
    62006426                alc_process_coef_fw(codec, coef0255);
    62016427                msleep(300);
    62026428                val = alc_read_coef_idx(codec, 0x46);
    62036429                is_ctia = (val & 0x0070) == 0x0070;
    6204 
     6430                if (!is_ctia) {
     6431                        alc_write_coef_idx(codec, 0x45, 0xe089);
     6432                        msleep(100);
     6433                        val = alc_read_coef_idx(codec, 0x46);
     6434                        if ((val & 0x0070) == 0x0070)
     6435                                is_ctia = false;
     6436                        else
     6437                                is_ctia = true;
     6438                }
    62056439                alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
    62066440                alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
    6207 
    6208                 snd_hda_codec_write(codec, 0x21, 0,
    6209                             AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    6210                 msleep(80);
    6211                 snd_hda_codec_write(codec, 0x21, 0,
    6212                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
    62136441                break;
    62146442        case 0x10ec0234:
     
    62876515        case 0x10ec0289:
    62886516        case 0x10ec0299:
    6289                 snd_hda_codec_write(codec, 0x21, 0,
    6290                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
    6291                 msleep(80);
    6292                 snd_hda_codec_write(codec, 0x21, 0,
    6293                             AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
    6294 
    62956517                alc_process_coef_fw(codec, alc225_pre_hsmode);
    62966518                alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
     
    63096531                        is_ctia = (val & 0x00f0) == 0x00f0;
    63106532                }
     6533                if (!is_ctia) {
     6534                        alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x38<<10);
     6535                        alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
     6536                        msleep(100);
     6537                        val = alc_read_coef_idx(codec, 0x46);
     6538                        if ((val & 0x00f0) == 0x00f0)
     6539                                is_ctia = false;
     6540                        else
     6541                                is_ctia = true;
     6542                }
    63116543                alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
    63126544                alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
    63136545                alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
    6314 
    6315                 snd_hda_codec_write(codec, 0x21, 0,
    6316                             AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
    6317                 msleep(80);
    6318                 snd_hda_codec_write(codec, 0x21, 0,
    6319                             AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
    63206546                break;
    63216547        case 0x10ec0867:
     
    70887314        case 0x10ec0255:
    70897315        case 0x10ec0256:
     7316        case 0x10ec0257:
    70907317        case 0x19e58326:
    70917318                alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
     
    72757502}
    72767503
     7504static void alc285_fixup_hp_envy_x360(struct hda_codec *codec,
     7505                                      const struct hda_fixup *fix,
     7506                                      int action)
     7507{
     7508        static const struct coef_fw coefs[] = {
     7509                WRITE_COEF(0x08, 0x6a0c), WRITE_COEF(0x0d, 0xa023),
     7510                WRITE_COEF(0x10, 0x0320), WRITE_COEF(0x1a, 0x8c03),
     7511                WRITE_COEF(0x25, 0x1800), WRITE_COEF(0x26, 0x003a),
     7512                WRITE_COEF(0x28, 0x1dfe), WRITE_COEF(0x29, 0xb014),
     7513                WRITE_COEF(0x2b, 0x1dfe), WRITE_COEF(0x37, 0xfe15),
     7514                WRITE_COEF(0x38, 0x7909), WRITE_COEF(0x45, 0xd489),
     7515                WRITE_COEF(0x46, 0x00f4), WRITE_COEF(0x4a, 0x21e0),
     7516                WRITE_COEF(0x66, 0x03f0), WRITE_COEF(0x67, 0x1000),
     7517                WRITE_COEF(0x6e, 0x1005), {0}
     7518        };
     7519
     7520        static const struct hda_pintbl pincfgs[] = {
     7521                { 0x12, 0xb7a60130 },  /* Internal microphone*/
     7522                { 0x14, 0x90170150 },  /* B&O soundbar speakers */
     7523                { 0x17, 0x90170153 },  /* Side speakers */
     7524                { 0x19, 0x03a11040 },  /* Headset microphone */
     7525                {0}
     7526        };
     7527
     7528        switch (action) {
     7529        case HDA_FIXUP_ACT_PRE_PROBE:
     7530                snd_hda_apply_pincfgs(codec, pincfgs);
     7531
     7532                /* Fixes volume control problem for side speakers */
     7533                alc295_fixup_disable_dac3(codec, fix, action);
     7534
     7535                /* Fixes no sound from headset speaker */
     7536                snd_hda_codec_amp_stereo(codec, 0x21, HDA_OUTPUT, 0, -1, 0);
     7537
     7538                /* Auto-enable headset mic when plugged */
     7539                snd_hda_jack_set_gating_jack(codec, 0x19, 0x21);
     7540
     7541                /* Headset mic volume enhancement */
     7542                snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREF50);
     7543                break;
     7544        case HDA_FIXUP_ACT_INIT:
     7545                alc_process_coef_fw(codec, coefs);
     7546                break;
     7547        case HDA_FIXUP_ACT_BUILD:
     7548                rename_ctl(codec, "Bass Speaker Playback Volume",
     7549                           "B&O-Tuned Playback Volume");
     7550                rename_ctl(codec, "Front Playback Switch",
     7551                           "B&O Soundbar Playback Switch");
     7552                rename_ctl(codec, "Bass Speaker Playback Switch",
     7553                           "Side Speaker Playback Switch");
     7554                break;
     7555        }
     7556}
     7557
    72777558/* for hda_fixup_thinkpad_acpi() */
    72787559#include "thinkpad_helper.c"
     
    72977578                break;
    72987579        }
     7580}
     7581
     7582static int comp_bind(struct device *dev)
     7583{
     7584        struct hda_codec *cdc = dev_to_hda_codec(dev);
     7585        struct alc_spec *spec = cdc->spec;
     7586
     7587        return component_bind_all(dev, spec->comps);
     7588}
     7589
     7590static void comp_unbind(struct device *dev)
     7591{
     7592        struct hda_codec *cdc = dev_to_hda_codec(dev);
     7593        struct alc_spec *spec = cdc->spec;
     7594
     7595        component_unbind_all(dev, spec->comps);
     7596}
     7597
     7598static const struct component_master_ops comp_master_ops = {
     7599        .bind = comp_bind,
     7600        .unbind = comp_unbind,
     7601};
     7602
     7603static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
     7604                                       struct snd_pcm_substream *sub, int action)
     7605{
     7606        struct alc_spec *spec = cdc->spec;
     7607        int i;
     7608
     7609        for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
     7610                if (spec->comps[i].dev && spec->comps[i].pre_playback_hook)
     7611                        spec->comps[i].pre_playback_hook(spec->comps[i].dev, action);
     7612        }
     7613        for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
     7614                if (spec->comps[i].dev && spec->comps[i].playback_hook)
     7615                        spec->comps[i].playback_hook(spec->comps[i].dev, action);
     7616        }
     7617        for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
     7618                if (spec->comps[i].dev && spec->comps[i].post_playback_hook)
     7619                        spec->comps[i].post_playback_hook(spec->comps[i].dev, action);
     7620        }
     7621}
     7622
     7623struct scodec_dev_name {
     7624        const char *bus;
     7625        const char *hid;
     7626        int index;
     7627};
     7628
     7629/* match the device name in a slightly relaxed manner */
     7630static int comp_match_cs35l41_dev_name(struct device *dev, void *data)
     7631{
     7632        struct scodec_dev_name *p = data;
     7633        const char *d = dev_name(dev);
     7634        int n = strlen(p->bus);
     7635        char tmp[32];
     7636
     7637        /* check the bus name */
     7638        if (strncmp(d, p->bus, n))
     7639                return 0;
     7640        /* skip the bus number */
     7641        if (isdigit(d[n]))
     7642                n++;
     7643        /* the rest must be exact matching */
     7644        snprintf(tmp, sizeof(tmp), "-%s:00-cs35l41-hda.%d", p->hid, p->index);
     7645        return !strcmp(d + n, tmp);
     7646}
     7647
     7648static int comp_match_tas2781_dev_name(struct device *dev,
     7649        void *data)
     7650{
     7651        struct scodec_dev_name *p = data;
     7652        const char *d = dev_name(dev);
     7653        int n = strlen(p->bus);
     7654        char tmp[32];
     7655
     7656        /* check the bus name */
     7657        if (strncmp(d, p->bus, n))
     7658                return 0;
     7659        /* skip the bus number */
     7660        if (isdigit(d[n]))
     7661                n++;
     7662        /* the rest must be exact matching */
     7663        snprintf(tmp, sizeof(tmp), "-%s:00", p->hid);
     7664
     7665        return !strcmp(d + n, tmp);
     7666}
     7667
     7668static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
     7669                                  const char *hid, int count)
     7670{
     7671        struct device *dev = hda_codec_dev(cdc);
     7672        struct alc_spec *spec = cdc->spec;
     7673        struct scodec_dev_name *rec;
     7674        int ret, i;
     7675
     7676        switch (action) {
     7677        case HDA_FIXUP_ACT_PRE_PROBE:
     7678                for (i = 0; i < count; i++) {
     7679                        rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
     7680                        if (!rec)
     7681                                return;
     7682                        rec->bus = bus;
     7683                        rec->hid = hid;
     7684                        rec->index = i;
     7685                        spec->comps[i].codec = cdc;
     7686                        component_match_add(dev, &spec->match,
     7687                                            comp_match_cs35l41_dev_name, rec);
     7688                }
     7689                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
     7690                if (ret)
     7691                        codec_err(cdc, "Fail to register component aggregator %d\n", ret);
     7692                else
     7693                        spec->gen.pcm_playback_hook = comp_generic_playback_hook;
     7694                break;
     7695        case HDA_FIXUP_ACT_FREE:
     7696                component_master_del(dev, &comp_master_ops);
     7697                break;
     7698        }
     7699}
     7700
     7701static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
     7702        const char *bus, const char *hid)
     7703{
     7704        struct device *dev = hda_codec_dev(cdc);
     7705        struct alc_spec *spec = cdc->spec;
     7706        struct scodec_dev_name *rec;
     7707        int ret;
     7708
     7709        switch (action) {
     7710        case HDA_FIXUP_ACT_PRE_PROBE:
     7711                rec = devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL);
     7712                if (!rec)
     7713                        return;
     7714                rec->bus = bus;
     7715                rec->hid = hid;
     7716                rec->index = 0;
     7717                spec->comps[0].codec = cdc;
     7718                component_match_add(dev, &spec->match,
     7719                        comp_match_tas2781_dev_name, rec);
     7720                ret = component_master_add_with_match(dev, &comp_master_ops,
     7721                        spec->match);
     7722                if (ret)
     7723                        codec_err(cdc,
     7724                                "Fail to register component aggregator %d\n",
     7725                                ret);
     7726                else
     7727                        spec->gen.pcm_playback_hook =
     7728                                comp_generic_playback_hook;
     7729                break;
     7730        case HDA_FIXUP_ACT_FREE:
     7731                component_master_del(dev, &comp_master_ops);
     7732                break;
     7733        }
     7734}
     7735
     7736static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
     7737{
     7738        cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
     7739}
     7740
     7741static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
     7742{
     7743        cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
     7744}
     7745
     7746static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
     7747{
     7748        cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
     7749}
     7750
     7751static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
     7752                                                 int action)
     7753{
     7754        cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
     7755}
     7756
     7757#ifndef TARGET_OS2
     7758static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
     7759                                                 int action)
     7760{
     7761        cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
     7762}
     7763#endif /* TARGET_OS2 */
     7764
     7765static void tas2781_fixup_i2c(struct hda_codec *cdc,
     7766        const struct hda_fixup *fix, int action)
     7767{
     7768         tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
    72997769}
    73007770
     
    73657835}
    73667836
     7837static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
     7838                                                  const struct hda_fixup *fix,
     7839                                                  int action)
     7840{
     7841        struct alc_spec *spec = codec->spec;
     7842        struct hda_input_mux *imux = &spec->gen.input_mux;
     7843        int i;
     7844
     7845        alc269_fixup_limit_int_mic_boost(codec, fix, action);
     7846
     7847        switch (action) {
     7848        case HDA_FIXUP_ACT_PRE_PROBE:
     7849                /**
     7850                 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
     7851                 * to Hi-Z to avoid pop noises at startup and when plugging and
     7852                 * unplugging headphones.
     7853                 */
     7854                snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
     7855                snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
     7856                break;
     7857        case HDA_FIXUP_ACT_PROBE:
     7858                /**
     7859                 * Make the internal mic (0x12) the default input source to
     7860                 * prevent pop noises on cold boot.
     7861                 */
     7862                for (i = 0; i < imux->num_items; i++) {
     7863                        if (spec->gen.imux_pins[i] == 0x12) {
     7864                                spec->gen.cur_mux[0] = i;
     7865                                break;
     7866                        }
     7867                }
     7868                break;
     7869        }
     7870}
     7871
     7872static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
     7873                                          const struct hda_fixup *fix, int action)
     7874{
     7875        /*
     7876         * The Pin Complex 0x17 for the bass speakers is wrongly reported as
     7877         * unconnected.
     7878         */
     7879        static const struct hda_pintbl pincfgs[] = {
     7880                { 0x17, 0x90170121 },
     7881                {0}
     7882        };
     7883        /*
     7884         * Avoid DAC 0x06 and 0x08, as they have no volume controls.
     7885         * DAC 0x02 and 0x03 would be fine.
     7886         */
     7887        static const hda_nid_t conn[] = { 0x02, 0x03 };
     7888        /*
     7889         * Prefer both speakerbar (0x14) and bass speakers (0x17) connected to DAC 0x02.
     7890         * Headphones (0x21) are connected to DAC 0x03.
     7891         */
     7892        static const hda_nid_t preferred_pairs[] = {
     7893                0x14, 0x02,
     7894                0x17, 0x02,
     7895                0x21, 0x03,
     7896                0
     7897        };
     7898        struct alc_spec *spec = codec->spec;
     7899
     7900        switch (action) {
     7901        case HDA_FIXUP_ACT_PRE_PROBE:
     7902                snd_hda_apply_pincfgs(codec, pincfgs);
     7903                snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     7904                spec->gen.preferred_dacs = preferred_pairs;
     7905                break;
     7906        }
     7907}
     7908
     7909static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
     7910                                          const struct hda_fixup *fix, int action)
     7911{
     7912        static const struct hda_pintbl pincfgs[] = {
     7913                { 0x14, 0x90170151 },
     7914                { 0x17, 0x90170150 },
     7915                {0}
     7916        };
     7917        static const hda_nid_t conn[] = { 0x02, 0x03 };
     7918        static const hda_nid_t preferred_pairs[] = {
     7919                0x14, 0x02,
     7920                0x17, 0x03,
     7921                0x21, 0x02,
     7922                0
     7923        };
     7924        struct alc_spec *spec = codec->spec;
     7925
     7926        alc_fixup_no_shutup(codec, fix, action);
     7927
     7928        switch (action) {
     7929        case HDA_FIXUP_ACT_PRE_PROBE:
     7930                snd_hda_apply_pincfgs(codec, pincfgs);
     7931                snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     7932                spec->gen.preferred_dacs = preferred_pairs;
     7933                break;
     7934        }
     7935}
     7936
     7937/* Forcibly assign NID 0x03 to HP while NID 0x02 to SPK */
     7938static void alc287_fixup_bind_dacs(struct hda_codec *codec,
     7939                                    const struct hda_fixup *fix, int action)
     7940{
     7941        struct alc_spec *spec = codec->spec;
     7942        static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
     7943        static const hda_nid_t preferred_pairs[] = {
     7944                0x17, 0x02, 0x21, 0x03, 0
     7945        };
     7946
     7947        if (action != HDA_FIXUP_ACT_PRE_PROBE)
     7948                return;
     7949
     7950        snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     7951        spec->gen.preferred_dacs = preferred_pairs;
     7952        spec->gen.auto_mute_via_amp = 1;
     7953        if (spec->gen.autocfg.speaker_pins[0] != 0x14) {
     7954                snd_hda_codec_write_cache(codec, 0x14, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
     7955                                        0x0); /* Make sure 0x14 was disable */
     7956        }
     7957}
     7958/* Fix none verb table of Headset Mic pin */
     7959static void alc_fixup_headset_mic(struct hda_codec *codec,
     7960                                   const struct hda_fixup *fix, int action)
     7961{
     7962        struct alc_spec *spec = codec->spec;
     7963        static const struct hda_pintbl pincfgs[] = {
     7964                { 0x19, 0x03a1103c },
     7965                {0}
     7966        };
     7967
     7968        switch (action) {
     7969        case HDA_FIXUP_ACT_PRE_PROBE:
     7970                snd_hda_apply_pincfgs(codec, pincfgs);
     7971                alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
     7972                spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
     7973                break;
     7974        }
     7975}
     7976
     7977
    73677978enum {
    73687979        ALC269_FIXUP_GPIO2,
     
    73727983        ALC269_FIXUP_SKU_IGNORE,
    73737984        ALC269_FIXUP_ASUS_G73JW,
     7985        ALC269_FIXUP_ASUS_N7601ZM_PINS,
     7986        ALC269_FIXUP_ASUS_N7601ZM,
    73747987        ALC269_FIXUP_LENOVO_EAPD,
    73757988        ALC275_FIXUP_SONY_HWEQ,
     
    74038016        ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
    74048017        ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
     8018        ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
    74058019        ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
    74068020        ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
    74078021        ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     8022        ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
    74088023        ALC269_FIXUP_HEADSET_MODE,
    74098024        ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
     
    74198034        ALC269VB_FIXUP_ASUS_ZENBOOK,
    74208035        ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
     8036        ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
    74218037        ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
    74228038        ALC269VB_FIXUP_ORDISSIMO_EVE2,
     
    74318047        ALC269_FIXUP_THINKPAD_ACPI,
    74328048        ALC269_FIXUP_DMIC_THINKPAD_ACPI,
     8049        ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13,
     8050        ALC269VC_FIXUP_INFINIX_Y4_MAX,
     8051        ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO,
    74338052        ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
    74348053        ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
    74358054        ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
     8055        ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
    74368056        ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
    74378057        ALC255_FIXUP_HEADSET_MODE,
     
    74528072        ALC245_FIXUP_HP_X360_AMP,
    74538073        ALC285_FIXUP_HP_SPECTRE_X360_EB1,
     8074        ALC285_FIXUP_HP_ENVY_X360,
    74548075        ALC288_FIXUP_DELL_HEADSET_MODE,
    74558076        ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
     
    74668087        ALC293_FIXUP_LENOVO_SPK_NOISE,
    74678088        ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
     8089        ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED,
    74688090        ALC255_FIXUP_DELL_SPK_NOISE,
    74698091        ALC225_FIXUP_DISABLE_MIC_VREF,
     
    74718093        ALC295_FIXUP_DISABLE_DAC3,
    74728094        ALC285_FIXUP_SPEAKER2_TO_DAC1,
     8095        ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1,
     8096        ALC285_FIXUP_ASUS_HEADSET_MIC,
     8097        ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS,
     8098        ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1,
     8099        ALC285_FIXUP_ASUS_I2C_HEADSET_MIC,
    74738100        ALC280_FIXUP_HP_HEADSET_MIC,
    74748101        ALC221_FIXUP_HP_FRONT_MIC,
     
    75188145        ALC256_FIXUP_ASUS_HEADSET_MIC,
    75198146        ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
     8147        ALC255_FIXUP_PREDATOR_SUBWOOFER,
    75208148        ALC299_FIXUP_PREDATOR_SPK,
    75218149        ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
     8150        ALC289_FIXUP_DELL_SPK1,
    75228151        ALC289_FIXUP_DELL_SPK2,
    75238152        ALC289_FIXUP_DUAL_SPK,
     8153        ALC289_FIXUP_RTK_AMP_DUAL_SPK,
    75248154        ALC294_FIXUP_SPK2_TO_DAC1,
    75258155        ALC294_FIXUP_ASUS_DUAL_SPK,
    75268156        ALC285_FIXUP_THINKPAD_X1_GEN7,
    75278157        ALC285_FIXUP_THINKPAD_HEADSET_JACK,
     8158        ALC294_FIXUP_ASUS_ALLY,
     8159        ALC294_FIXUP_ASUS_ALLY_PINS,
     8160        ALC294_FIXUP_ASUS_ALLY_VERBS,
     8161        ALC294_FIXUP_ASUS_ALLY_SPEAKER,
    75288162        ALC294_FIXUP_ASUS_HPE,
    75298163        ALC294_FIXUP_ASUS_COEF_1B,
     
    75348168        ALC294_FIXUP_ASUS_GU502_PINS,
    75358169        ALC294_FIXUP_ASUS_GU502_VERBS,
     8170        ALC294_FIXUP_ASUS_G513_PINS,
     8171        ALC285_FIXUP_ASUS_G533Z_PINS,
    75368172        ALC285_FIXUP_HP_GPIO_LED,
    75378173        ALC285_FIXUP_HP_MUTE_LED,
     8174        ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
     8175        ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
    75388176        ALC236_FIXUP_HP_GPIO_LED,
    75398177        ALC236_FIXUP_HP_MUTE_LED,
    75408178        ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
     8179        ALC236_FIXUP_LENOVO_INV_DMIC,
     8180        ALC298_FIXUP_SAMSUNG_AMP,
    75418181        ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
    75428182        ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
     
    75848224        ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
    75858225        ALC298_FIXUP_LENOVO_C940_DUET7,
     8226        ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
    75868227        ALC287_FIXUP_13S_GEN2_SPEAKERS,
    75878228        ALC256_FIXUP_SET_COEF_DEFAULTS,
     
    75918232        ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
    75928233        ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
     8234        ALC287_FIXUP_LEGION_16ACHG6,
     8235        ALC287_FIXUP_CS35L41_I2C_2,
     8236        ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
     8237        ALC245_FIXUP_CS35L41_SPI_2,
     8238        ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
     8239        ALC245_FIXUP_CS35L41_SPI_4,
     8240        ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
     8241        ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
     8242        ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
     8243        ALC287_FIXUP_LEGION_16ITHG6,
     8244        ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
     8245        ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
     8246        ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
     8247        ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
     8248        ALC236_FIXUP_DELL_DUAL_CODECS,
     8249        ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
     8250        ALC287_FIXUP_TAS2781_I2C,
     8251        ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
     8252        ALC245_FIXUP_HP_X360_MUTE_LEDS,
     8253        ALC287_FIXUP_THINKPAD_I2S_SPK,
     8254        ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
     8255        ALC2XX_FIXUP_HEADSET_MIC,
     8256        ALC289_FIXUP_DELL_CS35L41_SPI_2,
     8257        ALC294_FIXUP_CS35L41_I2C_2,
    75938258};
    75948259
     
    77808445#endif
    77818446
     8447#ifndef TARGET_OS2
     8448/* A special fixup for Lenovo Slim/Yoga Pro 9 14IRP8 and Yoga DuetITL 2021;
     8449 * 14IRP8 PCI SSID will mistakenly be matched with the DuetITL codec SSID,
     8450 * so we need to apply a different fixup in this case. The only DuetITL codec
     8451 * SSID reported so far is the 17aa:3802 while the 14IRP8 has the 17aa:38be
     8452 * and 17aa:38bf. If it weren't for the PCI SSID, the 14IRP8 models would
     8453 * have matched correctly by their codecs.
     8454 */
     8455static void alc287_fixup_lenovo_14irp8_duetitl(struct hda_codec *codec,
     8456                                              const struct hda_fixup *fix,
     8457                                              int action)
     8458{
     8459        int id;
     8460
     8461        if (codec->core.subsystem_id == 0x17aa3802)
     8462                id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* DuetITL */
     8463        else
     8464                id = ALC287_FIXUP_TAS2781_I2C; /* 14IRP8 */
     8465        __snd_hda_apply_fixup(codec, id, action, 0);
     8466}
     8467#endif /* TARGET_OS2 */
     8468
    77828469static const struct hda_fixup alc269_fixups[] = {
    77838470        [ALC269_FIXUP_GPIO2] = {
     
    78308517#endif
    78318518        },
     8519#ifdef NOT_USED
     8520        [ALC269_FIXUP_ASUS_N7601ZM_PINS] = {
     8521                .type = HDA_FIXUP_PINS,
     8522                .v.pins = (const struct hda_pintbl[]) {
     8523                        { 0x19, 0x03A11050 },
     8524                        { 0x1a, 0x03A11C30 },
     8525                        { 0x21, 0x03211420 },
     8526                        { }
     8527                }
     8528        },
     8529        [ALC269_FIXUP_ASUS_N7601ZM] = {
     8530                .type = HDA_FIXUP_VERBS,
     8531                .v.verbs = (const struct hda_verb[]) {
     8532                        {0x20, AC_VERB_SET_COEF_INDEX, 0x62},
     8533                        {0x20, AC_VERB_SET_PROC_COEF, 0xa007},
     8534                        {0x20, AC_VERB_SET_COEF_INDEX, 0x10},
     8535                        {0x20, AC_VERB_SET_PROC_COEF, 0x8420},
     8536                        {0x20, AC_VERB_SET_COEF_INDEX, 0x0f},
     8537                        {0x20, AC_VERB_SET_PROC_COEF, 0x7774},
     8538                        { }
     8539                },
     8540                .chained = true,
     8541                .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS,
     8542        },
     8543#endif
    78328544        [ALC269_FIXUP_LENOVO_EAPD] = {
    78338545                .type = HDA_FIXUP_VERBS,
     
    79198631                .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
    79208632        },
     8633#ifdef NOT_USED
     8634        [ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13] = {
     8635                .type = HDA_FIXUP_PINS,
     8636                .v.pins = (const struct hda_pintbl[]) {
     8637                        { 0x14, 0x90170151 }, /* use as internal speaker (LFE) */
     8638                        { 0x1b, 0x90170152 }, /* use as internal speaker (back) */
     8639                        { }
     8640                },
     8641                .chained = true,
     8642                .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
     8643        },
     8644        [ALC269VC_FIXUP_INFINIX_Y4_MAX] = {
     8645                .type = HDA_FIXUP_PINS,
     8646                .v.pins = (const struct hda_pintbl[]) {
     8647                        { 0x1b, 0x90170150 }, /* use as internal speaker */
     8648                        { }
     8649                },
     8650                .chained = true,
     8651                .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
     8652        },
     8653        [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = {
     8654                .type = HDA_FIXUP_PINS,
     8655                .v.pins = (const struct hda_pintbl[]) {
     8656                        { 0x18, 0x03a19020 }, /* headset mic */
     8657                        { 0x1b, 0x90170150 }, /* speaker */
     8658                        { }
     8659                },
     8660        },
     8661#endif
    79218662        [ALC269_FIXUP_AMIC] = {
    79228663                .type = HDA_FIXUP_PINS,
     
    80538794                .chain_id = ALC269_FIXUP_HEADSET_MODE
    80548795        },
     8796        [ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
     8797                .type = HDA_FIXUP_FUNC,
     8798                .v.func = alc269_fixup_limit_int_mic_boost,
     8799                .chained = true,
     8800                .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
     8801        },
    80558802        [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
    80568803                .type = HDA_FIXUP_PINS,
     
    80818828                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
    80828829        },
    8083 #ifdef TARGET_OS2xxx
     8830#ifdef NOT_USED
    80848831        [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
    80858832                .type = HDA_FIXUP_PINS,
     
    81038850                .v.func = alc_fixup_headset_mode_no_hp_mic,
    81048851        },
    8105 #ifdef TARGET_OS2xxx
     8852#ifdef NOT_USED
    81068853        [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
    81078854                .type = HDA_FIXUP_PINS,
     
    82508997                .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
    82518998        },
     8999#ifdef NOT_USED
     9000        [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
     9001                .type = HDA_FIXUP_PINS,
     9002                .v.pins = (const struct hda_pintbl[]) {
     9003                        { 0x18, 0x01a110f0 },  /* use as headset mic */
     9004                        { }
     9005                },
     9006                .chained = true,
     9007                .chain_id = ALC269_FIXUP_HEADSET_MIC
     9008        },
     9009#endif
    82529010        [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
    82539011                .type = HDA_FIXUP_FUNC,
     
    83459103                .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
    83469104        },
    8347 #ifdef TARGET_OS2xxx
     9105#ifdef NOT_USED
    83489106        [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
    83499107                .type = HDA_FIXUP_PINS,
     
    83799137                .chain_id = ALC255_FIXUP_HEADSET_MODE
    83809138        },
     9139        [ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST] = {
     9140                .type = HDA_FIXUP_FUNC,
     9141                .v.func = alc269_fixup_limit_int_mic_boost,
     9142                .chained = true,
     9143                .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
     9144        },
    83819145        [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
    83829146                .type = HDA_FIXUP_PINS,
     
    84029166                .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
    84039167        },
    8404 #ifdef TARGET_OS2xxx
     9168#ifdef NOT_USED
    84059169        [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
    84069170                .type = HDA_FIXUP_PINS,
     
    84269190                .chain_id = ALC292_FIXUP_TPT440_DOCK,
    84279191        },
    8428 #ifdef TARGET_OS2xxx
     9192#ifdef NOT_USED
    84299193        [ALC283_FIXUP_HEADSET_MIC] = {
    84309194                .type = HDA_FIXUP_PINS,
     
    84399203                .v.func = alc_fixup_micmute_led,
    84409204        },
    8441 #ifdef TARGET_OS2xxx
     9205#ifdef NOT_USED
    84429206        [ALC282_FIXUP_ASPIRE_V5_PINS] = {
    84439207                .type = HDA_FIXUP_PINS,
     
    84739237                .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
    84749238        },
    8475 #ifdef TARGET_OS2xxx
     9239#ifdef NOT_USED
    84769240        [ALC280_FIXUP_HP_DOCK_PINS] = {
    84779241                .type = HDA_FIXUP_PINS,
     
    85129276                .chain_id = ALC255_FIXUP_MIC_MUTE_LED
    85139277        },
    8514 #ifdef TARGET_OS2xxx
     9278#ifdef NOT_USED
    85159279        [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
    85169280                .type = HDA_FIXUP_PINS,
     
    85619325                .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
    85629326        },
    8563 #ifdef TARGET_OS2xxx
     9327#ifdef NOT_USED
    85649328        [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
    85659329                .type = HDA_FIXUP_PINS,
     
    86129376                .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
    86139377        },
     9378        [ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED] = {
     9379                .type = HDA_FIXUP_FUNC,
     9380                .v.func = alc233_fixup_lenovo_low_en_micmute_led,
     9381        },
    86149382        [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
    86159383                .type = HDA_FIXUP_FUNC,
     
    86349402                .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
    86359403        },
    8636 #ifdef TARGET_OS2xxx
     9404#ifdef NOT_USED
    86379405        [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
    86389406                .type = HDA_FIXUP_VERBS,
     
    86539421                .chain_id = ALC269_FIXUP_HEADSET_MIC,
    86549422        },
    8655 #ifdef TARGET_OS2xxx
     9423#ifdef NOT_USED
    86569424        [ALC221_FIXUP_HP_FRONT_MIC] = {
    86579425                .type = HDA_FIXUP_PINS,
     
    86889456                .chain_id = ALC269_FIXUP_THINKPAD_ACPI
    86899457        },
    8690 #ifdef TARGET_OS2xxx
     9458        [ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1] = {
     9459                .type = HDA_FIXUP_FUNC,
     9460                .v.func = alc285_fixup_speaker2_to_dac1,
     9461                .chained = true,
     9462                .chain_id = ALC245_FIXUP_CS35L41_SPI_2
     9463        },
     9464#ifdef NOT_USED
     9465        [ALC285_FIXUP_ASUS_HEADSET_MIC] = {
     9466                .type = HDA_FIXUP_PINS,
     9467                .v.pins = (const struct hda_pintbl[]) {
     9468                        { 0x19, 0x03a11050 },
     9469                        { 0x1b, 0x03a11c30 },
     9470                        { }
     9471                },
     9472                .chained = true,
     9473                .chain_id = ALC285_FIXUP_ASUS_SPEAKER2_TO_DAC1
     9474        },
     9475        [ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS] = {
     9476                .type = HDA_FIXUP_PINS,
     9477                .v.pins = (const struct hda_pintbl[]) {
     9478                        { 0x14, 0x90170120 },
     9479                        { }
     9480                },
     9481                .chained = true,
     9482                .chain_id = ALC285_FIXUP_ASUS_HEADSET_MIC
     9483        },
     9484#endif
     9485        [ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1] = {
     9486                .type = HDA_FIXUP_FUNC,
     9487                .v.func = alc285_fixup_speaker2_to_dac1,
     9488                .chained = true,
     9489                .chain_id = ALC287_FIXUP_CS35L41_I2C_2
     9490        },
     9491#ifdef NOT_USED
     9492        [ALC285_FIXUP_ASUS_I2C_HEADSET_MIC] = {
     9493                .type = HDA_FIXUP_PINS,
     9494                .v.pins = (const struct hda_pintbl[]) {
     9495                        { 0x19, 0x03a11050 },
     9496                        { 0x1b, 0x03a11c30 },
     9497                        { }
     9498                },
     9499                .chained = true,
     9500                .chain_id = ALC285_FIXUP_ASUS_I2C_SPEAKER2_TO_DAC1
     9501        },
    86919502        [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
    86929503                .type = HDA_FIXUP_PINS,
     
    87059516                .chain_id = ALC269_FIXUP_NO_SHUTUP
    87069517        },
    8707 #ifdef TARGET_OS2xxx
     9518#ifdef NOT_USED
    87089519        [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
    87099520                .type = HDA_FIXUP_PINS,
     
    87319542                .v.func = alc_fixup_headset_mode,
    87329543        },
    8733 #ifdef TARGET_OS2xxx
     9544#ifdef NOT_USED
    87349545        [ALC256_FIXUP_ASUS_MIC] = {
    87359546                .type = HDA_FIXUP_PINS,
     
    87489559                .v.func = alc_fixup_gpio4,
    87499560        },
    8750 #ifdef TARGET_OS2xxx
     9561#ifdef NOT_USED
    87519562        [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
    87529563                .type = HDA_FIXUP_PINS,
     
    87769587                .chain_id = ALC269_FIXUP_GPIO2
    87779588        },
    8778 #ifdef TARGET_OS2xxx
     9589#ifdef NOT_USED
    87799590        [ALC233_FIXUP_ACER_HEADSET_MIC] = {
    87809591                .type = HDA_FIXUP_VERBS,
     
    88189629                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
    88199630        },
    8820 #ifdef TARGET_OS2xxx
     9631#ifdef NOT_USED
    88219632        [ALC700_FIXUP_INTEL_REFERENCE] = {
    88229633                .type = HDA_FIXUP_VERBS,
     
    88419652                .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
    88429653        },
    8843 #ifdef TARGET_OS2xxx
     9654#ifdef NOT_USED
    88449655        [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
    88459656                .type = HDA_FIXUP_PINS,
     
    88649675                .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
    88659676        },
    8866 #ifdef TARGET_OS2xxx
     9677#ifdef NOT_USED
    88679678        [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
    88689679                .type = HDA_FIXUP_PINS,
     
    88909701                .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
    88919702        },
    8892 #ifdef TARGET_OS2xxx
     9703#ifdef NOT_USED
    88939704        [ALC221_FIXUP_HP_HEADSET_MIC] = {
    88949705                .type = HDA_FIXUP_PINS,
     
    89119722                .v.func = alc_fixup_auto_mute_via_amp,
    89129723        },
    8913 #ifdef TARGET_OS2xxx
     9724#ifdef NOT_USED
    89149725        [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
    89159726                .type = HDA_FIXUP_PINS,
     
    89649775                .v.func = alc_fixup_headset_jack,
    89659776        },
    8966 #ifdef TARGET_OS2xxx
     9777#ifdef NOT_USED
    89679778        [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
    89689779                .type = HDA_FIXUP_PINS,
     
    90189829                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
    90199830        },
    9020 #ifdef TARGET_OS2xxx
     9831#ifdef NOT_USED
    90219832        [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
    90229833                .type = HDA_FIXUP_VERBS,
     
    90479858                .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
    90489859        },
     9860        [ALC255_FIXUP_PREDATOR_SUBWOOFER] = {
     9861                .type = HDA_FIXUP_PINS,
     9862                .v.pins = (const struct hda_pintbl[]) {
     9863                        { 0x17, 0x90170151 }, /* use as internal speaker (LFE) */
     9864                        { 0x1b, 0x90170152 } /* use as internal speaker (back) */
     9865                }
     9866        },
    90499867        [ALC299_FIXUP_PREDATOR_SPK] = {
    90509868                .type = HDA_FIXUP_PINS,
     
    90649882                .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
    90659883        },
     9884        [ALC289_FIXUP_DELL_SPK1] = {
     9885                .type = HDA_FIXUP_PINS,
     9886                .v.pins = (const struct hda_pintbl[]) {
     9887                        { 0x14, 0x90170140 },
     9888                        { }
     9889                },
     9890                .chained = true,
     9891                .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
     9892        },
    90669893        [ALC289_FIXUP_DELL_SPK2] = {
    90679894                .type = HDA_FIXUP_PINS,
     
    90799906                .chained = true,
    90809907                .chain_id = ALC289_FIXUP_DELL_SPK2
     9908        },
     9909        [ALC289_FIXUP_RTK_AMP_DUAL_SPK] = {
     9910                .type = HDA_FIXUP_FUNC,
     9911                .v.func = alc285_fixup_speaker2_to_dac1,
     9912                .chained = true,
     9913                .chain_id = ALC289_FIXUP_DELL_SPK1
    90819914        },
    90829915        [ALC294_FIXUP_SPK2_TO_DAC1] = {
     
    90939926                .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
    90949927        },
     9928        [ALC294_FIXUP_ASUS_ALLY] = {
     9929                .type = HDA_FIXUP_FUNC,
     9930                .v.func = cs35l41_fixup_i2c_two,
     9931                .chained = true,
     9932                .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS
     9933        },
     9934#ifdef NOT_USED
     9935        [ALC294_FIXUP_ASUS_ALLY_PINS] = {
     9936                .type = HDA_FIXUP_PINS,
     9937                .v.pins = (const struct hda_pintbl[]) {
     9938                        { 0x19, 0x03a11050 },
     9939                        { 0x1a, 0x03a11c30 },
     9940                        { 0x21, 0x03211420 },
     9941                        { }
     9942                },
     9943                .chained = true,
     9944                .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS
     9945        },
     9946        [ALC294_FIXUP_ASUS_ALLY_VERBS] = {
     9947                .type = HDA_FIXUP_VERBS,
     9948                .v.verbs = (const struct hda_verb[]) {
     9949                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
     9950                        { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
     9951                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 },
     9952                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 },
     9953                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 },
     9954                        { 0x20, AC_VERB_SET_PROC_COEF, 0xa47a },
     9955                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
     9956                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0049},
     9957                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
     9958                        { 0x20, AC_VERB_SET_PROC_COEF, 0x201b },
     9959                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
     9960                        { 0x20, AC_VERB_SET_PROC_COEF, 0x4278},
     9961                        { }
     9962                },
     9963                .chained = true,
     9964                .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER
     9965        },
     9966#endif
     9967        [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = {
     9968                .type = HDA_FIXUP_FUNC,
     9969                .v.func = alc285_fixup_speaker2_to_dac1,
     9970        },
    90959971        [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
    90969972                .type = HDA_FIXUP_FUNC,
     
    91059981                .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
    91069982        },
    9107 #ifdef TARGET_OS2xxx
     9983#ifdef NOT_USED
    91089984        [ALC294_FIXUP_ASUS_HPE] = {
    91099985                .type = HDA_FIXUP_VERBS,
     
    917310049                .v.func = alc294_fixup_gu502_hp,
    917410050        },
     10051         [ALC294_FIXUP_ASUS_G513_PINS] = {
     10052                .type = HDA_FIXUP_PINS,
     10053                .v.pins = (const struct hda_pintbl[]) {
     10054                                { 0x19, 0x03a11050 }, /* front HP mic */
     10055                                { 0x1a, 0x03a11c30 }, /* rear external mic */
     10056                                { 0x21, 0x03211420 }, /* front HP out */
     10057                                { }
     10058                },
     10059        },
     10060        [ALC285_FIXUP_ASUS_G533Z_PINS] = {
     10061                .type = HDA_FIXUP_PINS,
     10062                .v.pins = (const struct hda_pintbl[]) {
     10063                        { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
     10064                        { 0x19, 0x03a19020 }, /* Mic Boost Volume */
     10065                        { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
     10066                        { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
     10067                        { 0x21, 0x03211420 },
     10068                        { }
     10069                },
     10070        },
    917510071        [ALC294_FIXUP_ASUS_COEF_1B] = {
    917610072                .type = HDA_FIXUP_VERBS,
     
    919510091                .v.func = alc285_fixup_hp_mute_led,
    919610092        },
     10093        [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
     10094                .type = HDA_FIXUP_FUNC,
     10095                .v.func = alc285_fixup_hp_spectre_x360_mute_led,
     10096        },
     10097        [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
     10098            .type = HDA_FIXUP_FUNC,
     10099            .v.func = alc236_fixup_hp_mute_led_coefbit2,
     10100        },
    919710101        [ALC236_FIXUP_HP_GPIO_LED] = {
    919810102                .type = HDA_FIXUP_FUNC,
     
    920710111                .v.func = alc236_fixup_hp_mute_led_micmute_vref,
    920810112        },
    9209 #ifdef TARGET_OS2xxx
     10113        [ALC236_FIXUP_LENOVO_INV_DMIC] = {
     10114                .type = HDA_FIXUP_FUNC,
     10115                .v.func = alc_fixup_inv_dmic,
     10116                .chained = true,
     10117                .chain_id = ALC283_FIXUP_INT_MIC,
     10118        },
     10119        [ALC298_FIXUP_SAMSUNG_AMP] = {
     10120                .type = HDA_FIXUP_FUNC,
     10121                .v.func = alc298_fixup_samsung_amp,
     10122                .chained = true,
     10123                .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
     10124        },
     10125#ifdef NOT_USED
    921010126        [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
    921110127                .type = HDA_FIXUP_VERBS,
     
    947610392                .v.func = alc295_fixup_asus_dacs,
    947710393        },
    9478 #ifdef TARGET_OS2xxx
     10394#ifdef NOT_USED
    947910395        [ALC295_FIXUP_HP_OMEN] = {
    948010396                .type = HDA_FIXUP_PINS,
     
    950610422                .v.func = alc285_fixup_hp_spectre_x360_eb1
    950710423        },
     10424        [ALC285_FIXUP_HP_ENVY_X360] = {
     10425                .type = HDA_FIXUP_FUNC,
     10426                .v.func = alc285_fixup_hp_envy_x360,
     10427                .chained = true,
     10428                .chain_id = ALC285_FIXUP_HP_GPIO_AMP_INIT,
     10429        },
    950810430        [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
    950910431                .type = HDA_FIXUP_FUNC,
     
    951810440                .chain_id = ALC283_FIXUP_HEADSET_MIC,
    951910441        },
    9520 #ifdef TARGET_OS2xxx
     10442#ifdef NOT_USED
    952110443        [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
    952210444                .type = HDA_FIXUP_PINS,
     
    954710469                .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
    954810470        },
    9549 #ifdef TARGET_OS2xxx
     10471#ifdef NOT_USED
    955010472        [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
    955110473                .type = HDA_FIXUP_VERBS,
     
    959510517                .chain_id = ALC269_FIXUP_HEADSET_MODE,
    959610518        },
    9597 #ifdef TARGET_OS2xxx
     10519#ifdef NOT_USED
    959810520        [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
    959910521                .type = HDA_FIXUP_VERBS,
     
    963810560                .type = HDA_FIXUP_FUNC,
    963910561                .v.func = alc298_fixup_lenovo_c940_duet7,
     10562        },
     10563        [ALC287_FIXUP_LENOVO_14IRP8_DUETITL] = {
     10564                .type = HDA_FIXUP_FUNC,
     10565                .v.func = alc287_fixup_lenovo_14irp8_duetitl,
    964010566        },
    964110567        [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
     
    966610592                .v.func = alc256_fixup_set_coef_defaults,
    966710593        },
    9668 #ifdef TARGET_OS2xxx
     10594#ifdef NOT_USED
    966910595        [ALC245_FIXUP_HP_GPIO_LED] = {
    967010596                .type = HDA_FIXUP_FUNC,
     
    969110617                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
    969210618        },
     10619        [ALC287_FIXUP_LEGION_16ACHG6] = {
     10620                .type = HDA_FIXUP_FUNC,
     10621                .v.func = alc287_fixup_legion_16achg6_speakers,
     10622        },
     10623        [ALC287_FIXUP_CS35L41_I2C_2] = {
     10624                .type = HDA_FIXUP_FUNC,
     10625                .v.func = cs35l41_fixup_i2c_two,
     10626        },
     10627        [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
     10628                .type = HDA_FIXUP_FUNC,
     10629                .v.func = cs35l41_fixup_i2c_two,
     10630                .chained = true,
     10631                .chain_id = ALC285_FIXUP_HP_MUTE_LED,
     10632        },
     10633        [ALC245_FIXUP_CS35L41_SPI_2] = {
     10634                .type = HDA_FIXUP_FUNC,
     10635                .v.func = cs35l41_fixup_spi_two,
     10636        },
     10637        [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
     10638                .type = HDA_FIXUP_FUNC,
     10639                .v.func = cs35l41_fixup_spi_two,
     10640                .chained = true,
     10641                .chain_id = ALC285_FIXUP_HP_GPIO_LED,
     10642        },
     10643        [ALC245_FIXUP_CS35L41_SPI_4] = {
     10644                .type = HDA_FIXUP_FUNC,
     10645                .v.func = cs35l41_fixup_spi_four,
     10646        },
     10647        [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
     10648                .type = HDA_FIXUP_FUNC,
     10649                .v.func = cs35l41_fixup_spi_four,
     10650                .chained = true,
     10651                .chain_id = ALC285_FIXUP_HP_GPIO_LED,
     10652        },
     10653#ifdef NOT_USED
     10654        [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
     10655                .type = HDA_FIXUP_VERBS,
     10656                .v.verbs = (const struct hda_verb[]) {
     10657                         { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
     10658                         { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
     10659                         { }
     10660                },
     10661                .chained = true,
     10662                .chain_id = ALC285_FIXUP_HP_MUTE_LED,
     10663        },
     10664#endif
     10665        [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
     10666                .type = HDA_FIXUP_FUNC,
     10667                .v.func = alc_fixup_dell4_mic_no_presence_quiet,
     10668                .chained = true,
     10669                .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     10670        },
     10671#ifdef NOT_USED
     10672        [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
     10673                .type = HDA_FIXUP_PINS,
     10674                .v.pins = (const struct hda_pintbl[]) {
     10675                        { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
     10676                        { }
     10677                },
     10678                .chained = true,
     10679                .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
     10680        },
     10681        [ALC287_FIXUP_LEGION_16ITHG6] = {
     10682                .type = HDA_FIXUP_FUNC,
     10683                .v.func = alc287_fixup_legion_16ithg6_speakers,
     10684        },
     10685        [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK] = {
     10686                .type = HDA_FIXUP_VERBS,
     10687                .v.verbs = (const struct hda_verb[]) {
     10688                        // enable left speaker
     10689                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
     10690                        { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
     10691
     10692                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10693                        { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
     10694                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10695                        { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
     10696                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10697
     10698                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10699                        { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
     10700                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10701                        { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
     10702                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10703
     10704                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10705                        { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
     10706                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10707                        { 0x20, AC_VERB_SET_PROC_COEF, 0x40 },
     10708                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10709
     10710                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10711                        { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
     10712                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10713                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10714                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10715
     10716                        // enable right speaker
     10717                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
     10718                        { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
     10719
     10720                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10721                        { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
     10722                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10723                        { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
     10724                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10725
     10726                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10727                        { 0x20, AC_VERB_SET_PROC_COEF, 0xf },
     10728                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10729                        { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
     10730                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10731
     10732                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10733                        { 0x20, AC_VERB_SET_PROC_COEF, 0x10 },
     10734                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10735                        { 0x20, AC_VERB_SET_PROC_COEF, 0x44 },
     10736                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10737
     10738                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
     10739                        { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
     10740                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10741                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
     10742                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
     10743
     10744                        { },
     10745                },
     10746        },
     10747#endif
     10748        [ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN] = {
     10749                .type = HDA_FIXUP_FUNC,
     10750                .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
     10751                .chained = true,
     10752                .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
     10753        },
     10754        [ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
     10755                .type = HDA_FIXUP_FUNC,
     10756                .v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
     10757                .chained = true,
     10758                .chain_id = ALC287_FIXUP_CS35L41_I2C_2,
     10759        },
     10760        [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
     10761                .type = HDA_FIXUP_FUNC,
     10762                .v.func = alc295_fixup_dell_inspiron_top_speakers,
     10763                .chained = true,
     10764                .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     10765        },
     10766        [ALC236_FIXUP_DELL_DUAL_CODECS] = {
     10767                .type = HDA_FIXUP_PINS,
     10768                .v.func = alc1220_fixup_gb_dual_codecs,
     10769                .chained = true,
     10770                .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
     10771        },
     10772        [ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI] = {
     10773                .type = HDA_FIXUP_FUNC,
     10774                .v.func = cs35l41_fixup_i2c_two,
     10775                .chained = true,
     10776                .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
     10777        },
     10778        [ALC287_FIXUP_TAS2781_I2C] = {
     10779                .type = HDA_FIXUP_FUNC,
     10780                .v.func = tas2781_fixup_i2c,
     10781                .chained = true,
     10782                .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
     10783        },
     10784        [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
     10785                .type = HDA_FIXUP_FUNC,
     10786                .v.func = alc245_fixup_hp_mute_led_coefbit,
     10787        },
     10788        [ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
     10789                .type = HDA_FIXUP_FUNC,
     10790                .v.func = alc245_fixup_hp_mute_led_coefbit,
     10791                .chained = true,
     10792                .chain_id = ALC245_FIXUP_HP_GPIO_LED
     10793        },
     10794        [ALC287_FIXUP_THINKPAD_I2S_SPK] = {
     10795                .type = HDA_FIXUP_FUNC,
     10796                .v.func = alc287_fixup_bind_dacs,
     10797                .chained = true,
     10798                .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
     10799        },
     10800        [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = {
     10801                .type = HDA_FIXUP_FUNC,
     10802                .v.func = alc287_fixup_bind_dacs,
     10803                .chained = true,
     10804                .chain_id = ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
     10805        },
     10806        [ALC2XX_FIXUP_HEADSET_MIC] = {
     10807                .type = HDA_FIXUP_FUNC,
     10808                .v.func = alc_fixup_headset_mic,
     10809        },
     10810        [ALC289_FIXUP_DELL_CS35L41_SPI_2] = {
     10811                .type = HDA_FIXUP_FUNC,
     10812                .v.func = cs35l41_fixup_spi_two,
     10813                .chained = true,
     10814                .chain_id = ALC289_FIXUP_DUAL_SPK
     10815        },
     10816        [ALC294_FIXUP_CS35L41_I2C_2] = {
     10817                .type = HDA_FIXUP_FUNC,
     10818                .v.func = cs35l41_fixup_i2c_two,
     10819        },
    969310820};
    969410821
    9695 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
     10822static const struct hda_quirk alc269_fixup_tbl[] = {
    969610823        SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
    969710824        SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
     
    970610833        SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
    970710834        SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
     10835        SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
    970810836        SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
    970910837        SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
     
    971510843        SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
    971610844        SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
     10845        SND_PCI_QUIRK(0x1025, 0x1177, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
     10846        SND_PCI_QUIRK(0x1025, 0x1178, "Acer Predator G9-593", ALC255_FIXUP_PREDATOR_SUBWOOFER),
    971710847        SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
    971810848        SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
    971910849        SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
    972010850        SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
     10851        SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
    972110852        SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
    972210853        SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
     
    972810859        SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
    972910860        SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
     10861        SND_PCI_QUIRK(0x1025, 0x1360, "Acer Aspire A115", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
    973010862        SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
    973110863        SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
    973210864        SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
    973310865        SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
     10866        SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
    973410867        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
    973510868        SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
     
    978310916        SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
    978410917        SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
     10918        SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
    978510919        SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
    978610920        SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
     
    978910923        SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
    979010924        SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
     10925        SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
     10926        SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     10927        SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     10928        SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10929        SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
     10930        SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
     10931        SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
     10932        SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
     10933        SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
     10934        SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
     10935        SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
     10936        SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
     10937        SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
     10938        SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
     10939        SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10940        SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10941        SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10942        SND_PCI_QUIRK(0x1028, 0x0cc0, "Dell Oasis 13", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
     10943        SND_PCI_QUIRK(0x1028, 0x0cc1, "Dell Oasis 14 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10944        SND_PCI_QUIRK(0x1028, 0x0cc2, "Dell Oasis 14 2-in-1 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10945        SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10946        SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     10947        SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
    979110948        SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
    979210949        SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    985311010        SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
    985411011        SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
    9855         SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
     11012        SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
    985611013        SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
    985711014        SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
     
    986211019        SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
    986311020        SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
     11021        SND_PCI_QUIRK(0x103c, 0x84a6, "HP 250 G7 Notebook PC", ALC269_FIXUP_HP_LINE1_MIC1_LED),
     11022        SND_PCI_QUIRK(0x103c, 0x84ae, "HP 15-db0403ng", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    986411023        SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
    986511024        SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
    986611025        SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
     11026        SND_PCI_QUIRK(0x103c, 0x8537, "HP ProBook 440 G6", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11027        SND_PCI_QUIRK(0x103c, 0x85de, "HP Envy x360 13-ar0xxx", ALC285_FIXUP_HP_ENVY_X360),
    986711028        SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    986811029        SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    986911030        SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
     11031        SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    987011032        SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
     11033        SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
     11034        SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
     11035        SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
    987111036        SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    987211037        SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
     
    987811043        SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    987911044        SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
     11045        SND_PCI_QUIRK(0x103c, 0x876e, "HP ENVY x360 Convertible 13-ay0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
    988011046        SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
    988111047        SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
     
    988411050        SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
    988511051                      ALC285_FIXUP_HP_GPIO_AMP_INIT),
     11052        SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
    988611053        SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
    988711054        SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
     11055        SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    988811056        SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
     11057        SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11058        SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
    988911059        SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
    989011060        SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
     
    989511065        SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
    989611066        SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
     11067        SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11068        SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    989711069        SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
    989811070        SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
    989911071        SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
    990011072        SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
     11073        SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    990111074        SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
    990211075        SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
     
    990811081        SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    990911082        SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
     11083        SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11084        SND_PCI_QUIRK(0x103c, 0x887c, "HP Laptop 14s-fq1xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11085        SND_PCI_QUIRK(0x103c, 0x888a, "HP ENVY x360 Convertible 15-eu0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
    991011086        SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
     11087        SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
    991111088        SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
    991211089        SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    991311090        SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
     11091        SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
     11092        SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
     11093        SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11094        SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
     11095        SND_PCI_QUIRK(0x103c, 0x896d, "HP ZBook Firefly 16 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11096        SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11097        SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11098        SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11099        SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11100        SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11101        SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11102        SND_PCI_QUIRK(0x103c, 0x897d, "HP mt440 Mobile Thin Client U74", ALC236_FIXUP_HP_GPIO_LED),
     11103        SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
     11104        SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
     11105        SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
     11106        SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11107        SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
     11108        SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11109        SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
     11110        SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
     11111        SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
    991411112        SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
    9915         SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
     11113        SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
     11114        SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
     11115        SND_PCI_QUIRK(0x103c, 0x89c0, "HP ZBook Power 15.6 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11116        SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
     11117        SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    991611118        SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11119        SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11120        SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
     11121        SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11122        SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
    991711123        SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    991811124        SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
     
    992011126        SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
    992111127        SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
     11128        SND_PCI_QUIRK(0x103c, 0x8ab9, "HP EliteBook 840 G8 (MB 8AB8)", ALC285_FIXUP_HP_GPIO_LED),
     11129        SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11130        SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11131        SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11132        SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11133        SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11134        SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
     11135        SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11136        SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11137        SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11138        SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11139        SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11140        SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11141        SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11142        SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11143        SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11144        SND_PCI_QUIRK(0x103c, 0x8b5f, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11145        SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
     11146        SND_PCI_QUIRK(0x103c, 0x8b65, "HP ProBook 455 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11147        SND_PCI_QUIRK(0x103c, 0x8b66, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11148        SND_PCI_QUIRK(0x103c, 0x8b70, "HP EliteBook 835 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11149        SND_PCI_QUIRK(0x103c, 0x8b72, "HP EliteBook 845 G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11150        SND_PCI_QUIRK(0x103c, 0x8b74, "HP EliteBook 845W G10", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11151        SND_PCI_QUIRK(0x103c, 0x8b77, "HP ElieBook 865 G10", ALC287_FIXUP_CS35L41_I2C_2),
     11152        SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11153        SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11154        SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11155        SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11156        SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11157        SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11158        SND_PCI_QUIRK(0x103c, 0x8b8f, "HP", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
     11159        SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11160        SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11161        SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11162        SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11163        SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11164        SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11165        SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11166        SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11167        SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11168        SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11169        SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11170        SND_PCI_QUIRK(0x103c, 0x8c7b, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11171        SND_PCI_QUIRK(0x103c, 0x8c7c, "HP ProBook 445 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11172        SND_PCI_QUIRK(0x103c, 0x8c7d, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11173        SND_PCI_QUIRK(0x103c, 0x8c7e, "HP ProBook 465 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11174        SND_PCI_QUIRK(0x103c, 0x8c7f, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11175        SND_PCI_QUIRK(0x103c, 0x8c80, "HP EliteBook 645 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11176        SND_PCI_QUIRK(0x103c, 0x8c81, "HP EliteBook 665 G11", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11177        SND_PCI_QUIRK(0x103c, 0x8c89, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
     11178        SND_PCI_QUIRK(0x103c, 0x8c8a, "HP EliteBook 630", ALC236_FIXUP_HP_GPIO_LED),
     11179        SND_PCI_QUIRK(0x103c, 0x8c8c, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
     11180        SND_PCI_QUIRK(0x103c, 0x8c8d, "HP ProBook 440 G11", ALC236_FIXUP_HP_GPIO_LED),
     11181        SND_PCI_QUIRK(0x103c, 0x8c8e, "HP ProBook 460 G11", ALC236_FIXUP_HP_GPIO_LED),
     11182        SND_PCI_QUIRK(0x103c, 0x8c90, "HP EliteBook 640", ALC236_FIXUP_HP_GPIO_LED),
     11183        SND_PCI_QUIRK(0x103c, 0x8c91, "HP EliteBook 660", ALC236_FIXUP_HP_GPIO_LED),
     11184        SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11185        SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11186        SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
     11187        SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED),
     11188        SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11189        SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11190        SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
     11191        SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED),
     11192        SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED),
     11193        SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED),
     11194        SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED),
     11195        SND_PCI_QUIRK(0x103c, 0x8e18, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
     11196        SND_PCI_QUIRK(0x103c, 0x8e19, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
     11197        SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED),
    992211198        SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    992311199        SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
     
    992611202        SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    992711203        SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
     11204        SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
    992811205        SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
    992911206        SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
     
    993211209        SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
    993311210        SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
     11211        SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM),
     11212        SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
    993411213        SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
    993511214        SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
     11215        SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
    993611216        SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
    993711217        SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
     11218        SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
     11219        SND_PCI_QUIRK(0x1043, 0x1460, "Asus VivoBook 15", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
     11220        SND_PCI_QUIRK(0x1043, 0x1463, "Asus GA402X/GA402N", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC),
     11221        SND_PCI_QUIRK(0x1043, 0x1473, "ASUS GU604VI/VC/VE/VG/VJ/VQ/VU/VV/VY/VZ", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11222        SND_PCI_QUIRK(0x1043, 0x1483, "ASUS GU603VQ/VU/VV/VJ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11223        SND_PCI_QUIRK(0x1043, 0x1493, "ASUS GV601VV/VU/VJ/VQ/VI", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11224        SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G614JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
     11225        SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS G513PI/PU/PV", ALC287_FIXUP_CS35L41_I2C_2),
     11226        SND_PCI_QUIRK(0x1043, 0x1503, "ASUS G733PY/PZ/PZV/PYV", ALC287_FIXUP_CS35L41_I2C_2),
    993811227        SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
     11228        SND_PCI_QUIRK(0x1043, 0x1533, "ASUS GV302XA/XJ/XQ/XU/XV/XI", ALC287_FIXUP_CS35L41_I2C_2),
     11229        SND_PCI_QUIRK(0x1043, 0x1573, "ASUS GZ301VV/VQ/VU/VJ/VA/VC/VE/VVC/VQC/VUC/VJC/VEC/VCC", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11230        SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
     11231        SND_PCI_QUIRK(0x1043, 0x1663, "ASUS GU603ZI/ZJ/ZQ/ZU/ZV", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11232        SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
     11233        SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
     11234        SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
    993911235        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
    994011236        SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
    994111237        SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
    9942         SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
     11238        SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
    994311239        SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
    994411240        SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
     11241        SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS UM3504DA", ALC294_FIXUP_CS35L41_I2C_2),
    994511242        SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
    994611243        SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
     
    995011247        SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
    995111248        SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
    9952         SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
     11249        SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
     11250        SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
     11251        SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
    995311252        SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
    995411253        SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
     11254        SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
    995511255        SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
     11256        SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2),
    995611257        SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
     11258        SND_PCI_QUIRK(0x1043, 0x1c33, "ASUS UX5304MA", ALC245_FIXUP_CS35L41_SPI_2),
     11259        SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
     11260        SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
     11261        SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
     11262        SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11263        SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
    995711264        SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
     11265        SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2),
     11266        SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2),
     11267        SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC),
     11268        SND_PCI_QUIRK(0x1043, 0x1d1f, "ASUS G713PI/PU/PV/PVN", ALC287_FIXUP_CS35L41_I2C_2),
     11269        SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
    995811270        SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
     11271        SND_PCI_QUIRK(0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2),
     11272        SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402ZA", ALC245_FIXUP_CS35L41_SPI_2),
    995911273        SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
     11274        SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
    996011275        SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
     11276        SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
    996111277        SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
     11278        SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
     11279        SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
    996211280        SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
    9963         SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
    9964         SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
     11281        SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
     11282        SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
     11283        SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
    996511284        SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
     11285        SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC245_FIXUP_CS35L41_SPI_2),
     11286        SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
     11287        SND_PCI_QUIRK(0x1043, 0x3a40, "ASUS G814JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
     11288        SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
     11289        SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC245_FIXUP_CS35L41_SPI_2),
    996611290        SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
    996711291        SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
     
    998311307        SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
    998411308        SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
     11309        SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
     11310        SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
    998511311        SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
     11312        SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
    998611313        SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
    998711314        SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
    9988         SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
     11315        SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
     11316        SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
    998911317        SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
    9990         SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    9991         SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    9992         SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    9993         SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     11318        SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
     11319        SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
     11320        SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
     11321        SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
     11322        SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
     11323        SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
     11324        SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
    999411325        SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
    9995         SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    9996         SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     11326        SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
     11327        SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
    999711328        SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     11329        SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
     11330        SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     11331        SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
    999811332        SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
    999911333        SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
    1000011334        SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
    1000111335        SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
     11336        SND_PCI_QUIRK(0x152d, 0x1262, "Huawei NBLB-WAX9N", ALC2XX_FIXUP_HEADSET_MIC),
     11337        SND_PCI_QUIRK(0x1558, 0x0353, "Clevo V35[05]SN[CDE]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1000211338        SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1000311339        SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1000611342        SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1000711343        SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11344        SND_PCI_QUIRK(0x1558, 0x2624, "Clevo L240TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11345        SND_PCI_QUIRK(0x1558, 0x28c1, "Clevo V370VND", ALC2XX_FIXUP_HEADSET_MIC),
    1000811346        SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1000911347        SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1001011348        SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11349        SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1001111350        SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1001211351        SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1002911368        SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003011369        SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11370        SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11371        SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11372        SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003111373        SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003211374        SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1003611378        SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003711379        SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11380        SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003811381        SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11382        SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1003911383        SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1004011384        SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1006211406        SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1006311407        SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11408        SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11409        SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11410        SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1006411411        SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1006511412        SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1009511442        SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
    1009611443        SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
     11444        SND_PCI_QUIRK(0x17aa, 0x2234, "Thinkpad ICE-1", ALC287_FIXUP_TAS2781_I2C),
    1009711445        SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
    1009811446        SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
     
    1010711455        SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
    1010811456        SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
     11457        SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11458        SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11459        SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11460        SND_PCI_QUIRK(0x17aa, 0x2316, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11461        SND_PCI_QUIRK(0x17aa, 0x2317, "Thinkpad P1 Gen 6", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11462        SND_PCI_QUIRK(0x17aa, 0x2318, "Thinkpad Z13 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11463        SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     11464        SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
    1010911465        SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
    1011011466        SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
     
    1011811474        SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
    1011911475        SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
    10120         SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
     11476        SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
     11477        SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
     11478        SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
     11479        SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
     11480        SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     11481        SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8 / DuetITL 2021", ALC287_FIXUP_LENOVO_14IRP8_DUETITL),
    1012111482        SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
    1012211483        SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
    1012311484        SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
    10124         SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
     11485        SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
    1012511486        SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
    1012611487        SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
     
    1012811489        SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
    1012911490        SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
     11491        SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
    1013011492        SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1013111493        SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1013211494        SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
     11495        SND_PCI_QUIRK(0x17aa, 0x3855, "Legion 7 16ITHG6", ALC287_FIXUP_LEGION_16ITHG6),
     11496        SND_PCI_QUIRK(0x17aa, 0x3865, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
     11497        SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
     11498        SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     11499        SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
     11500        SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
     11501        SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
     11502        SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     11503        SND_PCI_QUIRK(0x17aa, 0x3884, "Y780 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
     11504        SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
     11505        SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     11506        SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
     11507        SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
     11508        SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
     11509        SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
     11510        SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
     11511        SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
     11512        SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
     11513        SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
     11514        SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
     11515        SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
     11516        SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
     11517        SND_PCI_QUIRK(0x17aa, 0x38df, "Y990 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
     11518        SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
     11519        SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_CS35L41_I2C_2),
    1013311520        SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
     11521        SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
    1013411522        SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
    1013511523        SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
     
    1015511543        SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
    1015611544        SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
     11545        SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
     11546        SND_PCI_QUIRK(0x1849, 0x0269, "Positivo Master C6400", ALC269VB_FIXUP_ASUS_ZENBOOK),
    1015711547        SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
     11548        SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
    1015811549        SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
     11550        SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
     11551        SND_PCI_QUIRK(0x19e5, 0x3212, "Huawei KLV-WX9 ", ALC256_FIXUP_ACER_HEADSET_MIC),
    1015911552        SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
    1016011553        SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
     
    1016311556        SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
    1016411557        SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
     11558        SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
     11559        SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
    1016511560        SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
    1016611561        SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
     
    1017211567        SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
    1017311568        SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
     11569        SND_PCI_QUIRK(0x1d05, 0x1387, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
     11570        SND_PCI_QUIRK(0x1d05, 0x1409, "TongFang GMxIXxx", ALC2XX_FIXUP_HEADSET_MIC),
     11571        SND_PCI_QUIRK(0x1d17, 0x3288, "Haier Boyue G42", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
    1017411572        SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
    1017511573        SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    1017711575        SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
    1017811576        SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
     11577        SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
     11578        SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
     11579        SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
     11580        SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
     11581        SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
     11582        SND_PCI_QUIRK(0x2782, 0x1701, "Infinix Y4 Max", ALC269VC_FIXUP_INFINIX_Y4_MAX),
     11583        SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
     11584        SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
    1017911585        SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
    1018011586        SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
    1018111587        SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
     11588        SND_PCI_QUIRK(0x8086, 0x3038, "Intel NUC 13", ALC295_FIXUP_CHROME_BOOK),
     11589        SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
     11590        SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
     11591        SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
     11592        SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
    1018211593
    1018311594#if 0
     
    1023211643};
    1023311644
    10234 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
     11645static const struct hda_quirk alc269_fixup_vendor_tbl[] = {
    1023511646        SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
    1023611647        SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
     
    1025811669        {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
    1025911670        {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
     11671        {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, .name = "dell-headset4-quiet"},
    1026011672        {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
    1026111673        {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
     
    1035211764        {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
    1035311765        {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
    10354         {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
     11766        {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
    1035511767        {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
    1035611768        {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
     
    1036011772        {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
    1036111773        {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
     11774        {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"},
    1036211775        {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
     11776        {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
    1036311777        {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
    1036411778        {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
    1036511779        {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
     11780        {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"},
     11781        {.id = ALC2XX_FIXUP_HEADSET_MIC, .name = "alc2xx-fixup-headset-mic"},
    1036611782        {0}
    1036711783};
     
    1039411810
    1039511811static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
    10396 #ifdef TARGET_OS2xxx
     11812#ifdef NOT_USED
    1039711813        SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
    1039811814                {0x14, 0x01014020},
     
    1066012076                {0x19, 0x03a11030},
    1066112077                {0x21, 0x03211020}),
     12078        SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
     12079                {0x17, 0x90170110},
     12080                {0x19, 0x03a11030},
     12081                {0x21, 0x03211020}),
     12082        SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC287_FIXUP_THINKPAD_I2S_SPK,
     12083                {0x17, 0x90170110}, /* 0x231f with RTK I2S AMP */
     12084                {0x19, 0x04a11040},
     12085                {0x21, 0x04211020}),
    1066212086        SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
    1066312087                {0x12, 0x90a60130},
     
    1075412178                {0x17, 0x90170110},
    1075512179                {0x21, 0x03211020}),
    10756         SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
    10757                 {0x14, 0x90170110},
    10758                 {0x21, 0x04211020}),
    10759         SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
    10760                 {0x14, 0x90170110},
    10761                 {0x21, 0x04211030}),
    10762         SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
    10763                 ALC295_STANDARD_PINS,
    10764                 {0x17, 0x21014020},
    10765                 {0x18, 0x21a19030}),
    10766         SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
    10767                 ALC295_STANDARD_PINS,
    10768                 {0x17, 0x21014040},
    10769                 {0x18, 0x21a19050}),
    10770         SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
    10771                 ALC295_STANDARD_PINS),
    1077212180        SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
    1077312181                ALC298_STANDARD_PINS,
     
    1081112219 */
    1081212220static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
    10813 #ifdef TARGET_OS2xxx
     12221#ifdef NOT_USED
     12222        SND_HDA_PIN_QUIRK(0x10ec0256, 0x1025, "Acer", ALC2XX_FIXUP_HEADSET_MIC,
     12223                {0x19, 0x40000000}),
    1081412224        SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     12225                {0x19, 0x40000000},
     12226                {0x1b, 0x40000000}),
     12227        SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
    1081512228                {0x19, 0x40000000},
    1081612229                {0x1b, 0x40000000}),
     
    1081812231                {0x19, 0x40000000},
    1081912232                {0x1a, 0x40000000}),
    10820         SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
     12233        SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
    1082112234                {0x19, 0x40000000},
    1082212235                {0x1a, 0x40000000}),
    10823         SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
     12236        SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_LIMIT_INT_MIC_BOOST,
    1082412237                {0x19, 0x40000000},
    1082512238                {0x1a, 0x40000000}),
     12239        SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC2XX_FIXUP_HEADSET_MIC,
     12240                {0x19, 0x40000000}),
     12241        SND_HDA_PIN_QUIRK(0x10ec0255, 0x1558, "Clevo", ALC2XX_FIXUP_HEADSET_MIC,
     12242                {0x19, 0x40000000}),
    1082612243#endif
    1082712244        {0}
     
    1088212299        spec->gen.shared_mic_vref_pin = 0x18;
    1088312300        codec->power_save_node = 0;
     12301        spec->en_3kpull_low = true;
    1088412302
    1088512303#ifdef CONFIG_PM
     
    1096412382                spec->init_hook = alc256_init;
    1096512383                spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
     12384                if (codec->core.vendor_id == 0x10ec0236 &&
     12385                    codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
     12386                        spec->en_3kpull_low = false;
    1096612387                break;
    1096712388        case 0x10ec0257:
     
    1097012391                spec->init_hook = alc256_init;
    1097112392                spec->gen.mixer_nid = 0;
     12393                spec->en_3kpull_low = false;
    1097212394                break;
    1097312395        case 0x10ec0215:
     
    1100912431                spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
    1101012432                break;
     12433        case 0x10ec0222:
    1101112434        case 0x10ec0623:
    1101212435                spec->codec_variant = ALC269_TYPE_ALC623;
     12436                spec->shutup = alc222_shutup;
     12437                spec->init_hook = alc222_init;
    1101312438                break;
    1101412439        case 0x10ec0700:
     
    1117512600};
    1117612601
    11177 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
     12602static const struct hda_quirk alc861_fixup_tbl[] = {
    1117812603        SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
    1117912604        SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
     
    1128512710                .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
    1128612711        },
    11287 #ifdef TARGET_OS2xxx
     12712#ifdef NOT_USED
    1128812713        [ALC256_FIXUP_ACER_HEADSET_MIC] = {
    1128912714                .type = HDA_FIXUP_PINS,
     
    1129912724};
    1130012725
    11301 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
     12726static const struct hda_quirk alc861vd_fixup_tbl[] = {
    1130212727        SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
    1130312728        SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
     
    1153112956        snd_hda_gen_hp_automute(codec, jack);
    1153212957        vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
    11533         snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
    11534                             vref);
     12958        snd_hda_set_pin_ctl(codec, 0x1b, vref);
    1153512959}
    1153612960
     
    1154012964        struct alc_spec *spec = codec->spec;
    1154112965        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     12966                spec->gen.hp_automute_hook = alc897_hp_automute_hook;
     12967                spec->no_shutup_pins = 1;
     12968        }
     12969        if (action == HDA_FIXUP_ACT_PROBE) {
     12970                snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
     12971        }
     12972}
     12973
     12974static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
     12975                                     const struct hda_fixup *fix, int action)
     12976{
     12977        struct alc_spec *spec = codec->spec;
     12978
     12979        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     12980                spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
    1154212981                spec->gen.hp_automute_hook = alc897_hp_automute_hook;
    1154312982        }
     
    1162713066        ALC897_FIXUP_HEADSET_MIC_PIN,
    1162813067        ALC897_FIXUP_HP_HSMIC_VERB,
     13068        ALC897_FIXUP_LENOVO_HEADSET_MODE,
     13069        ALC897_FIXUP_HEADSET_MIC_PIN2,
     13070        ALC897_FIXUP_UNIS_H3C_X500S,
     13071        ALC897_FIXUP_HEADSET_MIC_PIN3,
    1162913072};
    1163013073
     
    1177113214                .v.func = alc272_fixup_mario,
    1177213215        },
    11773 #ifdef TARGET_OS2xxx
     13216#ifdef NOT_USED
    1177413217        [ALC662_FIXUP_CZC_ET26] = {
    1177513218                .type = HDA_FIXUP_PINS,
     
    1199313436                .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
    1199413437        },
    11995 #ifdef TARGET_OS2xxx
     13438#ifdef NOT_USED
    1199613439        [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
    1199713440                .type = HDA_FIXUP_PINS,
     
    1200913452                .v.func = alc_fixup_headset_mode_alc662,
    1201013453        },
    12011 #ifdef TARGET_OS2xxx
     13454#ifdef NOT_USED
    1201213455        [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
    1201313456                .type = HDA_FIXUP_PINS,
     
    1207213515                .chain_id = ALC662_FIXUP_BASS_CHMAP
    1207313516        },
    12074 #ifdef TARGET_OS2xxx
     13517#ifdef NOT_USED
    1207513518        [ALC668_FIXUP_ASUS_Nx51] = {
    1207613519                .type = HDA_FIXUP_PINS,
     
    1210613549                .v.func = alc_fixup_headset_mode,
    1210713550        },
    12108 #ifdef TARGET_OS2xxx
     13551#ifdef NOT_USED
    1210913552        [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
    1211013553                .type = HDA_FIXUP_PINS,
     
    1213713580                .v.func = alc662_fixup_usi_headset_mic,
    1213813581        },
    12139 #ifdef TARGET_OS2xxx
     13582#ifdef NOT_USED
    1214013583        [ALC662_FIXUP_USI_HEADSET_MODE] = {
    1214113584                .type = HDA_FIXUP_PINS,
     
    1215713600                .v.func = alc662_fixup_aspire_ethos_hp,
    1215813601        },
    12159 #ifdef TARGET_OS2xxx
     13602#ifdef NOT_USED
    1216013603        [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
    1216113604                .type = HDA_FIXUP_PINS,
     
    1217413617                .v.func = alc671_fixup_hp_headset_mic2,
    1217513618        },
    12176 #ifdef TARGET_OS2xxx
     13619#ifdef NOT_USED
    1217713620        [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
    1217813621                .type = HDA_FIXUP_PINS,
     
    1221013653                .chain_id = ALC668_FIXUP_MIC_DET_COEF
    1221113654        },
    12212 #ifdef TARGET_OS2xxx
     13655#ifdef NOT_USED
    1221313656        [ALC668_FIXUP_MIC_DET_COEF] = {
    1221413657                .type = HDA_FIXUP_VERBS,
     
    1222413667                .v.func = alc897_fixup_lenovo_headset_mic,
    1222513668        },
    12226 #ifdef TARGET_OS2xxx
     13669#ifdef NOT_USED
    1222713670        [ALC897_FIXUP_HEADSET_MIC_PIN] = {
    1222813671                .type = HDA_FIXUP_PINS,
     
    1224213685        },
    1224313686#endif
     13687        [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
     13688                .type = HDA_FIXUP_FUNC,
     13689                .v.func = alc897_fixup_lenovo_headset_mode,
     13690        },
     13691#ifdef NOT_USED
     13692        [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
     13693                .type = HDA_FIXUP_PINS,
     13694                .v.pins = (const struct hda_pintbl[]) {
     13695                        { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
     13696                        { }
     13697                },
     13698                .chained = true,
     13699                .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
     13700        },
     13701        [ALC897_FIXUP_UNIS_H3C_X500S] = {
     13702                .type = HDA_FIXUP_VERBS,
     13703                .v.verbs = (const struct hda_verb[]) {
     13704                        { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
     13705                        {}
     13706                },
     13707        },
     13708        [ALC897_FIXUP_HEADSET_MIC_PIN3] = {
     13709                .type = HDA_FIXUP_PINS,
     13710                .v.pins = (const struct hda_pintbl[]) {
     13711                        { 0x19, 0x03a11050 }, /* use as headset mic */
     13712                        { }
     13713                },
     13714        },
     13715#endif
    1224413716};
    1224513717
    12246 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
     13718static const struct hda_quirk alc662_fixup_tbl[] = {
    1224713719        SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
     13720        SND_PCI_QUIRK(0x1019, 0x9859, "JP-IK LEAP W502", ALC897_FIXUP_HEADSET_MIC_PIN3),
    1224813721        SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
    1224913722        SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
     
    1226713740        SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
    1226813741        SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
     13742        SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
    1226913743        SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
     13744        SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
    1227013745        SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
     13746        SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
    1227113747        SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
    1227213748        SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
     
    1229013766        SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
    1229113767        SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
     13768        SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
    1229213769        SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
    1229313770        SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
    1229413771        SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
    1229513772        SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
     13773        SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
     13774        SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
     13775        SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
     13776        SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
    1229613777        SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
    1229713778        SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
     
    1230113782        SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
    1230213783        SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
     13784        SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
    1230313785
    1230413786#if 0
     
    1239513877        {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
    1239613878        {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
     13879        {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
    1239713880        {0}
    1239813881};
    1239913882
    1240013883static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
    12401 #ifdef TARGET_OS2xxx
     13884#ifdef NOT_USED
    1240213885        SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
    1240313886                {0x17, 0x02211010},
     
    1251013993                goto error;
    1251113994
    12512 #ifndef TARGET_OS2
    1251313995        if (!spec->gen.no_analog && spec->gen.beep_nid) {
    1251413996                switch (codec->core.vendor_id) {
     
    1252914011                        goto error;
    1253014012        }
    12531 #endif
     14013
    1253214014        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
    1253314015
  • GPL/trunk/alsa-kernel/pci/hda/patch_sigmatel.c

    r717 r772  
    214214        /* beep widgets */
    215215        hda_nid_t anabeep_nid;
     216        bool beep_power_on;
    216217
    217218        /* SPDIF-out mux */
     
    14821483};
    14831484
    1484 static const struct snd_pci_quirk stac9200_fixup_tbl[] = {
     1485static const struct hda_quirk stac9200_fixup_tbl[] = {
    14851486        /* SigmaTel reference board */
    14861487        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    17031704};
    17041705
    1705 static const struct snd_pci_quirk stac925x_fixup_tbl[] = {
     1706static const struct hda_quirk stac925x_fixup_tbl[] = {
    17061707        /* SigmaTel reference board */
    17071708        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668, "DFI LanParty", STAC_REF),
     
    17271728
    17281729static const struct hda_pintbl ref92hd73xx_pin_configs[] = {
     1730        // Port A-H
    17291731        { 0x0a, 0x02214030 },
    17301732        { 0x0b, 0x02a19040 },
     
    17351737        { 0x10, 0x01014020 },
    17361738        { 0x11, 0x01014030 },
     1739        // CD in
    17371740        { 0x12, 0x02319040 },
     1741        // Digial Mic ins
    17381742        { 0x13, 0x90a000f0 },
    17391743        { 0x14, 0x90a000f0 },
     1744        // Digital outs
    17401745        { 0x22, 0x01452050 },
    17411746        { 0x23, 0x01452050 },
     
    17781783
    17791784static const struct hda_pintbl intel_dg45id_pin_configs[] = {
     1785        // Analog outputs
    17801786        { 0x0a, 0x02214230 },
    17811787        { 0x0b, 0x02A19240 },
     
    17851791        { 0x0f, 0x01011212 },
    17861792        { 0x10, 0x01016211 },
     1793        // Digital output
     1794        { 0x22, 0x01451380 },
     1795        { 0x23, 0x40f000f0 },
    17871796        {0}
    17881797};
     
    19841993};
    19851994
    1986 static const struct snd_pci_quirk stac92hd73xx_fixup_tbl[] = {
     1995static const struct hda_quirk stac92hd73xx_fixup_tbl[] = {
    19871996        /* SigmaTel reference board */
    19881997        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    19901999        SND_PCI_QUIRK(PCI_VENDOR_ID_DFI, 0x3101,
    19912000                                "DFI LanParty", STAC_92HD73XX_REF),
     2001        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5001,
     2002                                "Intel DP45SG", STAC_92HD73XX_INTEL),
    19922003        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5002,
    19932004                                "Intel DG45ID", STAC_92HD73XX_INTEL),
     
    28002811};
    28012812
    2802 static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
     2813static const struct hda_quirk stac92hd83xxx_fixup_tbl[] = {
    28032814        /* SigmaTel reference board */
    28042815        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    32833294};
    32843295
    3285 static const struct snd_pci_quirk stac92hd71bxx_fixup_tbl[] = {
     3296static const struct hda_quirk stac92hd71bxx_fixup_tbl[] = {
    32863297        /* SigmaTel reference board */
    32873298        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    35433554
    35443555/* codec SSIDs for Intel Mac sharing the same PCI SSID 8384:7680 */
    3545 static const struct snd_pci_quirk stac922x_intel_mac_fixup_tbl[] = {
     3556static const struct hda_quirk stac922x_intel_mac_fixup_tbl[] = {
    35463557        SND_PCI_QUIRK(0x0000, 0x0100, "Mac Mini", STAC_INTEL_MAC_V3),
    35473558        SND_PCI_QUIRK(0x106b, 0x0800, "Mac", STAC_INTEL_MAC_V1),
     
    36873698};
    36883699
    3689 static const struct snd_pci_quirk stac922x_fixup_tbl[] = {
     3700static const struct hda_quirk stac922x_fixup_tbl[] = {
    36903701        /* SigmaTel reference board */
    36913702        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    40504061};
    40514062
    4052 static const struct snd_pci_quirk stac927x_fixup_tbl[] = {
     4063static const struct hda_quirk stac927x_fixup_tbl[] = {
    40534064        /* SigmaTel reference board */
    40544065        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    42604271};
    42614272
    4262 static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
     4273static const struct hda_quirk stac9205_fixup_tbl[] = {
    42634274        /* SigmaTel reference board */
    42644275        SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
     
    43484359};
    43494360
    4350 static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = {
     4361static const struct hda_quirk stac92hd95_fixup_tbl[] = {
    43514362        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS),
    43524363        {0} /* terminator */
     
    44134424                        /* IDT/STAC codecs have linear beep tone parameter */
    44144425                        codec->beep->linear_tone = spec->linear_tone_beep;
     4426                        /* keep power up while beep is enabled */
     4427                        codec->beep->keep_power_at_enable = 1;
    44154428                        /* if no beep switch is available, make its own one */
    44164429                        caps = query_amp_caps(codec, nid, HDA_OUTPUT);
     
    45454558        return 0;
    45464559}
     4560
     4561static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid)
     4562{
     4563#ifdef CONFIG_SND_HDA_INPUT_BEEP
     4564        struct sigmatel_spec *spec = codec->spec;
     4565#endif
     4566        int ret = snd_hda_gen_check_power_status(codec, nid);
     4567
     4568#ifdef CONFIG_SND_HDA_INPUT_BEEP
     4569        if (nid == spec->gen.beep_nid && codec->beep) {
     4570                if (codec->beep->enabled != spec->beep_power_on) {
     4571                        spec->beep_power_on = codec->beep->enabled;
     4572                        if (spec->beep_power_on)
     4573                                snd_hda_power_up_pm(codec);
     4574                        else
     4575                                snd_hda_power_down_pm(codec);
     4576                }
     4577                ret |= spec->beep_power_on;
     4578        }
     4579#endif
     4580        return ret;
     4581}
    45474582#else
    45484583#define stac_suspend            NULL
     
    45574592#ifdef CONFIG_PM
    45584593        .suspend = stac_suspend,
     4594        .check_power_status = stac_check_power_status,
    45594595#endif
    45604596};
     
    51015137};
    51025138
    5103 static const struct snd_pci_quirk stac9872_fixup_tbl[] = {
     5139static const struct hda_quirk stac9872_fixup_tbl[] = {
    51045140        SND_PCI_QUIRK_MASK(0x104d, 0xfff0, 0x81e0,
    51055141                           "Sony VAIO F/S", STAC_9872_VAIO),
  • GPL/trunk/alsa-kernel/pci/hda/patch_via.c

    r717 r772  
    458458                snd_hda_codec_set_pincfg(codec, nid, def_conf);
    459459        }
    460 
    461         return;
    462460}
    463461
     
    830828        nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn,
    831829                                       ARRAY_SIZE(conn) - 1);
     830        if (nums < 0)
     831                return nums;
     832
    832833        for (i = 0; i < nums; i++) {
    833834                if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT)
     
    10621063};
    10631064
    1064 static const struct snd_pci_quirk vt2002p_fixups[] = {
     1065static const struct hda_quirk vt2002p_fixups[] = {
    10651066        SND_PCI_QUIRK(0x1043, 0x13f7, "Asus B23E", VIA_FIXUP_POWER_SAVE),
    10661067        SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
Note: See TracChangeset for help on using the changeset viewer.