Changeset 757


Ignore:
Timestamp:
Mar 11, 2023, 11:24:27 PM (2 years ago)
Author:
Paul Smedley
Message:

Update linux sound source to v6.1.18

Location:
GPL/branches/uniaud32-exp
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-exp/alsa-kernel/core/control.c

    r755 r757  
    12161216        int ret;
    12171217
     1218        down_read(&card->controls_rwsem);
    12181219        kctl = snd_ctl_find_id(card, &control->id);
    1219         if (kctl == NULL)
    1220                 return -ENOENT;
     1220        if (kctl == NULL) {
     1221                ret = -ENOENT;
     1222                goto unlock;
     1223        }
    12211224
    12221225        index_offset = snd_ctl_get_ioff(kctl, &control->id);
    12231226        vd = &kctl->vd[index_offset];
    1224         if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
    1225                 return -EPERM;
     1227        if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) {
     1228                ret = -EPERM;
     1229                goto unlock;
     1230        }
    12261231
    12271232        snd_ctl_build_ioff(&control->id, kctl, index_offset);
     
    12331238        ret = __snd_ctl_elem_info(card, kctl, &info, NULL);
    12341239        if (ret < 0)
    1235                 return ret;
     1240                goto unlock;
    12361241#endif
    12371242
     
    12431248        snd_power_unref(card);
    12441249        if (ret < 0)
    1245                 return ret;
     1250                goto unlock;
    12461251        if (!snd_ctl_skip_validation(&info) &&
    12471252            sanity_check_elem_value(card, control, &info, pattern) < 0) {
     
    12511256                        control->id.subdevice, control->id.name,
    12521257                        control->id.index);
    1253                 return -EINVAL;
    1254         }
     1258                ret = -EINVAL;
     1259                goto unlock;
     1260        }
     1261unlock:
     1262        up_read(&card->controls_rwsem);
    12551263        return ret;
    12561264}
     
    12661274                return PTR_ERR(control);
    12671275
    1268         down_read(&card->controls_rwsem);
    12691276        result = snd_ctl_elem_read(card, control);
    1270         up_read(&card->controls_rwsem);
    12711277        if (result < 0)
    12721278                goto error;
  • GPL/branches/uniaud32-exp/alsa-kernel/core/pcm_native.c

    r756 r757  
    14601460                               snd_pcm_state_t state)
    14611461{
    1462         if (substream->runtime->trigger_master == substream)
     1462        if (substream->runtime->trigger_master == substream) {
    14631463                substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP);
     1464                substream->runtime->stop_operating = true;
     1465        }
    14641466}
    14651467
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/hda_codec.h

    r756 r757  
    259259        unsigned int relaxed_resume:1;  /* don't resume forcibly for jack */
    260260        unsigned int forced_resume:1; /* forced resume for jack */
     261        unsigned int no_stream_clean_at_suspend:1; /* do not clean streams at suspend */
     262        unsigned int ctl_dev_id:1; /* old control element id build behaviour */
    261263
    262264#ifdef CONFIG_PM
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/pcm.h

    r756 r757  
    107107
    108108/* If you change this don't forget to change rates[] table in pcm_native.c */
    109 #define SNDRV_PCM_RATE_5512             (1<<0)          /* 5512Hz */
    110 #define SNDRV_PCM_RATE_8000             (1<<1)          /* 8000Hz */
    111 #define SNDRV_PCM_RATE_11025            (1<<2)          /* 11025Hz */
    112 #define SNDRV_PCM_RATE_16000            (1<<3)          /* 16000Hz */
    113 #define SNDRV_PCM_RATE_22050            (1<<4)          /* 22050Hz */
    114 #define SNDRV_PCM_RATE_32000            (1<<5)          /* 32000Hz */
    115 #define SNDRV_PCM_RATE_44100            (1<<6)          /* 44100Hz */
    116 #define SNDRV_PCM_RATE_48000            (1<<7)          /* 48000Hz */
    117 #define SNDRV_PCM_RATE_64000            (1<<8)          /* 64000Hz */
    118 #define SNDRV_PCM_RATE_88200            (1<<9)          /* 88200Hz */
    119 #define SNDRV_PCM_RATE_96000            (1<<10)         /* 96000Hz */
    120 #define SNDRV_PCM_RATE_176400           (1<<11)         /* 176400Hz */
    121 #define SNDRV_PCM_RATE_192000           (1<<12)         /* 192000Hz */
    122 #define SNDRV_PCM_RATE_352800           (1<<13)         /* 352800Hz */
    123 #define SNDRV_PCM_RATE_384000           (1<<14)         /* 384000Hz */
    124 
    125 #define SNDRV_PCM_RATE_CONTINUOUS       (1<<30)         /* continuous range */
    126 #define SNDRV_PCM_RATE_KNOT             (1<<31)         /* supports more non-continuos rates */
     109#define SNDRV_PCM_RATE_5512             (1U<<0)         /* 5512Hz */
     110#define SNDRV_PCM_RATE_8000             (1U<<1)         /* 8000Hz */
     111#define SNDRV_PCM_RATE_11025            (1U<<2)         /* 11025Hz */
     112#define SNDRV_PCM_RATE_16000            (1U<<3)         /* 16000Hz */
     113#define SNDRV_PCM_RATE_22050            (1U<<4)         /* 22050Hz */
     114#define SNDRV_PCM_RATE_32000            (1U<<5)         /* 32000Hz */
     115#define SNDRV_PCM_RATE_44100            (1U<<6)         /* 44100Hz */
     116#define SNDRV_PCM_RATE_48000            (1U<<7)         /* 48000Hz */
     117#define SNDRV_PCM_RATE_64000            (1U<<8)         /* 64000Hz */
     118#define SNDRV_PCM_RATE_88200            (1U<<9)         /* 88200Hz */
     119#define SNDRV_PCM_RATE_96000            (1U<<10)        /* 96000Hz */
     120#define SNDRV_PCM_RATE_176400           (1U<<11)        /* 176400Hz */
     121#define SNDRV_PCM_RATE_192000           (1U<<12)        /* 192000Hz */
     122#define SNDRV_PCM_RATE_352800           (1U<<13)        /* 352800Hz */
     123#define SNDRV_PCM_RATE_384000           (1U<<14)        /* 384000Hz */
     124
     125#define SNDRV_PCM_RATE_CONTINUOUS       (1U<<30)        /* continuous range */
     126#define SNDRV_PCM_RATE_KNOT             (1U<<31)        /* supports more non-continuos rates */
    127127
    128128#define SNDRV_PCM_RATE_8000_44100       (SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_11025|\
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/soc-dapm.h

    r738 r757  
    1717
    1818struct device;
     19struct snd_pcm_substream;
    1920struct snd_soc_pcm_runtime;
    2021struct soc_enum;
  • GPL/branches/uniaud32-exp/alsa-kernel/include/sound/version.h

    r756 r757  
    11/* include/version.h */
    2 #define CONFIG_SND_VERSION "6.1.0"
     2#define CONFIG_SND_VERSION "6.1.18"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/uniaud32-exp/alsa-kernel/include/uapi/sound/asequencer.h

    r756 r757  
    348348                       
    349349        /* event filter flags */
    350 #define SNDRV_SEQ_FILTER_BROADCAST      (1<<0)  /* accept broadcast messages */
    351 #define SNDRV_SEQ_FILTER_MULTICAST      (1<<1)  /* accept multicast messages */
    352 #define SNDRV_SEQ_FILTER_BOUNCE         (1<<2)  /* accept bounce event in error */
    353 #define SNDRV_SEQ_FILTER_USE_EVENT      (1<<31) /* use event filter */
     350#define SNDRV_SEQ_FILTER_BROADCAST      (1U<<0) /* accept broadcast messages */
     351#define SNDRV_SEQ_FILTER_MULTICAST      (1U<<1) /* accept multicast messages */
     352#define SNDRV_SEQ_FILTER_BOUNCE         (1U<<2) /* accept bounce event in error */
     353#define SNDRV_SEQ_FILTER_USE_EVENT      (1U<<31)        /* use event filter */
    354354
    355355struct snd_seq_client_info {
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_bind.c

    r750 r757  
    147147 error:
    148148        snd_hda_codec_cleanup_for_unbind(codec);
     149        codec->preset = NULL;
    149150        return err;
    150151}
     
    169170                codec->patch_ops.free(codec);
    170171        snd_hda_codec_cleanup_for_unbind(codec);
     172        codec->preset = NULL;
    171173        module_put(dev->driver->owner);
    172174        return 0;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_codec.c

    r756 r757  
    808808        snd_array_free(&codec->spdif_out);
    809809        snd_array_free(&codec->verbs);
    810         codec->preset = NULL;
    811810        codec->follower_dig_outs = NULL;
    812811        codec->spdif_status_reset = 0;
     
    941940        codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
    942941        codec->core.dev.release = snd_hda_codec_dev_release;
    943         codec->core.exec_verb = codec_exec_verb;
    944942        codec->core.type = HDA_DEV_LEGACY;
    945943
     
    10121010                return -EINVAL;
    10131011
     1012        codec->core.exec_verb = codec_exec_verb;
    10141013        codec->card = card;
    10151014        codec->addr = codec_addr;
     
    29042903        if (codec->patch_ops.suspend)
    29052904                codec->patch_ops.suspend(codec);
    2906         hda_cleanup_all_streams(codec);
     2905        if (!codec->no_stream_clean_at_suspend)
     2906                hda_cleanup_all_streams(codec);
    29072907        state = hda_set_power_state(codec, AC_PWRST_D3);
    29082908        update_power_acct(codec, true);
     
    34093409                        if (!kctl)
    34103410                                return -ENOMEM;
    3411                         if (addr > 0)
     3411                        /* Do not use the id.device field for MIXER elements.
     3412                         * This field is for real device numbers (like PCM) but codecs
     3413                         * are hidden components from the user space view (unrelated
     3414                         * to the mixer element identification).
     3415                         */
     3416                        if (addr > 0 && codec->ctl_dev_id)
    34123417                                kctl->id.device = addr;
    34133418                        if (idx > 0)
     
    34203425                         * primary codec), then try another control index
    34213426                         */
    3422                         if (!addr && codec->core.addr)
     3427                        if (!addr && codec->core.addr) {
    34233428                                addr = codec->core.addr;
    3424                         else if (!idx && !knew->index) {
     3429                                if (!codec->ctl_dev_id)
     3430                                        idx += 10 * addr;
     3431                        } else if (!idx && !knew->index) {
    34253432                                idx = find_empty_mixer_ctl_idx(codec,
    34263433                                                               knew->name, 0);
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.c

    r756 r757  
    12611261                        codec->jackpoll_interval = chip->jackpoll_interval;
    12621262                        codec->beep_mode = chip->beep_mode;
     1263                        codec->ctl_dev_id = chip->ctl_dev_id;
    12631264                        codecs++;
    12641265                }
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_controller.h

    r710 r757  
    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/branches/uniaud32-exp/alsa-kernel/pci/hda/hda_intel.c

    r756 r757  
    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>
     
    136137#endif
    137138static 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
    138144
    139145module_param_array(index, int, NULL, 0444);
     
    174180                             "(0=off, 1=on) (default=1); "
    175181                 "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).");
    176184
    177185#ifdef CONFIG_PM
     
    14971505                                 */
    14981506                                if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
    1499                                     atpx_present())
     1507                                    (atpx_present() || apple_gmux_detect(NULL, NULL)))
    15001508                                        return p;
    15011509                                pci_dev_put(p);
     
    23292337        chip->beep_mode = beep_mode[dev];
    23302338#endif
     2339
     2340        chip->ctl_dev_id = ctl_dev_id;
    23312341
    23322342        /* create codec instances */
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_ca0132.c

    r756 r757  
    24612461{
    24622462        int status = 0;
    2463         unsigned int size = sizeof(dma_chan);
     2463        unsigned int size = sizeof(*dma_chan);
    24642464
    24652465        codec_dbg(codec, "     dspio_alloc_dma_chan() -- begin\n");
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_conexant.c

    r741 r757  
    11881188        HDA_CODEC_ENTRY(0x14f12008, "CX8200", patch_conexant_auto),
    11891189        HDA_CODEC_ENTRY(0x14f120d0, "CX11970", patch_conexant_auto),
     1190        HDA_CODEC_ENTRY(0x14f120d1, "SN6180", patch_conexant_auto),
    11901191        HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto),
    11911192        HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto),
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_hdmi.c

    r756 r757  
    180180
    181181        bool dyn_pin_out;
     182        bool static_pcm_mapping;
    182183        /* hdmi interrupt trigger control flag for Nvidia codec */
    183184        bool hdmi_intr_trig_ctrl;
     
    15421543        pcm_jack = pin_idx_to_pcm_jack(codec, per_pin);
    15431544
    1544         if (eld->eld_valid) {
    1545                 hdmi_attach_hda_pcm(spec, per_pin);
    1546                 hdmi_pcm_setup_pin(spec, per_pin);
    1547         } else {
    1548                 hdmi_pcm_reset_pin(spec, per_pin);
    1549                 hdmi_detach_hda_pcm(spec, per_pin);
    1550         }
     1545        if (!spec->static_pcm_mapping) {
     1546                if (eld->eld_valid) {
     1547                        hdmi_attach_hda_pcm(spec, per_pin);
     1548                        hdmi_pcm_setup_pin(spec, per_pin);
     1549                } else {
     1550                        hdmi_pcm_reset_pin(spec, per_pin);
     1551                        hdmi_detach_hda_pcm(spec, per_pin);
     1552                }
     1553        }
     1554
    15511555        /* if pcm_idx == -1, it means this is in monitor connection event
    15521556         * we can get the correct pcm_idx now.
     
    17551759        switch (spec->silent_stream_type) {
    17561760        case SILENT_STREAM_KAE:
     1761                silent_stream_enable_i915(codec, per_pin);
    17571762                silent_stream_set_kae(codec, per_pin, true);
    17581763                break;
     
    19921997        SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1),
    19931998        SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
     1999        SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),
     2000        SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1),
    19942001        SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
    19952002        SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1),
     
    22962303        int idx, pcm_num;
    22972304
    2298         /* limit the PCM devices to the codec converters */
    2299         pcm_num = spec->num_cvts;
     2305        /* limit the PCM devices to the codec converters or available PINs */
     2306        pcm_num = min(spec->num_cvts, spec->num_pins);
    23002307        codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
    23012308
     
    23932400                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
    23942401                struct hdmi_eld *pin_eld = &per_pin->sink_eld;
     2402
     2403                if (spec->static_pcm_mapping) {
     2404                        hdmi_attach_hda_pcm(spec, per_pin);
     2405                        hdmi_pcm_setup_pin(spec, per_pin);
     2406                }
    23952407
    23962408                pin_eld->eld_valid = false;
     
    28992911                                 int format)
    29002912{
     2913        struct hdmi_spec *spec = codec->spec;
     2914        int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id);
     2915        struct hdmi_spec_per_pin *per_pin;
     2916        int res;
     2917
     2918        if (pin_idx < 0)
     2919                per_pin = NULL;
     2920        else
     2921                per_pin = get_pin(spec, pin_idx);
     2922
    29012923        haswell_verify_D0(codec, cvt_nid, pin_nid);
    2902         return hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
    2903                                  stream_tag, format);
     2924
     2925        if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
     2926                silent_stream_set_kae(codec, per_pin, false);
     2927                /* wait for pending transfers in codec to clear */
     2928                usleep_range(100, 200);
     2929        }
     2930
     2931        res = hdmi_setup_stream(codec, cvt_nid, pin_nid, dev_id,
     2932                                stream_tag, format);
     2933
     2934        if (spec->silent_stream_type == SILENT_STREAM_KAE && per_pin && per_pin->silent_stream) {
     2935                usleep_range(100, 200);
     2936                silent_stream_set_kae(codec, per_pin, true);
     2937        }
     2938
     2939        return res;
    29042940}
    29052941
     
    29202956        }
    29212957}
     2958
     2959#ifdef CONFIG_PM
     2960static int i915_adlp_hdmi_suspend(struct hda_codec *codec)
     2961{
     2962        struct hdmi_spec *spec = codec->spec;
     2963        bool silent_streams = false;
     2964        int pin_idx, res;
     2965
     2966        res = generic_hdmi_suspend(codec);
     2967
     2968        for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
     2969                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
     2970
     2971                if (per_pin->silent_stream) {
     2972                        silent_streams = true;
     2973                        break;
     2974                }
     2975        }
     2976
     2977        if (silent_streams && spec->silent_stream_type == SILENT_STREAM_KAE) {
     2978                /*
     2979                 * stream-id should remain programmed when codec goes
     2980                 * to runtime suspend
     2981                 */
     2982                codec->no_stream_clean_at_suspend = 1;
     2983
     2984                /*
     2985                 * the system might go to S3, in which case keep-alive
     2986                 * must be reprogrammed upon resume
     2987                 */
     2988                codec->forced_resume = 1;
     2989
     2990                codec_dbg(codec, "HDMI: KAE active at suspend\n");
     2991        } else {
     2992                codec->no_stream_clean_at_suspend = 0;
     2993                codec->forced_resume = 0;
     2994        }
     2995
     2996        return res;
     2997}
     2998
     2999static int i915_adlp_hdmi_resume(struct hda_codec *codec)
     3000{
     3001        struct hdmi_spec *spec = codec->spec;
     3002        int pin_idx, res;
     3003
     3004        res = generic_hdmi_resume(codec);
     3005
     3006        /* KAE not programmed at suspend, nothing to do here */
     3007        if (!codec->no_stream_clean_at_suspend)
     3008                return res;
     3009
     3010        for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
     3011                struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
     3012
     3013                /*
     3014                 * If system was in suspend with monitor connected,
     3015                 * the codec setting may have been lost. Re-enable
     3016                 * keep-alive.
     3017                 */
     3018                if (per_pin->silent_stream) {
     3019                        unsigned int param;
     3020
     3021                        param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0,
     3022                                                   AC_VERB_GET_CONV, 0);
     3023                        if (!param) {
     3024                                codec_dbg(codec, "HDMI: KAE: restore stream id\n");
     3025                                silent_stream_enable_i915(codec, per_pin);
     3026                        }
     3027
     3028                        param = snd_hda_codec_read(codec, per_pin->cvt_nid, 0,
     3029                                                   AC_VERB_GET_DIGI_CONVERT_1, 0);
     3030                        if (!(param & (AC_DIG3_KAE << 16))) {
     3031                                codec_dbg(codec, "HDMI: KAE: restore DIG3_KAE\n");
     3032                                silent_stream_set_kae(codec, per_pin, true);
     3033                        }
     3034                }
     3035        }
     3036
     3037        return res;
     3038}
     3039#endif
    29223040
    29233041/* precondition and allocation for Intel codecs */
     
    30513169                spec = codec->spec;
    30523170
    3053                 if (spec->silent_stream_type)
     3171                if (spec->silent_stream_type) {
    30543172                        spec->silent_stream_type = SILENT_STREAM_KAE;
     3173
     3174#ifdef CONFIG_PM
     3175                        codec->patch_ops.resume = i915_adlp_hdmi_resume;
     3176                        codec->patch_ops.suspend = i915_adlp_hdmi_suspend;
     3177#endif
     3178                }
    30553179        }
    30563180
     
    43254449
    43264450        spec = codec->spec;
     4451
     4452        spec->static_pcm_mapping = true;
    43274453
    43284454        spec->ops.pin_get_eld = atihdmi_pin_get_eld;
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_realtek.c

    r756 r757  
    844844                        break;
    845845                case 7:
    846                         alc_setup_gpio(codec, 0x03);
     846                        alc_setup_gpio(codec, 0x04);
    847847                        break;
    848848                case 5:
     
    42144214        bool hp_pin_sense;
    42154215
    4216         if (!hp_pin)
    4217                 hp_pin = 0x21;
    4218 
    4219         msleep(30);
    4220 
    4221         hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
    4222 
    4223         if (hp_pin_sense)
    4224                 msleep(2);
    4225 
    4226         alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    42274216        if (spec->ultra_low_power) {
    42284217                alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
     
    42334222                msleep(30);
    42344223        }
     4224
     4225        if (!hp_pin)
     4226                hp_pin = 0x21;
     4227
     4228        msleep(30);
     4229
     4230        hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
     4231
     4232        if (hp_pin_sense)
     4233                msleep(2);
     4234
     4235        alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    42354236
    42364237        snd_hda_codec_write(codec, hp_pin, 0,
     
    43634364        bool hp1_pin_sense, hp2_pin_sense;
    43644365
     4366        if (spec->ultra_low_power) {
     4367                alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
     4368                alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
     4369                alc_update_coef_idx(codec, 0x33, 1<<11, 0);
     4370                msleep(30);
     4371        }
     4372
    43654373        if (spec->codec_variant != ALC269_TYPE_ALC287 &&
    43664374                spec->codec_variant != ALC269_TYPE_ALC245)
     
    43894397
    43904398        alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
    4391         if (spec->ultra_low_power) {
    4392                 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
    4393                 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
    4394                 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
    4395                 msleep(30);
    4396         }
    43974399
    43984400        if (hp1_pin_sense || spec->ultra_low_power)
     
    53305332}
    53315333
     5334static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
     5335                                const struct hda_fixup *fix, int action)
     5336{
     5337        struct alc_spec *spec = codec->spec;
     5338
     5339        if (action == HDA_FIXUP_ACT_PRE_PROBE)
     5340                spec->micmute_led_polarity = 1;
     5341        alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
     5342}
     5343
    53325344static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
    53335345                                const struct hda_fixup *fix, int action)
     
    53515363        alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
    53525364        alc285_fixup_hp_coef_micmute_led(codec, fix, action);
     5365}
     5366
     5367static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
     5368                                const struct hda_fixup *fix, int action)
     5369{
     5370        alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
     5371        alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
    53535372}
    53545373
     
    75957614        };
    75967615        struct alc_spec *spec = codec->spec;
     7616
     7617        switch (action) {
     7618        case HDA_FIXUP_ACT_PRE_PROBE:
     7619                snd_hda_apply_pincfgs(codec, pincfgs);
     7620                snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     7621                spec->gen.preferred_dacs = preferred_pairs;
     7622                break;
     7623        }
     7624}
     7625
     7626static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
     7627                                          const struct hda_fixup *fix, int action)
     7628{
     7629        static const struct hda_pintbl pincfgs[] = {
     7630                { 0x14, 0x90170151 },
     7631                { 0x17, 0x90170150 },
     7632                {0}
     7633        };
     7634        static const hda_nid_t conn[] = { 0x02, 0x03 };
     7635        static const hda_nid_t preferred_pairs[] = {
     7636                0x14, 0x02,
     7637                0x17, 0x03,
     7638                0x21, 0x02,
     7639                0
     7640        };
     7641        struct alc_spec *spec = codec->spec;
     7642
     7643        alc_fixup_no_shutup(codec, fix, action);
    75977644
    75987645        switch (action) {
     
    77807827        ALC285_FIXUP_HP_GPIO_LED,
    77817828        ALC285_FIXUP_HP_MUTE_LED,
     7829        ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
    77827830        ALC236_FIXUP_HP_GPIO_LED,
    77837831        ALC236_FIXUP_HP_MUTE_LED,
     
    78487896        ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
    78497897        ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
     7898        ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
     7899        ALC236_FIXUP_DELL_DUAL_CODECS,
    78507900};
    78517901
     
    94829532                .type = HDA_FIXUP_FUNC,
    94839533                .v.func = alc285_fixup_hp_mute_led,
     9534        },
     9535        [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
     9536                .type = HDA_FIXUP_FUNC,
     9537                .v.func = alc285_fixup_hp_spectre_x360_mute_led,
    94849538        },
    94859539        [ALC236_FIXUP_HP_GPIO_LED] = {
     
    1012110175                .chained = true,
    1012210176                .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
     10177        },
     10178        [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
     10179                .type = HDA_FIXUP_FUNC,
     10180                .v.func = alc295_fixup_dell_inspiron_top_speakers,
     10181                .chained = true,
     10182                .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
     10183        },
     10184        [ALC236_FIXUP_DELL_DUAL_CODECS] = {
     10185                .type = HDA_FIXUP_PINS,
     10186                .v.func = alc1220_fixup_gb_dual_codecs,
     10187                .chained = true,
     10188                .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
    1012310189        },
    1012410190};
     
    1016310229        SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
    1016410230        SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
     10231        SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
    1016510232        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
    1016610233        SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
     
    1022210289        SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
    1022310290        SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
     10291        SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     10292        SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     10293        SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
     10294        SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
     10295        SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
     10296        SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
     10297        SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
     10298        SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
     10299        SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
    1022410300        SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
    1022510301        SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    1030410380        SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
    1030510381        SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
     10382        SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
    1030610383        SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    1030710384        SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
     
    1037310450        SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1037410451        SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     10452        SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
    1037510453        SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    1037610454        SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
     
    1038110459        SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1038210460        SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10461        SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10462        SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10463        SND_PCI_QUIRK(0x103c, 0x8b44, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10464        SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10465        SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10466        SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10467        SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     10468        SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     10469        SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10470        SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10471        SND_PCI_QUIRK(0x103c, 0x8b87, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10472        SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10473        SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10474        SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED),
     10475        SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     10476        SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
    1038310477        SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    1038410478        SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
     
    1042610520        SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2),
    1042710521        SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
     10522        SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
    1042810523        SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
    1042910524        SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
     
    1046910564        SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
    1047010565        SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
     10566        SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
    1047110567        SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
    1047210568        SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
     
    1064710743        SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
    1064810744        SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
     10745        SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
    1064910746        SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
    1065010747        SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
     
    1203012127}
    1203112128
     12129static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
     12130                                     const struct hda_fixup *fix, int action)
     12131{
     12132        struct alc_spec *spec = codec->spec;
     12133
     12134        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     12135                spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
     12136                spec->gen.hp_automute_hook = alc897_hp_automute_hook;
     12137        }
     12138}
     12139
    1203212140static const struct coef_fw alc668_coefs[] = {
    1203312141        WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03,    0x0),
     
    1211312221        ALC897_FIXUP_HEADSET_MIC_PIN,
    1211412222        ALC897_FIXUP_HP_HSMIC_VERB,
     12223        ALC897_FIXUP_LENOVO_HEADSET_MODE,
     12224        ALC897_FIXUP_HEADSET_MIC_PIN2,
    1211512225};
    1211612226
     
    1272612836                        { }
    1272712837                },
     12838        },
     12839#endif
     12840        [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
     12841                .type = HDA_FIXUP_FUNC,
     12842                .v.func = alc897_fixup_lenovo_headset_mode,
     12843        },
     12844#ifdef NOT_USED
     12845        [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
     12846                .type = HDA_FIXUP_PINS,
     12847                .v.pins = (const struct hda_pintbl[]) {
     12848                        { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
     12849                        { }
     12850                },
     12851                .chained = true,
     12852                .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
    1272812853        },
    1272912854#endif
     
    1275312878        SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
    1275412879        SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
     12880        SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
    1275512881        SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
    1275612882        SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
     
    1278012906        SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
    1278112907        SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
     12908        SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
    1278212909        SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
    1278312910        SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
  • GPL/branches/uniaud32-exp/alsa-kernel/pci/hda/patch_via.c

    r739 r757  
    828828        nums = snd_hda_get_connections(codec, spec->gen.mixer_nid, conn,
    829829                                       ARRAY_SIZE(conn) - 1);
     830        if (nums < 0)
     831                return nums;
     832
    830833        for (i = 0; i < nums; i++) {
    831834                if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT)
  • GPL/branches/uniaud32-exp/alsa-kernel/synth/emux/emux_nrpn.c

    r697 r757  
    350350                    int param)
    351351{
     352        if (param >= ARRAY_SIZE(chan->control))
     353                return -EINVAL;
     354
    352355        return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
    353356                                     port, chan, param,
Note: See TracChangeset for help on using the changeset viewer.