Ignore:
Timestamp:
Sep 26, 2021, 6:18:40 PM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

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

    r689 r703  
    170170        struct hda_codec *codec = dev_to_hda_codec(dev);
    171171
    172         if (!pm_runtime_suspended(dev) && codec->patch_ops.reboot_notify)
    173                 codec->patch_ops.reboot_notify(codec);
     172        if (!pm_runtime_suspended(dev)) {
     173                if (codec->patch_ops.reboot_notify)
     174                        codec->patch_ops.reboot_notify(codec);
     175                snd_hda_codec_display_power(codec, false);
     176        }
    174177}
    175178
  • GPL/trunk/alsa-kernel/pci/hda/hda_codec.c

    r695 r703  
    809809
    810810/* enable/disable display power per codec */
    811 static void codec_display_power(struct hda_codec *codec, bool enable)
     811void snd_hda_codec_display_power(struct hda_codec *codec, bool enable)
    812812{
    813813        if (codec->display_power_control)
     
    821821                return;
    822822        if (device_is_registered(hda_codec_dev(codec))) {
    823                 codec_display_power(codec, true);
     823                snd_hda_codec_display_power(codec, true);
    824824                pm_runtime_enable(hda_codec_dev(codec));
    825825                /* it was powered up in snd_hda_codec_new(), now all done */
     
    847847        if (codec->core.type == HDA_DEV_LEGACY)
    848848                snd_hdac_device_unregister(&codec->core);
    849         codec_display_power(codec, false);
     849        snd_hda_codec_display_power(codec, false);
    850850
    851851        /*
     
    29092909             (state & AC_PWRST_CLK_STOP_OK)))
    29102910                snd_hdac_codec_link_down(&codec->core);
    2911         codec_display_power(codec, false);
     2911        snd_hda_codec_display_power(codec, false);
    29122912        return 0;
    29132913}
     
    29212921                return 0;
    29222922
    2923         codec_display_power(codec, true);
     2923        snd_hda_codec_display_power(codec, true);
    29242924        snd_hdac_codec_link_up(&codec->core);
    29252925        hda_call_codec_resume(codec);
  • GPL/trunk/alsa-kernel/pci/hda/hda_generic.c

    r695 r703  
    14371437                }
    14381438                if (!path) {
    1439                         dac = dacs[i] = 0;
     1439                        dacs[i] = 0;
    14401440                        badness += bad->no_dac;
    14411441                } else {
     
    34723472        const struct hda_input_mux *imux;
    34733473        struct nid_path *path;
    3474         int i, adc_idx, err = 0;
     3474        int i, adc_idx, ret, err = 0;
    34753475
    34763476        imux = &spec->input_mux;
     
    34823482                        continue;
    34833483                kcontrol->private_value = path->ctls[type];
    3484                 err = func(kcontrol, ucontrol);
    3485                 if (err < 0)
     3484                ret = func(kcontrol, ucontrol);
     3485                if (ret < 0) {
     3486                        err = ret;
    34863487                        break;
     3488                }
     3489                if (ret > 0)
     3490                        err = 1;
    34873491        }
    34883492        mutex_unlock(&codec->control_mutex);
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.c

    r695 r703  
    909909}
    910910
     911static void __azx_shutdown_chip(struct azx *chip, bool skip_link_reset)
     912{
     913        azx_stop_chip(chip);
     914        if (!skip_link_reset)
     915                azx_enter_link_reset(chip);
     916        azx_clear_irq_pending(chip);
     917        display_power(chip, false);
     918}
     919
    911920#ifdef CONFIG_PM
    912921static DEFINE_MUTEX(card_list_lock);
    913922static LIST_HEAD(card_list);
     923
     924static void azx_shutdown_chip(struct azx *chip)
     925{
     926        __azx_shutdown_chip(chip, false);
     927}
    914928
    915929static void azx_add_card_list(struct azx *chip)
     
    970984}
    971985
    972 static void __azx_runtime_suspend(struct azx *chip)
    973 {
    974         azx_stop_chip(chip);
    975         azx_enter_link_reset(chip);
    976         azx_clear_irq_pending(chip);
    977         display_power(chip, false);
    978 }
    979 
    980986static void __azx_runtime_resume(struct azx *chip)
    981987{
     
    10561062        chip = card->private_data;
    10571063        bus = azx_bus(chip);
    1058         __azx_runtime_suspend(chip);
     1064        azx_shutdown_chip(chip);
    10591065        if (bus->irq >= 0) {
    10601066                free_irq(bus->irq, chip);
     
    11361142        azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) | STATESTS_INT_MASK);
    11371143
    1138         __azx_runtime_suspend(chip);
     1144        azx_shutdown_chip(chip);
    11391145        trace_azx_runtime_suspend(chip);
    11401146        return 0;
     
    24352441        chip = card->private_data;
    24362442        if (chip && chip->running)
    2437                 azx_stop_chip(chip);
     2443                __azx_shutdown_chip(chip, true);
    24382444}
    24392445
  • GPL/trunk/alsa-kernel/pci/hda/hda_local.h

    r695 r703  
    724724void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
    725725
     726void snd_hda_codec_display_power(struct hda_codec *codec, bool enable);
     727
    726728/*
    727729 */
  • GPL/trunk/alsa-kernel/pci/hda/hda_tegra.c

    r695 r703  
    236236        struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
    237237        struct hdac_bus *bus = azx_bus(chip);
    238         struct device *dev = hda->dev;
    239238        struct resource *res;
    240239
    241         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    242         hda->regs = devm_ioremap_resource(dev, res);
     240        hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
    243241        if (IS_ERR(hda->regs))
    244242                return PTR_ERR(hda->regs);
  • GPL/trunk/alsa-kernel/pci/hda/patch_ca0132.c

    r695 r703  
    76977697static void ca0132_alt_start_dsp_audio_streams(struct hda_codec *codec)
    76987698{
    7699         const unsigned int dsp_dma_stream_ids[] = { 0x0c, 0x03, 0x04 };
     7699        static const unsigned int dsp_dma_stream_ids[] = { 0x0c, 0x03, 0x04 };
    77007700        struct ca0132_spec *spec = codec->spec;
    77017701        unsigned int i, tmp;
  • GPL/trunk/alsa-kernel/pci/hda/patch_hdmi.c

    r695 r703  
    19491949        SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
    19501950        SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
     1951        SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1),
    19511952        {}
    19521953};
  • GPL/trunk/alsa-kernel/pci/hda/patch_realtek.c

    r695 r703  
    36973697        ALC269_TYPE_ALC215,
    36983698        ALC269_TYPE_ALC225,
     3699        ALC269_TYPE_ALC287,
    36993700        ALC269_TYPE_ALC294,
    37003701        ALC269_TYPE_ALC300,
     
    37333734        case ALC269_TYPE_ALC215:
    37343735        case ALC269_TYPE_ALC225:
     3736        case ALC269_TYPE_ALC287:
    37353737        case ALC269_TYPE_ALC294:
    37363738        case ALC269_TYPE_ALC300:
     
    42054207}
    42064208
     4209static void alc285_hp_init(struct hda_codec *codec)
     4210{
     4211        struct alc_spec *spec = codec->spec;
     4212        hda_nid_t hp_pin = alc_get_hp_pin(spec);
     4213        int i, val;
     4214        int coef38, coef0d, coef36;
     4215
     4216        alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
     4217        coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
     4218        coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
     4219        coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
     4220        alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
     4221        alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
     4222
     4223        alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
     4224
     4225        if (hp_pin)
     4226                snd_hda_codec_write(codec, hp_pin, 0,
     4227                            AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
     4228
     4229        msleep(130);
     4230        alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
     4231        alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
     4232
     4233        if (hp_pin)
     4234                snd_hda_codec_write(codec, hp_pin, 0,
     4235                            AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
     4236        msleep(10);
     4237        alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
     4238        alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
     4239        alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
     4240        alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
     4241
     4242        alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
     4243        val = alc_read_coefex_idx(codec, 0x58, 0x00);
     4244        for (i = 0; i < 20 && val & 0x8000; i++) {
     4245                msleep(50);
     4246                val = alc_read_coefex_idx(codec, 0x58, 0x00);
     4247        } /* Wait for depop procedure finish  */
     4248
     4249        alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
     4250        alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
     4251        alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
     4252        alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
     4253
     4254        msleep(50);
     4255        alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
     4256}
     4257
    42074258static void alc225_init(struct hda_codec *codec)
    42084259{
     
    42104261        hda_nid_t hp_pin = alc_get_hp_pin(spec);
    42114262        bool hp1_pin_sense, hp2_pin_sense;
     4263
     4264        if (spec->codec_variant != ALC269_TYPE_ALC287)
     4265                /* required only at boot or S3 and S4 resume time */
     4266#ifndef TARGET_OS2
     4267                if (!spec->done_hp_init ||
     4268                        is_s3_resume(codec) ||
     4269                        is_s4_resume(codec)) {
     4270#else
     4271                if (!spec->done_hp_init ) {
     4272
     4273#endif
     4274                        alc285_hp_init(codec);
     4275                        spec->done_hp_init = true;
     4276                }
    42124277
    42134278        if (!hp_pin)
     
    72897354        ALC623_FIXUP_LENOVO_THINKSTATION_P340,
    72907355        ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
     7356        ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
    72917357};
    72927358
     
    91849250        },
    91859251#endif
     9252        [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
     9253                .type = HDA_FIXUP_FUNC,
     9254                .v.func = alc269_fixup_limit_int_mic_boost,
     9255                .chained = true,
     9256                .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
     9257        },
    91869258};
    91879259
     
    92749346        SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
    92759347        SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
     9348        SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
    92769349        SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
    92779350        SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
     
    93729445        SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
    93739446        SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
     9447        SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
    93749448        SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
     9449        SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
    93759450        SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
    93769451        SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
     
    93789453        SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
    93799454        SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
    9380         SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
    9381         SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     9455        SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
     9456        SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    93829457        SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
    93839458        SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
     
    94079482        SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
    94089483        SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
     9484        SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
    94099485        SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
    94109486        SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
     
    94639539        SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
    94649540        SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9465         SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     9541        SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    94669542        SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    94679543        SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    94989574        SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    94999575        SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9500         SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9501         SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9502         SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
    9503         SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
    9504         SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
     9576        SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     9577        SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     9578        SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
     9579        SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
     9580        SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
    95059581        SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    95069582        SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    95139589        SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    95149590        SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9515         SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    9516         SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     9591        SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     9592        SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    95179593        SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    95189594        SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1040110477        case 0x10ec0245:
    1040210478        case 0x10ec0285:
    10403         case 0x10ec0287:
    1040410479        case 0x10ec0289:
    1040510480                spec->codec_variant = ALC269_TYPE_ALC215;
     
    1041510490                spec->init_hook = alc225_init;
    1041610491                spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
     10492                break;
     10493        case 0x10ec0287:
     10494                spec->codec_variant = ALC269_TYPE_ALC287;
     10495                spec->shutup = alc225_shutup;
     10496                spec->init_hook = alc225_init;
     10497                spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
    1041710498                break;
    1041810499        case 0x10ec0234:
     
    1045210533        snd_hda_pick_fixup(codec, alc269_fixup_models,
    1045310534                       alc269_fixup_tbl, alc269_fixups);
     10535        /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
     10536         * the quirk breaks the latter (bko#214101).
     10537         * Clear the wrong entry.
     10538         */
     10539        if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
     10540            codec->core.vendor_id == 0x10ec0294) {
     10541                codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
     10542                codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
     10543        }
     10544
    1045410545        snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
    1045510546        snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
  • GPL/trunk/alsa-kernel/pci/hda/patch_via.c

    r679 r703  
    10631063
    10641064static const struct snd_pci_quirk vt2002p_fixups[] = {
     1065        SND_PCI_QUIRK(0x1043, 0x13f7, "Asus B23E", VIA_FIXUP_POWER_SAVE),
    10651066        SND_PCI_QUIRK(0x1043, 0x1487, "Asus G75", VIA_FIXUP_ASUS_G75),
    10661067        SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST),
Note: See TracChangeset for help on using the changeset viewer.