Ignore:
Timestamp:
Apr 21, 2025, 7:17:25 PM (6 months ago)
Author:
David Azarewicz
Message:

Merge from uniaud32-exp branch

Location:
GPL/trunk
Files:
53 edited
1 copied

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/pci/ac97/ac97_codec.c

    r772 r777  
    30283028                result = apply_quirk_str(ac97, override);
    30293029                if (result < 0)
    3030                         snd_printk(KERN_ERR "applying quirk type %s failed (%d)\n", override, result);
     3030                        ac97_err(ac97, "applying quirk type %s failed (%d)\n",
     3031                                 override, result);
    30313032                return result;
    30323033        }
     
    30423043                        if (quirk->codec_id && quirk->codec_id != ac97->id)
    30433044                                continue;
    3044                         snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device);
     3045                        ac97_dbg(ac97, "ac97 quirk for %s (%04x:%04x)\n",
     3046                                 quirk->name, ac97->subsystem_vendor,
     3047                                 ac97->subsystem_device);
    30453048                        result = apply_quirk(ac97, quirk->type);
    30463049                        if (result < 0)
    3047                                 snd_printk(KERN_ERR "applying quirk type %d for %s failed (%d)\n", quirk->type, quirk->name, result);
     3050                                ac97_err(ac97,
     3051                                         "applying quirk type %d for %s failed (%d)\n",
     3052                                         quirk->type, quirk->name, result);
    30483053                        return result;
    30493054                }
  • GPL/trunk/alsa-kernel/pci/ac97/ac97_patch.c

    r772 r777  
    4242                      const unsigned int *tlv)
    4343{
    44         struct snd_ctl_elem_id sid;
    4544        struct snd_kcontrol *kctl;
    46         memset(&sid, 0, sizeof(sid));
    47         strcpy(sid.name, name);
    48         sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
    49         kctl = snd_ctl_find_id(ac97->bus->card, &sid);
     45
     46        kctl = snd_ctl_find_id_mixer(ac97->bus->card, name);
    5047        if (kctl && kctl->tlv.p)
    5148                kctl->tlv.p = tlv;
  • GPL/trunk/alsa-kernel/pci/ali5451/ali5451.c

    r717 r777  
    247247        spinlock_t      voice_alloc;
    248248
    249 #ifdef CONFIG_PM_SLEEP
    250         struct snd_ali_image *image;
    251 #endif
     249        struct snd_ali_image image;
    252250};
    253251
     
    18281826}
    18291827
    1830 #ifdef CONFIG_PM_SLEEP
    18311828static int ali_suspend(struct device *dev)
    18321829{
    18331830        struct snd_card *card = dev_get_drvdata(dev);
    18341831        struct snd_ali *chip = card->private_data;
    1835         struct snd_ali_image *im;
     1832        struct snd_ali_image *im = &chip->image;
    18361833        int i, j;
    1837 
    1838         im = chip->image;
    1839         if (!im)
    1840                 return 0;
    18411834
    18421835        snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
     
    18761869        struct snd_card *card = dev_get_drvdata(dev);
    18771870        struct snd_ali *chip = card->private_data;
    1878         struct snd_ali_image *im;
     1871        struct snd_ali_image *im = &chip->image;
    18791872        int i, j;
    1880 
    1881         im = chip->image;
    1882         if (!im)
    1883                 return 0;
    18841873
    18851874        spin_lock_irq(&chip->reg_lock);
     
    19121901}
    19131902
    1914 static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume);
    1915 #define ALI_PM_OPS      &ali_pm
    1916 #else
    1917 #define ALI_PM_OPS      NULL
    1918 #endif /* CONFIG_PM_SLEEP */
     1903static DEFINE_SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume);
    19191904
    19201905static void snd_ali_free(struct snd_card *card)
     
    21202105        }
    21212106
    2122 #ifdef CONFIG_PM_SLEEP
    2123         codec->image = devm_kmalloc(&pci->dev, sizeof(*codec->image),
    2124                                     GFP_KERNEL);
    2125         if (!codec->image)
    2126                 dev_warn(card->dev, "can't allocate apm buffer\n");
    2127 #endif
    2128 
    21292107        snd_ali_enable_address_interrupt(codec);
    21302108        codec->hw_initialized = 1;
     
    21892167        .probe = snd_ali_probe,
    21902168        .driver = {
    2191                 .pm = ALI_PM_OPS,
     2169                .pm = &ali_pm,
    21922170        },
    21932171};                               
  • GPL/trunk/alsa-kernel/pci/als4000.c

    r717 r777  
    940940}
    941941
    942 #ifdef CONFIG_PM_SLEEP
    943942static int snd_als4000_suspend(struct device *dev)
    944943{
     
    972971}
    973972
    974 static SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume);
    975 #define SND_ALS4000_PM_OPS      &snd_als4000_pm
    976 #else
    977 #define SND_ALS4000_PM_OPS      NULL
    978 #endif /* CONFIG_PM_SLEEP */
     973static DEFINE_SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume);
    979974
    980975static struct pci_driver als4000_driver = {
     
    983978        .probe = snd_card_als4000_probe,
    984979        .driver = {
    985                 .pm = SND_ALS4000_PM_OPS,
     980                .pm = &snd_als4000_pm,
    986981        },
    987982};
  • GPL/trunk/alsa-kernel/pci/atiixp.c

    r772 r777  
    530530}
    531531
    532 #ifdef CONFIG_PM_SLEEP
    533532static int snd_atiixp_aclink_down(struct atiixp *chip)
    534533{
     
    540539        return 0;
    541540}
    542 #endif
    543541
    544542/*
     
    14641462
    14651463
    1466 #ifdef CONFIG_PM_SLEEP
    14671464/*
    14681465 * power management
     
    15091506}
    15101507
    1511 static SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume);
    1512 #define SND_ATIIXP_PM_OPS       &snd_atiixp_pm
    1513 #else
    1514 #define SND_ATIIXP_PM_OPS       NULL
    1515 #endif /* CONFIG_PM_SLEEP */
    1516 
     1508static DEFINE_SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume);
    15171509
    15181510/*
     
    16471639        .probe = snd_atiixp_probe,
    16481640        .driver = {
    1649                 .pm = SND_ATIIXP_PM_OPS,
     1641                .pm = &snd_atiixp_pm,
    16501642        },
    16511643};
  • GPL/trunk/alsa-kernel/pci/au88x0/au88x0.c

    r772 r777  
    1111 * the ALSA part.
    1212 *   Thanks also to Sourceforge for maintaining the old binary drivers,
    13  * and the forum, where developers could comunicate.
     13 * and the forum, where developers could communicate.
    1414 *
    1515 * Now at least i can play Legacy DOOM with MIDI music :-)
  • GPL/trunk/alsa-kernel/pci/au88x0/au88x0_core.c

    r772 r777  
    11961196                                snd_pcm_sgbuf_get_addr(dma->substream,
    11971197                                dma->period_bytes * p));
    1198                         /* Force write thru cache. */
     1198                        /* Force write through cache. */
    11991199                        hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE +
    12001200                               (((adbdma << 2) + pp) << 2));
     
    12381238                        snd_pcm_sgbuf_get_addr(dma->substream,
    12391239                                               dma->period_bytes * p));
    1240                 /* Force write thru cache. */
     1240                /* Force write through cache. */
    12411241                hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2));
    12421242        }
     
    14671467                                snd_pcm_sgbuf_get_addr(dma->substream,
    14681468                                                       dma->period_bytes * p));
    1469                         /* Force write thru cache. */
     1469                        /* Force write through cache. */
    14701470                        hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE +
    14711471                               (((wtdma << 2) + pp) << 2));
     
    18551855}
    18561856
    1857 // Connect absolut address to mixin.
     1857// Connect absolute address to mixin.
    18581858static void
    18591859vortex_connection_adb_mixin(vortex_t * vortex, int en,
     
    18811881}
    18821882
    1883 // mix to absolut address.
     1883// mix to absolute address.
    18841884static void
    18851885vortex_connection_mix_adb(vortex_t * vortex, int en, unsigned char ch,
  • GPL/trunk/alsa-kernel/pci/cmipci.c

    r772 r777  
    496496        spinlock_t reg_lock;
    497497
    498 #ifdef CONFIG_PM_SLEEP
    499498        unsigned int saved_regs[0x20];
    500499        unsigned char saved_mixers[0x20];
    501 #endif
    502500};
    503501
     
    15821580};
    15831581
    1584 static const unsigned int rate_constraints[] = { 5512, 8000, 11025, 16000, 22050,
    1585                         32000, 44100, 48000, 88200, 96000, 128000 };
    1586 static const struct snd_pcm_hw_constraint_list hw_constraints_rates = {
    1587                 .count = ARRAY_SIZE(rate_constraints),
    1588                 .list = rate_constraints,
    1589                 .mask = 0,
    1590 };
    1591 
    15921582/*
    15931583 * check device open/close
     
    16611651                runtime->hw.rate_max = 96000;
    16621652        } else if (cm->chip_version == 55) {
    1663                 err = snd_pcm_hw_constraint_list(runtime, 0,
    1664                         SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
    1665                 if (err < 0)
    1666                         return err;
    1667                 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
     1653                runtime->hw.rates |= SNDRV_PCM_RATE_88200 |
     1654                                     SNDRV_PCM_RATE_96000 |
     1655                                     SNDRV_PCM_RATE_128000;
    16681656                runtime->hw.rate_max = 128000;
    16691657        }
     
    16871675                runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
    16881676        } else if (cm->chip_version == 55) {
    1689                 err = snd_pcm_hw_constraint_list(runtime, 0,
    1690                         SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
    1691                 if (err < 0)
    1692                         return err;
    1693                 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
     1677                runtime->hw.rates |= SNDRV_PCM_RATE_88200 |
     1678                                     SNDRV_PCM_RATE_96000 |
     1679                                     SNDRV_PCM_RATE_128000;
    16941680                runtime->hw.rate_max = 128000;
    16951681        }
     
    17271713                runtime->hw.rate_max = 96000;
    17281714        } else if (cm->chip_version == 55) {
    1729                 err = snd_pcm_hw_constraint_list(runtime, 0,
    1730                         SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
    1731                 if (err < 0)
    1732                         return err;
    1733                 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
     1715                runtime->hw.rates |= SNDRV_PCM_RATE_88200 |
     1716                                     SNDRV_PCM_RATE_96000 |
     1717                                     SNDRV_PCM_RATE_128000;
    17341718                runtime->hw.rate_max = 128000;
    17351719        }
     
    32813265}
    32823266
    3283 #ifdef CONFIG_PM_SLEEP
    32843267/*
    32853268 * power management
     
    33453328}
    33463329
    3347 static SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume);
    3348 #define SND_CMIPCI_PM_OPS       &snd_cmipci_pm
    3349 #else
    3350 #define SND_CMIPCI_PM_OPS       NULL
    3351 #endif /* CONFIG_PM_SLEEP */
     3330static DEFINE_SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume);
    33523331
    33533332static struct pci_driver cmipci_driver = {
     
    33563335        .probe = snd_cmipci_probe,
    33573336        .driver = {
    3358                 .pm = SND_CMIPCI_PM_OPS,
     3337                .pm = &snd_cmipci_pm,
    33593338        },
    33603339};
  • GPL/trunk/alsa-kernel/pci/cs4281.c

    r772 r777  
    474474        struct gameport *gameport;
    475475
    476 #ifdef CONFIG_PM_SLEEP
    477476        u32 suspend_regs[SUSPEND_REGISTERS];
    478 #endif
    479 
    480477};
    481478
     
    19001897 * Power Management
    19011898 */
    1902 #ifdef CONFIG_PM_SLEEP
    1903 
    19041899static const int saved_regs[SUSPEND_REGISTERS] = {
    19051900        BA0_JSCTL,
     
    19901985}
    19911986
    1992 static SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume);
    1993 #define CS4281_PM_OPS   &cs4281_pm
    1994 #else
    1995 #define CS4281_PM_OPS   NULL
    1996 #endif /* CONFIG_PM_SLEEP */
     1987static DEFINE_SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume);
    19971988
    19981989static struct pci_driver cs4281_driver = {
     
    20011992        .probe = snd_cs4281_probe,
    20021993        .driver = {
    2003                 .pm = CS4281_PM_OPS,
     1994                .pm = &cs4281_pm,
    20041995        },
    20051996};
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c

    r772 r777  
    256256                if (bp != best + V_OFF && bp != best + V_FREE &&
    257257                    (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) {
    258                         val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch);
     258                        val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch) - 64 + 3;
    259259                        if (val >= vp->reg.loopstart)
    260260                                bp = best + V_OFF;
     
    311311        unsigned int temp;
    312312        int ch;
     313        bool w_16;
    313314        u32 psst, dsl, map, ccca, vtarget;
    314315        unsigned int addr, mapped_offset;
     
    322323                return -EINVAL;
    323324        chan = vp->chan;
     325        w_16 = !(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS);
    324326
    325327        emem = (struct snd_emu10k1_memblk *)vp->block;
     
    331333                return -ENOMEM;
    332334        }
    333         mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
     335        mapped_offset = snd_emu10k1_memblk_offset(emem) >> w_16;
    334336        vp->reg.start += mapped_offset;
    335337        vp->reg.end += mapped_offset;
     
    363365        map = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
    364366
    365         addr = vp->reg.start;
     367        addr = vp->reg.start + 64 - 3;
    366368        temp = vp->reg.parm.filterQ;
    367369        ccca = (temp << 28) | addr;
     
    372374                ccca |= shift << 25;
    373375        }
    374         if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS)
     376        if (!w_16)
    375377                ccca |= CCCA_8BITSELECT;
    376378
     
    431433                CCCA, ccca,
    432434
     435                /* cache */
     436                CCR, REG_VAL_PUT(CCR_CACHEINVALIDSIZE, 64),
     437
    433438                /* reset volume */
    434439                VTFT, vtarget | vp->ftarget,
  • GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c

    r772 r777  
    673673}
    674674
    675 static int snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu,
    676                                      const struct firmware *fw_entry)
    677 {
    678         int n, i;
    679         u16 reg;
    680         u8 value;
    681         __always_unused u16 write_post;
    682 
    683         if (!fw_entry)
    684                 return -EIO;
    685 
    686         /* The FPGA is a Xilinx Spartan IIE XC2S50E */
    687         /* On E-MU 0404b it is a Xilinx Spartan III XC3S50 */
    688         /* GPIO7 -> FPGA PGMN
    689          * GPIO6 -> FPGA CCLK
    690          * GPIO5 -> FPGA DIN
    691          * FPGA CONFIG OFF -> FPGA PGMN
    692          */
    693         spin_lock_irq(&emu->emu_lock);
    694         outw(0x00, emu->port + A_GPIO); /* Set PGMN low for 100uS. */
    695         write_post = inw(emu->port + A_GPIO);
    696         udelay(100);
    697         outw(0x80, emu->port + A_GPIO); /* Leave bit 7 set during netlist setup. */
    698         write_post = inw(emu->port + A_GPIO);
    699         udelay(100); /* Allow FPGA memory to clean */
    700         for (n = 0; n < fw_entry->size; n++) {
    701                 value = fw_entry->data[n];
    702                 for (i = 0; i < 8; i++) {
    703                         reg = 0x80;
    704                         if (value & 0x1)
    705                                 reg = reg | 0x20;
    706                         value = value >> 1;
    707                         outw(reg, emu->port + A_GPIO);
    708                         write_post = inw(emu->port + A_GPIO);
    709                         outw(reg | 0x40, emu->port + A_GPIO);
    710                         write_post = inw(emu->port + A_GPIO);
    711                 }
    712         }
    713         /* After programming, set GPIO bit 4 high again. */
    714         outw(0x10, emu->port + A_GPIO);
    715         write_post = inw(emu->port + A_GPIO);
    716         spin_unlock_irq(&emu->emu_lock);
    717 
    718         return 0;
    719 }
    720 
    721675/* firmware file names, per model, init-fw and dock-fw (optional) */
    722676static const char * const firmware_names[5][2] = {
     
    750704        }
    751705
    752         return snd_emu1010_load_firmware_entry(emu, *fw);
     706        snd_emu1010_load_firmware_entry(emu, dock, *fw);
     707        return 0;
    753708}
    754709
     
    765720
    766721        dev_info(emu->card->dev, "emu1010: Loading Audio Dock Firmware\n");
    767         /* Return to Audio Dock programming mode */
    768         snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
    769                                EMU_HANA_FPGA_CONFIG_AUDIODOCK);
    770722        err = snd_emu1010_load_firmware(emu, 1, &emu->dock_fw);
    771723        if (err < 0)
     
    837789#endif
    838790
     791        snd_emu1010_fpga_lock(emu);
     792
    839793        snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &sts);
    840794
     
    846800        if (sts & EMU_HANA_IRQ_WCLK_CHANGED)
    847801                emu1010_clock_event(emu);
     802
     803        snd_emu1010_fpga_unlock(emu);
    848804}
    849805
     
    880836        outl(HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK, emu->port + HCFG);
    881837
    882         /* Disable 48Volt power to Audio Dock */
    883         snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
    884 
    885         /* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
    886         snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
    887         dev_dbg(emu->card->dev, "reg1 = 0x%x\n", reg);
    888         if ((reg & 0x3f) == 0x15) {
    889                 /* FPGA netlist already present so clear it */
    890                 /* Return to programming mode */
    891 
    892                 snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_HANA);
    893         }
    894         snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
    895         dev_dbg(emu->card->dev, "reg2 = 0x%x\n", reg);
    896         if ((reg & 0x3f) == 0x15) {
    897                 /* FPGA failed to return to programming mode */
    898                 dev_info(emu->card->dev,
    899                          "emu1010: FPGA failed to return to programming mode\n");
    900                 return -ENODEV;
    901         }
    902         dev_info(emu->card->dev, "emu1010: EMU_HANA_ID = 0x%x\n", reg);
     838        snd_emu1010_fpga_lock(emu);
     839
     840        dev_info(emu->card->dev, "emu1010: Loading Hana Firmware\n");
    903841
    904842        err = snd_emu1010_load_firmware(emu, 0, &emu->firmware);
    905843        if (err < 0) {
    906844                dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n");
    907                 return err;
     845                goto fail;
    908846        }
    909847
     
    915853                         "emu1010: Loading Hana Firmware file failed, reg = 0x%x\n",
    916854                         reg);
    917                 return -ENODEV;
     855                err = -ENODEV;
     856                goto fail;
    918857        }
    919858
     
    975914        snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
    976915
    977         return 0;
     916fail:
     917        snd_emu1010_fpga_unlock(emu);
     918        return err;
    978919}
    979920/*
     
    997938        if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) {
    998939                /* Disable 48Volt power to Audio Dock */
    999                 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
     940                snd_emu1010_fpga_write_lock(emu, EMU_HANA_DOCK_PWR, 0);
    1000941        }
    1001942        cancel_work_sync(&emu->emu1010.work);
     943        mutex_destroy(&emu->emu1010.lock);
    1002944        release_firmware(emu->firmware);
    1003945        release_firmware(emu->dock_fw);
     
    15791521        emu->get_synth_voice = NULL;
    15801522        INIT_WORK(&emu->emu1010.work, emu1010_work);
     1523        mutex_init(&emu->emu1010.lock);
    15811524        /* read revision & serial */
    15821525#ifndef TARGET_OS2
  • GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c

    r772 r777  
    662662        if (change) {
    663663                emu->emu1010.output_source[channel] = val;
     664                snd_emu1010_fpga_lock(emu);
    664665                snd_emu1010_output_source_apply(emu, channel, val);
     666                snd_emu1010_fpga_unlock(emu);
    665667        }
    666668        return change;
     
    706708        if (change) {
    707709                emu->emu1010.input_source[channel] = val;
     710                snd_emu1010_fpga_lock(emu);
    708711                snd_emu1010_input_source_apply(emu, channel, val);
     712                snd_emu1010_fpga_unlock(emu);
    709713        }
    710714        return change;
     
    775779        change = (cache != emu->emu1010.adc_pads);
    776780        if (change) {
    777                 snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache );
     781                snd_emu1010_fpga_write_lock(emu, EMU_HANA_ADC_PADS, cache );
    778782                emu->emu1010.adc_pads = cache;
    779783        }
     
    833837        change = (cache != emu->emu1010.dac_pads);
    834838        if (change) {
    835                 snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
     839                snd_emu1010_fpga_write_lock(emu, EMU_HANA_DAC_PADS, cache );
    836840                emu->emu1010.dac_pads = cache;
    837841        }
     
    981985        if (val >= emu_ci->num)
    982986                return -EINVAL;
     987        snd_emu1010_fpga_lock(emu);
    983988        spin_lock_irq(&emu->reg_lock);
    984989        change = (emu->emu1010.clock_source != val);
     
    9971002                spin_unlock_irq(&emu->reg_lock);
    9981003        }
     1004        snd_emu1010_fpga_unlock(emu);
    9991005        return change;
    10001006}
     
    10421048        if (change) {
    10431049                emu->emu1010.clock_fallback = val;
    1044                 snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 1 - val);
     1050                snd_emu1010_fpga_write_lock(emu, EMU_HANA_DEFCLOCK, 1 - val);
    10451051        }
    10461052        return change;
     
    10941100                tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : EMU_HANA_OPTICAL_IN_SPDIF) |
    10951101                        (emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : EMU_HANA_OPTICAL_OUT_SPDIF);
    1096                 snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
     1102                snd_emu1010_fpga_write_lock(emu, EMU_HANA_OPTICAL_TYPE, tmp);
    10971103        }
    10981104        return change;
     
    11451151                tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : EMU_HANA_OPTICAL_IN_SPDIF) |
    11461152                        (emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : EMU_HANA_OPTICAL_OUT_SPDIF);
    1147                 snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
     1153                snd_emu1010_fpga_write_lock(emu, EMU_HANA_OPTICAL_TYPE, tmp);
    11481154        }
    11491155        return change;
     
    23242330                        emu->emu1010.output_source[i] =
    23252331                                emu1010_map_source(emu_ri, emu_ri->out_dflts[i]);
     2332                snd_emu1010_fpga_lock(emu);
    23262333                snd_emu1010_apply_sources(emu);
     2334                snd_emu1010_fpga_unlock(emu);
    23272335
    23282336                kctl = emu->ctl_clock_source = snd_ctl_new1(&snd_emu1010_clock_source, emu);
  • GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c

    r772 r777  
    148148};
    149149
    150 static const unsigned int capture_rates[8] = {
    151         8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000
    152 };
    153 
    154 static const struct snd_pcm_hw_constraint_list hw_constraints_capture_rates = {
    155         .count = 8,
    156         .list = capture_rates,
    157         .mask = 0
    158 };
    159 
    160150static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate)
    161151{
     
    174164        }
    175165}
    176 
    177 static const unsigned int audigy_capture_rates[9] = {
    178         8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
    179 };
    180 
    181 static const struct snd_pcm_hw_constraint_list hw_constraints_audigy_capture_rates = {
    182         .count = 9,
    183         .list = audigy_capture_rates,
    184         .mask = 0
    185 };
    186166
    187167static unsigned int snd_emu10k1_audigy_capture_rate_reg(unsigned int rate)
     
    208188        if (emu->card_capabilities->emu_model &&
    209189            emu->emu1010.word_clock == 44100) {
    210                 // This also sets the rate constraint by deleting SNDRV_PCM_RATE_KNOT
    211190                runtime->hw.rates = SNDRV_PCM_RATE_11025 | \
    212191                                    SNDRV_PCM_RATE_22050 | \
     
    214193                runtime->hw.rate_min = 11025;
    215194                runtime->hw.rate_max = 44100;
    216                 return;
    217         }
    218         snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
    219                                    emu->audigy ? &hw_constraints_audigy_capture_rates :
    220                                                  &hw_constraints_capture_rates);
     195        } else if (emu->audigy) {
     196                runtime->hw.rates = SNDRV_PCM_RATE_8000_48000 |
     197                                    SNDRV_PCM_RATE_12000 |
     198                                    SNDRV_PCM_RATE_24000;
     199        }
    221200}
    222201
     
    10541033                                 SNDRV_PCM_INFO_MMAP_VALID),
    10551034        .formats =              SNDRV_PCM_FMTBIT_S16_LE,
    1056         .rates =                SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT,
     1035        .rates =                SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_24000,
    10571036        .rate_min =             8000,
    10581037        .rate_max =             48000,
  • GPL/trunk/alsa-kernel/pci/emu10k1/emuproc.c

    r772 r777  
    166166
    167167        if (emu->card_capabilities->emu_model) {
     168                snd_emu1010_fpga_lock(emu);
     169
    168170                // This represents the S/PDIF lock status on 0404b, which is
    169171                // kinda weird and unhelpful, because monitoring it via IRQ is
     
    198200                                    value & EMU_HANA_SPDIF_MODE_RX_PRO ? "professional" : "consumer",
    199201                                    value & EMU_HANA_SPDIF_MODE_RX_NOCOPY ? ", no copy" : "");
     202
     203                snd_emu1010_fpga_unlock(emu);
    200204        } else {
    201205                snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS);
     
    459463        u32 value;
    460464        int i;
     465
     466        snd_emu1010_fpga_lock(emu);
     467
    461468        snd_iprintf(buffer, "EMU1010 Registers:\n\n");
    462469
     
    497504                }
    498505        }
     506
     507        snd_emu1010_fpga_unlock(emu);
    499508}
    500509
  • GPL/trunk/alsa-kernel/pci/emu10k1/io.c

    r772 r777  
    291291void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value)
    292292{
    293         unsigned long flags;
    294 
    295         spin_lock_irqsave(&emu->emu_lock, flags);
     293#ifndef TARGET_OS2
     294        if (snd_BUG_ON(!mutex_is_locked(&emu->emu1010.lock)))
     295                return;
     296#endif
    296297        snd_emu1010_fpga_write_locked(emu, reg, value);
    297         spin_unlock_irqrestore(&emu->emu_lock, flags);
    298 }
    299 
    300 static void snd_emu1010_fpga_read_locked(struct snd_emu10k1 *emu, u32 reg, u32 *value)
     298}
     299
     300void snd_emu1010_fpga_write_lock(struct snd_emu10k1 *emu, u32 reg, u32 value)
     301{
     302        snd_emu1010_fpga_lock(emu);
     303        snd_emu1010_fpga_write_locked(emu, reg, value);
     304        snd_emu1010_fpga_unlock(emu);
     305}
     306
     307void snd_emu1010_fpga_read(struct snd_emu10k1 *emu, u32 reg, u32 *value)
    301308{
    302309        // The higest input pin is used as the designated interrupt trigger,
     
    305312        // so using this function often causes an IRQ as a side effect.
    306313        u32 mask = emu->card_capabilities->ca0108_chip ? 0x1f : 0x7f;
     314
     315#ifndef TARGET_OS2
     316        if (snd_BUG_ON(!mutex_is_locked(&emu->emu1010.lock)))
     317                return;
     318#endif
    307319        if (snd_BUG_ON(reg > 0x3f))
    308320                return;
     
    315327}
    316328
    317 void snd_emu1010_fpga_read(struct snd_emu10k1 *emu, u32 reg, u32 *value)
    318 {
    319         unsigned long flags;
    320 
    321         spin_lock_irqsave(&emu->emu_lock, flags);
    322         snd_emu1010_fpga_read_locked(emu, reg, value);
    323         spin_unlock_irqrestore(&emu->emu_lock, flags);
    324 }
    325 
    326329/* Each Destination has one and only one Source,
    327330 * but one Source can feed any number of Destinations simultaneously.
     
    329332void snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 *emu, u32 dst, u32 src)
    330333{
    331         unsigned long flags;
    332 
    333334        if (snd_BUG_ON(dst & ~0x71f))
    334335                return;
    335336        if (snd_BUG_ON(src & ~0x71f))
    336337                return;
    337         spin_lock_irqsave(&emu->emu_lock, flags);
    338         snd_emu1010_fpga_write_locked(emu, EMU_HANA_DESTHI, dst >> 8);
    339         snd_emu1010_fpga_write_locked(emu, EMU_HANA_DESTLO, dst & 0x1f);
    340         snd_emu1010_fpga_write_locked(emu, EMU_HANA_SRCHI, src >> 8);
    341         snd_emu1010_fpga_write_locked(emu, EMU_HANA_SRCLO, src & 0x1f);
    342         spin_unlock_irqrestore(&emu->emu_lock, flags);
     338        snd_emu1010_fpga_write(emu, EMU_HANA_DESTHI, dst >> 8);
     339        snd_emu1010_fpga_write(emu, EMU_HANA_DESTLO, dst & 0x1f);
     340        snd_emu1010_fpga_write(emu, EMU_HANA_SRCHI, src >> 8);
     341        snd_emu1010_fpga_write(emu, EMU_HANA_SRCLO, src & 0x1f);
    343342}
    344343
    345344u32 snd_emu1010_fpga_link_dst_src_read(struct snd_emu10k1 *emu, u32 dst)
    346345{
    347         unsigned long flags;
    348346        u32 hi, lo;
    349347
    350348        if (snd_BUG_ON(dst & ~0x71f))
    351349                return 0;
    352         spin_lock_irqsave(&emu->emu_lock, flags);
    353         snd_emu1010_fpga_write_locked(emu, EMU_HANA_DESTHI, dst >> 8);
    354         snd_emu1010_fpga_write_locked(emu, EMU_HANA_DESTLO, dst & 0x1f);
    355         snd_emu1010_fpga_read_locked(emu, EMU_HANA_SRCHI, &hi);
    356         snd_emu1010_fpga_read_locked(emu, EMU_HANA_SRCLO, &lo);
    357         spin_unlock_irqrestore(&emu->emu_lock, flags);
     350        snd_emu1010_fpga_write(emu, EMU_HANA_DESTHI, dst >> 8);
     351        snd_emu1010_fpga_write(emu, EMU_HANA_DESTLO, dst & 0x1f);
     352        snd_emu1010_fpga_read(emu, EMU_HANA_SRCHI, &hi);
     353        snd_emu1010_fpga_read(emu, EMU_HANA_SRCLO, &lo);
    358354        return (hi << 8) | lo;
    359355}
     
    429425
    430426        snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, leds);
     427}
     428
     429void snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, int dock,
     430                                     const struct firmware *fw_entry)
     431{
     432        __always_unused u16 write_post;
     433
     434        // On E-MU 1010 rev1 the FPGA is a Xilinx Spartan IIE XC2S50E.
     435        // On E-MU 0404b it is a Xilinx Spartan III XC3S50.
     436        // The wiring is as follows:
     437        // GPO7 -> FPGA input & 1K resistor -> FPGA /PGMN <- FPGA output
     438        //   In normal operation, the active low reset line is held up by
     439        //   an FPGA output, while the GPO pin performs its duty as control
     440        //   register access strobe signal. Writing the respective bit to
     441        //   EMU_HANA_FPGA_CONFIG puts the FPGA output into high-Z mode, at
     442        //   which point the GPO pin can control the reset line through the
     443        //   resistor.
     444        // GPO6 -> FPGA CCLK & FPGA input
     445        // GPO5 -> FPGA DIN (dual function)
     446
     447        // If the FPGA is already programmed, return it to programming mode
     448        snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG,
     449                               dock ? EMU_HANA_FPGA_CONFIG_AUDIODOCK :
     450                                      EMU_HANA_FPGA_CONFIG_HANA);
     451
     452        // Assert reset line for 100uS
     453        outw(0x00, emu->port + A_GPIO);
     454        write_post = inw(emu->port + A_GPIO);
     455        udelay(100);
     456        outw(0x80, emu->port + A_GPIO);
     457        write_post = inw(emu->port + A_GPIO);
     458        udelay(100);  // Allow FPGA memory to clean
     459
     460        // Upload the netlist. Keep reset line high!
     461        for (int n = 0; n < fw_entry->size; n++) {
     462                u8 value = fw_entry->data[n];
     463                for (int i = 0; i < 8; i++) {
     464                        u16 reg = 0x80;
     465                        if (value & 1)
     466                                reg |= 0x20;
     467                        value >>= 1;
     468                        outw(reg, emu->port + A_GPIO);
     469                        write_post = inw(emu->port + A_GPIO);
     470                        outw(reg | 0x40, emu->port + A_GPIO);
     471                        write_post = inw(emu->port + A_GPIO);
     472                }
     473        }
     474
     475        // After programming, set GPIO bit 4 high again.
     476        // This appears to be a config word that the rev1 Hana
     477        // firmware reads; weird things happen without this.
     478        outw(0x10, emu->port + A_GPIO);
     479        write_post = inw(emu->port + A_GPIO);
    431480}
    432481
  • GPL/trunk/alsa-kernel/pci/emu10k1/memory.c

    r772 r777  
    602602
    603603/*
    604  * bzero(blk + offset, size)
    605  */
    606 int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk,
    607                             int offset, int size)
     604 * memset(blk + offset, value, size)
     605 */
     606int snd_emu10k1_synth_memset(struct snd_emu10k1 *emu, struct snd_util_memblk *blk,
     607                             int offset, int size, u8 value)
    608608{
    609609        int page, nextofs, end_offset, temp, temp1;
    610610        void *ptr;
    611611        struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk;
     612
     613        if (snd_BUG_ON(offset + size > p->mem.size))
     614                return -EFAULT;
    612615
    613616        offset += blk->offset & (PAGE_SIZE - 1);
     
    622625                ptr = offset_ptr(emu, page + p->first_page, offset);
    623626                if (ptr)
    624                         memset(ptr, 0, temp);
     627                        memset(ptr, value, temp);
    625628                offset = nextofs;
    626629                page++;
     
    629632}
    630633
    631 EXPORT_SYMBOL(snd_emu10k1_synth_bzero);
    632 
    633 /*
    634  * copy_from_user(blk + offset, data, size)
     634EXPORT_SYMBOL(snd_emu10k1_synth_memset);
     635
     636// Note that the value is assumed to be suitably repetitive.
     637static void xor_range(void *ptr, int size, u32 value)
     638{
     639        if ((long)ptr & 1) {
     640                *(u8 *)ptr ^= (u8)value;
     641                ptr++;
     642                size--;
     643        }
     644        if (size > 1 && ((long)ptr & 2)) {
     645                *(u16 *)ptr ^= (u16)value;
     646                ptr += 2;
     647                size -= 2;
     648        }
     649        while (size > 3) {
     650                *(u32 *)ptr ^= value;
     651                ptr += 4;
     652                size -= 4;
     653        }
     654        if (size > 1) {
     655                *(u16 *)ptr ^= (u16)value;
     656                ptr += 2;
     657                size -= 2;
     658        }
     659        if (size > 0)
     660                *(u8 *)ptr ^= (u8)value;
     661}
     662
     663/*
     664 * copy_from_user(blk + offset, data, size) ^ xor
    635665 */
    636666int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk,
    637                                      int offset, const char __user *data, int size)
     667                                     int offset, const char __user *data, int size, u32 xor)
    638668{
    639669        int page, nextofs, end_offset, temp, temp1;
    640670        void *ptr;
    641671        struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk;
     672
     673        if (snd_BUG_ON(offset + size > p->mem.size))
     674                return -EFAULT;
    642675
    643676        offset += blk->offset & (PAGE_SIZE - 1);
     
    651684                        temp = temp1;
    652685                ptr = offset_ptr(emu, page + p->first_page, offset);
    653                 if (ptr && copy_from_user(ptr, data, temp))
     686                if (ptr) {
     687                        if (copy_from_user(ptr, data, temp))
    654688                        return -EFAULT;
     689                        if (xor)
     690                                xor_range(ptr, temp, xor);
     691                }
    655692                offset = nextofs;
    656693                data += temp;
  • GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c

    r772 r777  
    175175                return err;
    176176
    177         runtime->sync.id32[0] = substream->pcm->card->number;
    178         runtime->sync.id32[1] = 'P';
    179         runtime->sync.id32[2] = 16;
    180         runtime->sync.id32[3] = 'V';
    181 
    182177        return 0;
    183178}
     
    225220        // Only using channel 0 for now, but the card has 2 channels.
    226221        return snd_p16v_pcm_open_capture_channel(substream, 0);
     222}
     223
     224static int snd_p16v_pcm_ioctl_playback(struct snd_pcm_substream *substream,
     225                                       unsigned int cmd, void *arg)
     226{
     227        if (cmd == SNDRV_PCM_IOCTL1_SYNC_ID) {
     228                static const unsigned char id[4] = { 'P', '1', '6', 'V' };
     229                snd_pcm_set_sync_per_card(substream, arg, id, 4);
     230                return 0;
     231        }
     232        return snd_pcm_lib_ioctl(substream, cmd, arg);
    227233}
    228234
     
    532538        .open =        snd_p16v_pcm_open_playback_front,
    533539        .close =       snd_p16v_pcm_close_playback,
     540        .ioctl =       snd_p16v_pcm_ioctl_playback,
    534541        .prepare =     snd_p16v_pcm_prepare_playback,
    535542        .trigger =     snd_p16v_pcm_trigger_playback,
  • GPL/trunk/alsa-kernel/pci/ens1370.c

    r772 r777  
    19801980}
    19811981
    1982 #ifdef CONFIG_PM_SLEEP
    19831982static int snd_ensoniq_suspend(struct device *dev)
    19841983{
     
    20192018}
    20202019
    2021 static SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume);
    2022 #define SND_ENSONIQ_PM_OPS      &snd_ensoniq_pm
    2023 #else
    2024 #define SND_ENSONIQ_PM_OPS      NULL
    2025 #endif /* CONFIG_PM_SLEEP */
     2020static DEFINE_SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume);
    20262021
    20272022static int snd_ensoniq_create(struct snd_card *card,
     
    23962391        .probe = snd_audiopci_probe,
    23972392        .driver = {
    2398                 .pm = SND_ENSONIQ_PM_OPS,
     2393                .pm = &snd_ensoniq_pm,
    23992394        },
    24002395};
  • GPL/trunk/alsa-kernel/pci/es1938.c

    r772 r777  
    220220        struct gameport *gameport;
    221221#endif
    222 #ifdef CONFIG_PM_SLEEP
    223222        unsigned char saved_regs[SAVED_REG_SIZE];
    224 #endif
    225223};
    226224
     
    14481446}
    14491447
    1450 #ifdef CONFIG_PM_SLEEP
    14511448/*
    14521449 * PM support
     
    15141511}
    15151512
    1516 static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume);
    1517 #define ES1938_PM_OPS   &es1938_pm
    1518 #else
    1519 #define ES1938_PM_OPS   NULL
    1520 #endif /* CONFIG_PM_SLEEP */
     1513static DEFINE_SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume);
    15211514
    15221515#ifdef SUPPORT_JOYSTICK
     
    18401833        .probe = snd_es1938_probe,
    18411834        .driver = {
    1842                 .pm = ES1938_PM_OPS,
     1835                .pm = &es1938_pm,
    18431836        },
    18441837};
  • GPL/trunk/alsa-kernel/pci/es1968.c

    r772 r777  
    489489        struct list_head list;
    490490
    491 #ifdef CONFIG_PM_SLEEP
    492491        u16 wc_map[4];
    493 #endif
    494492};
    495493
     
    542540        spinlock_t substream_lock;
    543541
    544 #ifdef CONFIG_PM_SLEEP
    545542        u16 apu_map[NR_APUS][NR_APU_REGS];
    546 #endif
    547543
    548544#ifdef SUPPORT_JOYSTICK
     
    705701        if (snd_BUG_ON(channel >= NR_APUS))
    706702                return;
    707 #ifdef CONFIG_PM_SLEEP
    708703        chip->apu_map[channel][reg] = data;
    709 #endif
    710704        reg |= (channel << 4);
    711705        apu_index_set(chip, reg);
     
    992986        wave_set_register(chip, es->apu[channel] << 3, tmpval);
    993987
    994 #ifdef CONFIG_PM_SLEEP
    995988        es->wc_map[channel] = tmpval;
    996 #endif
    997989}
    998990
     
    23932385}
    23942386
    2395 #ifdef CONFIG_PM_SLEEP
    23962387/*
    23972388 * PM support
     
    24552446}
    24562447
    2457 static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume);
    2458 #define ES1968_PM_OPS   &es1968_pm
    2459 #else
    2460 #define ES1968_PM_OPS   NULL
    2461 #endif /* CONFIG_PM_SLEEP */
     2448static DEFINE_SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume);
    24622449
    24632450#ifdef SUPPORT_JOYSTICK
     
    28892876        .probe = snd_es1968_probe,
    28902877        .driver = {
    2891                 .pm = ES1968_PM_OPS,
     2878                .pm = &es1968_pm,
    28922879        },
    28932880};
  • GPL/trunk/alsa-kernel/pci/fm801.c

    r772 r777  
    231231#endif
    232232
    233 #ifdef CONFIG_PM_SLEEP
    234233        u16 saved_regs[0x20];
    235 #endif
    236234};
    237235
     
    13521350}
    13531351
    1354 #ifdef CONFIG_PM_SLEEP
    13551352static const unsigned char saved_regs[] = {
    13561353        FM801_PCM_VOL, FM801_I2S_VOL, FM801_FM_VOL, FM801_REC_SRC,
     
    14091406}
    14101407
    1411 static SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume);
    1412 #define SND_FM801_PM_OPS        &snd_fm801_pm
    1413 #else
    1414 #define SND_FM801_PM_OPS        NULL
    1415 #endif /* CONFIG_PM_SLEEP */
     1408static DEFINE_SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume);
    14161409
    14171410static struct pci_driver fm801_driver = {
     
    14201413        .probe = snd_card_fm801_probe,
    14211414        .driver = {
    1422                 .pm = SND_FM801_PM_OPS,
     1415                .pm = &snd_fm801_pm,
    14231416        },
    14241417};
  • GPL/trunk/alsa-kernel/pci/hda/Makefile

    r709 r777  
    1212#
    1313#===================================================================
    14 FILES = hda_intel.obj hda_codec.obj hda_controller.obj hda_auto_parser.obj hda_jack.obj &
    15   hda_proc.obj hda_generic.obj hda_hwdep.obj hda_sysfs.obj hda_bind.obj hda_eld.obj &
    16   patch_analog.obj patch_cmedia.obj patch_conexant.obj patch_ca0110.obj patch_ca0132.obj patch_cirrus.obj &
    17   patch_hdmi.obj patch_realtek.obj patch_si3054.obj patch_sigmatel.obj patch_via.obj
     14FILES = hda_intel.obj hda_codec.obj hda_controller.obj hda_auto_parser.obj &
     15  hda_jack.obj hda_proc.obj hda_generic.obj hda_hwdep.obj hda_sysfs.obj  &
     16  hda_bind.obj hda_eld.obj hda_component.obj patch_analog.obj &
     17  patch_cmedia.obj patch_conexant.obj patch_ca0110.obj patch_ca0132.obj &
     18  patch_cirrus.obj patch_hdmi.obj patch_realtek.obj patch_si3054.obj &
     19  patch_sigmatel.obj patch_via.obj
    1820
    1921TARGET = hda
  • GPL/trunk/alsa-kernel/pci/hda/hda_beep.h

    r772 r777  
    2828        unsigned int keep_power_at_enable:1;    /* set by driver */
    2929        struct work_struct beep_work; /* scheduled task for beep event */
    30         struct mutex mutex;
    3130        void (*power_hook)(struct hda_beep *beep, bool on);
    3231};
  • GPL/trunk/alsa-kernel/pci/hda/hda_codec.c

    r772 r777  
    8989        int len;
    9090        hda_nid_t nid;
    91         hda_nid_t conns[];
     91        hda_nid_t conns[] __counted_by(len);
    9292};
    9393
     
    625625EXPORT_SYMBOL_GPL(snd_hda_shutup_pins);
    626626
    627 #ifdef CONFIG_PM
    628627/* Restore the pin controls cleared previously via snd_hda_shutup_pins() */
    629628static void restore_shutup_pins(struct hda_codec *codec)
     
    643642        codec->pins_shutup = 0;
    644643}
    645 #endif
    646644
    647645static void hda_jackpoll_work(struct work_struct *work)
     
    10141012        codec->addr = codec_addr;
    10151013
    1016 #ifdef CONFIG_PM
    10171014        codec->power_jiffies = jiffies;
    1018 #endif
    10191015
    10201016        snd_hda_sysfs_init(codec);
     
    12511247}
    12521248
    1253 #ifdef CONFIG_PM
    12541249/* clean up all streams; called from suspend */
    12551250static void hda_cleanup_all_streams(struct hda_codec *codec)
     
    12631258        }
    12641259}
    1265 #endif
    12661260
    12671261/*
     
    15151509        maxval = get_amp_max_value(codec, nid, dir, 0);
    15161510        if (val > maxval)
    1517                 val = maxval;
     1511                return -EINVAL;
    15181512        return snd_hda_codec_amp_update(codec, nid, ch, dir, idx,
    15191513                                        HDA_AMP_VOLMASK, val);
     
    15661560        long *valp = ucontrol->value.integer.value;
    15671561        int change = 0;
     1562        int err;
    15681563
    15691564        if (chs & 1) {
    1570                 change = update_amp_value(codec, nid, 0, dir, idx, ofs, *valp);
     1565                err = update_amp_value(codec, nid, 0, dir, idx, ofs, *valp);
     1566                if (err < 0)
     1567                        return err;
     1568                change |= err;
    15711569                valp++;
    15721570        }
    1573         if (chs & 2)
    1574                 change |= update_amp_value(codec, nid, 1, dir, idx, ofs, *valp);
     1571        if (chs & 2) {
     1572                err = update_amp_value(codec, nid, 1, dir, idx, ofs, *valp);
     1573                if (err < 0)
     1574                        return err;
     1575                change |= err;
     1576        }
    15751577        return change;
    15761578}
     
    17451747 * snd_hda_add_nid - Assign a NID to a control element
    17461748 * @codec: HD-audio codec
    1747  * @nid: corresponding NID (optional)
    17481749 * @kctl: the control element to assign
    17491750 * @index: index to kctl
     1751 * @nid: corresponding NID (optional)
    17501752 *
    17511753 * Add the given control element to an array inside the codec instance.
     
    21742176
    21752177        if (chs & 1) {
     2178                if (*valp < 0 || *valp > 1)
     2179                        return -EINVAL;
    21762180                change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx,
    21772181                                                  HDA_AMP_MUTE,
     
    21792183                valp++;
    21802184        }
    2181         if (chs & 2)
     2185        if (chs & 2) {
     2186                if (*valp < 0 || *valp > 1)
     2187                        return -EINVAL;
    21822188                change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx,
    21832189                                                   HDA_AMP_MUTE,
    21842190                                                   *valp ? 0 : HDA_AMP_MUTE);
     2191        }
    21852192        hda_call_check_power_status(codec, nid);
    21862193        return change;
     
    28782885#endif
    28792886
    2880 #ifdef CONFIG_PM
    28812887/* update the power on/off account with the current jiffies */
    28822888static void update_power_acct(struct hda_codec *codec, bool on)
     
    29862992}
    29872993
    2988 #endif /* CONFIG_PM */
    2989 
    2990 #ifdef CONFIG_PM_SLEEP
    29912994static int hda_codec_pm_prepare(struct device *dev)
    29922995{
     
    30453048        return pm_runtime_force_resume(dev);
    30463049}
    3047 #endif /* CONFIG_PM_SLEEP */
    30483050
    30493051/* referred in hda_bind.c */
    30503052const struct dev_pm_ops hda_codec_driver_pm = {
    3051 #ifdef CONFIG_PM_SLEEP
    3052         .prepare = hda_codec_pm_prepare,
    3053         .complete = hda_codec_pm_complete,
    3054         .suspend = hda_codec_pm_suspend,
    3055         .resume = hda_codec_pm_resume,
    3056         .freeze = hda_codec_pm_freeze,
    3057         .thaw = hda_codec_pm_thaw,
    3058         .poweroff = hda_codec_pm_suspend,
    3059         .restore = hda_codec_pm_restore,
    3060 #endif /* CONFIG_PM_SLEEP */
    3061         SET_RUNTIME_PM_OPS(hda_codec_runtime_suspend, hda_codec_runtime_resume,
    3062                            NULL)
     3053        .prepare = pm_sleep_ptr(hda_codec_pm_prepare),
     3054        .complete = pm_sleep_ptr(hda_codec_pm_complete),
     3055        .suspend = pm_sleep_ptr(hda_codec_pm_suspend),
     3056        .resume = pm_sleep_ptr(hda_codec_pm_resume),
     3057        .freeze = pm_sleep_ptr(hda_codec_pm_freeze),
     3058        .thaw = pm_sleep_ptr(hda_codec_pm_thaw),
     3059        .poweroff = pm_sleep_ptr(hda_codec_pm_suspend),
     3060        .restore = pm_sleep_ptr(hda_codec_pm_restore),
     3061        .runtime_suspend = pm_ptr(hda_codec_runtime_suspend),
     3062        .runtime_resume = pm_ptr(hda_codec_runtime_resume),
    30633063};
    30643064
     
    31853185                                info->rates ? NULL : &info->rates,
    31863186                                info->formats ? NULL : &info->formats,
     3187                                info->subformats ? NULL : &info->subformats,
    31873188                                info->maxbps ? NULL : &info->maxbps);
    31883189                if (err < 0){
     
    33353336                int stream;
    33363337
    3337                 for (stream = 0; stream < 2; stream++) {
     3338                for_each_pcm_streams(stream) {
    33383339                        struct hda_pcm_stream *info = &cpcm->stream[stream];
    33393340
     
    34473448EXPORT_SYMBOL_GPL(snd_hda_add_new_ctls);
    34483449
    3449 #ifdef CONFIG_PM
    34503450/**
    34513451 * snd_hda_codec_set_power_save - Configure codec's runtime PM
     
    35383538}
    35393539EXPORT_SYMBOL_GPL(snd_hda_check_amp_list_power);
    3540 #endif
    35413540
    35423541/*
     
    37803779                                                    &mout->spdif_rates,
    37813780                                                    &mout->spdif_formats,
     3781                                                    NULL,
    37823782                                                    &mout->spdif_maxbps);
    37833783                }
     
    40834083                        cancel_delayed_work_sync(&codec->jackpoll_work);
    40844084#endif
    4085 #ifdef CONFIG_PM
    40864085                if (hda_codec_is_power_on(codec)) {
    40874086                        hda_call_codec_suspend(codec);
    40884087                        hda_call_codec_resume(codec);
    40894088                }
    4090 #endif
    40914089        }
    40924090}
  • GPL/trunk/alsa-kernel/pci/hda/hda_component.c

    r775 r777  
    1414#include "hda_component2.h"
    1515#include "hda_local.h"
     16#include <ctype.h>
    1617
    1718#ifdef CONFIG_ACPI
  • GPL/trunk/alsa-kernel/pci/hda/hda_component2.h

    r772 r777  
    77 */
    88
     9#ifndef __HDA_COMPONENT_H__
     10#define __HDA_COMPONENT_H__
     11
     12#include <linux/acpi.h>
    913#include <linux/component.h>
     14#include <linux/mutex.h>
     15#include <sound/hda_codec.h>
    1016
    1117#define HDA_MAX_COMPONENTS      4
     
    1521        struct device *dev;
    1622        char name[HDA_MAX_NAME_SIZE];
    17         struct hda_codec *codec;
     23        struct acpi_device *adev;
     24        bool acpi_notifications_supported;
     25//      void (*acpi_notify)(acpi_handle handle, u32 event, struct device *dev);
    1826        void (*pre_playback_hook)(struct device *dev, int action);
    1927        void (*playback_hook)(struct device *dev, int action);
    2028        void (*post_playback_hook)(struct device *dev, int action);
    2129};
     30
     31struct hda_component_parent {
     32        struct mutex mutex;
     33        struct hda_codec *codec;
     34        struct hda_component comps[HDA_MAX_COMPONENTS];
     35};
     36
     37#ifdef CONFIG_ACPI
     38void hda_component_acpi_device_notify(struct hda_component_parent *parent,
     39                                      acpi_handle handle, u32 event, void *data);
     40int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
     41                                                  struct hda_component_parent *parent,
     42                                                  acpi_notify_handler handler, void *data);
     43void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
     44                                                     struct hda_component_parent *parent,
     45                                                     acpi_notify_handler handler);
     46#else
     47static inline void hda_component_acpi_device_notify(struct hda_component_parent *parent,
     48                                                    acpi_handle handle,
     49                                                    u32 event,
     50                                                    void *data)
     51{
     52}
     53
     54static inline int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
     55                                                                struct hda_component_parent *parent,
     56                                                                acpi_notify_handler handler,
     57                                                                void *data)
     58
     59{
     60        return 0;
     61}
     62
     63static inline void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
     64                                                                   struct hda_component_parent *parent,
     65                                                                   acpi_notify_handler handler)
     66{
     67}
     68#endif /* ifdef CONFIG_ACPI */
     69
     70void hda_component_manager_playback_hook(struct hda_component_parent *parent, int action);
     71
     72int hda_component_manager_init(struct hda_codec *cdc,
     73                               struct hda_component_parent *parent, int count,
     74                               const char *bus, const char *hid,
     75                               const char *match_str,
     76                               const struct component_master_ops *ops);
     77
     78void hda_component_manager_free(struct hda_component_parent *parent,
     79                                const struct component_master_ops *ops);
     80
     81int hda_component_manager_bind(struct hda_codec *cdc, struct hda_component_parent *parent);
     82
     83static inline struct hda_component *hda_component_from_index(struct hda_component_parent *parent,
     84                                                             int index)
     85{
     86        if (!parent)
     87                return NULL;
     88
     89        if (index < 0 || index >= ARRAY_SIZE(parent->comps))
     90                return NULL;
     91
     92        return &parent->comps[index];
     93}
     94
     95static inline void hda_component_manager_unbind(struct hda_codec *cdc,
     96                                                struct hda_component_parent *parent)
     97{
     98        mutex_lock(&parent->mutex);
     99        component_unbind_all(hda_codec_dev(cdc), parent);
     100        mutex_unlock(&parent->mutex);
     101}
     102
     103#endif /* ifndef __HDA_COMPONENT_H__ */
  • GPL/trunk/alsa-kernel/pci/hda/hda_controller.c

    r772 r777  
    44 *  Implementation of primary alsa driver code base for Intel HD Audio.
    55 *
    6  *  Copyright(c) 2004 Intel Corporation. All rights reserved.
     6 *  Copyright(c) 2004 Intel Corporation
    77 *
    88 *  Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
     
    2525#include <sound/core.h>
    2626#include <sound/initval.h>
     27#include <sound/pcm_params.h>
    2728#include "hda_controller.h"
    2829#include "hda_local.h"
     
    117118        //NOT_USED struct azx *chip = apcm->chip;
    118119        struct azx_dev *azx_dev = get_azx_dev(substream);
     120        struct hdac_stream *hdas = azx_stream(azx_dev);
    119121        int ret = 0;
    120122
     
    126128        }
    127129
    128         azx_dev->core.bufsize = 0;
    129         azx_dev->core.period_bytes = 0;
    130         azx_dev->core.format_val = 0;
     130        /* Set up BDLEs here, return -ENOMEM if too many BDLEs are required */
     131        hdas->bufsize = params_buffer_bytes(hw_params);
     132        hdas->period_bytes = params_period_bytes(hw_params);
     133        hdas->format_val = 0;
     134        hdas->no_period_wakeup =
     135                (hw_params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP) &&
     136                (hw_params->flags & SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP);
     137        if (snd_hdac_stream_setup_periods(hdas) < 0)
     138                ret = -ENOMEM;
    131139
    132140unlock:
     
    160168        struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream);
    161169        struct snd_pcm_runtime *runtime = substream->runtime;
    162         unsigned int format_val, stream_tag;
     170        unsigned int format_val, stream_tag, bits;
    163171        int err;
    164172        struct hda_spdif_out *spdif =
     
    174182
    175183        snd_hdac_stream_reset(azx_stream(azx_dev));
    176         format_val = snd_hdac_calc_stream_format(runtime->rate,
    177                                                 runtime->channels,
    178                                                 runtime->format,
    179                                                 hinfo->maxbps,
    180                                                 ctls);
     184        bits = snd_hdac_stream_format_bits(runtime->format, SNDRV_PCM_SUBFORMAT_STD, hinfo->maxbps);
     185
     186        format_val = snd_hdac_spdif_stream_format(runtime->channels, bits, runtime->rate, ctls);
    181187        if (!format_val) {
    182188                dev_err(chip->card->dev,
     
    191197                goto unlock;
    192198
    193         snd_hdac_stream_setup(azx_stream(azx_dev));
     199        snd_hdac_stream_setup(azx_stream(azx_dev), false);
    194200
    195201        stream_tag = azx_dev->core.stream_tag;
     
    280286        /* reset SYNC bits */
    281287        snd_hdac_stream_sync_trigger(hstr, false, sbits, sync_reg);
    282         if (start)
    283                 snd_hdac_stream_timecounter_init(hstr, sbits);
     288        snd_hdac_stream_timecounter_init(hstr, sbits, start);
    284289        spin_unlock(&bus->reg_lock);
    285290        return 0;
     
    470475                               ((HDA_MAX_CYCLE_VALUE + 1) * runtime->rate));
    471476
    472         *system = convert_art_to_tsc(tsc_counter);
     477        system->cycles = tsc_counter;
     478        system->cs_id = CSID_X86_ART;
    473479
    474480        return 0;
     
    933939        if (chip->disabled)
    934940                return 0;
    935         if (chip->single_cmd)
     941        if (chip->single_cmd || bus->use_pio_for_commands)
    936942                return azx_single_send_cmd(bus, val);
    937943        else
     
    947953        if (chip->disabled)
    948954                return 0;
    949         if (chip->single_cmd)
     955        if (chip->single_cmd || bus->use_pio_for_commands)
    950956                return azx_single_get_response(bus, addr, res);
    951957        else
     
    10941100        int repeat = 0; /* count for avoiding endless loop */
    10951101
    1096 #ifdef CONFIG_PM
    10971102        if (azx_has_pm_runtime(chip))
    10981103                if (!pm_runtime_active(chip->card->dev))
    10991104                        return IRQ_NONE;
    1100 #endif
    11011105
    11021106        spin_lock(&bus->reg_lock);
     
    12121216                bus->core.align_bdle_4k = true;
    12131217
     1218        if (chip->driver_caps & AZX_DCAPS_PIO_COMMANDS)
     1219                bus->core.use_pio_for_commands = true;
     1220
    12141221        /* enable sync_write flag for stable communication as default */
    12151222        bus->core.sync_write = 1;
     
    12391246                                         "Codec #%d probe error; disabling it...\n", c);
    12401247                                bus->codec_mask &= ~(1 << c);
     1248                                /* no codecs */
     1249                                if (bus->codec_mask == 0)
     1250                                        break;
    12411251                                /* More badly, accessing to a non-existing
    12421252                                 * codec often screws up the controller chip,
  • GPL/trunk/alsa-kernel/pci/hda/hda_controller.h

    r772 r777  
    4646#define AZX_DCAPS_NO_MSI64      (1 << 29)       /* Stick to 32-bit MSIs */
    4747#define AZX_DCAPS_SEPARATE_STREAM_TAG   (1 << 30) /* capture and playback use separate stream tag */
     48#define AZX_DCAPS_PIO_COMMANDS (1 << 31)        /* Use PIO instead of CORB for commands */
    4849
    4950enum {
  • GPL/trunk/alsa-kernel/pci/hda/hda_eld.c

    r772 r777  
    1313#include <linux/slab.h>
    1414#include <sound/core.h>
    15 #include <asm/unaligned.h>
     15#include <linux/unaligned.h>
    1616#include <sound/hda_chmap.h>
    1717#include <sound/hda_codec.h>
  • GPL/trunk/alsa-kernel/pci/hda/hda_generic.c

    r772 r777  
    39583958        cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
    39593959        cdev->brightness_set_blocking = callback;
    3960         cdev->brightness = ledtrig_audio_get(idx);
    39613960        cdev->flags = LED_CORE_SUSPENDRESUME;
    39623961
     
    60976096EXPORT_SYMBOL_GPL(snd_hda_gen_free);
    60986097
    6099 #ifdef CONFIG_PM
    61006098/**
    61016099 * snd_hda_gen_check_power_status - check the loopback power save state
     
    61116109}
    61126110EXPORT_SYMBOL_GPL(snd_hda_gen_check_power_status);
    6113 #endif
    61146111
    61156112
     
    61246121        .free = snd_hda_gen_free,
    61256122        .unsol_event = snd_hda_jack_unsol_event,
    6126 #ifdef CONFIG_PM
    61276123        .check_power_status = snd_hda_gen_check_power_status,
    6128 #endif
    61296124};
    61306125
  • GPL/trunk/alsa-kernel/pci/hda/hda_generic.h

    r772 r777  
    233233        unsigned int dac_min_mute:1; /* minimal = mute for DACs */
    234234        unsigned int suppress_vmaster:1; /* don't create vmaster kctls */
    235         unsigned int obey_preferred_dacs:1; /* obey preferred_dacs assignment */
    236235
    237236        /* other internal flags */
     
    341340void snd_hda_gen_update_outputs(struct hda_codec *codec);
    342341
    343 #ifdef CONFIG_PM
    344342int snd_hda_gen_check_power_status(struct hda_codec *codec, hda_nid_t nid);
    345 #endif
    346343unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec,
    347344                                           hda_nid_t nid,
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.c

    r772 r777  
    55 *                for Intel HD Audio.
    66 *
    7  *  Copyright(c) 2004 Intel Corporation. All rights reserved.
     7 *  Copyright(c) 2004 Intel Corporation
    88 *
    99 *  Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
     
    198198                 "(in second, 0 = disable).");
    199199
    200 static bool pm_blacklist = true;
    201 module_param(pm_blacklist, bool, 0644);
     200static int pm_blacklist = -1;
     201module_param(pm_blacklist, bint, 0644);
    202202MODULE_PARM_DESC(pm_blacklist, "Enable power-management denylist");
    203203
     
    209209module_param(power_save_controller, bool, 0644);
    210210MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");
    211 #else
     211#else /* CONFIG_PM */
    212212#define power_save      0
     213#define pm_blacklist    0
     214#define power_save_controller   false
    213215#endif /* CONFIG_PM */
    214216
     
    312314#define AZX_DCAPS_INTEL_BROXTON         AZX_DCAPS_INTEL_SKYLAKE
    313315
     316#define AZX_DCAPS_INTEL_LNL \
     317        (AZX_DCAPS_INTEL_SKYLAKE | AZX_DCAPS_PIO_COMMANDS)
     318
    314319/* quirks for ATI SB / AMD Hudson */
    315320#define AZX_DCAPS_PRESET_ATI_SB \
     
    839844        mod_dma_pos %= azx_dev->core.period_bytes;
    840845
    841         fifo_size = azx_stream(azx_dev)->fifo_size - 1;
     846        fifo_size = azx_stream(azx_dev)->fifo_size;
    842847
    843848        if (azx_dev->insufficient) {
     
    923928}
    924929
    925 #ifdef CONFIG_PM
    926930static DEFINE_MUTEX(card_list_lock);
    927931static LIST_HEAD(card_list);
     
    950954#ifdef NOT_USED
    951955/* trigger power-save check at writing parameter */
    952 static int param_set_xint(const char *val, const struct kernel_param *kp)
     956static int __maybe_unused param_set_xint(const char *val, const struct kernel_param *kp)
    953957{
    954958        struct hda_intel *hda;
     
    960964                return ret;
    961965
     966        if (pm_blacklist > 0)
     967                return 0;
     968
    962969        mutex_lock(&card_list_lock);
    963970        list_for_each_entry(hda, &card_list, list, struct hda_intel) {
    964971                chip = &hda->chip;
    965                 if (!hda->probe_continued || chip->disabled)
     972                if (!hda->probe_continued || chip->disabled ||
     973                    hda->runtime_pm_disabled)
    966974                        continue;
    967975                snd_hda_set_power_save(&chip->bus, power_save * 1000);
     
    10221030}
    10231031
    1024 #ifdef CONFIG_PM_SLEEP
    10251032static int azx_prepare(struct device *dev)
    10261033{
     
    10811088}
    10821089
    1083 static int azx_resume(struct device *dev)
     1090static int __maybe_unused azx_resume(struct device *dev)
    10841091{
    10851092        struct snd_card *card = dev_get_drvdata(dev);
     
    11321139        return 0;
    11331140}
    1134 #endif /* CONFIG_PM_SLEEP */
    11351141
    11361142#ifdef NOT_USED
    1137 static int azx_runtime_suspend(struct device *dev)
     1143static int __maybe_unused azx_runtime_suspend(struct device *dev)
    11381144{
    11391145        struct snd_card *card = dev_get_drvdata(dev);
     
    11521158}
    11531159
    1154 static int azx_runtime_resume(struct device *dev)
     1160static int __maybe_unused azx_runtime_resume(struct device *dev)
    11551161{
    11561162        struct snd_card *card = dev_get_drvdata(dev);
     
    11691175}
    11701176
    1171 static int azx_runtime_idle(struct device *dev)
     1177static int __maybe_unused azx_runtime_idle(struct device *dev)
    11721178{
    11731179        struct snd_card *card = dev_get_drvdata(dev);
     
    11961202
    11971203static const struct dev_pm_ops azx_pm = {
    1198         SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
    1199 #ifdef CONFIG_PM_SLEEP
    1200         .prepare = azx_prepare,
    1201         .complete = azx_complete,
    1202         .freeze_noirq = azx_freeze_noirq,
    1203         .thaw_noirq = azx_thaw_noirq,
    1204 #endif
     1204        SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
     1205        .prepare = pm_sleep_ptr(azx_prepare),
     1206        .complete = pm_sleep_ptr(azx_complete),
     1207        .freeze_noirq = pm_sleep_ptr(azx_freeze_noirq),
     1208        .thaw_noirq = pm_sleep_ptr(azx_thaw_noirq),
    12051209#ifdef CONFIG_PM_RUNTIME
    12061210        SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle)
    12071211#endif
    12081212};
    1209 
    1210 #define AZX_PM_OPS      &azx_pm
    1211 #else
    1212 #define azx_add_card_list(chip) /* NOP */
    1213 #define azx_del_card_list(chip) /* NOP */
    1214 #define AZX_PM_OPS      NULL
    1215 #endif /* CONFIG_PM */
    12161213
    12171214
     
    14581455        acpi_status status;
    14591456
    1460         while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
    1461                 dhandle = ACPI_HANDLE(&pdev->dev);
    1462                 if (dhandle) {
    1463                         status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);
    1464                         if (ACPI_SUCCESS(status)) {
    1465                                 pci_dev_put(pdev);
    1466                                 return true;
    1467                         }
    1468                 }
    1469         }
    1470         while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
     1457        while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) {
     1458                if ((pdev->class != PCI_CLASS_DISPLAY_VGA << 8) &&
     1459                    (pdev->class != PCI_CLASS_DISPLAY_OTHER << 8))
     1460                        continue;
     1461
    14711462                dhandle = ACPI_HANDLE(&pdev->dev);
    14721463                if (dhandle) {
     
    18631854        /* use the non-cached pages in non-snoop mode */
    18641855        if (!azx_snoop(chip))
    1865                 azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC_SG;
     1856                azx_bus(chip)->dma_type = SNDRV_DMA_TYPE_DEV_WC;
    18661857
    18671858        if (chip->driver_type == AZX_DRIVER_NVIDIA) {
     
    21162107        { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */
    21172108        { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */
     2109        { PCI_DEVICE_SUB(0x1022, 0x15e3, 0x1022, 0xd601) }, /* ASRock X670E Taichi */
    21182110        {0}
    21192111};
     
    21882180        pci_set_drvdata(pci, card);
    21892181
     2182#ifdef CONFIG_SND_HDA_I915
     2183        /* bind with i915 if needed */
     2184        if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT) {
     2185                err = snd_hdac_i915_init(azx_bus(chip));
     2186                if (err < 0) {
     2187                        if (err == -EPROBE_DEFER)
     2188                                goto out_free;
     2189
     2190                        /* if the controller is bound only with HDMI/DP
     2191                         * (for HSW and BDW), we need to abort the probe;
     2192                         * for other chips, still continue probing as other
     2193                         * codecs can be on the same link.
     2194                         */
     2195                        if (HDA_CONTROLLER_IN_GPU(pci)) {
     2196                                dev_err_probe(card->dev, err,
     2197                                             "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n");
     2198
     2199                                goto out_free;
     2200                        } else {
     2201                                /* don't bother any longer */
     2202                                chip->driver_caps &= ~AZX_DCAPS_I915_COMPONENT;
     2203                        }
     2204                }
     2205
     2206                /* HSW/BDW controllers need this power */
     2207                if (HDA_CONTROLLER_IN_GPU(pci))
     2208                        hda->need_i915_power = true;
     2209        }
     2210#else
     2211        if (HDA_CONTROLLER_IN_GPU(pci))
     2212                dev_err(card->dev, "Haswell/Broadwell HDMI/DP must build in CONFIG_SND_HDA_I915\n");
     2213#endif
     2214
    21902215        err = register_vga_switcheroo(chip);
    21912216        if (err < 0) {
     
    22152240#endif /* CONFIG_SND_HDA_PATCH_LOADER */
    22162241
    2217 #if !defined(CONFIG_SND_HDA_I915) && !defined(TARGET_OS2)
    2218         if (HDA_CONTROLLER_IN_GPU(pci))
    2219                 dev_err(card->dev, "Haswell/Broadwell HDMI/DP must build in CONFIG_SND_HDA_I915\n");
    2220 #endif
    2221 
    22222242#ifdef TARGET_OS2 // modified code from 3.13 otherwise we don't detect hardware. Is schedule_work a stub?
    22232243        if (schedule_probe) {
     
    22372257
    22382258out_free:
     2259        pci_set_drvdata(pci, NULL);
    22392260        snd_card_free(card);
    22402261        return err;
    22412262}
    22422263
    2243 #ifdef CONFIG_PM
    22442264/* On some boards setting power_save to a non 0 value leads to clicking /
    22452265 * popping sounds when ever we enter/leave powersaving mode. Ideally we would
     
    22852305        {0}
    22862306};
    2287 #endif /* CONFIG_PM */
    22882307
    22892308static void set_default_power_save(struct azx *chip)
    22902309{
     2310        struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
    22912311        int val = power_save;
    22922312
    2293 #ifdef CONFIG_PM
    2294         if (pm_blacklist) {
     2313        if (pm_blacklist < 0) {
    22952314                const struct snd_pci_quirk *q;
    22962315
     
    23002319                                 q->subvendor, q->subdevice);
    23012320                        val = 0;
     2321                        hda->runtime_pm_disabled = 1;
    23022322                }
    2303         }
    2304 #endif /* CONFIG_PM */
     2323        } else if (pm_blacklist > 0) {
     2324                dev_info(chip->card->dev, "Forcing power_save to 0 via option\n");
     2325                val = 0;
     2326        }
    23052327        snd_hda_set_power_save(&chip->bus, val * 1000);
    23062328}
     
    23272349        to_hda_bus(bus)->bus_probing = 1;
    23282350        hda->probe_continued = 1;
    2329 
    2330         /* bind with i915 if needed */
    2331         if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT) {
    2332                 err = snd_hdac_i915_init(bus);
    2333                 if (err < 0) {
    2334                         /* if the controller is bound only with HDMI/DP
    2335                          * (for HSW and BDW), we need to abort the probe;
    2336                          * for other chips, still continue probing as other
    2337                          * codecs can be on the same link.
    2338                          */
    2339                         if (HDA_CONTROLLER_IN_GPU(pci)) {
    2340                                 dev_err(chip->card->dev,
    2341                                         "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n");
    2342                                 goto out_free;
    2343                         } else {
    2344                                 /* don't bother any longer */
    2345                                 chip->driver_caps &= ~AZX_DCAPS_I915_COMPONENT;
    2346                         }
    2347                 }
    2348 
    2349                 /* HSW/BDW controllers need this power */
    2350                 if (HDA_CONTROLLER_IN_GPU(pci))
    2351                         hda->need_i915_power = true;
    2352         }
    23532351
    23542352        /* Request display power well for the HDA controller or codec. For
     
    23822380                if (err < 0)
    23832381                        goto out_free;
    2384 #ifndef CONFIG_PM
    2385                 release_firmware(chip->fw); /* no longer needed */
    2386                 chip->fw = NULL;
    2387 #endif
    23882382        }
    23892383#endif
     
    25632557        { PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25642558        { PCI_DEVICE_DATA(INTEL, HDA_MTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2559        /* Battlemage */
     2560        { PCI_DEVICE_DATA(INTEL, HDA_BMG, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25652561        /* Lunarlake-P */
    2566         { PCI_DEVICE_DATA(INTEL, HDA_LNL_P, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2562        { PCI_DEVICE_DATA(INTEL, HDA_LNL_P, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) },
    25672563        /* Arrow Lake-S */
    25682564        { PCI_DEVICE_DATA(INTEL, HDA_ARL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
    25692565        /* Arrow Lake */
    25702566        { PCI_DEVICE_DATA(INTEL, HDA_ARL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
     2567        /* Panther Lake */
     2568        { PCI_DEVICE_DATA(INTEL, HDA_PTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) },
     2569        /* Panther Lake-H */
     2570        { PCI_DEVICE_DATA(INTEL, HDA_PTL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) },
    25712571        /* Apollolake (Broxton-P) */
    25722572        { PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) },
     
    28262826        .shutdown = azx_shutdown,
    28272827        .driver = {
    2828                 .pm = AZX_PM_OPS,
     2828                .pm = &azx_pm,
    28292829        },
    28302830};
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.h

    r772 r777  
    2323        unsigned int irq_pending_warned:1;
    2424        unsigned int probe_continued:1;
     25        unsigned int runtime_pm_disabled:1;
    2526
    2627        /* vga_switcheroo setup */
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel_trace.h

    r772 r777  
    3535);
    3636
    37 #ifdef CONFIG_PM
    3837DEFINE_EVENT(hda_pm, azx_runtime_suspend,
    3938        TP_PROTO(struct azx *chip),
     
    4544        TP_ARGS(chip)
    4645);
    47 #endif
    4846
    4947#endif /* _TRACE_HDA_INTEL_H */
  • GPL/trunk/alsa-kernel/pci/hda/hda_sysfs.c

    r772 r777  
    3030};
    3131
    32 #ifdef CONFIG_PM
    3332static ssize_t power_on_acct_show(struct device *dev,
    3433                                  struct device_attribute *attr,
     
    5150static DEVICE_ATTR_RO(power_on_acct);
    5251static DEVICE_ATTR_RO(power_off_acct);
    53 #endif /* CONFIG_PM */
    5452
    5553#define CODEC_INFO_SHOW(type, field)                            \
     
    749747        &dev_attr_init_pin_configs.attr,
    750748        &dev_attr_driver_pin_configs.attr,
    751 #ifdef CONFIG_PM
    752749        &dev_attr_power_on_acct.attr,
    753750        &dev_attr_power_off_acct.attr,
    754 #endif
    755751#ifdef CONFIG_SND_HDA_RECONFIG
    756752        &dev_attr_init_verbs.attr,
  • GPL/trunk/alsa-kernel/pci/hda/patch_analog.c

    r772 r777  
    7676#endif
    7777
    78 #ifdef CONFIG_PM
    7978static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front,
    8079                                hda_nid_t hp)
     
    122121        return 0;
    123122}
    124 #endif
    125123
    126124/* follow EAPD via vmaster hook */
     
    162160        .free = snd_hda_gen_free,
    163161        .unsol_event = snd_hda_jack_unsol_event,
    164 #ifdef CONFIG_PM
    165162        .check_power_status = snd_hda_gen_check_power_status,
    166163        .suspend = ad198x_suspend,
    167 #endif
    168164};
    169165
  • GPL/trunk/alsa-kernel/pci/hda/patch_ca0132.c

    r772 r777  
    30403040        unsigned int format_val;
    30413041
    3042         format_val = snd_hdac_calc_stream_format(sample_rate,
    3043                                 channels, SNDRV_PCM_FORMAT_S32_LE, 32, 0);
     3042        format_val = snd_hdac_stream_format(channels, 32, sample_rate);
    30443043
    30453044        if (hda_format)
     
    36343633static bool dspload_wait_loaded(struct hda_codec *codec)
    36353634{
     3635#ifndef TARGET_OS2
    36363636        unsigned long timeout = jiffies + msecs_to_jiffies(2000);
    36373637
    36383638        do {
    3639           #ifndef TARGET_OS2
    36403639                if (dspload_is_loaded(codec)) {
    36413640                        codec_info(codec, "ca0132 DSP downloaded and running\n");
    36423641                        return true;
    36433642                }
    3644                 #endif
    36453643                msleep(20);
    36463644        } while (time_before(jiffies, timeout));
    3647 
     3645#endif
    36483646        codec_err(codec, "ca0132 failed to download DSP\n");
    36493647        return false;
     
    66756673        struct snd_kcontrol_new knew = {
    66766674                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
    6677                 .index = 0,  \
     6675                .index = 0,
    66786676                .subdevice = HDA_SUBDEV_AMP_FLAG,
    6679                 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
    6680                             SNDRV_CTL_ELEM_ACCESS_TLV_READ |
     6677                .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | 
     6678                            SNDRV_CTL_ELEM_ACCESS_TLV_READ | 
    66816679                            SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
    6682                 .info = snd_hda_mixer_amp_volume_info, \
     6680                .info = snd_hda_mixer_amp_volume_info,
    66836681                .get = snd_hda_mixer_amp_volume_get,
    66846682                .put = snd_hda_mixer_amp_volume_put,
     
    67556753#else
    67566754        struct snd_kcontrol_new knew =
    6757         {
     6755        { 
    67586756                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
    67596757                .index = 0,
     
    67656763        knew.name = ca0132_voicefx.name;
    67666764        knew.private_value = HDA_COMPOSE_AMP_VAL(VOICEFX, 1, 0, HDA_INPUT);
    6767 
    67686765#endif
    67696766        knew.info = ca0132_voicefx_info;
     
    67826779#else
    67836780        struct snd_kcontrol_new knew =
    6784         {
     6781        { 
    67856782                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
    67866783                .index = 0,
     
    68916888#else
    68926889        struct snd_kcontrol_new knew = {
    6893                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     6890                .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 
    68946891                .index = 0,  \
    6895                 .subdevice = HDA_SUBDEV_AMP_FLAG,
    6896                 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
    6897                             SNDRV_CTL_ELEM_ACCESS_TLV_READ |
    6898                             SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
     6892                .subdevice = HDA_SUBDEV_AMP_FLAG, 
     6893                .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | 
     6894                            SNDRV_CTL_ELEM_ACCESS_TLV_READ | 
     6895                            SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, 
    68996896                .info = snd_hda_mixer_amp_volume_info, \
    69006897                .get = snd_hda_mixer_amp_volume_get,
    6901                 .put = snd_hda_mixer_amp_volume_put,
     6898                .put = snd_hda_mixer_amp_volume_put, 
    69026899                .tlv = { .c = snd_hda_mixer_amp_tlv },         
    69036900        };
     
    91709167{
    91719168        /* put any chip cleanup stuffs here. */
    9172   #ifndef TARGET_OS2
     9169
     9170#ifndef TARGET_OS2
    91739171        if (dspload_is_loaded(codec))
    91749172                dsp_reset(codec);
    9175   #endif
     9173#endif
    91769174}
    91779175
     
    97959793}
    97969794
    9797 #ifdef CONFIG_PM
    97989795static int ca0132_suspend(struct hda_codec *codec)
    97999796{
     
    98039800        return 0;
    98049801}
    9805 #endif
    98069802
    98079803static const struct hda_codec_ops ca0132_patch_ops = {
     
    98119807        .free = ca0132_free,
    98129808        .unsol_event = snd_hda_jack_unsol_event,
    9813 #ifdef CONFIG_PM
    98149809        .suspend = ca0132_suspend,
    9815 #endif
    98169810};
    98179811
  • GPL/trunk/alsa-kernel/pci/hda/patch_cirrus.c

    r772 r777  
    11351135}
    11361136
    1137 #ifdef CONFIG_PM
    11381137/*
    11391138 *      Manage PDREF, when transitioning to D3hot
     
    11601159        return 0;
    11611160}
    1162 #endif
    11631161
    11641162static const struct hda_codec_ops cs421x_patch_ops = {
     
    11681166        .free = cs_free,
    11691167        .unsol_event = snd_hda_jack_unsol_event,
    1170 #ifdef CONFIG_PM
    11711168        .suspend = cs421x_suspend,
    1172 #endif
    11731169};
    11741170
  • GPL/trunk/alsa-kernel/pci/hda/patch_cmedia.c

    r679 r777  
    2222#endif
    2323
     24/* CM9825 Offset Definitions */
     25
     26#define CM9825_VERB_SET_HPF_1 0x781
     27#define CM9825_VERB_SET_HPF_2 0x785
     28#define CM9825_VERB_SET_PLL 0x7a0
     29#define CM9825_VERB_SET_NEG 0x7a1
     30#define CM9825_VERB_SET_ADCL 0x7a2
     31#define CM9825_VERB_SET_DACL 0x7a3
     32#define CM9825_VERB_SET_MBIAS 0x7a4
     33#define CM9825_VERB_SET_VNEG 0x7a8
     34#define CM9825_VERB_SET_D2S 0x7a9
     35#define CM9825_VERB_SET_DACTRL 0x7aa
     36#define CM9825_VERB_SET_PDNEG 0x7ac
     37#define CM9825_VERB_SET_VDO 0x7ad
     38#define CM9825_VERB_SET_CDALR 0x7b0
     39#define CM9825_VERB_SET_MTCBA 0x7b1
     40#define CM9825_VERB_SET_OTP 0x7b2
     41#define CM9825_VERB_SET_OCP 0x7b3
     42#define CM9825_VERB_SET_GAD 0x7b4
     43#define CM9825_VERB_SET_TMOD 0x7b5
     44#define CM9825_VERB_SET_SNR 0x7b6
     45
    2446struct cmi_spec {
    2547        struct hda_gen_spec gen;
    26 };
     48        const struct hda_verb *chip_d0_verbs;
     49        const struct hda_verb *chip_d3_verbs;
     50        const struct hda_verb *chip_hp_present_verbs;
     51        const struct hda_verb *chip_hp_remove_verbs;
     52        struct hda_codec *codec;
     53        struct delayed_work unsol_hp_work;
     54        int quirk;
     55};
     56
     57static const struct hda_verb cm9825_std_d3_verbs[] = {
     58        /* chip sleep verbs */
     59        {0x43, CM9825_VERB_SET_D2S, 0x62},      /* depop */
     60        {0x43, CM9825_VERB_SET_PLL, 0x01},      /* PLL set */
     61        {0x43, CM9825_VERB_SET_NEG, 0xc2},      /* NEG set */
     62        {0x43, CM9825_VERB_SET_ADCL, 0x00},     /* ADC */
     63        {0x43, CM9825_VERB_SET_DACL, 0x02},     /* DACL */
     64        {0x43, CM9825_VERB_SET_VNEG, 0x50},     /* VOL NEG */
     65        {0x43, CM9825_VERB_SET_MBIAS, 0x00},    /* MBIAS */
     66        {0x43, CM9825_VERB_SET_PDNEG, 0x04},    /* SEL OSC */
     67        {0x43, CM9825_VERB_SET_CDALR, 0xf6},    /* Class D */
     68        {0x43, CM9825_VERB_SET_OTP, 0xcd},      /* OTP set */
     69        {0}
     70};
     71
     72static const struct hda_verb cm9825_std_d0_verbs[] = {
     73        /* chip init verbs */
     74        {0x34, AC_VERB_SET_EAPD_BTLENABLE, 0x02},       /* EAPD set */
     75        {0x43, CM9825_VERB_SET_SNR, 0x30},      /* SNR set */
     76        {0x43, CM9825_VERB_SET_PLL, 0x00},      /* PLL set */
     77        {0x43, CM9825_VERB_SET_ADCL, 0x00},     /* ADC */
     78        {0x43, CM9825_VERB_SET_DACL, 0x02},     /* DACL */
     79        {0x43, CM9825_VERB_SET_MBIAS, 0x00},    /* MBIAS */
     80        {0x43, CM9825_VERB_SET_VNEG, 0x56},     /* VOL NEG */
     81        {0x43, CM9825_VERB_SET_D2S, 0x62},      /* depop */
     82        {0x43, CM9825_VERB_SET_DACTRL, 0x00},   /* DACTRL set */
     83        {0x43, CM9825_VERB_SET_PDNEG, 0x0c},    /* SEL OSC */
     84        {0x43, CM9825_VERB_SET_VDO, 0x80},      /* VDO set */
     85        {0x43, CM9825_VERB_SET_CDALR, 0xf4},    /* Class D */
     86        {0x43, CM9825_VERB_SET_OTP, 0xcd},      /* OTP set */
     87        {0x43, CM9825_VERB_SET_MTCBA, 0x61},    /* SR set */
     88        {0x43, CM9825_VERB_SET_OCP, 0x33},      /* OTP set */
     89        {0x43, CM9825_VERB_SET_GAD, 0x07},      /* ADC -3db */
     90        {0x43, CM9825_VERB_SET_TMOD, 0x26},     /* Class D clk */
     91        {0x3C, AC_VERB_SET_AMP_GAIN_MUTE |
     92                AC_AMP_SET_OUTPUT | AC_AMP_SET_RIGHT, 0x2d},    /* Gain set */
     93        {0x3C, AC_VERB_SET_AMP_GAIN_MUTE |
     94                AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT, 0x2d},     /* Gain set */
     95        {0x43, CM9825_VERB_SET_HPF_1, 0x40},    /* HPF set */
     96        {0x43, CM9825_VERB_SET_HPF_2, 0x40},    /* HPF set */
     97        {0}
     98};
     99
     100static const struct hda_verb cm9825_hp_present_verbs[] = {
     101        {0x42, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00},   /* PIN off */
     102        {0x43, CM9825_VERB_SET_ADCL, 0x88},     /* ADC */
     103        {0x43, CM9825_VERB_SET_DACL, 0xaa},     /* DACL */
     104        {0x43, CM9825_VERB_SET_MBIAS, 0x10},    /* MBIAS */
     105        {0x43, CM9825_VERB_SET_D2S, 0xf2},      /* depop */
     106        {0x43, CM9825_VERB_SET_DACTRL, 0x00},   /* DACTRL set */
     107        {0x43, CM9825_VERB_SET_VDO, 0xc4},      /* VDO set */
     108        {0}
     109};
     110
     111static const struct hda_verb cm9825_hp_remove_verbs[] = {
     112        {0x43, CM9825_VERB_SET_ADCL, 0x00},     /* ADC */
     113        {0x43, CM9825_VERB_SET_DACL, 0x56},     /* DACL */
     114        {0x43, CM9825_VERB_SET_MBIAS, 0x00},    /* MBIAS */
     115        {0x43, CM9825_VERB_SET_D2S, 0x62},      /* depop */
     116        {0x43, CM9825_VERB_SET_DACTRL, 0xe0},   /* DACTRL set */
     117        {0x43, CM9825_VERB_SET_VDO, 0x80},      /* VDO set */
     118        {0x42, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},   /* PIN on */
     119        {0}
     120};
     121
     122static void cm9825_unsol_hp_delayed(struct work_struct *work)
     123{
     124        struct cmi_spec *spec =
     125            container_of(to_delayed_work(work), struct cmi_spec, unsol_hp_work);
     126        struct hda_jack_tbl *jack;
     127        hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
     128        bool hp_jack_plugin = false;
     129        int err = 0;
     130
     131        hp_jack_plugin = snd_hda_jack_detect(spec->codec, hp_pin);
     132
     133        codec_dbg(spec->codec, "hp_jack_plugin %d, hp_pin 0x%X\n",
     134                  (int)hp_jack_plugin, hp_pin);
     135
     136        if (!hp_jack_plugin) {
     137                err =
     138                    snd_hda_codec_write(spec->codec, 0x42, 0,
     139                                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40);
     140                if (err)
     141                        codec_dbg(spec->codec, "codec_write err %d\n", err);
     142
     143                snd_hda_sequence_write(spec->codec, spec->chip_hp_remove_verbs);
     144        } else {
     145                snd_hda_sequence_write(spec->codec,
     146                                       spec->chip_hp_present_verbs);
     147        }
     148
     149        jack = snd_hda_jack_tbl_get(spec->codec, hp_pin);
     150        if (jack) {
     151                jack->block_report = 0;
     152                snd_hda_jack_report_sync(spec->codec);
     153        }
     154}
     155
     156static void hp_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
     157{
     158        struct cmi_spec *spec = codec->spec;
     159        struct hda_jack_tbl *tbl;
     160
     161        /* Delay enabling the HP amp, to let the mic-detection
     162         * state machine run.
     163         */
     164
     165        codec_dbg(spec->codec, "cb->nid 0x%X\n", cb->nid);
     166
     167        tbl = snd_hda_jack_tbl_get(codec, cb->nid);
     168        if (tbl)
     169                tbl->block_report = 1;
     170        schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(200));
     171}
     172
     173static void cm9825_setup_unsol(struct hda_codec *codec)
     174{
     175        struct cmi_spec *spec = codec->spec;
     176
     177        hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];
     178
     179        snd_hda_jack_detect_enable_callback(codec, hp_pin, hp_callback);
     180}
     181
     182static int cm9825_init(struct hda_codec *codec)
     183{
     184        snd_hda_gen_init(codec);
     185        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
     186
     187        return 0;
     188}
     189
     190static void cm9825_free(struct hda_codec *codec)
     191{
     192        struct cmi_spec *spec = codec->spec;
     193
     194        cancel_delayed_work_sync(&spec->unsol_hp_work);
     195        snd_hda_gen_free(codec);
     196}
     197
     198static int cm9825_suspend(struct hda_codec *codec)
     199{
     200        struct cmi_spec *spec = codec->spec;
     201
     202        cancel_delayed_work_sync(&spec->unsol_hp_work);
     203
     204        snd_hda_sequence_write(codec, spec->chip_d3_verbs);
     205
     206        return 0;
     207}
     208
     209static int cm9825_resume(struct hda_codec *codec)
     210{
     211        struct cmi_spec *spec = codec->spec;
     212        hda_nid_t hp_pin = 0;
     213        bool hp_jack_plugin = false;
     214        int err;
     215
     216        err =
     217            snd_hda_codec_write(spec->codec, 0x42, 0,
     218                                AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00);
     219        if (err)
     220                codec_dbg(codec, "codec_write err %d\n", err);
     221
     222        msleep(150);            /* for depop noise */
     223
     224        codec->patch_ops.init(codec);
     225
     226        hp_pin = spec->gen.autocfg.hp_pins[0];
     227        hp_jack_plugin = snd_hda_jack_detect(spec->codec, hp_pin);
     228
     229        codec_dbg(spec->codec, "hp_jack_plugin %d, hp_pin 0x%X\n",
     230                  (int)hp_jack_plugin, hp_pin);
     231
     232        if (!hp_jack_plugin) {
     233                err =
     234                    snd_hda_codec_write(spec->codec, 0x42, 0,
     235                                        AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40);
     236
     237                if (err)
     238                        codec_dbg(codec, "codec_write err %d\n", err);
     239
     240                snd_hda_sequence_write(codec, cm9825_hp_remove_verbs);
     241        }
     242
     243        snd_hda_regmap_sync(codec);
     244        hda_call_check_power_status(codec, 0x01);
     245
     246        return 0;
     247}
    27248
    28249/*
     
    36257        .unsol_event = snd_hda_jack_unsol_event,
    37258};
     259
     260static int patch_cm9825(struct hda_codec *codec)
     261{
     262        struct cmi_spec *spec;
     263        struct auto_pin_cfg *cfg;
     264        int err;
     265
     266        spec = kzalloc(sizeof(*spec), GFP_KERNEL);
     267        if (spec == NULL)
     268                return -ENOMEM;
     269
     270        INIT_DELAYED_WORK(&spec->unsol_hp_work, cm9825_unsol_hp_delayed);
     271        codec->spec = spec;
     272        spec->codec = codec;
     273        codec->patch_ops = cmi_auto_patch_ops;
     274        codec->patch_ops.init = cm9825_init;
     275        codec->patch_ops.suspend = cm9825_suspend;
     276        codec->patch_ops.resume = cm9825_resume;
     277        codec->patch_ops.free = cm9825_free;
     278        codec->patch_ops.check_power_status = snd_hda_gen_check_power_status;
     279        cfg = &spec->gen.autocfg;
     280        snd_hda_gen_spec_init(&spec->gen);
     281        spec->chip_d0_verbs = cm9825_std_d0_verbs;
     282        spec->chip_d3_verbs = cm9825_std_d3_verbs;
     283        spec->chip_hp_present_verbs = cm9825_hp_present_verbs;
     284        spec->chip_hp_remove_verbs = cm9825_hp_remove_verbs;
     285
     286        snd_hda_sequence_write(codec, spec->chip_d0_verbs);
     287
     288        err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
     289        if (err < 0)
     290                goto error;
     291        err = snd_hda_gen_parse_auto_config(codec, cfg);
     292        if (err < 0)
     293                goto error;
     294
     295        cm9825_setup_unsol(codec);
     296
     297        return 0;
     298
     299 error:
     300        cm9825_free(codec);
     301
     302        codec_info(codec, "Enter err %d\n", err);
     303
     304        return err;
     305}
    38306
    39307static int patch_cmi9880(struct hda_codec *codec)
     
    118386        HDA_CODEC_ENTRY(0x13f69880, "CMI9880", patch_cmi9880),
    119387        HDA_CODEC_ENTRY(0x434d4980, "CMI9880", patch_cmi9880),
     388        HDA_CODEC_ENTRY(0x13f69825, "CM9825", patch_cm9825),
    120389        {0} /* terminator */
    121390};
  • GPL/trunk/alsa-kernel/pci/hda/patch_conexant.c

    r772 r777  
    173173static void cx_fixup_headset_recog(struct hda_codec *codec)
    174174{
    175         unsigned int mic_persent;
     175        unsigned int mic_present;
    176176
    177177        /* fix some headset type recognize fail issue, such as EDIFIER headset */
    178         /* set micbiasd output current comparator threshold from 66% to 55%. */
     178        /* set micbias output current comparator threshold from 66% to 55%. */
    179179        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
     180        /* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias register
    181181         * value adjustment trim from 2.2K ohms to 2.0K ohms.
    182182         */
    183183        snd_hda_codec_write(codec, 0x1c, 0, 0x3b0, 0xe10);
    184184        /* 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)
     185        mic_present = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
     186        if (mic_present & AC_PINSENSE_PRESENCE)
    187187                /* enable headset mic VREF */
    188188                snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24);
     
    254254        unsigned int mic_present;
    255255
    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.
     256        /* In cx8070 and sn6140, the node 16 can only be configured to headphone or disabled,
     257         * the node 19 can only be configured to microphone or disabled.
     258         * Check hp&mic tag to process headset plugin & plugout.
    259259         */
    260260        mic_present = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);
     
    265265}
    266266
    267 #ifdef CONFIG_PM
    268267static int cx_auto_suspend(struct hda_codec *codec)
    269268{
     
    271270        return 0;
    272271}
    273 #endif
    274272
    275273static const struct hda_codec_ops cx_auto_patch_ops = {
     
    279277        .free = cx_auto_free,
    280278        .unsol_event = snd_hda_jack_unsol_event,
    281 #ifdef CONFIG_PM
    282279        .suspend = cx_auto_suspend,
    283280        .check_power_status = snd_hda_gen_check_power_status,
    284 #endif
    285281};
    286282
     
    792788}
    793789
    794 #ifndef TARGET_OS2
    795790static void cxt_setup_gpio_unmute(struct hda_codec *codec,
    796791                                  unsigned int gpio_mute_mask)
     
    804799        }
    805800}
    806 #endif
    807801
    808802static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
     
    820814}
    821815
    822 #ifndef TARGET_OS2
    823816static void cxt_fixup_hp_a_u(struct hda_codec *codec,
    824817                             const struct hda_fixup *fix, int action)
     
    829822                cxt_setup_gpio_unmute(codec, 0x2);
    830823}
    831 #endif
    832824
    833825/* ThinkPad X200 & co with cxt5051 */
     
    884876                        {0}
    885877};
    886 #endif /* TARGET_OS2 */
    887 
    888 #ifndef TARGET_OS2
     878#endif
     879
    889880/* SuoWoSi/South-holding JS201D with sn6140 */
    890881static const struct hda_pintbl cxt_pincfg_sws_js201d[] = {
     
    897888        {0}
    898889};
    899 #endif
    900890
    901891static const struct hda_fixup cxt_fixups[] = {
     
    10811071                .chain_id = CXT_FIXUP_HEADSET_MIC,
    10821072        },
     1073#endif
    10831074        [CXT_PINCFG_SWS_JS201D] = {
    10841075                .type = HDA_FIXUP_PINS,
    10851076                .v.pins = cxt_pincfg_sws_js201d,
    10861077        },
     1078#ifdef NOT_USED
    10871079        [CXT_PINCFG_TOP_SPEAKER] = {
    10881080                .type = HDA_FIXUP_PINS,
     
    10921084                },
    10931085        },
     1086#endif
    10941087        [CXT_FIXUP_HP_A_U] = {
    10951088                .type = HDA_FIXUP_FUNC,
    10961089                .v.func = cxt_fixup_hp_a_u,
    10971090        },
    1098 #endif
    10991091};
    11001092
  • GPL/trunk/alsa-kernel/pci/hda/patch_hdmi.c

    r772 r777  
    44 *  patch_hdmi.c - routines for HDMI/DisplayPort codecs
    55 *
    6  *  Copyright(c) 2008-2010 Intel Corporation. All rights reserved.
     6 *  Copyright(c) 2008-2010 Intel Corporation
    77 *  Copyright (c) 2006 ATI Technologies Inc.
    88 *  Copyright (c) 2008 NVIDIA Corp.  All rights reserved.
     
    5555IS_ENABLED(CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM);
    5656#else
    57 1
     571;
    5858#endif
    5959module_param(enable_silent_stream, bool, 0644);
     
    16721672#define I915_SILENT_RATE                48000
    16731673#define I915_SILENT_CHANNELS            2
    1674 #define I915_SILENT_FORMAT              SNDRV_PCM_FORMAT_S16_LE
    16751674#define I915_SILENT_FORMAT_BITS 16
    16761675#define I915_SILENT_FMT_MASK            0xf
     
    16851684
    16861685        /* trigger silent stream generation in hw */
    1687         format = snd_hdac_calc_stream_format(I915_SILENT_RATE, I915_SILENT_CHANNELS,
    1688                                              I915_SILENT_FORMAT, I915_SILENT_FORMAT_BITS, 0);
     1686        format = snd_hdac_stream_format(I915_SILENT_CHANNELS, I915_SILENT_FORMAT_BITS,
     1687                                        I915_SILENT_RATE);
    16891688        snd_hda_codec_setup_stream(codec, per_pin->cvt_nid,
    16901689                                   I915_SILENT_FMT_MASK, I915_SILENT_FMT_MASK, format);
     
    19941993                                          &per_cvt->rates,
    19951994                                          &per_cvt->formats,
     1995                                          NULL,
    19961996                                          &per_cvt->maxbps);
    19971997        if (err < 0)
     
    20832083        mutex_lock(&codec->spdif_mutex);
    20842084        spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid);
     2085  #ifndef TARGET_OS2
    20852086        /* Add sanity check to pass klockwork check.
    20862087         * This should never happen.
    20872088         */
    2088         #ifndef TARGET_OS2
    20892089        if (WARN_ON(spdif == NULL)) {
    20902090                mutex_unlock(&codec->spdif_mutex);
    20912091                return true;
    20922092        }
    2093         #endif
     2093  #endif
    20942094        non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
    20952095        mutex_unlock(&codec->spdif_mutex);
     
    25402540}
    25412541
    2542 #ifdef CONFIG_PM
    25432542static int generic_hdmi_suspend(struct hda_codec *codec)
    25442543{
     
    25672566        return 0;
    25682567}
    2569 #endif
    25702568
    25712569static const struct hda_codec_ops generic_hdmi_patch_ops = {
     
    25752573        .build_controls         = generic_hdmi_build_controls,
    25762574        .unsol_event            = hdmi_unsol_event,
    2577 #ifdef CONFIG_PM
    25782575        .suspend                = generic_hdmi_suspend,
    25792576        .resume                 = generic_hdmi_resume,
    2580 #endif
    25812577};
    25822578
     
    29832979}
    29842980
    2985 #ifdef CONFIG_PM
    29862981static int i915_adlp_hdmi_suspend(struct hda_codec *codec)
    29872982{
     
    30633058        return res;
    30643059}
    3065 #endif
    30663060
    30673061/* precondition and allocation for Intel codecs */
     
    31983192                        spec->silent_stream_type = SILENT_STREAM_KAE;
    31993193
    3200 #ifdef CONFIG_PM
    32013194                        codec->patch_ops.resume = i915_adlp_hdmi_resume;
    32023195                        codec->patch_ops.suspend = i915_adlp_hdmi_suspend;
    3203 #endif
    32043196                }
    32053197        }
     
    46734665HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi),
    46744666HDA_CODEC_ENTRY(0x8086281d, "Meteor Lake HDMI", patch_i915_adlp_hdmi),
     4667HDA_CODEC_ENTRY(0x8086281e, "Battlemage HDMI",  patch_i915_adlp_hdmi),
    46754668HDA_CODEC_ENTRY(0x8086281f, "Raptor Lake P HDMI",       patch_i915_adlp_hdmi),
    46764669HDA_CODEC_ENTRY(0x80862820, "Lunar Lake HDMI",  patch_i915_adlp_hdmi),
  • GPL/trunk/alsa-kernel/pci/hda/patch_realtek.c

    r772 r777  
    1111 */
    1212
     13#include <linux/acpi.h>
     14#include <linux/cleanup.h>
    1315#include <linux/init.h>
    1416#include <linux/delay.h>
     
    1719#include <linux/dmi.h>
    1820#include <linux/module.h>
     21//#include <linux/i2c.h>
    1922#include <linux/input.h>
    2023#include <linux/leds.h>
    2124#include <linux/ctype.h>
     25//#include <linux/spi/spi.h>
    2226#include <sound/core.h>
    2327#include <sound/jack.h>
     
    118122        /* hooks */
    119123        void (*init_hook)(struct hda_codec *codec);
    120 #ifdef CONFIG_PM
    121124        void (*power_hook)(struct hda_codec *codec);
    122 #endif
    123125        void (*shutup)(struct hda_codec *codec);
    124126
     
    133135        unsigned int no_internal_mic_pin:1;
    134136        unsigned int en_3kpull_low:1;
     137        int num_speaker_amps;
    135138
    136139        /* for PLL fix */
     
    142145
    143146        /* component binding */
    144         struct component_match *match;
    145         struct hda_component comps[HDA_MAX_COMPONENTS];
     147        struct hda_component_parent comps;
    146148};
    147149
     
    938940#define is_s4_resume(codec) \
    939941        ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
     942#define is_s4_suspend(codec) \
     943        ((codec)->core.dev.power.power_state.event == PM_EVENT_FREEZE)
    940944
    941945static int alc_init(struct hda_codec *codec)
     
    962966}
    963967
    964 #define alc_free        snd_hda_gen_free
    965 
    966 #ifdef CONFIG_PM
     968/* forward declaration */
     969static const struct component_master_ops comp_master_ops;
     970
     971static void alc_free(struct hda_codec *codec)
     972{
     973        struct alc_spec *spec = codec->spec;
     974
     975        if (spec)
     976                hda_component_manager_free(&spec->comps, &comp_master_ops);
     977
     978        snd_hda_gen_free(codec);
     979}
     980
    967981static inline void alc_shutup(struct hda_codec *codec)
    968982{
     
    10031017        return 0;
    10041018}
    1005 #endif
    10061019
    10071020/*
     
    10131026        .free = alc_free,
    10141027        .unsol_event = snd_hda_jack_unsol_event,
    1015 #ifdef CONFIG_PM
    10161028        .resume = alc_resume,
    10171029        .suspend = alc_suspend,
    10181030        .check_power_status = snd_hda_gen_check_power_status,
    1019 #endif
    10201031};
    10211032
     
    30993110                        { 0x18, PIN_VREF50 }, /* rear mic */
    31003111                        { 0x19, PIN_VREF50 }, /* front mic */
    3101                         {}
     3112                        {0}
    31023113                }
    31033114        },
     
    35243535                .v.pins = (const struct hda_pintbl[]) {
    35253536                        { 0x18, PIN_VREF100 }, /* headset mic */
    3526                         {}
     3537                        {0}
    35273538                }
    35283539        },
     
    47594770#endif
    47604771
    4761 #ifdef CONFIG_PM
    47624772static int alc269_suspend(struct hda_codec *codec)
    47634773{
     
    48084818        return 0;
    48094819}
    4810 #endif /* CONFIG_PM */
    48114820
    48124821static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
     
    55615570}
    55625571
    5563 #ifndef TARGET_OS2
     5572struct alc298_samsung_v2_amp_desc {
     5573        unsigned short nid;
     5574        int init_seq_size;
     5575        unsigned short init_seq[18][2];
     5576};
     5577
     5578static const struct alc298_samsung_v2_amp_desc
     5579alc298_samsung_v2_amp_desc_tbl[] = {
     5580        { 0x38, 18, {
     5581                { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
     5582                { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
     5583                { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
     5584                { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
     5585                { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
     5586                { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
     5587        }},
     5588        { 0x39, 18, {
     5589                { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
     5590                { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
     5591                { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
     5592                { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
     5593                { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x2399, 0x0003 },
     5594                { 0x23a4, 0x00b5 }, { 0x23a5, 0x0001 }, { 0x23ba, 0x0094 }
     5595        }},
     5596        { 0x3c, 15, {
     5597                { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
     5598                { 0x201b, 0x0001 }, { 0x201d, 0x0001 }, { 0x201f, 0x00fe },
     5599                { 0x2021, 0x0000 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
     5600                { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
     5601                { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
     5602        }},
     5603        { 0x3d, 15, {
     5604                { 0x23e1, 0x0000 }, { 0x2012, 0x006f }, { 0x2014, 0x0000 },
     5605                { 0x201b, 0x0002 }, { 0x201d, 0x0002 }, { 0x201f, 0x00fd },
     5606                { 0x2021, 0x0001 }, { 0x2022, 0x0010 }, { 0x203d, 0x0005 },
     5607                { 0x203f, 0x0003 }, { 0x2050, 0x002c }, { 0x2076, 0x000e },
     5608                { 0x207c, 0x004a }, { 0x2081, 0x0003 }, { 0x23ba, 0x008d }
     5609        }}
     5610};
     5611
     5612static void alc298_samsung_v2_enable_amps(struct hda_codec *codec)
     5613{
     5614        struct alc_spec *spec = codec->spec;
     5615        static const unsigned short enable_seq[][2] = {
     5616                { 0x203a, 0x0081 }, { 0x23ff, 0x0001 },
     5617        };
     5618        int i, j;
     5619
     5620        for (i = 0; i < spec->num_speaker_amps; i++) {
     5621                alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
     5622                for (j = 0; j < ARRAY_SIZE(enable_seq); j++)
     5623                        alc298_samsung_write_coef_pack(codec, enable_seq[j]);
     5624                codec_dbg(codec, "alc298_samsung_v2: Enabled speaker amp 0x%02x\n",
     5625                                alc298_samsung_v2_amp_desc_tbl[i].nid);
     5626        }
     5627}
     5628
     5629static void alc298_samsung_v2_disable_amps(struct hda_codec *codec)
     5630{
     5631        struct alc_spec *spec = codec->spec;
     5632        static const unsigned short disable_seq[][2] = {
     5633                { 0x23ff, 0x0000 }, { 0x203a, 0x0080 },
     5634        };
     5635        int i, j;
     5636
     5637        for (i = 0; i < spec->num_speaker_amps; i++) {
     5638                alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
     5639                for (j = 0; j < ARRAY_SIZE(disable_seq); j++)
     5640                        alc298_samsung_write_coef_pack(codec, disable_seq[j]);
     5641                codec_dbg(codec, "alc298_samsung_v2: Disabled speaker amp 0x%02x\n",
     5642                                alc298_samsung_v2_amp_desc_tbl[i].nid);
     5643        }
     5644}
     5645
     5646static void alc298_samsung_v2_playback_hook(struct hda_pcm_stream *hinfo,
     5647                                struct hda_codec *codec,
     5648                                struct snd_pcm_substream *substream,
     5649                                int action)
     5650{
     5651        /* Dynamically enable/disable speaker amps before and after playback */
     5652        if (action == HDA_GEN_PCM_ACT_OPEN)
     5653                alc298_samsung_v2_enable_amps(codec);
     5654        if (action == HDA_GEN_PCM_ACT_CLOSE)
     5655                alc298_samsung_v2_disable_amps(codec);
     5656}
     5657
     5658static void alc298_samsung_v2_init_amps(struct hda_codec *codec,
     5659                                int num_speaker_amps)
     5660{
     5661        struct alc_spec *spec = codec->spec;
     5662        int i, j;
     5663
     5664        /* Set spec's num_speaker_amps before doing anything else */
     5665        spec->num_speaker_amps = num_speaker_amps;
     5666
     5667        /* Disable speaker amps before init to prevent any physical damage */
     5668        alc298_samsung_v2_disable_amps(codec);
     5669
     5670        /* Initialize the speaker amps */
     5671        for (i = 0; i < spec->num_speaker_amps; i++) {
     5672                alc_write_coef_idx(codec, 0x22, alc298_samsung_v2_amp_desc_tbl[i].nid);
     5673                for (j = 0; j < alc298_samsung_v2_amp_desc_tbl[i].init_seq_size; j++) {
     5674                        alc298_samsung_write_coef_pack(codec,
     5675                                        alc298_samsung_v2_amp_desc_tbl[i].init_seq[j]);
     5676                }
     5677                alc_write_coef_idx(codec, 0x89, 0x0);
     5678                codec_dbg(codec, "alc298_samsung_v2: Initialized speaker amp 0x%02x\n",
     5679                                alc298_samsung_v2_amp_desc_tbl[i].nid);
     5680        }
     5681
     5682        /* register hook to enable speaker amps only when they are needed */
     5683        spec->gen.pcm_playback_hook = alc298_samsung_v2_playback_hook;
     5684}
     5685
     5686static void alc298_fixup_samsung_amp_v2_2_amps(struct hda_codec *codec,
     5687                                const struct hda_fixup *fix, int action)
     5688{
     5689        if (action == HDA_FIXUP_ACT_PROBE)
     5690                alc298_samsung_v2_init_amps(codec, 2);
     5691}
     5692
     5693static void alc298_fixup_samsung_amp_v2_4_amps(struct hda_codec *codec,
     5694                                const struct hda_fixup *fix, int action)
     5695{
     5696        if (action == HDA_FIXUP_ACT_PROBE)
     5697                alc298_samsung_v2_init_amps(codec, 4);
     5698}
     5699
     5700#ifdef NOT_USED
    55645701static void gpio2_mic_hotkey_event(struct hda_codec *codec,
    55655702                                   struct hda_jack_callback *event)
     
    56085745        return 0;
    56095746}
    5610 #endif /* TARGET_OS2 */
     5747#endif
    56115748
    56125749/* GPIO1 = set according to SKU external amp
     
    72817418        struct alc_spec *spec = codec->spec;
    72827419
    7283         if (action == HDA_FIXUP_ACT_PRE_PROBE) {
     7420        if (action == HDA_FIXUP_ACT_PRE_PROBE)
    72847421                spec->gen.preferred_dacs = preferred_pairs;
    7285                 spec->gen.obey_preferred_dacs = 1;
    7286         }
    72877422}
    72887423#endif /* NOT_USED */
     
    73337468        case HDA_FIXUP_ACT_INIT:
    73347469                alc_combo_jack_hp_jd_restart(codec);
     7470                break;
     7471        }
     7472}
     7473
     7474static void alc256_fixup_chromebook(struct hda_codec *codec,
     7475                                    const struct hda_fixup *fix, int action)
     7476{
     7477        struct alc_spec *spec = codec->spec;
     7478
     7479        switch (action) {
     7480        case HDA_FIXUP_ACT_PRE_PROBE:
     7481                spec->gen.suppress_auto_mute = 1;
     7482                spec->gen.suppress_auto_mic = 1;
     7483                spec->en_3kpull_low = false;
    73357484                break;
    73367485        }
     
    75807729}
    75817730
     7731static void comp_acpi_device_notify(acpi_handle handle, u32 event, void *data)
     7732{
     7733        struct hda_codec *cdc = data;
     7734        struct alc_spec *spec = cdc->spec;
     7735
     7736        codec_info(cdc, "ACPI Notification %d\n", event);
     7737
     7738        hda_component_acpi_device_notify(&spec->comps, handle, event, data);
     7739}
     7740
    75827741static int comp_bind(struct device *dev)
    75837742{
    75847743        struct hda_codec *cdc = dev_to_hda_codec(dev);
    75857744        struct alc_spec *spec = cdc->spec;
    7586 
    7587         return component_bind_all(dev, spec->comps);
     7745        int ret;
     7746
     7747        ret = hda_component_manager_bind(cdc, &spec->comps);
     7748        if (ret)
     7749                return ret;
     7750
     7751        return hda_component_manager_bind_acpi_notifications(cdc,
     7752                                                             &spec->comps,
     7753                                                             comp_acpi_device_notify, cdc);
    75887754}
    75897755
     
    75937759        struct alc_spec *spec = cdc->spec;
    75947760
    7595         component_unbind_all(dev, spec->comps);
     7761        hda_component_manager_unbind_acpi_notifications(cdc, &spec->comps, comp_acpi_device_notify);
     7762        hda_component_manager_unbind(cdc, &spec->comps);
    75967763}
    75977764
     
    76057772{
    76067773        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 
    7623 struct 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 */
    7630 static 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 
    7648 static 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 
    7668 static 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);
     7774
     7775        hda_component_manager_playback_hook(&spec->comps, action);
     7776}
     7777
     7778static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
     7779                               const char *hid, const char *match_str, int count)
     7780{
    76727781        struct alc_spec *spec = cdc->spec;
    7673         struct scodec_dev_name *rec;
    7674         int ret, i;
     7782        int ret;
    76757783
    76767784        switch (action) {
    76777785        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);
     7786                ret = hda_component_manager_init(cdc, &spec->comps, count, bus, hid,
     7787                                                 match_str, &comp_master_ops);
    76907788                if (ret)
    7691                         codec_err(cdc, "Fail to register component aggregator %d\n", ret);
    7692                 else
     7789                        return;
     7790
    76937791                        spec->gen.pcm_playback_hook = comp_generic_playback_hook;
    76947792                break;
    76957793        case HDA_FIXUP_ACT_FREE:
    7696                 component_master_del(dev, &comp_master_ops);
    7697                 break;
    7698         }
    7699 }
    7700 
    7701 static void tas2781_generic_fixup(struct hda_codec *cdc, int action,
    7702         const char *bus, const char *hid)
    7703 {
     7794                hda_component_manager_free(&spec->comps, &comp_master_ops);
     7795                break;
     7796        }
     7797}
     7798
     7799static void find_cirrus_companion_amps(struct hda_codec *cdc)
     7800{
     7801#ifndef TARGET_OS2
    77047802        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         }
     7803        struct acpi_device *adev;
     7804        struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
     7805        const char *bus = NULL;
     7806        static const struct {
     7807                const char *hid;
     7808                const char *name;
     7809        } acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
     7810                        { "CSC3556", "cs35l56-hda" },
     7811                        { "CSC3557", "cs35l57-hda" }};
     7812        char *match;
     7813        int i, count = 0, count_devindex = 0;
     7814
     7815        for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
     7816                adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
     7817                if (adev)
     7818                break;
     7819        }
     7820
     7821        if (!adev) {
     7822                codec_dbg(cdc, "Did not find ACPI entry for a Cirrus Amp\n");
     7823                return;
     7824        }
     7825
     7826        count = i2c_acpi_client_count(adev);
     7827        if (count > 0) {
     7828                bus = "i2c";
     7829        } else {
     7830                count = acpi_spi_count_resources(adev);
     7831                if (count > 0)
     7832                        bus = "spi";
     7833        }
     7834
     7835        fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
     7836        acpi_dev_put(adev);
     7837
     7838        if (!bus) {
     7839                codec_err(cdc, "Did not find any buses for %s\n", acpi_ids[i].hid);
     7840                return;
     7841        }
     7842
     7843        if (!fwnode) {
     7844                codec_err(cdc, "Could not get fwnode for %s\n", acpi_ids[i].hid);
     7845                return;
     7846        }
     7847
     7848        /*
     7849         * When available the cirrus,dev-index property is an accurate
     7850         * count of the amps in a system and is used in preference to
     7851         * the count of bus devices that can contain additional address
     7852         * alias entries.
     7853         */
     7854        count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
     7855        if (count_devindex > 0)
     7856                count = count_devindex;
     7857        match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
     7858        if (!match)
     7859                return;
     7860        codec_info(cdc, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
     7861        comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
     7862#else
     7863        codec_dbg(cdc, "Cirrus Amp detection not supported on OS/2\n");
     7864        return;
     7865
     7866#endif
    77347867}
    77357868
    77367869static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
    77377870{
    7738         cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
     7871        comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
     7872}
     7873
     7874static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
     7875{
     7876        comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
    77397877}
    77407878
    77417879static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
    77427880{
    7743         cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);
     7881        comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
    77447882}
    77457883
    77467884static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
    77477885{
    7748         cs35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);
     7886        comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
    77497887}
    77507888
     
    77527890                                                 int action)
    77537891{
    7754         cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
    7755 }
    7756 
    7757 #ifndef TARGET_OS2
     7892        comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2);
     7893}
     7894
     7895#ifdef NOT_USED
    77587896static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
    77597897                                                 int action)
    77607898{
    7761         cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0101", 2);
    7762 }
    7763 #endif /* TARGET_OS2 */
     7899        comp_generic_fixup(cdc, action, "i2c", "CLSA0101", "-%s:00-cs35l41-hda.%d", 2);
     7900}
     7901#endif
     7902
     7903static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
     7904{
     7905        /*
     7906         * The same SSID has been re-used in different hardware, they have
     7907         * different codecs and the newer GA403U has a ALC285.
     7908         */
     7909        if (cdc->core.vendor_id != 0x10ec0285)
     7910                alc_fixup_inv_dmic(cdc, fix, action);
     7911}
    77647912
    77657913static void tas2781_fixup_i2c(struct hda_codec *cdc,
    77667914        const struct hda_fixup *fix, int action)
    77677915{
    7768          tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781");
    7769 }
     7916        comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
     7917}
     7918
     7919static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
     7920        const struct hda_fixup *fix, int action)
     7921{
     7922        comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
     7923}
     7924
     7925static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
     7926        const struct hda_fixup *fix, int action)
     7927{
     7928        alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
     7929}
     7930
    77707931
    77717932/* for alc295_fixup_hp_top_speakers */
     
    78337994                snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
    78347995        }
     7996}
     7997
     7998static void alc256_decrease_headphone_amp_val(struct hda_codec *codec,
     7999                                              const struct hda_fixup *fix, int action)
     8000{
     8001        u32 caps;
     8002        u8 nsteps, offs;
     8003
     8004        if (action != HDA_FIXUP_ACT_PRE_PROBE)
     8005                return;
     8006
     8007        caps = query_amp_caps(codec, 0x3, HDA_OUTPUT);
     8008        nsteps = ((caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT) - 10;
     8009        offs = ((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT) - 10;
     8010        caps &= ~AC_AMPCAP_NUM_STEPS & ~AC_AMPCAP_OFFSET;
     8011        caps |= (nsteps << AC_AMPCAP_NUM_STEPS_SHIFT) | (offs << AC_AMPCAP_OFFSET_SHIFT);
     8012
     8013        if (snd_hda_override_amp_caps(codec, 0x3, HDA_OUTPUT, caps))
     8014                codec_warn(codec, "failed to override amp caps for NID 0x3\n");
    78358015}
    78368016
     
    79738153                break;
    79748154        }
     8155}
     8156
     8157static void alc245_fixup_hp_spectre_x360_eu0xxx(struct hda_codec *codec,
     8158                                          const struct hda_fixup *fix, int action)
     8159{
     8160        /*
     8161         * The Pin Complex 0x14 for the treble speakers is wrongly reported as
     8162         * unconnected.
     8163         * The Pin Complex 0x17 for the bass speakers has the lowest association
     8164         * and sequence values so shift it up a bit to squeeze 0x14 in.
     8165         */
     8166        static const struct hda_pintbl pincfgs[] = {
     8167                { 0x14, 0x90170110 }, // top/treble
     8168                { 0x17, 0x90170111 }, // bottom/bass
     8169                {0}
     8170        };
     8171
     8172        /*
     8173         * Force DAC 0x02 for the bass speakers 0x17.
     8174         */
     8175        static const hda_nid_t conn[] = { 0x02 };
     8176
     8177        switch (action) {
     8178        case HDA_FIXUP_ACT_PRE_PROBE:
     8179                snd_hda_apply_pincfgs(codec, pincfgs);
     8180                snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     8181                break;
     8182        }
     8183
     8184        cs35l41_fixup_i2c_two(codec, fix, action);
     8185#ifdef NOT_USED
     8186        alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
     8187        alc245_fixup_hp_gpio_led(codec, fix, action);
     8188#endif
     8189}
     8190
     8191/* some changes for Spectre x360 16, 2024 model */
     8192static void alc245_fixup_hp_spectre_x360_16_aa0xxx(struct hda_codec *codec,
     8193                                          const struct hda_fixup *fix, int action)
     8194{
     8195        /*
     8196         * The Pin Complex 0x14 for the treble speakers is wrongly reported as
     8197         * unconnected.
     8198         * The Pin Complex 0x17 for the bass speakers has the lowest association
     8199         * and sequence values so shift it up a bit to squeeze 0x14 in.
     8200         */
     8201        struct alc_spec *spec = codec->spec;
     8202        static const struct hda_pintbl pincfgs[] = {
     8203                { 0x14, 0x90170110 }, // top/treble
     8204                { 0x17, 0x90170111 }, // bottom/bass
     8205                {0}
     8206        };
     8207
     8208        /*
     8209         * Force DAC 0x02 for the bass speakers 0x17.
     8210         */
     8211        static const hda_nid_t conn[] = { 0x02 };
     8212
     8213        switch (action) {
     8214        case HDA_FIXUP_ACT_PRE_PROBE:
     8215                /* needed for amp of back speakers */
     8216                spec->gpio_mask |= 0x01;
     8217                spec->gpio_dir |= 0x01;
     8218                snd_hda_apply_pincfgs(codec, pincfgs);
     8219                snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
     8220                break;
     8221        case HDA_FIXUP_ACT_INIT:
     8222                /* need to toggle GPIO to enable the amp of back speakers */
     8223                alc_update_gpio_data(codec, 0x01, true);
     8224                msleep(100);
     8225                alc_update_gpio_data(codec, 0x01, false);
     8226                break;
     8227        }
     8228
     8229        cs35l41_fixup_i2c_two(codec, fix, action);
     8230#ifdef NOT_USED
     8231        alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
     8232        alc245_fixup_hp_gpio_led(codec, fix, action);
     8233#endif
     8234}
     8235
     8236/*
     8237 * ALC287 PCM hooks
     8238 */
     8239static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
     8240                                   struct hda_codec *codec,
     8241                                   struct snd_pcm_substream *substream,
     8242                                   int action)
     8243{
     8244        switch (action) {
     8245        case HDA_GEN_PCM_ACT_OPEN:
     8246                alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
     8247                break;
     8248        case HDA_GEN_PCM_ACT_CLOSE:
     8249                alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
     8250                break;
     8251        }
     8252}
     8253
     8254static void alc287_s4_power_gpio3_default(struct hda_codec *codec)
     8255{
     8256#ifndef TARGET_OS2
     8257        if (is_s4_suspend(codec)) {
     8258                alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
     8259        }
     8260#endif
     8261}
     8262
     8263static void alc287_fixup_lenovo_thinkpad_with_alc1318(struct hda_codec *codec,
     8264                               const struct hda_fixup *fix, int action)
     8265{
     8266        struct alc_spec *spec = codec->spec;
     8267        static const struct coef_fw coefs[] = {
     8268                WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC300),
     8269                WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
     8270                WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC301),
     8271                WRITE_COEF(0x28, 0x0001), WRITE_COEF(0x29, 0xb023),
     8272        };
     8273
     8274        if (action != HDA_FIXUP_ACT_PRE_PROBE)
     8275                return;
     8276        alc_update_coef_idx(codec, 0x10, 1<<11, 1<<11);
     8277        alc_process_coef_fw(codec, coefs);
     8278        spec->power_hook = alc287_s4_power_gpio3_default;
     8279        spec->gen.pcm_playback_hook = alc287_alc1318_playback_pcm_hook;
    79758280}
    79768281
     
    81798484        ALC236_FIXUP_LENOVO_INV_DMIC,
    81808485        ALC298_FIXUP_SAMSUNG_AMP,
     8486        ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS,
     8487        ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS,
    81818488        ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
    81828489        ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
     
    82028509        ALC274_FIXUP_HP_HEADSET_MIC,
    82038510        ALC274_FIXUP_HP_ENVY_GPIO,
     8511        ALC274_FIXUP_ASUS_ZEN_AIO_27,
    82048512        ALC256_FIXUP_ASUS_HPE,
    82058513        ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
     
    82248532        ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
    82258533        ALC298_FIXUP_LENOVO_C940_DUET7,
    8226         ALC287_FIXUP_LENOVO_14IRP8_DUETITL,
    82278534        ALC287_FIXUP_13S_GEN2_SPEAKERS,
    82288535        ALC256_FIXUP_SET_COEF_DEFAULTS,
     
    82358542        ALC287_FIXUP_CS35L41_I2C_2,
    82368543        ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
     8544        ALC287_FIXUP_CS35L41_I2C_4,
    82378545        ALC245_FIXUP_CS35L41_SPI_2,
    82388546        ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
     
    82498557        ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
    82508558        ALC287_FIXUP_TAS2781_I2C,
     8559        ALC287_FIXUP_YOGA7_14ARB7_I2C,
    82518560        ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
    82528561        ALC245_FIXUP_HP_X360_MUTE_LEDS,
     
    82568565        ALC289_FIXUP_DELL_CS35L41_SPI_2,
    82578566        ALC294_FIXUP_CS35L41_I2C_2,
     8567        ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
     8568        ALC256_FIXUP_HEADPHONE_AMP_VOL,
     8569        ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX,
     8570        ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX,
     8571        ALC285_FIXUP_ASUS_GA403U,
     8572        ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC,
     8573        ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1,
     8574        ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
     8575        ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1,
     8576        ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318,
     8577        ALC256_FIXUP_CHROME_BOOK,
     8578        ALC245_FIXUP_CLEVO_NOISY_MIC,
     8579        ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE,
     8580        ALC233_FIXUP_MEDION_MTL_SPK,
    82588581};
    82598582
     
    84438766                        {0}
    84448767};
    8445 #endif
    8446 
    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  */
    8455 static 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 */
     8768
     8769static const struct hda_pintbl ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC_PINS[] = {
     8770                        { 0x19, 0x03a11050 },
     8771                        { 0x1b, 0x03a11c30 },
     8772                        {0}
     8773};
     8774
     8775static const struct hda_pintbl ALC294_FIXUP_LENOVO_MIC_LOCATION_PINS[] = {
     8776                        /* Change the mic location from front to right, otherwise there are
     8777                           two front mics with the same name, pulseaudio can't handle them.
     8778                           This is just a temporary workaround, after applying this fixup,
     8779                           there will be one "Front Mic" and one "Mic" in this machine.
     8780                         */
     8781                        { 0x1a, 0x04a19040 },
     8782                        {0}
     8783};
     8784#endif
    84688785
    84698786static const struct hda_fixup alc269_fixups[] = {
     
    95989915                .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
    95999916        },
     9917#endif
    96009918        [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
    96019919                .type = HDA_FIXUP_PINS,
     9920#ifndef TARGET_OS2
    96029921                .v.pins = (const struct hda_pintbl[]) {
    96039922                        /* Change the mic location from front to right, otherwise there are
     
    96099928                        {0}
    96109929                },
    9611         },
     9930#else
     9931                .v.pins = ALC294_FIXUP_LENOVO_MIC_LOCATION_PINS,
     9932#endif
     9933        },
     9934#ifdef NOT_USED
    96129935        [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
    96139936                .type = HDA_FIXUP_PINS,
     
    1012310446                .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
    1012410447        },
     10448        [ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS] = {
     10449                .type = HDA_FIXUP_FUNC,
     10450                .v.func = alc298_fixup_samsung_amp_v2_2_amps
     10451        },
     10452        [ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS] = {
     10453                .type = HDA_FIXUP_FUNC,
     10454                .v.func = alc298_fixup_samsung_amp_v2_4_amps
     10455        },
    1012510456#ifdef NOT_USED
    1012610457        [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
     
    1033410665                .v.func = alc274_fixup_hp_envy_gpio,
    1033510666        },
     10667        [ALC274_FIXUP_ASUS_ZEN_AIO_27] = {
     10668                .type = HDA_FIXUP_VERBS,
     10669                .v.verbs = (const struct hda_verb[]) {
     10670                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x10 },
     10671                        { 0x20, AC_VERB_SET_PROC_COEF, 0xc420 },
     10672                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
     10673                        { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
     10674                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 },
     10675                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0249 },
     10676                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x4a },
     10677                        { 0x20, AC_VERB_SET_PROC_COEF, 0x202b },
     10678                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x62 },
     10679                        { 0x20, AC_VERB_SET_PROC_COEF, 0xa007 },
     10680                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x6b },
     10681                        { 0x20, AC_VERB_SET_PROC_COEF, 0x5060 },
     10682                        {0}
     10683                },
     10684                .chained = true,
     10685                .chain_id = ALC2XX_FIXUP_HEADSET_MIC,
     10686        },
    1033610687        [ALC256_FIXUP_ASUS_HPE] = {
    1033710688                .type = HDA_FIXUP_VERBS,
     
    1040810759                        { 0x1e, 0x411111f0 },
    1040910760                        { 0x21, 0x03211020 },
    10410                         {}
     10761                        {0}
    1041110762                },
    1041210763                .chained = true,
     
    1050510856                         { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
    1050610857                         { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
    10507                          {}
     10858                         {0}
    1050810859                },
    1050910860                .chained = true,
     
    1055210903                         { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
    1055310904                         { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
    10554                          {}
     10905                         {0}
    1055510906                },
    1055610907                .chained = true,
     
    1056010911                .type = HDA_FIXUP_FUNC,
    1056110912                .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,
    1056610913        },
    1056710914        [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
     
    1058210929                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
    1058310930                        { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
    10584                         {}
     10931                        {0}
    1058510932                },
    1058610933                .chained = true,
     
    1063010977                .chained = true,
    1063110978                .chain_id = ALC285_FIXUP_HP_MUTE_LED,
     10979        },
     10980        [ALC287_FIXUP_CS35L41_I2C_4] = {
     10981                .type = HDA_FIXUP_FUNC,
     10982                .v.func = cs35l41_fixup_i2c_four,
    1063210983        },
    1063310984        [ALC245_FIXUP_CS35L41_SPI_2] = {
     
    1078211133                .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
    1078311134        },
     11135        [ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
     11136                .type = HDA_FIXUP_FUNC,
     11137                .v.func = yoga7_14arb7_fixup_i2c,
     11138                .chained = true,
     11139                .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
     11140        },
    1078411141        [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = {
    1078511142                .type = HDA_FIXUP_FUNC,
     
    1081811175                .v.func = cs35l41_fixup_i2c_two,
    1081911176        },
     11177        [ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
     11178                .type = HDA_FIXUP_FUNC,
     11179                .v.func = alc256_fixup_acer_sfg16_micmute_led,
     11180        },
     11181        [ALC256_FIXUP_HEADPHONE_AMP_VOL] = {
     11182                .type = HDA_FIXUP_FUNC,
     11183                .v.func = alc256_decrease_headphone_amp_val,
     11184        },
     11185        [ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX] = {
     11186                .type = HDA_FIXUP_FUNC,
     11187                .v.func = alc245_fixup_hp_spectre_x360_eu0xxx,
     11188        },
     11189        [ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX] = {
     11190                .type = HDA_FIXUP_FUNC,
     11191                .v.func = alc245_fixup_hp_spectre_x360_16_aa0xxx,
     11192        },
     11193        [ALC285_FIXUP_ASUS_GA403U] = {
     11194                .type = HDA_FIXUP_FUNC,
     11195                .v.func = alc285_fixup_asus_ga403u,
     11196        },
     11197        [ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC] = {
     11198                .type = HDA_FIXUP_PINS,
     11199#ifndef TARGET_OS2
     11200                .v.pins = (const struct hda_pintbl[]) {
     11201                        { 0x19, 0x03a11050 },
     11202                        { 0x1b, 0x03a11c30 },
     11203                        { }
     11204                },
     11205#else
     11206                .v.pins = ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC_PINS,
     11207#endif
     11208                .chained = true,
     11209                .chain_id = ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1
     11210        },
     11211        [ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1] = {
     11212                .type = HDA_FIXUP_FUNC,
     11213                .v.func = alc285_fixup_speaker2_to_dac1,
     11214                .chained = true,
     11215                .chain_id = ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC,
     11216        },
     11217#ifdef NOT_USED
     11218        [ALC285_FIXUP_ASUS_GU605_SPI_2_HEADSET_MIC] = {
     11219                .type = HDA_FIXUP_PINS,
     11220                .v.pins = (const struct hda_pintbl[]) {
     11221                        { 0x19, 0x03a11050 },
     11222                        { 0x1b, 0x03a11c30 },
     11223                        { }
     11224                },
     11225        },
     11226#endif
     11227        [ALC285_FIXUP_ASUS_GA403U_I2C_SPEAKER2_TO_DAC1] = {
     11228                .type = HDA_FIXUP_FUNC,
     11229                .v.func = alc285_fixup_speaker2_to_dac1,
     11230                .chained = true,
     11231                .chain_id = ALC285_FIXUP_ASUS_GA403U,
     11232        },
     11233        [ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318] = {
     11234                .type = HDA_FIXUP_FUNC,
     11235                .v.func = alc287_fixup_lenovo_thinkpad_with_alc1318,
     11236                .chained = true,
     11237                .chain_id = ALC269_FIXUP_THINKPAD_ACPI
     11238        },
     11239        [ALC256_FIXUP_CHROME_BOOK] = {
     11240                .type = HDA_FIXUP_FUNC,
     11241                .v.func = alc256_fixup_chromebook,
     11242                .chained = true,
     11243                .chain_id = ALC225_FIXUP_HEADSET_JACK
     11244        },
     11245        [ALC245_FIXUP_CLEVO_NOISY_MIC] = {
     11246                .type = HDA_FIXUP_FUNC,
     11247                .v.func = alc269_fixup_limit_int_mic_boost,
     11248                .chained = true,
     11249                .chain_id = ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
     11250        },
     11251#ifdef NOT_USED
     11252        [ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE] = {
     11253                .type = HDA_FIXUP_PINS,
     11254                .v.pins = (const struct hda_pintbl[]) {
     11255                        { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
     11256                        { 0x1b, 0x20a11040 }, /* dock mic */
     11257                        { }
     11258                },
     11259                .chained = true,
     11260                .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
     11261        },
     11262        [ALC233_FIXUP_MEDION_MTL_SPK] = {
     11263                .type = HDA_FIXUP_PINS,
     11264                .v.pins = (const struct hda_pintbl[]) {
     11265                        { 0x1b, 0x90170110 },
     11266                        { }
     11267                },
     11268        },
     11269#endif
    1082011270};
    1082111271
     
    1086511315        SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
    1086611316        SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
     11317        SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC),
     11318        SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
    1086711319        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
    1086811320        SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
     
    1092411376        SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
    1092511377        SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
     11378        SND_PCI_QUIRK(0x1028, 0x0b27, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
     11379        SND_PCI_QUIRK(0x1028, 0x0b28, "Dell", ALC245_FIXUP_CS35L41_SPI_2),
    1092611380        SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
    1092711381        SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     
    1093711391        SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
    1093811392        SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
     11393        SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
     11394        SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
     11395        SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC287_FIXUP_TAS2781_I2C),
     11396        SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC287_FIXUP_TAS2781_I2C),
    1093911397        SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
    1094011398        SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
     
    1111811576        SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
    1111911577        SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11578        SND_PCI_QUIRK(0x103c, 0x89e7, "HP Elite x2 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1112011579        SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED),
    1112111580        SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
    1112211581        SND_PCI_QUIRK(0x103c, 0x8a25, "HP Victus 16-d1xxx (MB 8A25)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
     11582        SND_PCI_QUIRK(0x103c, 0x8a28, "HP Envy 13", ALC287_FIXUP_CS35L41_I2C_2),
     11583        SND_PCI_QUIRK(0x103c, 0x8a29, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11584        SND_PCI_QUIRK(0x103c, 0x8a2a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11585        SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11586        SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11587        SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11588        SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11589        SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11590        SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11591        SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4),
     11592        SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
    1112311593        SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
    1112411594        SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
     
    1113011600        SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1113111601        SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11602        SND_PCI_QUIRK(0x103c, 0x8ad8, "HP 800 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1113211603        SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
    1113311604        SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
     11605        SND_PCI_QUIRK(0x103c, 0x8b3a, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
    1113411606        SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED),
    1113511607        SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     
    1116011632        SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
    1116111633        SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11634        SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
     11635        SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
     11636        SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11637        SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11638        SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11639        SND_PCI_QUIRK(0x103c, 0x8be0, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11640        SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11641        SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11642        SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11643        SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11644        SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11645        SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11646        SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11647        SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
    1116211648        SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
     11649        SND_PCI_QUIRK(0x103c, 0x8c15, "HP Spectre x360 2-in-1 Laptop 14-eu0xxx", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX),
     11650        SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre x360 2-in-1 Laptop 16-aa0xxx", ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX),
     11651        SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2),
     11652        SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS),
     11653        SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
    1116311654        SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1116411655        SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1116511656        SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1116611657        SND_PCI_QUIRK(0x103c, 0x8c49, "HP Elite x360 830 2-in-1 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11658        SND_PCI_QUIRK(0x103c, 0x8c4d, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
     11659        SND_PCI_QUIRK(0x103c, 0x8c4e, "HP Omen", ALC287_FIXUP_CS35L41_I2C_2),
     11660        SND_PCI_QUIRK(0x103c, 0x8c4f, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
     11661        SND_PCI_QUIRK(0x103c, 0x8c50, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11662        SND_PCI_QUIRK(0x103c, 0x8c51, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11663        SND_PCI_QUIRK(0x103c, 0x8c52, "HP EliteBook 1040 G11", ALC285_FIXUP_HP_GPIO_LED),
     11664        SND_PCI_QUIRK(0x103c, 0x8c53, "HP Elite x360 1040 2-in-1 G11", ALC285_FIXUP_HP_GPIO_LED),
     11665        SND_PCI_QUIRK(0x103c, 0x8c66, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
     11666        SND_PCI_QUIRK(0x103c, 0x8c67, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11667        SND_PCI_QUIRK(0x103c, 0x8c68, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
     11668        SND_PCI_QUIRK(0x103c, 0x8c6a, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
    1116711669        SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
    1116811670        SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     
    1118811690        SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
    1118911691        SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
     11692        SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
     11693        SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS),
     11694        SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
     11695        SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2),
     11696        SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
     11697        SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
    1119011698        SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
    1119111699        SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED),
     
    1120011708        SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
    1120111709        SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
     11710        SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C),
    1120211711        SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
    1120311712        SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
    1120411713        SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
     11714        SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C),
    1120511715        SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
    1120611716        SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
     11717        SND_PCI_QUIRK(0x1043, 0x1204, "ASUS Strix G615JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
     11718        SND_PCI_QUIRK(0x1043, 0x1214, "ASUS Strix G615LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
    1120711719        SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
    1120811720        SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
     
    1123311745        SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2),
    1123411746        SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
     11747        SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2),
    1123511748        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
     11749        SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS UX7602VI/BZ", ALC245_FIXUP_CS35L41_SPI_2),
    1123611750        SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
    1123711751        SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
    1123811752        SND_PCI_QUIRK(0x1043, 0x17f3, "ROG Ally NR2301L/X", ALC294_FIXUP_ASUS_ALLY),
     11753        SND_PCI_QUIRK(0x1043, 0x1863, "ASUS UX6404VI/VV", ALC245_FIXUP_CS35L41_SPI_2),
    1123911754        SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
    1124011755        SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
     
    1125111766        SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
    1125211767        SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
    11253         SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
     11768        SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
    1125411769        SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2),
    1125511770        SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
     
    1125911774        SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2),
    1126011775        SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
     11776        SND_PCI_QUIRK(0x1043, 0x1c63, "ASUS GU605M", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
    1126111777        SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
    1126211778        SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC),
     
    1127311789        SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
    1127411790        SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2),
     11791        SND_PCI_QUIRK(0x1043, 0x1e1f, "ASUS Vivobook 15 X1504VAP", ALC2XX_FIXUP_HEADSET_MIC),
    1127511792        SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
    1127611793        SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
     11794        SND_PCI_QUIRK(0x1043, 0x1e63, "ASUS H7606W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
     11795        SND_PCI_QUIRK(0x1043, 0x1e83, "ASUS GA605W", ALC285_FIXUP_ASUS_GU605_SPI_SPEAKER2_TO_DAC1),
    1127711796        SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
     11797        SND_PCI_QUIRK(0x1043, 0x1eb3, "ASUS Ally RCLA72", ALC287_FIXUP_TAS2781_I2C),
     11798        SND_PCI_QUIRK(0x1043, 0x1ed3, "ASUS HN7306W", ALC287_FIXUP_CS35L41_I2C_2),
    1127811799        SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2),
    1127911800        SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
    1128011801        SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
    1128111802        SND_PCI_QUIRK(0x1043, 0x1f12, "ASUS UM5302", ALC287_FIXUP_CS35L41_I2C_2),
     11803        SND_PCI_QUIRK(0x1043, 0x1f1f, "ASUS H7604JI/JV/J3D", ALC245_FIXUP_CS35L41_SPI_2),
    1128211804        SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2),
    1128311805        SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
    1128411806        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),
     11807        SND_PCI_QUIRK(0x1043, 0x31d0, "ASUS Zen AIO 27 Z272SD_A272SD", ALC274_FIXUP_ASUS_ZEN_AIO_27),
     11808        SND_PCI_QUIRK(0x1043, 0x3a20, "ASUS G614JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
     11809        SND_PCI_QUIRK(0x1043, 0x3a30, "ASUS G814JVR/JIR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
    1128711810        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),
     11811        SND_PCI_QUIRK(0x1043, 0x3a50, "ASUS G834JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
     11812        SND_PCI_QUIRK(0x1043, 0x3a60, "ASUS G634JYR/JZR", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS),
     11813        SND_PCI_QUIRK(0x1043, 0x3e30, "ASUS TP3607SA", ALC287_FIXUP_TAS2781_I2C),
     11814        SND_PCI_QUIRK(0x1043, 0x3ee0, "ASUS Strix G815_JHR_JMR_JPR", ALC287_FIXUP_TAS2781_I2C),
     11815        SND_PCI_QUIRK(0x1043, 0x3ef0, "ASUS Strix G635LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
     11816        SND_PCI_QUIRK(0x1043, 0x3f00, "ASUS Strix G815LH_LM_LP", ALC287_FIXUP_TAS2781_I2C),
     11817        SND_PCI_QUIRK(0x1043, 0x3f10, "ASUS Strix G835LR_LW_LX", ALC287_FIXUP_TAS2781_I2C),
     11818        SND_PCI_QUIRK(0x1043, 0x3f20, "ASUS Strix G615LR_LW", ALC287_FIXUP_TAS2781_I2C),
     11819        SND_PCI_QUIRK(0x1043, 0x3f30, "ASUS Strix G815LR_LW", ALC287_FIXUP_TAS2781_I2C),
    1129011820        SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
    1129111821        SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
     
    1131411844        SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
    1131511845        SND_PCI_QUIRK(0x10ec, 0x12cc, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
     11846        SND_PCI_QUIRK(0x10ec, 0x12f6, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
    1131611847        SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
    1131711848        SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
     
    1133011861        SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
    1133111862        SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
     11863        SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
     11864        SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
     11865        SND_PCI_QUIRK(0x144d, 0xc886, "Samsung Galaxy Book3 Pro (NP964XFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
     11866        SND_PCI_QUIRK(0x144d, 0xc1ca, "Samsung Galaxy Book3 Pro 360 (NP960QFG)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
     11867        SND_PCI_QUIRK(0x144d, 0xc1cc, "Samsung Galaxy Book3 Ultra (NT960XFH)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
    1133211868        SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
    1133311869        SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
     
    1140511941        SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1140611942        SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     11943        SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE),
    1140711944        SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1140811945        SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1140911946        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),
     11947        SND_PCI_QUIRK(0x1558, 0xa741, "Clevo V54x_6x_TNE", ALC245_FIXUP_CLEVO_NOISY_MIC),
     11948        SND_PCI_QUIRK(0x1558, 0xa763, "Clevo V54x_6x_TU", ALC245_FIXUP_CLEVO_NOISY_MIC),
    1141111949        SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
    1141211950        SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
     
    1146312001        SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
    1146412002        SND_PCI_QUIRK(0x17aa, 0x231a, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     12003        SND_PCI_QUIRK(0x17aa, 0x231e, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
     12004        SND_PCI_QUIRK(0x17aa, 0x231f, "Thinkpad", ALC287_FIXUP_LENOVO_THKPAD_WH_ALC1318),
     12005        SND_PCI_QUIRK(0x17aa, 0x2326, "Hera2", ALC287_FIXUP_TAS2781_I2C),
    1146512006        SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
    1146612007        SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
     
    1147912020        SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
    1148012021        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),
     12022        HDA_CODEC_QUIRK(0x17aa, 0x3802, "DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
     12023        SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga Pro 9 14IRP8", ALC287_FIXUP_TAS2781_I2C),
    1148212024        SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
    1148312025        SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
    1148412026        SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
    11485         SND_PCI_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
     12027        HDA_CODEC_QUIRK(0x17aa, 0x3820, "IdeaPad 330-17IKB 81DM", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
     12028        SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
    1148612029        SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
    1148712030        SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
     
    1149712040        SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2),
    1149812041        SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     12042        HDA_CODEC_QUIRK(0x17aa, 0x386e, "Legion Y9000X 2022 IAH7", ALC287_FIXUP_CS35L41_I2C_2),
     12043        SND_PCI_QUIRK(0x17aa, 0x386e, "Yoga Pro 7 14ARP8", ALC285_FIXUP_SPEAKER2_TO_DAC1),
     12044        HDA_CODEC_QUIRK(0x17aa, 0x38a8, "Legion Pro 7 16ARX8H", ALC287_FIXUP_TAS2781_I2C), /* this must match before PCI SSID 17aa:386f below */
     12045        SND_PCI_QUIRK(0x17aa, 0x386f, "Legion Pro 7i 16IAX7", ALC287_FIXUP_CS35L41_I2C_2),
     12046        SND_PCI_QUIRK(0x17aa, 0x3870, "Lenovo Yoga 7 14ARB7", ALC287_FIXUP_YOGA7_14ARB7_I2C),
     12047        SND_PCI_QUIRK(0x17aa, 0x3877, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
     12048        SND_PCI_QUIRK(0x17aa, 0x3878, "Lenovo Legion 7 Slim 16ARHA7", ALC287_FIXUP_CS35L41_I2C_2),
    1149912049        SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C),
    1150012050        SND_PCI_QUIRK(0x17aa, 0x387e, "Yoga S780-16 pro Quad YC", ALC287_FIXUP_TAS2781_I2C),
     12051        SND_PCI_QUIRK(0x17aa, 0x387f, "Yoga S780-16 pro dual LX", ALC287_FIXUP_TAS2781_I2C),
     12052        SND_PCI_QUIRK(0x17aa, 0x3880, "Yoga S780-16 pro dual YC", ALC287_FIXUP_TAS2781_I2C),
    1150112053        SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C),
    1150212054        SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     
    1150412056        SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
    1150512057        SND_PCI_QUIRK(0x17aa, 0x3891, "Lenovo Yoga Pro 7 14AHP9", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
     12058        SND_PCI_QUIRK(0x17aa, 0x38a5, "Y580P AMD dual", ALC287_FIXUP_TAS2781_I2C),
    1150612059        SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C),
    1150712060        SND_PCI_QUIRK(0x17aa, 0x38a8, "Y780P AMD VECO dual", ALC287_FIXUP_TAS2781_I2C),
     12061        SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     12062        SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     12063        SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
     12064        SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2),
     12065        SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
     12066        SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
     12067        SND_PCI_QUIRK(0x17aa, 0x38b8, "Yoga S780-14.5 proX AMD YC Dual", ALC287_FIXUP_TAS2781_I2C),
     12068        SND_PCI_QUIRK(0x17aa, 0x38b9, "Yoga S780-14.5 proX AMD LX Dual", ALC287_FIXUP_TAS2781_I2C),
    1150812069        SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C),
    1150912070        SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C),
     
    1151112072        SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
    1151212073        SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
     12074        SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
     12075        SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
    1151312076        SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
    1151412077        SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
    1151512078        SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
     12079        SND_PCI_QUIRK(0x17aa, 0x38d3, "Yoga S990-16 Pro IMH YC Dual", ALC287_FIXUP_TAS2781_I2C),
     12080        SND_PCI_QUIRK(0x17aa, 0x38d4, "Yoga S990-16 Pro IMH VECO Dual", ALC287_FIXUP_TAS2781_I2C),
     12081        SND_PCI_QUIRK(0x17aa, 0x38d5, "Yoga S990-16 Pro IMH YC Quad", ALC287_FIXUP_TAS2781_I2C),
     12082        SND_PCI_QUIRK(0x17aa, 0x38d6, "Yoga S990-16 Pro IMH VECO Quad", ALC287_FIXUP_TAS2781_I2C),
    1151612083        SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
     12084        SND_PCI_QUIRK(0x17aa, 0x38df, "Yoga Y990 Intel YC Dual", ALC287_FIXUP_TAS2781_I2C),
     12085        SND_PCI_QUIRK(0x17aa, 0x38e0, "Yoga Y990 Intel VECO Dual", ALC287_FIXUP_TAS2781_I2C),
     12086        SND_PCI_QUIRK(0x17aa, 0x38f8, "Yoga Book 9i", ALC287_FIXUP_TAS2781_I2C),
    1151712087        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),
     12088        SND_PCI_QUIRK(0x17aa, 0x38f9, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     12089        SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
     12090        SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
    1152012091        SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
    1152112092        SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
     12093        SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
     12094        SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
    1152212095        SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
    1152312096        SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
     
    1154712120        SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
    1154812121        SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
     12122        SND_PCI_QUIRK(0x1854, 0x0440, "LG CQ6", ALC256_FIXUP_HEADPHONE_AMP_VOL),
     12123        SND_PCI_QUIRK(0x1854, 0x0441, "LG CQ6 AIO", ALC256_FIXUP_HEADPHONE_AMP_VOL),
     12124        SND_PCI_QUIRK(0x1854, 0x0488, "LG gram 16 (16Z90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
     12125        SND_PCI_QUIRK(0x1854, 0x048a, "LG gram 17 (17ZD90R)", ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS),
    1154912126        SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
    1155012127        SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
     
    1158312160        SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX),
    1158412161        SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME),
     12162        SND_PCI_QUIRK(0x2782, 0x4900, "MEDION E15443", ALC233_FIXUP_MEDION_MTL_SPK),
    1158512163        SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
    1158612164        SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
     
    1176112339        {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
    1176212340        {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
     12341        {.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"},
    1176312342        {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
    1176412343        {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
    1176512344        {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
    1176612345        {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
     12346        {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, .name = "alc298-samsung-amp-v2-2-amps"},
     12347        {.id = ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, .name = "alc298-samsung-amp-v2-4-amps"},
    1176712348        {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
    1176812349        {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
     
    1230112882        spec->en_3kpull_low = true;
    1230212883
    12303 #ifdef CONFIG_PM
    1230412884        codec->patch_ops.suspend = alc269_suspend;
    1230512885        codec->patch_ops.resume = alc269_resume;
    12306 #endif
    1230712886        spec->shutup = alc_default_shutup;
    1230812887        spec->init_hook = alc_default_init;
     
    1247213051        snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
    1247313052                           alc269_fixups);
     13053
     13054        /*
     13055         * Check whether ACPI describes companion amplifiers that require
     13056         * component binding
     13057         */
     13058        find_cirrus_companion_amps(codec);
     13059
    1247413060        snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
    1247513061
     
    1262613212                spec->gen.beep_nid = 0x23;
    1262713213
    12628 #ifdef CONFIG_PM
    1262913214        spec->power_hook = alc_power_eapd;
    12630 #endif
    1263113215
    1263213216        alc_pre_init(codec);
     
    1365914243                        { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
    1366014244                        { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
    13661                         {}
     14245                        {0}
    1366214246                },
    1366314247        },
     
    1368114265                .v.pins = (const struct hda_pintbl[]) {
    1368214266                        { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
    13683                         { }
     14267                        {0}
    1368414268                },
    1368514269        },
     
    1370314287                .v.verbs = (const struct hda_verb[]) {
    1370414288                        { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
    13705                         {}
     14289                        {0}
    1370614290                },
    1370714291        },
     
    1414114725MODULE_LICENSE("GPL");
    1414214726MODULE_DESCRIPTION("Realtek HD-audio codec");
     14727MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT);
    1414314728
    1414414729static struct hda_codec_driver realtek_driver = {
  • GPL/trunk/alsa-kernel/pci/hda/patch_sigmatel.c

    r772 r777  
    21902190        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
    21912191                spec->mic_mute_led_gpio = 0x08; /* GPIO3 */
    2192 #ifdef CONFIG_PM
    21932192                /* resetting controller clears GPIO, so we need to keep on */
    21942193                codec->core.power_caps &= ~AC_PWRST_CLKSTOP;
    2195 #endif
    21962194        }
    21972195}
     
    45444542#endif
    45454543
    4546 #ifdef CONFIG_PM
    45474544static int stac_suspend(struct hda_codec *codec)
    45484545{
     
    45584555        return 0;
    45594556}
    4560 
    4561 static 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 }
    4582 #else
    4583 #define stac_suspend            NULL
    4584 #endif /* CONFIG_PM */
    45854557
    45864558static const struct hda_codec_ops stac_patch_ops = {
     
    45904562        .free = stac_free,
    45914563        .unsol_event = snd_hda_jack_unsol_event,
    4592 #ifdef CONFIG_PM
    45934564        .suspend = stac_suspend,
    4594         .check_power_status = stac_check_power_status,
    4595 #endif
    45964565};
    45974566
  • GPL/trunk/alsa-kernel/pci/hda/patch_via.c

    r772 r777  
    388388}
    389389
    390 #ifdef CONFIG_PM
    391390static int via_suspend(struct hda_codec *codec)
    392391{
     
    409408        return 0;
    410409}
    411 #endif
    412 
    413 #ifdef CONFIG_PM
     410
    414411static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid)
    415412{
     
    419416        return snd_hda_check_amp_list_power(codec, &spec->gen.loopback, nid);
    420417}
    421 #endif
    422418
    423419/*
     
    432428        .free = via_free,
    433429        .unsol_event = snd_hda_jack_unsol_event,
    434 #ifdef CONFIG_PM
    435430        .suspend = via_suspend,
    436431        .resume = via_resume,
    437432        .check_power_status = via_check_power_status,
    438 #endif
    439433};
    440434
  • GPL/trunk/alsa-kernel/pci/intel8x0.c

    r717 r777  
    707707                step = 0;
    708708        } else if (civ == ichdev->civ) {
    709                 // snd_printd("civ same %d\n", civ);
    710709                step = 1;
    711710                ichdev->civ++;
     
    715714                if (step < 0)
    716715                        step += ICH_REG_LVI_MASK + 1;
    717                 // if (step != 1)
    718                 //      snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);
    719716                ichdev->civ = civ;
    720717        }
     
    25612558}
    25622559
    2563 #ifdef CONFIG_PM_SLEEP
    25642560/*
    25652561 * power management
     
    26342630}
    26352631
    2636 static SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume);
    2637 #define INTEL8X0_PM_OPS &intel8x0_pm
    2638 #else
    2639 #define INTEL8X0_PM_OPS NULL
    2640 #endif /* CONFIG_PM_SLEEP */
     2632static DEFINE_SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume);
    26412633
    26422634#define INTEL8X0_TESTBUF_SIZE   32768   /* enough large for one shot */
     
    32243216        .probe = snd_intel8x0_probe,
    32253217        .driver = {
    3226                 .pm = INTEL8X0_PM_OPS,
     3218                .pm = &intel8x0_pm,
    32273219        },
    32283220};
  • GPL/trunk/alsa-kernel/pci/korg1212/korg1212.c

    r772 r777  
    2929#define K1212_DEBUG_LEVEL               0
    3030#if K1212_DEBUG_LEVEL > 0
    31 #define K1212_DEBUG_PRINTK(fmt,args...) printk(KERN_DEBUG fmt,##args)
     31#define K1212_DEBUG_PRINTK(fmt, args...) pr_debug(fmt, ##args)
    3232#else
    3333#define K1212_DEBUG_PRINTK(fmt,...)     do { } while (0)
    3434#endif
    3535#if K1212_DEBUG_LEVEL > 1
    36 #define K1212_DEBUG_PRINTK_VERBOSE(fmt,args...) printk(KERN_DEBUG fmt,##args)
     36#define K1212_DEBUG_PRINTK_VERBOSE(fmt, args...) pr_debug(fmt, ##args)
    3737#else
    3838#define K1212_DEBUG_PRINTK_VERBOSE(fmt,...)
     
    603603                        mod_timer(&korg1212->timer, jiffies + 1);
    604604                } else {
    605                         snd_printd("korg1212_timer_func timeout\n");
     605                        dev_dbg(korg1212->card->dev, "korg1212_timer_func timeout\n");
    606606                        korg1212->sharedBufferPtr->cardCommand = 0;
    607607                        korg1212->dsp_stop_is_processed = 1;
     
    11321132                                                   korg1212->irqcount, doorbellValue,
    11331133                                                   stateName[korg1212->cardState]);
    1134                         snd_printk(KERN_ERR "korg1212: DMA Error\n");
     1134                        dev_err(korg1212->card->dev, "korg1212: DMA Error\n");
    11351135                        korg1212->errorcnt++;
    11361136                        korg1212->totalerrorcnt++;
     
    12731273                if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
    12741274                     (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
    1275                         printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_silence KERNEL EFAULT dst=%p iter=%d\n",
    1276                               dst, i);
     1275                        pr_debug("K1212_DEBUG: %s KERNEL EFAULT dst=%p iter=%d\n",
     1276                                 __func__, dst, i);
    12771277                        return -EFAULT;
    12781278                }
     
    13061306                if ( (void *) src < (void *) korg1212->recordDataBufsPtr ||
    13071307                     (void *) src > (void *) korg1212->recordDataBufsPtr[8].bufferData ) {
    1308                         printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_to KERNEL EFAULT, src=%p dst=%p iter=%d\n", src, dst->kvec.iov_base, i);
     1308                        pr_debug("K1212_DEBUG: %s KERNEL EFAULT, src=%p dst=%p iter=%d\n",
     1309                                 __func__, src, dst->kvec.iov_base, i);
    13091310                        return -EFAULT;
    13101311                }
     
    13311332        dst = korg1212->playDataBufsPtr[0].bufferData + pos;
    13321333
    1333         K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_copy_from pos=%d size=%d count=%d\n",
    1334                                    pos, size, count);
     1334        K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: %s pos=%d size=%d count=%d\n",
     1335                                   __func__, pos, size, count);
    13351336
    13361337        if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
     
    13411342                if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
    13421343                     (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
    1343                         printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_from KERNEL EFAULT, src=%p dst=%p iter=%d\n", src->kvec.iov_base, dst, i);
     1344                        pr_debug("K1212_DEBUG: %s KERNEL EFAULT, src=%p dst=%p iter=%d\n",
     1345                                 __func__, src->kvec.iov_base, dst, i);
    13441346                        return -EFAULT;
    13451347                }
     
    21362138
    21372139        if (err) {
    2138                 snd_printk(KERN_ERR "korg1212: unable to grab IRQ %d\n", pci->irq);
     2140                dev_err(&pci->dev, "korg1212: unable to grab IRQ %d\n", pci->irq);
    21392141                return -EBUSY;
    21402142        }
     
    22332235        err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev);
    22342236        if (err < 0) {
    2235                 snd_printk(KERN_ERR "firmware not available\n");
     2237                dev_err(&pci->dev, "firmware not available\n");
    22362238                return err;
    22372239        }
  • GPL/trunk/alsa-kernel/pci/maestro3.c

    r772 r777  
    777777        unsigned int in_suspend;
    778778
    779 #ifdef CONFIG_PM_SLEEP
    780779        u16 *suspend_mem;
    781 #endif
    782780
    783781        const struct firmware *assp_kernel_image;
     
    23662364        }
    23672365
    2368 #ifdef CONFIG_PM_SLEEP
    23692366        vfree(chip->suspend_mem);
    2370 #endif
    23712367        release_firmware(chip->assp_kernel_image);
    23722368        release_firmware(chip->assp_minisrc_image);
     
    23772373 * APM support
    23782374 */
    2379 #ifdef CONFIG_PM_SLEEP
    23802375static int m3_suspend(struct device *dev)
    23812376{
     
    24512446}
    24522447
    2453 static SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
    2454 #define M3_PM_OPS       &m3_pm
    2455 #else
    2456 #define M3_PM_OPS       NULL
    2457 #endif /* CONFIG_PM_SLEEP */
     2448static DEFINE_SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume);
    24582449
    24592450#ifdef CONFIG_SND_MAESTRO3_INPUT
     
    25992590        card->sync_irq = chip->irq;
    26002591
    2601 #ifdef CONFIG_PM_SLEEP
     2592#ifndef TARGET_OS2
     2593        if (IS_ENABLED(CONFIG_PM_SLEEP)) {
    26022594        chip->suspend_mem =
    26032595                vmalloc(array_size(sizeof(u16),
    26042596                                   REV_B_CODE_MEMORY_LENGTH +
    26052597                                        REV_B_DATA_MEMORY_LENGTH));
    2606         if (chip->suspend_mem == NULL)
     2598                if (!chip->suspend_mem)
    26072599                dev_warn(card->dev, "can't allocate apm buffer\n");
     2600        }
    26082601#endif
    2609 
    26102602        err = snd_m3_mixer(chip);
    26112603        if (err < 0)
     
    27182710        .probe = snd_m3_probe,
    27192711        .driver = {
    2720                 .pm = M3_PM_OPS,
     2712                .pm = &m3_pm,
    27212713        },
    27222714};
  • GPL/trunk/alsa-kernel/pci/nm256/nm256.c

    r772 r777  
    13811381}
    13821382
    1383 #ifdef CONFIG_PM_SLEEP
    13841383/*
    13851384 * APM event handler, so the card is properly reinitialized after a power
     
    14251424}
    14261425
    1427 static SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume);
    1428 #define NM256_PM_OPS    &nm256_pm
    1429 #else
    1430 #define NM256_PM_OPS    NULL
    1431 #endif /* CONFIG_PM_SLEEP */
     1426static DEFINE_SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume);
    14321427
    14331428static void snd_nm256_free(struct snd_card *card)
     
    16851680        .probe = snd_nm256_probe,
    16861681        .driver = {
    1687                 .pm = NM256_PM_OPS,
     1682                .pm = &nm256_pm,
    16881683        },
    16891684};
  • GPL/trunk/alsa-kernel/pci/rme9652/hdsp.c

    r772 r777  
    43024302};
    43034303
    4304 static const unsigned int hdsp_9632_sample_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 };
    4305 
    4306 static const struct snd_pcm_hw_constraint_list hdsp_hw_constraints_9632_sample_rates = {
    4307         .count = ARRAY_SIZE(hdsp_9632_sample_rates),
    4308         .list = hdsp_9632_sample_rates,
    4309         .mask = 0
    4310 };
    4311 
    43124304static int snd_hdsp_hw_rule_in_channels(struct snd_pcm_hw_params *params,
    43134305                                        struct snd_pcm_hw_rule *rule)
     
    45004492        } else if (hdsp->io_type == H9632) {
    45014493                runtime->hw.rate_max = 192000;
    4502                 runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
    4503                 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
     4494                runtime->hw.rates |= (SNDRV_PCM_RATE_128000 |
     4495                                      SNDRV_PCM_RATE_176400 |
     4496                                      SNDRV_PCM_RATE_192000);
    45044497        }
    45054498        if (hdsp->io_type == H9632) {
     
    45764569                runtime->hw.channels_max = hdsp->ss_in_channels;
    45774570                runtime->hw.rate_max = 192000;
    4578                 runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
    4579                 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
     4571                runtime->hw.rates |= (SNDRV_PCM_RATE_128000 |
     4572                                      SNDRV_PCM_RATE_176400 |
     4573                                      SNDRV_PCM_RATE_192000);
    45804574        }
    45814575        snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
  • GPL/trunk/alsa-kernel/pci/rme9652/hdspm.c

    r772 r777  
    30843084
    30853085
    3086 #define HDSPM_TCO_VIDEO_INPUT_FORMAT(xname, xindex) \
     3086#define HDSPM_TCO_VIDEO_INPUT_FORMAT(xname) \
    30873087{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
    30883088        .name = xname, \
     
    31303130
    31313131
    3132 #define HDSPM_TCO_LTC_FRAMES(xname, xindex) \
     3132#define HDSPM_TCO_LTC_FRAMES(xname) \
    31333133{       .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
    31343134        .name = xname, \
     
    46314631        HDSPM_TCO_LOCK_CHECK("TCO Input Check", 11),
    46324632        HDSPM_TCO_LOCK_CHECK("TCO LTC Valid", 12),
    4633         HDSPM_TCO_LTC_FRAMES("TCO Detected Frame Rate", 0),
    4634         HDSPM_TCO_VIDEO_INPUT_FORMAT("Video Input Format", 0)
     4633        HDSPM_TCO_LTC_FRAMES("TCO Detected Frame Rate"),
     4634        HDSPM_TCO_VIDEO_INPUT_FORMAT("Video Input Format")
    46354635};
    46364636
     
    56135613           dev_dbg(hdspm->card->dev,
    56145614           "Allocated sample buffer for %s at 0x%08X\n",
    5615            substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
    5616            "playback" : "capture",
     5615           snd_pcm_direction_name(substream->stream),
    56175616           snd_pcm_sgbuf_get_addr(substream, 0));
    56185617           */
     
    56205619           dev_dbg(hdspm->card->dev,
    56215620           "set_hwparams: %s %d Hz, %d channels, bs = %d\n",
    5622            substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
    5623            "playback" : "capture",
     5621           snd_pcm_direction_name(substream->stream),
    56245622           params_rate(params), params_channels(params),
    56255623           params_buffer_size(params));
     
    60356033}
    60366034
    6037 
    6038 static const unsigned int hdspm_aes32_sample_rates[] = {
    6039         32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000
    6040 };
    6041 
    6042 static const struct snd_pcm_hw_constraint_list
    6043 hdspm_hw_constraints_aes32_sample_rates = {
    6044         .count = ARRAY_SIZE(hdspm_aes32_sample_rates),
    6045         .list = hdspm_aes32_sample_rates,
    6046         .mask = 0
    6047 };
    6048 
    60496035static int snd_hdspm_open(struct snd_pcm_substream *substream)
    60506036{
     
    60996085
    61006086        if (AES32 == hdspm->io_type) {
    6101                 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
    6102                 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
    6103                                 &hdspm_hw_constraints_aes32_sample_rates);
     6087                runtime->hw.rates |= SNDRV_PCM_RATE_128000;
    61046088        } else {
    61056089                snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
  • GPL/trunk/alsa-kernel/pci/trident/trident.h

    r772 r777  
    407407int snd_trident_foldback_pcm(struct snd_trident *trident, int device);
    408408int snd_trident_spdif_pcm(struct snd_trident *trident, int device);
    409 int snd_trident_attach_synthesizer(struct snd_trident * trident);
    410409struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type,
    411410                                             int client, int port);
     
    420419                                                struct snd_pcm_substream *substream);
    421420int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk);
    422 struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size);
    423 int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk);
    424 int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk,
    425                                      int offset, const char __user *data, int size);
    426421
    427422#endif /* __SOUND_TRIDENT_H */
  • GPL/trunk/alsa-kernel/pci/trident/trident_memory.c

    r717 r777  
    138138 * check if the given pointer is valid for pages
    139139 */
    140 static int is_valid_page(unsigned long ptr)
     140static int is_valid_page(struct snd_trident *trident, unsigned long ptr)
    141141{
    142142        if (ptr & ~0x3fffffffUL) {
    143                 snd_printk(KERN_ERR "max memory size is 1GB!!\n");
     143                dev_err(trident->card->dev, "max memory size is 1GB!!\n");
    144144                return 0;
    145145        }
    146146        if (ptr & (SNDRV_TRIDENT_PAGE_SIZE-1)) {
    147                 snd_printk(KERN_ERR "page is not aligned\n");
     147                dev_err(trident->card->dev, "page is not aligned\n");
    148148                return 0;
    149149        }
     
    187187                unsigned long ofs = idx << PAGE_SHIFT;
    188188                dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs);
    189                 if (! is_valid_page(addr)) {
     189                if (!is_valid_page(trident, addr)) {
    190190                        __snd_util_mem_free(hdr, blk);
    191191                        mutex_unlock(&hdr->block_mutex);
     
    232232        for (page = firstpg(blk); page <= lastpg(blk); page++,
    233233             addr += SNDRV_TRIDENT_PAGE_SIZE) {
    234                 if (! is_valid_page(addr)) {
     234                if (!is_valid_page(trident, addr)) {
    235235                        __snd_util_mem_free(hdr, blk);
    236236                        mutex_unlock(&hdr->block_mutex);
  • GPL/trunk/alsa-kernel/pci/via82xx.c

    r772 r777  
    352352        unsigned char old_legacy;
    353353        unsigned char old_legacy_cfg;
    354 #ifdef CONFIG_PM_SLEEP
    355354        unsigned char legacy_saved;
    356355        unsigned char legacy_cfg_saved;
     
    358357        unsigned char capture_src_saved[2];
    359358        unsigned int mpu_port_saved;
    360 #endif
    361359
    362360        unsigned char playback_volume[4][2]; /* for VIA8233/C/8235; default = 0 */
     
    20362034                        mpu_port &= 0xfffc;
    20372035                        pci_write_config_dword(chip->pci, 0x18, mpu_port | 0x01);
    2038 #ifdef CONFIG_PM_SLEEP
    20392036                        chip->mpu_port_saved = mpu_port;
    2040 #endif
    20412037                } else {
    20422038                        mpu_port = pci_resource_start(chip->pci, 2);
     
    20902086        snd_via686_create_gameport(chip, &legacy);
    20912087
    2092 #ifdef CONFIG_PM_SLEEP
    20932088        chip->legacy_saved = legacy;
    20942089        chip->legacy_cfg_saved = legacy_cfg;
    2095 #endif
    20962090
    20972091        return 0;
     
    22392233}
    22402234
    2241 #ifdef CONFIG_PM_SLEEP
    22422235/*
    22432236 * power management
     
    22922285}
    22932286
    2294 static SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume);
    2295 #define SND_VIA82XX_PM_OPS      &snd_via82xx_pm
    2296 #else
    2297 #define SND_VIA82XX_PM_OPS      NULL
    2298 #endif /* CONFIG_PM_SLEEP */
     2287static DEFINE_SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume);
    22992288
    23002289static void snd_via82xx_free(struct snd_card *card)
     
    25812570        .probe = snd_via82xx_probe,
    25822571        .driver = {
    2583                 .pm = SND_VIA82XX_PM_OPS,
     2572                .pm = &snd_via82xx_pm,
    25842573        },
    25852574};
Note: See TracChangeset for help on using the changeset viewer.