Changeset 777 for GPL/trunk/alsa-kernel/pci
- Timestamp:
- Apr 21, 2025, 7:17:25 PM (6 months ago)
- Location:
- GPL/trunk
- Files:
-
- 53 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-exp merged: 766-767,770-771,773-774
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/ac97/ac97_codec.c
r772 r777 3028 3028 result = apply_quirk_str(ac97, override); 3029 3029 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); 3031 3032 return result; 3032 3033 } … … 3042 3043 if (quirk->codec_id && quirk->codec_id != ac97->id) 3043 3044 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); 3045 3048 result = apply_quirk(ac97, quirk->type); 3046 3049 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); 3048 3053 return result; 3049 3054 } -
GPL/trunk/alsa-kernel/pci/ac97/ac97_patch.c
r772 r777 42 42 const unsigned int *tlv) 43 43 { 44 struct snd_ctl_elem_id sid;45 44 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); 50 47 if (kctl && kctl->tlv.p) 51 48 kctl->tlv.p = tlv; -
GPL/trunk/alsa-kernel/pci/ali5451/ali5451.c
r717 r777 247 247 spinlock_t voice_alloc; 248 248 249 #ifdef CONFIG_PM_SLEEP 250 struct snd_ali_image *image; 251 #endif 249 struct snd_ali_image image; 252 250 }; 253 251 … … 1828 1826 } 1829 1827 1830 #ifdef CONFIG_PM_SLEEP1831 1828 static int ali_suspend(struct device *dev) 1832 1829 { 1833 1830 struct snd_card *card = dev_get_drvdata(dev); 1834 1831 struct snd_ali *chip = card->private_data; 1835 struct snd_ali_image *im ;1832 struct snd_ali_image *im = &chip->image; 1836 1833 int i, j; 1837 1838 im = chip->image;1839 if (!im)1840 return 0;1841 1834 1842 1835 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); … … 1876 1869 struct snd_card *card = dev_get_drvdata(dev); 1877 1870 struct snd_ali *chip = card->private_data; 1878 struct snd_ali_image *im ;1871 struct snd_ali_image *im = &chip->image; 1879 1872 int i, j; 1880 1881 im = chip->image;1882 if (!im)1883 return 0;1884 1873 1885 1874 spin_lock_irq(&chip->reg_lock); … … 1912 1901 } 1913 1902 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 */ 1903 static DEFINE_SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume); 1919 1904 1920 1905 static void snd_ali_free(struct snd_card *card) … … 2120 2105 } 2121 2106 2122 #ifdef CONFIG_PM_SLEEP2123 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 #endif2128 2129 2107 snd_ali_enable_address_interrupt(codec); 2130 2108 codec->hw_initialized = 1; … … 2189 2167 .probe = snd_ali_probe, 2190 2168 .driver = { 2191 .pm = ALI_PM_OPS,2169 .pm = &ali_pm, 2192 2170 }, 2193 2171 }; -
GPL/trunk/alsa-kernel/pci/als4000.c
r717 r777 940 940 } 941 941 942 #ifdef CONFIG_PM_SLEEP943 942 static int snd_als4000_suspend(struct device *dev) 944 943 { … … 972 971 } 973 972 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 */ 973 static DEFINE_SIMPLE_DEV_PM_OPS(snd_als4000_pm, snd_als4000_suspend, snd_als4000_resume); 979 974 980 975 static struct pci_driver als4000_driver = { … … 983 978 .probe = snd_card_als4000_probe, 984 979 .driver = { 985 .pm = SND_ALS4000_PM_OPS,980 .pm = &snd_als4000_pm, 986 981 }, 987 982 }; -
GPL/trunk/alsa-kernel/pci/atiixp.c
r772 r777 530 530 } 531 531 532 #ifdef CONFIG_PM_SLEEP533 532 static int snd_atiixp_aclink_down(struct atiixp *chip) 534 533 { … … 540 539 return 0; 541 540 } 542 #endif543 541 544 542 /* … … 1464 1462 1465 1463 1466 #ifdef CONFIG_PM_SLEEP1467 1464 /* 1468 1465 * power management … … 1509 1506 } 1510 1507 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 1508 static DEFINE_SIMPLE_DEV_PM_OPS(snd_atiixp_pm, snd_atiixp_suspend, snd_atiixp_resume); 1517 1509 1518 1510 /* … … 1647 1639 .probe = snd_atiixp_probe, 1648 1640 .driver = { 1649 .pm = SND_ATIIXP_PM_OPS,1641 .pm = &snd_atiixp_pm, 1650 1642 }, 1651 1643 }; -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0.c
r772 r777 11 11 * the ALSA part. 12 12 * Thanks also to Sourceforge for maintaining the old binary drivers, 13 * and the forum, where developers could com unicate.13 * and the forum, where developers could communicate. 14 14 * 15 15 * Now at least i can play Legacy DOOM with MIDI music :-) -
GPL/trunk/alsa-kernel/pci/au88x0/au88x0_core.c
r772 r777 1196 1196 snd_pcm_sgbuf_get_addr(dma->substream, 1197 1197 dma->period_bytes * p)); 1198 /* Force write thr ucache. */1198 /* Force write through cache. */ 1199 1199 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + 1200 1200 (((adbdma << 2) + pp) << 2)); … … 1238 1238 snd_pcm_sgbuf_get_addr(dma->substream, 1239 1239 dma->period_bytes * p)); 1240 /* Force write thr ucache. */1240 /* Force write through cache. */ 1241 1241 hwread(vortex->mmio, VORTEX_ADBDMA_BUFBASE + (((adbdma << 2)+pp) << 2)); 1242 1242 } … … 1467 1467 snd_pcm_sgbuf_get_addr(dma->substream, 1468 1468 dma->period_bytes * p)); 1469 /* Force write thr ucache. */1469 /* Force write through cache. */ 1470 1470 hwread(vortex->mmio, VORTEX_WTDMA_BUFBASE + 1471 1471 (((wtdma << 2) + pp) << 2)); … … 1855 1855 } 1856 1856 1857 // Connect absolut address to mixin.1857 // Connect absolute address to mixin. 1858 1858 static void 1859 1859 vortex_connection_adb_mixin(vortex_t * vortex, int en, … … 1881 1881 } 1882 1882 1883 // mix to absolut address.1883 // mix to absolute address. 1884 1884 static void 1885 1885 vortex_connection_mix_adb(vortex_t * vortex, int en, unsigned char ch, -
GPL/trunk/alsa-kernel/pci/cmipci.c
r772 r777 496 496 spinlock_t reg_lock; 497 497 498 #ifdef CONFIG_PM_SLEEP499 498 unsigned int saved_regs[0x20]; 500 499 unsigned char saved_mixers[0x20]; 501 #endif502 500 }; 503 501 … … 1582 1580 }; 1583 1581 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 1592 1582 /* 1593 1583 * check device open/close … … 1661 1651 runtime->hw.rate_max = 96000; 1662 1652 } 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; 1668 1656 runtime->hw.rate_max = 128000; 1669 1657 } … … 1687 1675 runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; 1688 1676 } 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; 1694 1680 runtime->hw.rate_max = 128000; 1695 1681 } … … 1727 1713 runtime->hw.rate_max = 96000; 1728 1714 } 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; 1734 1718 runtime->hw.rate_max = 128000; 1735 1719 } … … 3281 3265 } 3282 3266 3283 #ifdef CONFIG_PM_SLEEP3284 3267 /* 3285 3268 * power management … … 3345 3328 } 3346 3329 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 */ 3330 static DEFINE_SIMPLE_DEV_PM_OPS(snd_cmipci_pm, snd_cmipci_suspend, snd_cmipci_resume); 3352 3331 3353 3332 static struct pci_driver cmipci_driver = { … … 3356 3335 .probe = snd_cmipci_probe, 3357 3336 .driver = { 3358 .pm = SND_CMIPCI_PM_OPS,3337 .pm = &snd_cmipci_pm, 3359 3338 }, 3360 3339 }; -
GPL/trunk/alsa-kernel/pci/cs4281.c
r772 r777 474 474 struct gameport *gameport; 475 475 476 #ifdef CONFIG_PM_SLEEP477 476 u32 suspend_regs[SUSPEND_REGISTERS]; 478 #endif479 480 477 }; 481 478 … … 1900 1897 * Power Management 1901 1898 */ 1902 #ifdef CONFIG_PM_SLEEP1903 1904 1899 static const int saved_regs[SUSPEND_REGISTERS] = { 1905 1900 BA0_JSCTL, … … 1990 1985 } 1991 1986 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 */ 1987 static DEFINE_SIMPLE_DEV_PM_OPS(cs4281_pm, cs4281_suspend, cs4281_resume); 1997 1988 1998 1989 static struct pci_driver cs4281_driver = { … … 2001 1992 .probe = snd_cs4281_probe, 2002 1993 .driver = { 2003 .pm = CS4281_PM_OPS,1994 .pm = &cs4281_pm, 2004 1995 }, 2005 1996 }; -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_callback.c
r772 r777 256 256 if (bp != best + V_OFF && bp != best + V_FREE && 257 257 (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; 259 259 if (val >= vp->reg.loopstart) 260 260 bp = best + V_OFF; … … 311 311 unsigned int temp; 312 312 int ch; 313 bool w_16; 313 314 u32 psst, dsl, map, ccca, vtarget; 314 315 unsigned int addr, mapped_offset; … … 322 323 return -EINVAL; 323 324 chan = vp->chan; 325 w_16 = !(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS); 324 326 325 327 emem = (struct snd_emu10k1_memblk *)vp->block; … … 331 333 return -ENOMEM; 332 334 } 333 mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;335 mapped_offset = snd_emu10k1_memblk_offset(emem) >> w_16; 334 336 vp->reg.start += mapped_offset; 335 337 vp->reg.end += mapped_offset; … … 363 365 map = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0); 364 366 365 addr = vp->reg.start ;367 addr = vp->reg.start + 64 - 3; 366 368 temp = vp->reg.parm.filterQ; 367 369 ccca = (temp << 28) | addr; … … 372 374 ccca |= shift << 25; 373 375 } 374 if ( vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS)376 if (!w_16) 375 377 ccca |= CCCA_8BITSELECT; 376 378 … … 431 433 CCCA, ccca, 432 434 435 /* cache */ 436 CCR, REG_VAL_PUT(CCR_CACHEINVALIDSIZE, 64), 437 433 438 /* reset volume */ 434 439 VTFT, vtarget | vp->ftarget, -
GPL/trunk/alsa-kernel/pci/emu10k1/emu10k1_main.c
r772 r777 673 673 } 674 674 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 PGMN689 * GPIO6 -> FPGA CCLK690 * GPIO5 -> FPGA DIN691 * FPGA CONFIG OFF -> FPGA PGMN692 */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 721 675 /* firmware file names, per model, init-fw and dock-fw (optional) */ 722 676 static const char * const firmware_names[5][2] = { … … 750 704 } 751 705 752 return snd_emu1010_load_firmware_entry(emu, *fw); 706 snd_emu1010_load_firmware_entry(emu, dock, *fw); 707 return 0; 753 708 } 754 709 … … 765 720 766 721 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);770 722 err = snd_emu1010_load_firmware(emu, 1, &emu->dock_fw); 771 723 if (err < 0) … … 837 789 #endif 838 790 791 snd_emu1010_fpga_lock(emu); 792 839 793 snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &sts); 840 794 … … 846 800 if (sts & EMU_HANA_IRQ_WCLK_CHANGED) 847 801 emu1010_clock_event(emu); 802 803 snd_emu1010_fpga_unlock(emu); 848 804 } 849 805 … … 880 836 outl(HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK, emu->port + HCFG); 881 837 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, ®); 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, ®); 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"); 903 841 904 842 err = snd_emu1010_load_firmware(emu, 0, &emu->firmware); 905 843 if (err < 0) { 906 844 dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n"); 907 return err;845 goto fail; 908 846 } 909 847 … … 915 853 "emu1010: Loading Hana Firmware file failed, reg = 0x%x\n", 916 854 reg); 917 return -ENODEV; 855 err = -ENODEV; 856 goto fail; 918 857 } 919 858 … … 975 914 snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE); 976 915 977 return 0; 916 fail: 917 snd_emu1010_fpga_unlock(emu); 918 return err; 978 919 } 979 920 /* … … 997 938 if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) { 998 939 /* 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); 1000 941 } 1001 942 cancel_work_sync(&emu->emu1010.work); 943 mutex_destroy(&emu->emu1010.lock); 1002 944 release_firmware(emu->firmware); 1003 945 release_firmware(emu->dock_fw); … … 1579 1521 emu->get_synth_voice = NULL; 1580 1522 INIT_WORK(&emu->emu1010.work, emu1010_work); 1523 mutex_init(&emu->emu1010.lock); 1581 1524 /* read revision & serial */ 1582 1525 #ifndef TARGET_OS2 -
GPL/trunk/alsa-kernel/pci/emu10k1/emumixer.c
r772 r777 662 662 if (change) { 663 663 emu->emu1010.output_source[channel] = val; 664 snd_emu1010_fpga_lock(emu); 664 665 snd_emu1010_output_source_apply(emu, channel, val); 666 snd_emu1010_fpga_unlock(emu); 665 667 } 666 668 return change; … … 706 708 if (change) { 707 709 emu->emu1010.input_source[channel] = val; 710 snd_emu1010_fpga_lock(emu); 708 711 snd_emu1010_input_source_apply(emu, channel, val); 712 snd_emu1010_fpga_unlock(emu); 709 713 } 710 714 return change; … … 775 779 change = (cache != emu->emu1010.adc_pads); 776 780 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 ); 778 782 emu->emu1010.adc_pads = cache; 779 783 } … … 833 837 change = (cache != emu->emu1010.dac_pads); 834 838 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 ); 836 840 emu->emu1010.dac_pads = cache; 837 841 } … … 981 985 if (val >= emu_ci->num) 982 986 return -EINVAL; 987 snd_emu1010_fpga_lock(emu); 983 988 spin_lock_irq(&emu->reg_lock); 984 989 change = (emu->emu1010.clock_source != val); … … 997 1002 spin_unlock_irq(&emu->reg_lock); 998 1003 } 1004 snd_emu1010_fpga_unlock(emu); 999 1005 return change; 1000 1006 } … … 1042 1048 if (change) { 1043 1049 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); 1045 1051 } 1046 1052 return change; … … 1094 1100 tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : EMU_HANA_OPTICAL_IN_SPDIF) | 1095 1101 (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); 1097 1103 } 1098 1104 return change; … … 1145 1151 tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : EMU_HANA_OPTICAL_IN_SPDIF) | 1146 1152 (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); 1148 1154 } 1149 1155 return change; … … 2324 2330 emu->emu1010.output_source[i] = 2325 2331 emu1010_map_source(emu_ri, emu_ri->out_dflts[i]); 2332 snd_emu1010_fpga_lock(emu); 2326 2333 snd_emu1010_apply_sources(emu); 2334 snd_emu1010_fpga_unlock(emu); 2327 2335 2328 2336 kctl = emu->ctl_clock_source = snd_ctl_new1(&snd_emu1010_clock_source, emu); -
GPL/trunk/alsa-kernel/pci/emu10k1/emupcm.c
r772 r777 148 148 }; 149 149 150 static const unsigned int capture_rates[8] = {151 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000152 };153 154 static const struct snd_pcm_hw_constraint_list hw_constraints_capture_rates = {155 .count = 8,156 .list = capture_rates,157 .mask = 0158 };159 160 150 static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate) 161 151 { … … 174 164 } 175 165 } 176 177 static const unsigned int audigy_capture_rates[9] = {178 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000179 };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 = 0185 };186 166 187 167 static unsigned int snd_emu10k1_audigy_capture_rate_reg(unsigned int rate) … … 208 188 if (emu->card_capabilities->emu_model && 209 189 emu->emu1010.word_clock == 44100) { 210 // This also sets the rate constraint by deleting SNDRV_PCM_RATE_KNOT211 190 runtime->hw.rates = SNDRV_PCM_RATE_11025 | \ 212 191 SNDRV_PCM_RATE_22050 | \ … … 214 193 runtime->hw.rate_min = 11025; 215 194 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 } 221 200 } 222 201 … … 1054 1033 SNDRV_PCM_INFO_MMAP_VALID), 1055 1034 .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, 1057 1036 .rate_min = 8000, 1058 1037 .rate_max = 48000, -
GPL/trunk/alsa-kernel/pci/emu10k1/emuproc.c
r772 r777 166 166 167 167 if (emu->card_capabilities->emu_model) { 168 snd_emu1010_fpga_lock(emu); 169 168 170 // This represents the S/PDIF lock status on 0404b, which is 169 171 // kinda weird and unhelpful, because monitoring it via IRQ is … … 198 200 value & EMU_HANA_SPDIF_MODE_RX_PRO ? "professional" : "consumer", 199 201 value & EMU_HANA_SPDIF_MODE_RX_NOCOPY ? ", no copy" : ""); 202 203 snd_emu1010_fpga_unlock(emu); 200 204 } else { 201 205 snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS); … … 459 463 u32 value; 460 464 int i; 465 466 snd_emu1010_fpga_lock(emu); 467 461 468 snd_iprintf(buffer, "EMU1010 Registers:\n\n"); 462 469 … … 497 504 } 498 505 } 506 507 snd_emu1010_fpga_unlock(emu); 499 508 } 500 509 -
GPL/trunk/alsa-kernel/pci/emu10k1/io.c
r772 r777 291 291 void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value) 292 292 { 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 296 297 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 300 void 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 307 void snd_emu1010_fpga_read(struct snd_emu10k1 *emu, u32 reg, u32 *value) 301 308 { 302 309 // The higest input pin is used as the designated interrupt trigger, … … 305 312 // so using this function often causes an IRQ as a side effect. 306 313 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 307 319 if (snd_BUG_ON(reg > 0x3f)) 308 320 return; … … 315 327 } 316 328 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 326 329 /* Each Destination has one and only one Source, 327 330 * but one Source can feed any number of Destinations simultaneously. … … 329 332 void snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 *emu, u32 dst, u32 src) 330 333 { 331 unsigned long flags;332 333 334 if (snd_BUG_ON(dst & ~0x71f)) 334 335 return; 335 336 if (snd_BUG_ON(src & ~0x71f)) 336 337 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); 343 342 } 344 343 345 344 u32 snd_emu1010_fpga_link_dst_src_read(struct snd_emu10k1 *emu, u32 dst) 346 345 { 347 unsigned long flags;348 346 u32 hi, lo; 349 347 350 348 if (snd_BUG_ON(dst & ~0x71f)) 351 349 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); 358 354 return (hi << 8) | lo; 359 355 } … … 429 425 430 426 snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, leds); 427 } 428 429 void 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); 431 480 } 432 481 -
GPL/trunk/alsa-kernel/pci/emu10k1/memory.c
r772 r777 602 602 603 603 /* 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 */ 606 int snd_emu10k1_synth_memset(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, 607 int offset, int size, u8 value) 608 608 { 609 609 int page, nextofs, end_offset, temp, temp1; 610 610 void *ptr; 611 611 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk; 612 613 if (snd_BUG_ON(offset + size > p->mem.size)) 614 return -EFAULT; 612 615 613 616 offset += blk->offset & (PAGE_SIZE - 1); … … 622 625 ptr = offset_ptr(emu, page + p->first_page, offset); 623 626 if (ptr) 624 memset(ptr, 0, temp);627 memset(ptr, value, temp); 625 628 offset = nextofs; 626 629 page++; … … 629 632 } 630 633 631 EXPORT_SYMBOL(snd_emu10k1_synth_bzero); 632 633 /* 634 * copy_from_user(blk + offset, data, size) 634 EXPORT_SYMBOL(snd_emu10k1_synth_memset); 635 636 // Note that the value is assumed to be suitably repetitive. 637 static 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 635 665 */ 636 666 int 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) 638 668 { 639 669 int page, nextofs, end_offset, temp, temp1; 640 670 void *ptr; 641 671 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk; 672 673 if (snd_BUG_ON(offset + size > p->mem.size)) 674 return -EFAULT; 642 675 643 676 offset += blk->offset & (PAGE_SIZE - 1); … … 651 684 temp = temp1; 652 685 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)) 654 688 return -EFAULT; 689 if (xor) 690 xor_range(ptr, temp, xor); 691 } 655 692 offset = nextofs; 656 693 data += temp; -
GPL/trunk/alsa-kernel/pci/emu10k1/p16v.c
r772 r777 175 175 return err; 176 176 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 182 177 return 0; 183 178 } … … 225 220 // Only using channel 0 for now, but the card has 2 channels. 226 221 return snd_p16v_pcm_open_capture_channel(substream, 0); 222 } 223 224 static 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); 227 233 } 228 234 … … 532 538 .open = snd_p16v_pcm_open_playback_front, 533 539 .close = snd_p16v_pcm_close_playback, 540 .ioctl = snd_p16v_pcm_ioctl_playback, 534 541 .prepare = snd_p16v_pcm_prepare_playback, 535 542 .trigger = snd_p16v_pcm_trigger_playback, -
GPL/trunk/alsa-kernel/pci/ens1370.c
r772 r777 1980 1980 } 1981 1981 1982 #ifdef CONFIG_PM_SLEEP1983 1982 static int snd_ensoniq_suspend(struct device *dev) 1984 1983 { … … 2019 2018 } 2020 2019 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 */ 2020 static DEFINE_SIMPLE_DEV_PM_OPS(snd_ensoniq_pm, snd_ensoniq_suspend, snd_ensoniq_resume); 2026 2021 2027 2022 static int snd_ensoniq_create(struct snd_card *card, … … 2396 2391 .probe = snd_audiopci_probe, 2397 2392 .driver = { 2398 .pm = SND_ENSONIQ_PM_OPS,2393 .pm = &snd_ensoniq_pm, 2399 2394 }, 2400 2395 }; -
GPL/trunk/alsa-kernel/pci/es1938.c
r772 r777 220 220 struct gameport *gameport; 221 221 #endif 222 #ifdef CONFIG_PM_SLEEP223 222 unsigned char saved_regs[SAVED_REG_SIZE]; 224 #endif225 223 }; 226 224 … … 1448 1446 } 1449 1447 1450 #ifdef CONFIG_PM_SLEEP1451 1448 /* 1452 1449 * PM support … … 1514 1511 } 1515 1512 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 */ 1513 static DEFINE_SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume); 1521 1514 1522 1515 #ifdef SUPPORT_JOYSTICK … … 1840 1833 .probe = snd_es1938_probe, 1841 1834 .driver = { 1842 .pm = ES1938_PM_OPS,1835 .pm = &es1938_pm, 1843 1836 }, 1844 1837 }; -
GPL/trunk/alsa-kernel/pci/es1968.c
r772 r777 489 489 struct list_head list; 490 490 491 #ifdef CONFIG_PM_SLEEP492 491 u16 wc_map[4]; 493 #endif494 492 }; 495 493 … … 542 540 spinlock_t substream_lock; 543 541 544 #ifdef CONFIG_PM_SLEEP545 542 u16 apu_map[NR_APUS][NR_APU_REGS]; 546 #endif547 543 548 544 #ifdef SUPPORT_JOYSTICK … … 705 701 if (snd_BUG_ON(channel >= NR_APUS)) 706 702 return; 707 #ifdef CONFIG_PM_SLEEP708 703 chip->apu_map[channel][reg] = data; 709 #endif710 704 reg |= (channel << 4); 711 705 apu_index_set(chip, reg); … … 992 986 wave_set_register(chip, es->apu[channel] << 3, tmpval); 993 987 994 #ifdef CONFIG_PM_SLEEP995 988 es->wc_map[channel] = tmpval; 996 #endif997 989 } 998 990 … … 2393 2385 } 2394 2386 2395 #ifdef CONFIG_PM_SLEEP2396 2387 /* 2397 2388 * PM support … … 2455 2446 } 2456 2447 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 */ 2448 static DEFINE_SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume); 2462 2449 2463 2450 #ifdef SUPPORT_JOYSTICK … … 2889 2876 .probe = snd_es1968_probe, 2890 2877 .driver = { 2891 .pm = ES1968_PM_OPS,2878 .pm = &es1968_pm, 2892 2879 }, 2893 2880 }; -
GPL/trunk/alsa-kernel/pci/fm801.c
r772 r777 231 231 #endif 232 232 233 #ifdef CONFIG_PM_SLEEP234 233 u16 saved_regs[0x20]; 235 #endif236 234 }; 237 235 … … 1352 1350 } 1353 1351 1354 #ifdef CONFIG_PM_SLEEP1355 1352 static const unsigned char saved_regs[] = { 1356 1353 FM801_PCM_VOL, FM801_I2S_VOL, FM801_FM_VOL, FM801_REC_SRC, … … 1409 1406 } 1410 1407 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 */ 1408 static DEFINE_SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume); 1416 1409 1417 1410 static struct pci_driver fm801_driver = { … … 1420 1413 .probe = snd_card_fm801_probe, 1421 1414 .driver = { 1422 .pm = SND_FM801_PM_OPS,1415 .pm = &snd_fm801_pm, 1423 1416 }, 1424 1417 }; -
GPL/trunk/alsa-kernel/pci/hda/Makefile
r709 r777 12 12 # 13 13 #=================================================================== 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 14 FILES = 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 18 20 19 21 TARGET = hda -
GPL/trunk/alsa-kernel/pci/hda/hda_beep.h
r772 r777 28 28 unsigned int keep_power_at_enable:1; /* set by driver */ 29 29 struct work_struct beep_work; /* scheduled task for beep event */ 30 struct mutex mutex;31 30 void (*power_hook)(struct hda_beep *beep, bool on); 32 31 }; -
GPL/trunk/alsa-kernel/pci/hda/hda_codec.c
r772 r777 89 89 int len; 90 90 hda_nid_t nid; 91 hda_nid_t conns[] ;91 hda_nid_t conns[] __counted_by(len); 92 92 }; 93 93 … … 625 625 EXPORT_SYMBOL_GPL(snd_hda_shutup_pins); 626 626 627 #ifdef CONFIG_PM628 627 /* Restore the pin controls cleared previously via snd_hda_shutup_pins() */ 629 628 static void restore_shutup_pins(struct hda_codec *codec) … … 643 642 codec->pins_shutup = 0; 644 643 } 645 #endif646 644 647 645 static void hda_jackpoll_work(struct work_struct *work) … … 1014 1012 codec->addr = codec_addr; 1015 1013 1016 #ifdef CONFIG_PM1017 1014 codec->power_jiffies = jiffies; 1018 #endif1019 1015 1020 1016 snd_hda_sysfs_init(codec); … … 1251 1247 } 1252 1248 1253 #ifdef CONFIG_PM1254 1249 /* clean up all streams; called from suspend */ 1255 1250 static void hda_cleanup_all_streams(struct hda_codec *codec) … … 1263 1258 } 1264 1259 } 1265 #endif1266 1260 1267 1261 /* … … 1515 1509 maxval = get_amp_max_value(codec, nid, dir, 0); 1516 1510 if (val > maxval) 1517 val = maxval;1511 return -EINVAL; 1518 1512 return snd_hda_codec_amp_update(codec, nid, ch, dir, idx, 1519 1513 HDA_AMP_VOLMASK, val); … … 1566 1560 long *valp = ucontrol->value.integer.value; 1567 1561 int change = 0; 1562 int err; 1568 1563 1569 1564 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; 1571 1569 valp++; 1572 1570 } 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 } 1575 1577 return change; 1576 1578 } … … 1745 1747 * snd_hda_add_nid - Assign a NID to a control element 1746 1748 * @codec: HD-audio codec 1747 * @nid: corresponding NID (optional)1748 1749 * @kctl: the control element to assign 1749 1750 * @index: index to kctl 1751 * @nid: corresponding NID (optional) 1750 1752 * 1751 1753 * Add the given control element to an array inside the codec instance. … … 2174 2176 2175 2177 if (chs & 1) { 2178 if (*valp < 0 || *valp > 1) 2179 return -EINVAL; 2176 2180 change = snd_hda_codec_amp_update(codec, nid, 0, dir, idx, 2177 2181 HDA_AMP_MUTE, … … 2179 2183 valp++; 2180 2184 } 2181 if (chs & 2) 2185 if (chs & 2) { 2186 if (*valp < 0 || *valp > 1) 2187 return -EINVAL; 2182 2188 change |= snd_hda_codec_amp_update(codec, nid, 1, dir, idx, 2183 2189 HDA_AMP_MUTE, 2184 2190 *valp ? 0 : HDA_AMP_MUTE); 2191 } 2185 2192 hda_call_check_power_status(codec, nid); 2186 2193 return change; … … 2878 2885 #endif 2879 2886 2880 #ifdef CONFIG_PM2881 2887 /* update the power on/off account with the current jiffies */ 2882 2888 static void update_power_acct(struct hda_codec *codec, bool on) … … 2986 2992 } 2987 2993 2988 #endif /* CONFIG_PM */2989 2990 #ifdef CONFIG_PM_SLEEP2991 2994 static int hda_codec_pm_prepare(struct device *dev) 2992 2995 { … … 3045 3048 return pm_runtime_force_resume(dev); 3046 3049 } 3047 #endif /* CONFIG_PM_SLEEP */3048 3050 3049 3051 /* referred in hda_bind.c */ 3050 3052 const 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), 3063 3063 }; 3064 3064 … … 3185 3185 info->rates ? NULL : &info->rates, 3186 3186 info->formats ? NULL : &info->formats, 3187 info->subformats ? NULL : &info->subformats, 3187 3188 info->maxbps ? NULL : &info->maxbps); 3188 3189 if (err < 0){ … … 3335 3336 int stream; 3336 3337 3337 for (stream = 0; stream < 2; stream++) {3338 for_each_pcm_streams(stream) { 3338 3339 struct hda_pcm_stream *info = &cpcm->stream[stream]; 3339 3340 … … 3447 3448 EXPORT_SYMBOL_GPL(snd_hda_add_new_ctls); 3448 3449 3449 #ifdef CONFIG_PM3450 3450 /** 3451 3451 * snd_hda_codec_set_power_save - Configure codec's runtime PM … … 3538 3538 } 3539 3539 EXPORT_SYMBOL_GPL(snd_hda_check_amp_list_power); 3540 #endif3541 3540 3542 3541 /* … … 3780 3779 &mout->spdif_rates, 3781 3780 &mout->spdif_formats, 3781 NULL, 3782 3782 &mout->spdif_maxbps); 3783 3783 } … … 4083 4083 cancel_delayed_work_sync(&codec->jackpoll_work); 4084 4084 #endif 4085 #ifdef CONFIG_PM4086 4085 if (hda_codec_is_power_on(codec)) { 4087 4086 hda_call_codec_suspend(codec); 4088 4087 hda_call_codec_resume(codec); 4089 4088 } 4090 #endif4091 4089 } 4092 4090 } -
GPL/trunk/alsa-kernel/pci/hda/hda_component.c
r775 r777 14 14 #include "hda_component2.h" 15 15 #include "hda_local.h" 16 #include <ctype.h> 16 17 17 18 #ifdef CONFIG_ACPI -
GPL/trunk/alsa-kernel/pci/hda/hda_component2.h
r772 r777 7 7 */ 8 8 9 #ifndef __HDA_COMPONENT_H__ 10 #define __HDA_COMPONENT_H__ 11 12 #include <linux/acpi.h> 9 13 #include <linux/component.h> 14 #include <linux/mutex.h> 15 #include <sound/hda_codec.h> 10 16 11 17 #define HDA_MAX_COMPONENTS 4 … … 15 21 struct device *dev; 16 22 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); 18 26 void (*pre_playback_hook)(struct device *dev, int action); 19 27 void (*playback_hook)(struct device *dev, int action); 20 28 void (*post_playback_hook)(struct device *dev, int action); 21 29 }; 30 31 struct 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 38 void hda_component_acpi_device_notify(struct hda_component_parent *parent, 39 acpi_handle handle, u32 event, void *data); 40 int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc, 41 struct hda_component_parent *parent, 42 acpi_notify_handler handler, void *data); 43 void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc, 44 struct hda_component_parent *parent, 45 acpi_notify_handler handler); 46 #else 47 static 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 54 static 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 63 static 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 70 void hda_component_manager_playback_hook(struct hda_component_parent *parent, int action); 71 72 int 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 78 void hda_component_manager_free(struct hda_component_parent *parent, 79 const struct component_master_ops *ops); 80 81 int hda_component_manager_bind(struct hda_codec *cdc, struct hda_component_parent *parent); 82 83 static 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 95 static 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 4 4 * Implementation of primary alsa driver code base for Intel HD Audio. 5 5 * 6 * Copyright(c) 2004 Intel Corporation . All rights reserved.6 * Copyright(c) 2004 Intel Corporation 7 7 * 8 8 * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> … … 25 25 #include <sound/core.h> 26 26 #include <sound/initval.h> 27 #include <sound/pcm_params.h> 27 28 #include "hda_controller.h" 28 29 #include "hda_local.h" … … 117 118 //NOT_USED struct azx *chip = apcm->chip; 118 119 struct azx_dev *azx_dev = get_azx_dev(substream); 120 struct hdac_stream *hdas = azx_stream(azx_dev); 119 121 int ret = 0; 120 122 … … 126 128 } 127 129 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; 131 139 132 140 unlock: … … 160 168 struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream); 161 169 struct snd_pcm_runtime *runtime = substream->runtime; 162 unsigned int format_val, stream_tag ;170 unsigned int format_val, stream_tag, bits; 163 171 int err; 164 172 struct hda_spdif_out *spdif = … … 174 182 175 183 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); 181 187 if (!format_val) { 182 188 dev_err(chip->card->dev, … … 191 197 goto unlock; 192 198 193 snd_hdac_stream_setup(azx_stream(azx_dev) );199 snd_hdac_stream_setup(azx_stream(azx_dev), false); 194 200 195 201 stream_tag = azx_dev->core.stream_tag; … … 280 286 /* reset SYNC bits */ 281 287 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); 284 289 spin_unlock(&bus->reg_lock); 285 290 return 0; … … 470 475 ((HDA_MAX_CYCLE_VALUE + 1) * runtime->rate)); 471 476 472 *system = convert_art_to_tsc(tsc_counter); 477 system->cycles = tsc_counter; 478 system->cs_id = CSID_X86_ART; 473 479 474 480 return 0; … … 933 939 if (chip->disabled) 934 940 return 0; 935 if (chip->single_cmd )941 if (chip->single_cmd || bus->use_pio_for_commands) 936 942 return azx_single_send_cmd(bus, val); 937 943 else … … 947 953 if (chip->disabled) 948 954 return 0; 949 if (chip->single_cmd )955 if (chip->single_cmd || bus->use_pio_for_commands) 950 956 return azx_single_get_response(bus, addr, res); 951 957 else … … 1094 1100 int repeat = 0; /* count for avoiding endless loop */ 1095 1101 1096 #ifdef CONFIG_PM1097 1102 if (azx_has_pm_runtime(chip)) 1098 1103 if (!pm_runtime_active(chip->card->dev)) 1099 1104 return IRQ_NONE; 1100 #endif1101 1105 1102 1106 spin_lock(&bus->reg_lock); … … 1212 1216 bus->core.align_bdle_4k = true; 1213 1217 1218 if (chip->driver_caps & AZX_DCAPS_PIO_COMMANDS) 1219 bus->core.use_pio_for_commands = true; 1220 1214 1221 /* enable sync_write flag for stable communication as default */ 1215 1222 bus->core.sync_write = 1; … … 1239 1246 "Codec #%d probe error; disabling it...\n", c); 1240 1247 bus->codec_mask &= ~(1 << c); 1248 /* no codecs */ 1249 if (bus->codec_mask == 0) 1250 break; 1241 1251 /* More badly, accessing to a non-existing 1242 1252 * codec often screws up the controller chip, -
GPL/trunk/alsa-kernel/pci/hda/hda_controller.h
r772 r777 46 46 #define AZX_DCAPS_NO_MSI64 (1 << 29) /* Stick to 32-bit MSIs */ 47 47 #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 */ 48 49 49 50 enum { -
GPL/trunk/alsa-kernel/pci/hda/hda_eld.c
r772 r777 13 13 #include <linux/slab.h> 14 14 #include <sound/core.h> 15 #include < asm/unaligned.h>15 #include <linux/unaligned.h> 16 16 #include <sound/hda_chmap.h> 17 17 #include <sound/hda_codec.h> -
GPL/trunk/alsa-kernel/pci/hda/hda_generic.c
r772 r777 3958 3958 cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute"; 3959 3959 cdev->brightness_set_blocking = callback; 3960 cdev->brightness = ledtrig_audio_get(idx);3961 3960 cdev->flags = LED_CORE_SUSPENDRESUME; 3962 3961 … … 6097 6096 EXPORT_SYMBOL_GPL(snd_hda_gen_free); 6098 6097 6099 #ifdef CONFIG_PM6100 6098 /** 6101 6099 * snd_hda_gen_check_power_status - check the loopback power save state … … 6111 6109 } 6112 6110 EXPORT_SYMBOL_GPL(snd_hda_gen_check_power_status); 6113 #endif6114 6111 6115 6112 … … 6124 6121 .free = snd_hda_gen_free, 6125 6122 .unsol_event = snd_hda_jack_unsol_event, 6126 #ifdef CONFIG_PM6127 6123 .check_power_status = snd_hda_gen_check_power_status, 6128 #endif6129 6124 }; 6130 6125 -
GPL/trunk/alsa-kernel/pci/hda/hda_generic.h
r772 r777 233 233 unsigned int dac_min_mute:1; /* minimal = mute for DACs */ 234 234 unsigned int suppress_vmaster:1; /* don't create vmaster kctls */ 235 unsigned int obey_preferred_dacs:1; /* obey preferred_dacs assignment */236 235 237 236 /* other internal flags */ … … 341 340 void snd_hda_gen_update_outputs(struct hda_codec *codec); 342 341 343 #ifdef CONFIG_PM344 342 int snd_hda_gen_check_power_status(struct hda_codec *codec, hda_nid_t nid); 345 #endif346 343 unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, 347 344 hda_nid_t nid, -
GPL/trunk/alsa-kernel/pci/hda/hda_intel.c
r772 r777 5 5 * for Intel HD Audio. 6 6 * 7 * Copyright(c) 2004 Intel Corporation . All rights reserved.7 * Copyright(c) 2004 Intel Corporation 8 8 * 9 9 * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> … … 198 198 "(in second, 0 = disable)."); 199 199 200 static bool pm_blacklist = true;201 module_param(pm_blacklist, b ool, 0644);200 static int pm_blacklist = -1; 201 module_param(pm_blacklist, bint, 0644); 202 202 MODULE_PARM_DESC(pm_blacklist, "Enable power-management denylist"); 203 203 … … 209 209 module_param(power_save_controller, bool, 0644); 210 210 MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode."); 211 #else 211 #else /* CONFIG_PM */ 212 212 #define power_save 0 213 #define pm_blacklist 0 214 #define power_save_controller false 213 215 #endif /* CONFIG_PM */ 214 216 … … 312 314 #define AZX_DCAPS_INTEL_BROXTON AZX_DCAPS_INTEL_SKYLAKE 313 315 316 #define AZX_DCAPS_INTEL_LNL \ 317 (AZX_DCAPS_INTEL_SKYLAKE | AZX_DCAPS_PIO_COMMANDS) 318 314 319 /* quirks for ATI SB / AMD Hudson */ 315 320 #define AZX_DCAPS_PRESET_ATI_SB \ … … 839 844 mod_dma_pos %= azx_dev->core.period_bytes; 840 845 841 fifo_size = azx_stream(azx_dev)->fifo_size - 1;846 fifo_size = azx_stream(azx_dev)->fifo_size; 842 847 843 848 if (azx_dev->insufficient) { … … 923 928 } 924 929 925 #ifdef CONFIG_PM926 930 static DEFINE_MUTEX(card_list_lock); 927 931 static LIST_HEAD(card_list); … … 950 954 #ifdef NOT_USED 951 955 /* trigger power-save check at writing parameter */ 952 static int param_set_xint(const char *val, const struct kernel_param *kp)956 static int __maybe_unused param_set_xint(const char *val, const struct kernel_param *kp) 953 957 { 954 958 struct hda_intel *hda; … … 960 964 return ret; 961 965 966 if (pm_blacklist > 0) 967 return 0; 968 962 969 mutex_lock(&card_list_lock); 963 970 list_for_each_entry(hda, &card_list, list, struct hda_intel) { 964 971 chip = &hda->chip; 965 if (!hda->probe_continued || chip->disabled) 972 if (!hda->probe_continued || chip->disabled || 973 hda->runtime_pm_disabled) 966 974 continue; 967 975 snd_hda_set_power_save(&chip->bus, power_save * 1000); … … 1022 1030 } 1023 1031 1024 #ifdef CONFIG_PM_SLEEP1025 1032 static int azx_prepare(struct device *dev) 1026 1033 { … … 1081 1088 } 1082 1089 1083 static int azx_resume(struct device *dev)1090 static int __maybe_unused azx_resume(struct device *dev) 1084 1091 { 1085 1092 struct snd_card *card = dev_get_drvdata(dev); … … 1132 1139 return 0; 1133 1140 } 1134 #endif /* CONFIG_PM_SLEEP */1135 1141 1136 1142 #ifdef NOT_USED 1137 static int azx_runtime_suspend(struct device *dev)1143 static int __maybe_unused azx_runtime_suspend(struct device *dev) 1138 1144 { 1139 1145 struct snd_card *card = dev_get_drvdata(dev); … … 1152 1158 } 1153 1159 1154 static int azx_runtime_resume(struct device *dev)1160 static int __maybe_unused azx_runtime_resume(struct device *dev) 1155 1161 { 1156 1162 struct snd_card *card = dev_get_drvdata(dev); … … 1169 1175 } 1170 1176 1171 static int azx_runtime_idle(struct device *dev)1177 static int __maybe_unused azx_runtime_idle(struct device *dev) 1172 1178 { 1173 1179 struct snd_card *card = dev_get_drvdata(dev); … … 1196 1202 1197 1203 static 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), 1205 1209 #ifdef CONFIG_PM_RUNTIME 1206 1210 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) 1207 1211 #endif 1208 1212 }; 1209 1210 #define AZX_PM_OPS &azx_pm1211 #else1212 #define azx_add_card_list(chip) /* NOP */1213 #define azx_del_card_list(chip) /* NOP */1214 #define AZX_PM_OPS NULL1215 #endif /* CONFIG_PM */1216 1213 1217 1214 … … 1458 1455 acpi_status status; 1459 1456 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 1471 1462 dhandle = ACPI_HANDLE(&pdev->dev); 1472 1463 if (dhandle) { … … 1863 1854 /* use the non-cached pages in non-snoop mode */ 1864 1855 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; 1866 1857 1867 1858 if (chip->driver_type == AZX_DRIVER_NVIDIA) { … … 2116 2107 { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ 2117 2108 { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ 2109 { PCI_DEVICE_SUB(0x1022, 0x15e3, 0x1022, 0xd601) }, /* ASRock X670E Taichi */ 2118 2110 {0} 2119 2111 }; … … 2188 2180 pci_set_drvdata(pci, card); 2189 2181 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 2190 2215 err = register_vga_switcheroo(chip); 2191 2216 if (err < 0) { … … 2215 2240 #endif /* CONFIG_SND_HDA_PATCH_LOADER */ 2216 2241 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 #endif2221 2222 2242 #ifdef TARGET_OS2 // modified code from 3.13 otherwise we don't detect hardware. Is schedule_work a stub? 2223 2243 if (schedule_probe) { … … 2237 2257 2238 2258 out_free: 2259 pci_set_drvdata(pci, NULL); 2239 2260 snd_card_free(card); 2240 2261 return err; 2241 2262 } 2242 2263 2243 #ifdef CONFIG_PM2244 2264 /* On some boards setting power_save to a non 0 value leads to clicking / 2245 2265 * popping sounds when ever we enter/leave powersaving mode. Ideally we would … … 2285 2305 {0} 2286 2306 }; 2287 #endif /* CONFIG_PM */2288 2307 2289 2308 static void set_default_power_save(struct azx *chip) 2290 2309 { 2310 struct hda_intel *hda = container_of(chip, struct hda_intel, chip); 2291 2311 int val = power_save; 2292 2312 2293 #ifdef CONFIG_PM 2294 if (pm_blacklist) { 2313 if (pm_blacklist < 0) { 2295 2314 const struct snd_pci_quirk *q; 2296 2315 … … 2300 2319 q->subvendor, q->subdevice); 2301 2320 val = 0; 2321 hda->runtime_pm_disabled = 1; 2302 2322 } 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 } 2305 2327 snd_hda_set_power_save(&chip->bus, val * 1000); 2306 2328 } … … 2327 2349 to_hda_bus(bus)->bus_probing = 1; 2328 2350 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/DP2335 * (for HSW and BDW), we need to abort the probe;2336 * for other chips, still continue probing as other2337 * 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 }2353 2351 2354 2352 /* Request display power well for the HDA controller or codec. For … … 2382 2380 if (err < 0) 2383 2381 goto out_free; 2384 #ifndef CONFIG_PM2385 release_firmware(chip->fw); /* no longer needed */2386 chip->fw = NULL;2387 #endif2388 2382 } 2389 2383 #endif … … 2563 2557 { PCI_DEVICE_DATA(INTEL, HDA_RPL_PX, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) }, 2564 2558 { 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) }, 2565 2561 /* 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) }, 2567 2563 /* Arrow Lake-S */ 2568 2564 { PCI_DEVICE_DATA(INTEL, HDA_ARL_S, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) }, 2569 2565 /* Arrow Lake */ 2570 2566 { 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) }, 2571 2571 /* Apollolake (Broxton-P) */ 2572 2572 { PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) }, … … 2826 2826 .shutdown = azx_shutdown, 2827 2827 .driver = { 2828 .pm = AZX_PM_OPS,2828 .pm = &azx_pm, 2829 2829 }, 2830 2830 }; -
GPL/trunk/alsa-kernel/pci/hda/hda_intel.h
r772 r777 23 23 unsigned int irq_pending_warned:1; 24 24 unsigned int probe_continued:1; 25 unsigned int runtime_pm_disabled:1; 25 26 26 27 /* vga_switcheroo setup */ -
GPL/trunk/alsa-kernel/pci/hda/hda_intel_trace.h
r772 r777 35 35 ); 36 36 37 #ifdef CONFIG_PM38 37 DEFINE_EVENT(hda_pm, azx_runtime_suspend, 39 38 TP_PROTO(struct azx *chip), … … 45 44 TP_ARGS(chip) 46 45 ); 47 #endif48 46 49 47 #endif /* _TRACE_HDA_INTEL_H */ -
GPL/trunk/alsa-kernel/pci/hda/hda_sysfs.c
r772 r777 30 30 }; 31 31 32 #ifdef CONFIG_PM33 32 static ssize_t power_on_acct_show(struct device *dev, 34 33 struct device_attribute *attr, … … 51 50 static DEVICE_ATTR_RO(power_on_acct); 52 51 static DEVICE_ATTR_RO(power_off_acct); 53 #endif /* CONFIG_PM */54 52 55 53 #define CODEC_INFO_SHOW(type, field) \ … … 749 747 &dev_attr_init_pin_configs.attr, 750 748 &dev_attr_driver_pin_configs.attr, 751 #ifdef CONFIG_PM752 749 &dev_attr_power_on_acct.attr, 753 750 &dev_attr_power_off_acct.attr, 754 #endif755 751 #ifdef CONFIG_SND_HDA_RECONFIG 756 752 &dev_attr_init_verbs.attr, -
GPL/trunk/alsa-kernel/pci/hda/patch_analog.c
r772 r777 76 76 #endif 77 77 78 #ifdef CONFIG_PM79 78 static void ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, 80 79 hda_nid_t hp) … … 122 121 return 0; 123 122 } 124 #endif125 123 126 124 /* follow EAPD via vmaster hook */ … … 162 160 .free = snd_hda_gen_free, 163 161 .unsol_event = snd_hda_jack_unsol_event, 164 #ifdef CONFIG_PM165 162 .check_power_status = snd_hda_gen_check_power_status, 166 163 .suspend = ad198x_suspend, 167 #endif168 164 }; 169 165 -
GPL/trunk/alsa-kernel/pci/hda/patch_ca0132.c
r772 r777 3040 3040 unsigned int format_val; 3041 3041 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); 3044 3043 3045 3044 if (hda_format) … … 3634 3633 static bool dspload_wait_loaded(struct hda_codec *codec) 3635 3634 { 3635 #ifndef TARGET_OS2 3636 3636 unsigned long timeout = jiffies + msecs_to_jiffies(2000); 3637 3637 3638 3638 do { 3639 #ifndef TARGET_OS23640 3639 if (dspload_is_loaded(codec)) { 3641 3640 codec_info(codec, "ca0132 DSP downloaded and running\n"); 3642 3641 return true; 3643 3642 } 3644 #endif3645 3643 msleep(20); 3646 3644 } while (time_before(jiffies, timeout)); 3647 3645 #endif 3648 3646 codec_err(codec, "ca0132 failed to download DSP\n"); 3649 3647 return false; … … 6675 6673 struct snd_kcontrol_new knew = { 6676 6674 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6677 .index = 0, \6675 .index = 0, 6678 6676 .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 | 6681 6679 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, 6682 .info = snd_hda_mixer_amp_volume_info, \6680 .info = snd_hda_mixer_amp_volume_info, 6683 6681 .get = snd_hda_mixer_amp_volume_get, 6684 6682 .put = snd_hda_mixer_amp_volume_put, … … 6755 6753 #else 6756 6754 struct snd_kcontrol_new knew = 6757 { 6755 { 6758 6756 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6759 6757 .index = 0, … … 6765 6763 knew.name = ca0132_voicefx.name; 6766 6764 knew.private_value = HDA_COMPOSE_AMP_VAL(VOICEFX, 1, 0, HDA_INPUT); 6767 6768 6765 #endif 6769 6766 knew.info = ca0132_voicefx_info; … … 6782 6779 #else 6783 6780 struct snd_kcontrol_new knew = 6784 { 6781 { 6785 6782 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6786 6783 .index = 0, … … 6891 6888 #else 6892 6889 struct snd_kcontrol_new knew = { 6893 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6890 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6894 6891 .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, 6899 6896 .info = snd_hda_mixer_amp_volume_info, \ 6900 6897 .get = snd_hda_mixer_amp_volume_get, 6901 .put = snd_hda_mixer_amp_volume_put, 6898 .put = snd_hda_mixer_amp_volume_put, 6902 6899 .tlv = { .c = snd_hda_mixer_amp_tlv }, 6903 6900 }; … … 9170 9167 { 9171 9168 /* put any chip cleanup stuffs here. */ 9172 #ifndef TARGET_OS2 9169 9170 #ifndef TARGET_OS2 9173 9171 if (dspload_is_loaded(codec)) 9174 9172 dsp_reset(codec); 9175 9173 #endif 9176 9174 } 9177 9175 … … 9795 9793 } 9796 9794 9797 #ifdef CONFIG_PM9798 9795 static int ca0132_suspend(struct hda_codec *codec) 9799 9796 { … … 9803 9800 return 0; 9804 9801 } 9805 #endif9806 9802 9807 9803 static const struct hda_codec_ops ca0132_patch_ops = { … … 9811 9807 .free = ca0132_free, 9812 9808 .unsol_event = snd_hda_jack_unsol_event, 9813 #ifdef CONFIG_PM9814 9809 .suspend = ca0132_suspend, 9815 #endif9816 9810 }; 9817 9811 -
GPL/trunk/alsa-kernel/pci/hda/patch_cirrus.c
r772 r777 1135 1135 } 1136 1136 1137 #ifdef CONFIG_PM1138 1137 /* 1139 1138 * Manage PDREF, when transitioning to D3hot … … 1160 1159 return 0; 1161 1160 } 1162 #endif1163 1161 1164 1162 static const struct hda_codec_ops cs421x_patch_ops = { … … 1168 1166 .free = cs_free, 1169 1167 .unsol_event = snd_hda_jack_unsol_event, 1170 #ifdef CONFIG_PM1171 1168 .suspend = cs421x_suspend, 1172 #endif1173 1169 }; 1174 1170 -
GPL/trunk/alsa-kernel/pci/hda/patch_cmedia.c
r679 r777 22 22 #endif 23 23 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 24 46 struct cmi_spec { 25 47 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 57 static 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 72 static 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 100 static 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 111 static 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 122 static 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 156 static 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 173 static 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 182 static 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 190 static 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 198 static 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 209 static 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 } 27 248 28 249 /* … … 36 257 .unsol_event = snd_hda_jack_unsol_event, 37 258 }; 259 260 static 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 } 38 306 39 307 static int patch_cmi9880(struct hda_codec *codec) … … 118 386 HDA_CODEC_ENTRY(0x13f69880, "CMI9880", patch_cmi9880), 119 387 HDA_CODEC_ENTRY(0x434d4980, "CMI9880", patch_cmi9880), 388 HDA_CODEC_ENTRY(0x13f69825, "CM9825", patch_cm9825), 120 389 {0} /* terminator */ 121 390 }; -
GPL/trunk/alsa-kernel/pci/hda/patch_conexant.c
r772 r777 173 173 static void cx_fixup_headset_recog(struct hda_codec *codec) 174 174 { 175 unsigned int mic_p ersent;175 unsigned int mic_present; 176 176 177 177 /* fix some headset type recognize fail issue, such as EDIFIER headset */ 178 /* set micbias doutput current comparator threshold from 66% to 55%. */178 /* set micbias output current comparator threshold from 66% to 55%. */ 179 179 snd_hda_codec_write(codec, 0x1c, 0, 0x320, 0x010); 180 /* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias regist or180 /* set OFF voltage for DFET from -1.2V to -0.8V, set headset micbias register 181 181 * value adjustment trim from 2.2K ohms to 2.0K ohms. 182 182 */ 183 183 snd_hda_codec_write(codec, 0x1c, 0, 0x3b0, 0xe10); 184 184 /* fix reboot headset type recognize fail issue */ 185 mic_p ersent = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0);186 if (mic_p ersent & 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) 187 187 /* enable headset mic VREF */ 188 188 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24); … … 254 254 unsigned int mic_present; 255 255 256 /* In cx8070 and sn6140, the node 16 can only be config to headphone or disabled,257 * the node 19 can only be config to microphone or disabled.258 * Check hp&mic tag to process headset p ulgin&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. 259 259 */ 260 260 mic_present = snd_hda_codec_read(codec, 0x19, 0, AC_VERB_GET_PIN_SENSE, 0x0); … … 265 265 } 266 266 267 #ifdef CONFIG_PM268 267 static int cx_auto_suspend(struct hda_codec *codec) 269 268 { … … 271 270 return 0; 272 271 } 273 #endif274 272 275 273 static const struct hda_codec_ops cx_auto_patch_ops = { … … 279 277 .free = cx_auto_free, 280 278 .unsol_event = snd_hda_jack_unsol_event, 281 #ifdef CONFIG_PM282 279 .suspend = cx_auto_suspend, 283 280 .check_power_status = snd_hda_gen_check_power_status, 284 #endif285 281 }; 286 282 … … 792 788 } 793 789 794 #ifndef TARGET_OS2795 790 static void cxt_setup_gpio_unmute(struct hda_codec *codec, 796 791 unsigned int gpio_mute_mask) … … 804 799 } 805 800 } 806 #endif807 801 808 802 static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, … … 820 814 } 821 815 822 #ifndef TARGET_OS2823 816 static void cxt_fixup_hp_a_u(struct hda_codec *codec, 824 817 const struct hda_fixup *fix, int action) … … 829 822 cxt_setup_gpio_unmute(codec, 0x2); 830 823 } 831 #endif832 824 833 825 /* ThinkPad X200 & co with cxt5051 */ … … 884 876 {0} 885 877 }; 886 #endif /* TARGET_OS2 */ 887 888 #ifndef TARGET_OS2 878 #endif 879 889 880 /* SuoWoSi/South-holding JS201D with sn6140 */ 890 881 static const struct hda_pintbl cxt_pincfg_sws_js201d[] = { … … 897 888 {0} 898 889 }; 899 #endif900 890 901 891 static const struct hda_fixup cxt_fixups[] = { … … 1081 1071 .chain_id = CXT_FIXUP_HEADSET_MIC, 1082 1072 }, 1073 #endif 1083 1074 [CXT_PINCFG_SWS_JS201D] = { 1084 1075 .type = HDA_FIXUP_PINS, 1085 1076 .v.pins = cxt_pincfg_sws_js201d, 1086 1077 }, 1078 #ifdef NOT_USED 1087 1079 [CXT_PINCFG_TOP_SPEAKER] = { 1088 1080 .type = HDA_FIXUP_PINS, … … 1092 1084 }, 1093 1085 }, 1086 #endif 1094 1087 [CXT_FIXUP_HP_A_U] = { 1095 1088 .type = HDA_FIXUP_FUNC, 1096 1089 .v.func = cxt_fixup_hp_a_u, 1097 1090 }, 1098 #endif1099 1091 }; 1100 1092 -
GPL/trunk/alsa-kernel/pci/hda/patch_hdmi.c
r772 r777 4 4 * patch_hdmi.c - routines for HDMI/DisplayPort codecs 5 5 * 6 * Copyright(c) 2008-2010 Intel Corporation . All rights reserved.6 * Copyright(c) 2008-2010 Intel Corporation 7 7 * Copyright (c) 2006 ATI Technologies Inc. 8 8 * Copyright (c) 2008 NVIDIA Corp. All rights reserved. … … 55 55 IS_ENABLED(CONFIG_SND_HDA_INTEL_HDMI_SILENT_STREAM); 56 56 #else 57 1 57 1; 58 58 #endif 59 59 module_param(enable_silent_stream, bool, 0644); … … 1672 1672 #define I915_SILENT_RATE 48000 1673 1673 #define I915_SILENT_CHANNELS 2 1674 #define I915_SILENT_FORMAT SNDRV_PCM_FORMAT_S16_LE1675 1674 #define I915_SILENT_FORMAT_BITS 16 1676 1675 #define I915_SILENT_FMT_MASK 0xf … … 1685 1684 1686 1685 /* 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); 1689 1688 snd_hda_codec_setup_stream(codec, per_pin->cvt_nid, 1690 1689 I915_SILENT_FMT_MASK, I915_SILENT_FMT_MASK, format); … … 1994 1993 &per_cvt->rates, 1995 1994 &per_cvt->formats, 1995 NULL, 1996 1996 &per_cvt->maxbps); 1997 1997 if (err < 0) … … 2083 2083 mutex_lock(&codec->spdif_mutex); 2084 2084 spdif = snd_hda_spdif_out_of_nid(codec, cvt_nid); 2085 #ifndef TARGET_OS2 2085 2086 /* Add sanity check to pass klockwork check. 2086 2087 * This should never happen. 2087 2088 */ 2088 #ifndef TARGET_OS22089 2089 if (WARN_ON(spdif == NULL)) { 2090 2090 mutex_unlock(&codec->spdif_mutex); 2091 2091 return true; 2092 2092 } 2093 2093 #endif 2094 2094 non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO); 2095 2095 mutex_unlock(&codec->spdif_mutex); … … 2540 2540 } 2541 2541 2542 #ifdef CONFIG_PM2543 2542 static int generic_hdmi_suspend(struct hda_codec *codec) 2544 2543 { … … 2567 2566 return 0; 2568 2567 } 2569 #endif2570 2568 2571 2569 static const struct hda_codec_ops generic_hdmi_patch_ops = { … … 2575 2573 .build_controls = generic_hdmi_build_controls, 2576 2574 .unsol_event = hdmi_unsol_event, 2577 #ifdef CONFIG_PM2578 2575 .suspend = generic_hdmi_suspend, 2579 2576 .resume = generic_hdmi_resume, 2580 #endif2581 2577 }; 2582 2578 … … 2983 2979 } 2984 2980 2985 #ifdef CONFIG_PM2986 2981 static int i915_adlp_hdmi_suspend(struct hda_codec *codec) 2987 2982 { … … 3063 3058 return res; 3064 3059 } 3065 #endif3066 3060 3067 3061 /* precondition and allocation for Intel codecs */ … … 3198 3192 spec->silent_stream_type = SILENT_STREAM_KAE; 3199 3193 3200 #ifdef CONFIG_PM3201 3194 codec->patch_ops.resume = i915_adlp_hdmi_resume; 3202 3195 codec->patch_ops.suspend = i915_adlp_hdmi_suspend; 3203 #endif3204 3196 } 3205 3197 } … … 4673 4665 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi), 4674 4666 HDA_CODEC_ENTRY(0x8086281d, "Meteor Lake HDMI", patch_i915_adlp_hdmi), 4667 HDA_CODEC_ENTRY(0x8086281e, "Battlemage HDMI", patch_i915_adlp_hdmi), 4675 4668 HDA_CODEC_ENTRY(0x8086281f, "Raptor Lake P HDMI", patch_i915_adlp_hdmi), 4676 4669 HDA_CODEC_ENTRY(0x80862820, "Lunar Lake HDMI", patch_i915_adlp_hdmi), -
GPL/trunk/alsa-kernel/pci/hda/patch_realtek.c
r772 r777 11 11 */ 12 12 13 #include <linux/acpi.h> 14 #include <linux/cleanup.h> 13 15 #include <linux/init.h> 14 16 #include <linux/delay.h> … … 17 19 #include <linux/dmi.h> 18 20 #include <linux/module.h> 21 //#include <linux/i2c.h> 19 22 #include <linux/input.h> 20 23 #include <linux/leds.h> 21 24 #include <linux/ctype.h> 25 //#include <linux/spi/spi.h> 22 26 #include <sound/core.h> 23 27 #include <sound/jack.h> … … 118 122 /* hooks */ 119 123 void (*init_hook)(struct hda_codec *codec); 120 #ifdef CONFIG_PM121 124 void (*power_hook)(struct hda_codec *codec); 122 #endif123 125 void (*shutup)(struct hda_codec *codec); 124 126 … … 133 135 unsigned int no_internal_mic_pin:1; 134 136 unsigned int en_3kpull_low:1; 137 int num_speaker_amps; 135 138 136 139 /* for PLL fix */ … … 142 145 143 146 /* component binding */ 144 struct component_match *match; 145 struct hda_component comps[HDA_MAX_COMPONENTS]; 147 struct hda_component_parent comps; 146 148 }; 147 149 … … 938 940 #define is_s4_resume(codec) \ 939 941 ((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) 940 944 941 945 static int alc_init(struct hda_codec *codec) … … 962 966 } 963 967 964 #define alc_free snd_hda_gen_free 965 966 #ifdef CONFIG_PM 968 /* forward declaration */ 969 static const struct component_master_ops comp_master_ops; 970 971 static 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 967 981 static inline void alc_shutup(struct hda_codec *codec) 968 982 { … … 1003 1017 return 0; 1004 1018 } 1005 #endif1006 1019 1007 1020 /* … … 1013 1026 .free = alc_free, 1014 1027 .unsol_event = snd_hda_jack_unsol_event, 1015 #ifdef CONFIG_PM1016 1028 .resume = alc_resume, 1017 1029 .suspend = alc_suspend, 1018 1030 .check_power_status = snd_hda_gen_check_power_status, 1019 #endif1020 1031 }; 1021 1032 … … 3099 3110 { 0x18, PIN_VREF50 }, /* rear mic */ 3100 3111 { 0x19, PIN_VREF50 }, /* front mic */ 3101 { }3112 {0} 3102 3113 } 3103 3114 }, … … 3524 3535 .v.pins = (const struct hda_pintbl[]) { 3525 3536 { 0x18, PIN_VREF100 }, /* headset mic */ 3526 { }3537 {0} 3527 3538 } 3528 3539 }, … … 4759 4770 #endif 4760 4771 4761 #ifdef CONFIG_PM4762 4772 static int alc269_suspend(struct hda_codec *codec) 4763 4773 { … … 4808 4818 return 0; 4809 4819 } 4810 #endif /* CONFIG_PM */4811 4820 4812 4821 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, … … 5561 5570 } 5562 5571 5563 #ifndef TARGET_OS2 5572 struct alc298_samsung_v2_amp_desc { 5573 unsigned short nid; 5574 int init_seq_size; 5575 unsigned short init_seq[18][2]; 5576 }; 5577 5578 static const struct alc298_samsung_v2_amp_desc 5579 alc298_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 5612 static 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 5629 static 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 5646 static 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 5658 static 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 5686 static 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 5693 static 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 5564 5701 static void gpio2_mic_hotkey_event(struct hda_codec *codec, 5565 5702 struct hda_jack_callback *event) … … 5608 5745 return 0; 5609 5746 } 5610 #endif /* TARGET_OS2 */5747 #endif 5611 5748 5612 5749 /* GPIO1 = set according to SKU external amp … … 7281 7418 struct alc_spec *spec = codec->spec; 7282 7419 7283 if (action == HDA_FIXUP_ACT_PRE_PROBE) {7420 if (action == HDA_FIXUP_ACT_PRE_PROBE) 7284 7421 spec->gen.preferred_dacs = preferred_pairs; 7285 spec->gen.obey_preferred_dacs = 1;7286 }7287 7422 } 7288 7423 #endif /* NOT_USED */ … … 7333 7468 case HDA_FIXUP_ACT_INIT: 7334 7469 alc_combo_jack_hp_jd_restart(codec); 7470 break; 7471 } 7472 } 7473 7474 static 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; 7335 7484 break; 7336 7485 } … … 7580 7729 } 7581 7730 7731 static 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 7582 7741 static int comp_bind(struct device *dev) 7583 7742 { 7584 7743 struct hda_codec *cdc = dev_to_hda_codec(dev); 7585 7744 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); 7588 7754 } 7589 7755 … … 7593 7759 struct alc_spec *spec = cdc->spec; 7594 7760 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); 7596 7763 } 7597 7764 … … 7605 7772 { 7606 7773 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 7778 static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bus, 7779 const char *hid, const char *match_str, int count) 7780 { 7672 7781 struct alc_spec *spec = cdc->spec; 7673 struct scodec_dev_name *rec; 7674 int ret, i; 7782 int ret; 7675 7783 7676 7784 switch (action) { 7677 7785 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); 7690 7788 if (ret) 7691 codec_err(cdc, "Fail to register component aggregator %d\n", ret);7692 else 7789 return; 7790 7693 7791 spec->gen.pcm_playback_hook = comp_generic_playback_hook; 7694 7792 break; 7695 7793 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 7799 static void find_cirrus_companion_amps(struct hda_codec *cdc) 7800 { 7801 #ifndef TARGET_OS2 7704 7802 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 7734 7867 } 7735 7868 7736 7869 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action) 7737 7870 { 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 7874 static 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); 7739 7877 } 7740 7878 7741 7879 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7742 7880 { 7743 c s35l41_generic_fixup(codec, action, "spi", "CSC3551", 2);7881 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2); 7744 7882 } 7745 7883 7746 7884 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action) 7747 7885 { 7748 c s35l41_generic_fixup(codec, action, "spi", "CSC3551", 4);7886 comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 4); 7749 7887 } 7750 7888 … … 7752 7890 int action) 7753 7891 { 7754 c s35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);7755 } 7756 7757 #if ndef TARGET_OS27892 comp_generic_fixup(cdc, action, "i2c", "CLSA0100", "-%s:00-cs35l41-hda.%d", 2); 7893 } 7894 7895 #ifdef NOT_USED 7758 7896 static void alc287_fixup_legion_16ithg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix, 7759 7897 int action) 7760 7898 { 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 7903 static 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 } 7764 7912 7765 7913 static void tas2781_fixup_i2c(struct hda_codec *cdc, 7766 7914 const struct hda_fixup *fix, int action) 7767 7915 { 7768 tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781"); 7769 } 7916 comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1); 7917 } 7918 7919 static 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 7925 static 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 7770 7931 7771 7932 /* for alc295_fixup_hp_top_speakers */ … … 7833 7994 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c); 7834 7995 } 7996 } 7997 7998 static 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"); 7835 8015 } 7836 8016 … … 7973 8153 break; 7974 8154 } 8155 } 8156 8157 static 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 */ 8192 static 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 */ 8239 static 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 8254 static 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 8263 static 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; 7975 8280 } 7976 8281 … … 8179 8484 ALC236_FIXUP_LENOVO_INV_DMIC, 8180 8485 ALC298_FIXUP_SAMSUNG_AMP, 8486 ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS, 8487 ALC298_FIXUP_SAMSUNG_AMP_V2_4_AMPS, 8181 8488 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, 8182 8489 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, … … 8202 8509 ALC274_FIXUP_HP_HEADSET_MIC, 8203 8510 ALC274_FIXUP_HP_ENVY_GPIO, 8511 ALC274_FIXUP_ASUS_ZEN_AIO_27, 8204 8512 ALC256_FIXUP_ASUS_HPE, 8205 8513 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, … … 8224 8532 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, 8225 8533 ALC298_FIXUP_LENOVO_C940_DUET7, 8226 ALC287_FIXUP_LENOVO_14IRP8_DUETITL,8227 8534 ALC287_FIXUP_13S_GEN2_SPEAKERS, 8228 8535 ALC256_FIXUP_SET_COEF_DEFAULTS, … … 8235 8542 ALC287_FIXUP_CS35L41_I2C_2, 8236 8543 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED, 8544 ALC287_FIXUP_CS35L41_I2C_4, 8237 8545 ALC245_FIXUP_CS35L41_SPI_2, 8238 8546 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED, … … 8249 8557 ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, 8250 8558 ALC287_FIXUP_TAS2781_I2C, 8559 ALC287_FIXUP_YOGA7_14ARB7_I2C, 8251 8560 ALC245_FIXUP_HP_MUTE_LED_COEFBIT, 8252 8561 ALC245_FIXUP_HP_X360_MUTE_LEDS, … … 8256 8565 ALC289_FIXUP_DELL_CS35L41_SPI_2, 8257 8566 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, 8258 8581 }; 8259 8582 … … 8443 8766 {0} 8444 8767 }; 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 8769 static const struct hda_pintbl ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC_PINS[] = { 8770 { 0x19, 0x03a11050 }, 8771 { 0x1b, 0x03a11c30 }, 8772 {0} 8773 }; 8774 8775 static 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 8468 8785 8469 8786 static const struct hda_fixup alc269_fixups[] = { … … 9598 9915 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE 9599 9916 }, 9917 #endif 9600 9918 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = { 9601 9919 .type = HDA_FIXUP_PINS, 9920 #ifndef TARGET_OS2 9602 9921 .v.pins = (const struct hda_pintbl[]) { 9603 9922 /* Change the mic location from front to right, otherwise there are … … 9609 9928 {0} 9610 9929 }, 9611 }, 9930 #else 9931 .v.pins = ALC294_FIXUP_LENOVO_MIC_LOCATION_PINS, 9932 #endif 9933 }, 9934 #ifdef NOT_USED 9612 9935 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = { 9613 9936 .type = HDA_FIXUP_PINS, … … 10123 10446 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET 10124 10447 }, 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 }, 10125 10456 #ifdef NOT_USED 10126 10457 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = { … … 10334 10665 .v.func = alc274_fixup_hp_envy_gpio, 10335 10666 }, 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 }, 10336 10687 [ALC256_FIXUP_ASUS_HPE] = { 10337 10688 .type = HDA_FIXUP_VERBS, … … 10408 10759 { 0x1e, 0x411111f0 }, 10409 10760 { 0x21, 0x03211020 }, 10410 { }10761 {0} 10411 10762 }, 10412 10763 .chained = true, … … 10505 10856 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 10506 10857 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 10507 { }10858 {0} 10508 10859 }, 10509 10860 .chained = true, … … 10552 10903 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 10553 10904 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 10554 { }10905 {0} 10555 10906 }, 10556 10907 .chained = true, … … 10560 10911 .type = HDA_FIXUP_FUNC, 10561 10912 .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,10566 10913 }, 10567 10914 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = { … … 10582 10929 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, 10583 10930 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, 10584 { }10931 {0} 10585 10932 }, 10586 10933 .chained = true, … … 10630 10977 .chained = true, 10631 10978 .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, 10632 10983 }, 10633 10984 [ALC245_FIXUP_CS35L41_SPI_2] = { … … 10782 11133 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 10783 11134 }, 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 }, 10784 11141 [ALC245_FIXUP_HP_MUTE_LED_COEFBIT] = { 10785 11142 .type = HDA_FIXUP_FUNC, … … 10818 11175 .v.func = cs35l41_fixup_i2c_two, 10819 11176 }, 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 10820 11270 }; 10821 11271 … … 10865 11315 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 10866 11316 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), 10867 11319 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 10868 11320 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), … … 10924 11376 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK), 10925 11377 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), 10926 11380 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), 10927 11381 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), … … 10937 11391 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), 10938 11392 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), 10939 11397 SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), 10940 11398 SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2), … … 11118 11576 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 11119 11577 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), 11120 11579 SND_PCI_QUIRK(0x103c, 0x8a0f, "HP Pavilion 14-ec1xxx", ALC287_FIXUP_HP_GPIO_LED), 11121 11580 SND_PCI_QUIRK(0x103c, 0x8a20, "HP Laptop 15s-fq5xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 11122 11581 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), 11123 11593 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 11124 11594 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), … … 11130 11600 SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 11131 11601 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), 11132 11603 SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 11133 11604 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), 11134 11606 SND_PCI_QUIRK(0x103c, 0x8b3f, "HP mt440 Mobile Thin Client U91", ALC236_FIXUP_HP_GPIO_LED), 11135 11607 SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), … … 11160 11632 SND_PCI_QUIRK(0x103c, 0x8b96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 11161 11633 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), 11162 11648 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), 11163 11654 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 11164 11655 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 11165 11656 SND_PCI_QUIRK(0x103c, 0x8c48, "HP EliteBook 860 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 11166 11657 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), 11167 11669 SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook 835 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 11168 11670 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), … … 11188 11690 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 11189 11691 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), 11190 11698 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 11191 11699 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED), … … 11200 11708 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 11201 11709 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK), 11710 SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C), 11202 11711 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 11203 11712 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 11204 11713 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK), 11714 SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C), 11205 11715 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 11206 11716 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), 11207 11719 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), 11208 11720 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), … … 11233 11745 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS UX3402VA", ALC245_FIXUP_CS35L41_SPI_2), 11234 11746 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), 11747 SND_PCI_QUIRK(0x1043, 0x16d3, "ASUS UX5304VA", ALC245_FIXUP_CS35L41_SPI_2), 11235 11748 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), 11236 11750 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), 11237 11751 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), 11238 11752 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), 11239 11754 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), 11240 11755 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), … … 11251 11766 SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 11252 11767 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), 11253 SND_PCI_QUIRK(0x1043, 0x1b13, "A sus U41SV", ALC269_FIXUP_INV_DMIC),11768 SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC), 11254 11769 SND_PCI_QUIRK(0x1043, 0x1b93, "ASUS G614JVR/JIR", ALC245_FIXUP_CS35L41_SPI_2), 11255 11770 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), … … 11259 11774 SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA", ALC245_FIXUP_CS35L41_SPI_2), 11260 11775 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), 11261 11777 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), 11262 11778 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC), … … 11273 11789 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 11274 11790 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), 11275 11792 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 11276 11793 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), 11277 11796 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), 11278 11799 SND_PCI_QUIRK(0x1043, 0x1ee2, "ASUS UM6702RA/RC", ALC287_FIXUP_CS35L41_I2C_2), 11279 11800 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), 11280 11801 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), 11281 11802 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), 11282 11804 SND_PCI_QUIRK(0x1043, 0x1f62, "ASUS UX7602ZM", ALC245_FIXUP_CS35L41_SPI_2), 11283 11805 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401), 11284 11806 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), 11287 11810 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), 11290 11820 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), 11291 11821 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), … … 11314 11844 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), 11315 11845 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), 11316 11847 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 11317 11848 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), … … 11330 11861 SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 11331 11862 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), 11332 11868 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 11333 11869 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), … … 11405 11941 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 11406 11942 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), 11407 11944 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 11408 11945 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 11409 11946 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), 11411 11949 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 11412 11950 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), … … 11463 12001 SND_PCI_QUIRK(0x17aa, 0x2319, "Thinkpad Z16 Gen2", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 11464 12002 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), 11465 12006 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), 11466 12007 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), … … 11479 12020 SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED), 11480 12021 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), 11482 12024 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 11483 12025 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7), 11484 12026 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), 11486 12029 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 11487 12030 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), … … 11497 12040 SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), 11498 12041 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), 11499 12049 SND_PCI_QUIRK(0x17aa, 0x387d, "Yoga S780-16 pro Quad AAC", ALC287_FIXUP_TAS2781_I2C), 11500 12050 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), 11501 12053 SND_PCI_QUIRK(0x17aa, 0x3881, "YB9 dual power mode2 YC", ALC287_FIXUP_TAS2781_I2C), 11502 12054 SND_PCI_QUIRK(0x17aa, 0x3882, "Lenovo Yoga Pro 7 14APH8", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), … … 11504 12056 SND_PCI_QUIRK(0x17aa, 0x3886, "Y780 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 11505 12057 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), 11506 12059 SND_PCI_QUIRK(0x17aa, 0x38a7, "Y780P AMD YG dual", ALC287_FIXUP_TAS2781_I2C), 11507 12060 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), 11508 12069 SND_PCI_QUIRK(0x17aa, 0x38ba, "Yoga S780-14.5 Air AMD quad YC", ALC287_FIXUP_TAS2781_I2C), 11509 12070 SND_PCI_QUIRK(0x17aa, 0x38bb, "Yoga S780-14.5 Air AMD quad AAC", ALC287_FIXUP_TAS2781_I2C), … … 11511 12072 SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C), 11512 12073 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), 11513 12076 SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C), 11514 12077 SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C), 11515 12078 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), 11516 12083 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), 11517 12087 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), 11520 12091 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 11521 12092 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), 11522 12095 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 11523 12096 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), … … 11547 12120 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK), 11548 12121 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), 11549 12126 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), 11550 12127 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), … … 11583 12160 SND_PCI_QUIRK(0x2782, 0x1705, "MEDION E15433", ALC269VC_FIXUP_INFINIX_Y4_MAX), 11584 12161 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), 11585 12163 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 11586 12164 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), … … 11761 12339 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"}, 11762 12340 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"}, 12341 {.id = ALC256_FIXUP_CHROME_BOOK, .name = "alc-2024y-chromebook"}, 11763 12342 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"}, 11764 12343 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"}, 11765 12344 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"}, 11766 12345 {.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"}, 11767 12348 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"}, 11768 12349 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"}, … … 12301 12882 spec->en_3kpull_low = true; 12302 12883 12303 #ifdef CONFIG_PM12304 12884 codec->patch_ops.suspend = alc269_suspend; 12305 12885 codec->patch_ops.resume = alc269_resume; 12306 #endif12307 12886 spec->shutup = alc_default_shutup; 12308 12887 spec->init_hook = alc_default_init; … … 12472 13051 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl, 12473 13052 alc269_fixups); 13053 13054 /* 13055 * Check whether ACPI describes companion amplifiers that require 13056 * component binding 13057 */ 13058 find_cirrus_companion_amps(codec); 13059 12474 13060 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 12475 13061 … … 12626 13212 spec->gen.beep_nid = 0x23; 12627 13213 12628 #ifdef CONFIG_PM12629 13214 spec->power_hook = alc_power_eapd; 12630 #endif12631 13215 12632 13216 alc_pre_init(codec); … … 13659 14243 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, 13660 14244 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, 13661 { }14245 {0} 13662 14246 }, 13663 14247 }, … … 13681 14265 .v.pins = (const struct hda_pintbl[]) { 13682 14266 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ 13683 { 14267 {0} 13684 14268 }, 13685 14269 }, … … 13703 14287 .v.verbs = (const struct hda_verb[]) { 13704 14288 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 }, 13705 { }14289 {0} 13706 14290 }, 13707 14291 }, … … 14141 14725 MODULE_LICENSE("GPL"); 14142 14726 MODULE_DESCRIPTION("Realtek HD-audio codec"); 14727 MODULE_IMPORT_NS(SND_HDA_SCODEC_COMPONENT); 14143 14728 14144 14729 static struct hda_codec_driver realtek_driver = { -
GPL/trunk/alsa-kernel/pci/hda/patch_sigmatel.c
r772 r777 2190 2190 if (action == HDA_FIXUP_ACT_PRE_PROBE) { 2191 2191 spec->mic_mute_led_gpio = 0x08; /* GPIO3 */ 2192 #ifdef CONFIG_PM2193 2192 /* resetting controller clears GPIO, so we need to keep on */ 2194 2193 codec->core.power_caps &= ~AC_PWRST_CLKSTOP; 2195 #endif2196 2194 } 2197 2195 } … … 4544 4542 #endif 4545 4543 4546 #ifdef CONFIG_PM4547 4544 static int stac_suspend(struct hda_codec *codec) 4548 4545 { … … 4558 4555 return 0; 4559 4556 } 4560 4561 static int stac_check_power_status(struct hda_codec *codec, hda_nid_t nid)4562 {4563 #ifdef CONFIG_SND_HDA_INPUT_BEEP4564 struct sigmatel_spec *spec = codec->spec;4565 #endif4566 int ret = snd_hda_gen_check_power_status(codec, nid);4567 4568 #ifdef CONFIG_SND_HDA_INPUT_BEEP4569 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 else4575 snd_hda_power_down_pm(codec);4576 }4577 ret |= spec->beep_power_on;4578 }4579 #endif4580 return ret;4581 }4582 #else4583 #define stac_suspend NULL4584 #endif /* CONFIG_PM */4585 4557 4586 4558 static const struct hda_codec_ops stac_patch_ops = { … … 4590 4562 .free = stac_free, 4591 4563 .unsol_event = snd_hda_jack_unsol_event, 4592 #ifdef CONFIG_PM4593 4564 .suspend = stac_suspend, 4594 .check_power_status = stac_check_power_status,4595 #endif4596 4565 }; 4597 4566 -
GPL/trunk/alsa-kernel/pci/hda/patch_via.c
r772 r777 388 388 } 389 389 390 #ifdef CONFIG_PM391 390 static int via_suspend(struct hda_codec *codec) 392 391 { … … 409 408 return 0; 410 409 } 411 #endif 412 413 #ifdef CONFIG_PM 410 414 411 static int via_check_power_status(struct hda_codec *codec, hda_nid_t nid) 415 412 { … … 419 416 return snd_hda_check_amp_list_power(codec, &spec->gen.loopback, nid); 420 417 } 421 #endif422 418 423 419 /* … … 432 428 .free = via_free, 433 429 .unsol_event = snd_hda_jack_unsol_event, 434 #ifdef CONFIG_PM435 430 .suspend = via_suspend, 436 431 .resume = via_resume, 437 432 .check_power_status = via_check_power_status, 438 #endif439 433 }; 440 434 -
GPL/trunk/alsa-kernel/pci/intel8x0.c
r717 r777 707 707 step = 0; 708 708 } else if (civ == ichdev->civ) { 709 // snd_printd("civ same %d\n", civ);710 709 step = 1; 711 710 ichdev->civ++; … … 715 714 if (step < 0) 716 715 step += ICH_REG_LVI_MASK + 1; 717 // if (step != 1)718 // snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);719 716 ichdev->civ = civ; 720 717 } … … 2561 2558 } 2562 2559 2563 #ifdef CONFIG_PM_SLEEP2564 2560 /* 2565 2561 * power management … … 2634 2630 } 2635 2631 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 */ 2632 static DEFINE_SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); 2641 2633 2642 2634 #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ … … 3224 3216 .probe = snd_intel8x0_probe, 3225 3217 .driver = { 3226 .pm = INTEL8X0_PM_OPS,3218 .pm = &intel8x0_pm, 3227 3219 }, 3228 3220 }; -
GPL/trunk/alsa-kernel/pci/korg1212/korg1212.c
r772 r777 29 29 #define K1212_DEBUG_LEVEL 0 30 30 #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) 32 32 #else 33 33 #define K1212_DEBUG_PRINTK(fmt,...) do { } while (0) 34 34 #endif 35 35 #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) 37 37 #else 38 38 #define K1212_DEBUG_PRINTK_VERBOSE(fmt,...) … … 603 603 mod_timer(&korg1212->timer, jiffies + 1); 604 604 } else { 605 snd_printd("korg1212_timer_func timeout\n");605 dev_dbg(korg1212->card->dev, "korg1212_timer_func timeout\n"); 606 606 korg1212->sharedBufferPtr->cardCommand = 0; 607 607 korg1212->dsp_stop_is_processed = 1; … … 1132 1132 korg1212->irqcount, doorbellValue, 1133 1133 stateName[korg1212->cardState]); 1134 snd_printk(KERN_ERR"korg1212: DMA Error\n");1134 dev_err(korg1212->card->dev, "korg1212: DMA Error\n"); 1135 1135 korg1212->errorcnt++; 1136 1136 korg1212->totalerrorcnt++; … … 1273 1273 if ( (void *) dst < (void *) korg1212->playDataBufsPtr || 1274 1274 (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) { 1275 pr intk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_silenceKERNEL EFAULT dst=%p iter=%d\n",1276 1275 pr_debug("K1212_DEBUG: %s KERNEL EFAULT dst=%p iter=%d\n", 1276 __func__, dst, i); 1277 1277 return -EFAULT; 1278 1278 } … … 1306 1306 if ( (void *) src < (void *) korg1212->recordDataBufsPtr || 1307 1307 (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); 1309 1310 return -EFAULT; 1310 1311 } … … 1331 1332 dst = korg1212->playDataBufsPtr[0].bufferData + pos; 1332 1333 1333 K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_copy_frompos=%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); 1335 1336 1336 1337 if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES)) … … 1341 1342 if ( (void *) dst < (void *) korg1212->playDataBufsPtr || 1342 1343 (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); 1344 1346 return -EFAULT; 1345 1347 } … … 2136 2138 2137 2139 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); 2139 2141 return -EBUSY; 2140 2142 } … … 2233 2235 err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev); 2234 2236 if (err < 0) { 2235 snd_printk(KERN_ERR"firmware not available\n");2237 dev_err(&pci->dev, "firmware not available\n"); 2236 2238 return err; 2237 2239 } -
GPL/trunk/alsa-kernel/pci/maestro3.c
r772 r777 777 777 unsigned int in_suspend; 778 778 779 #ifdef CONFIG_PM_SLEEP780 779 u16 *suspend_mem; 781 #endif782 780 783 781 const struct firmware *assp_kernel_image; … … 2366 2364 } 2367 2365 2368 #ifdef CONFIG_PM_SLEEP2369 2366 vfree(chip->suspend_mem); 2370 #endif2371 2367 release_firmware(chip->assp_kernel_image); 2372 2368 release_firmware(chip->assp_minisrc_image); … … 2377 2373 * APM support 2378 2374 */ 2379 #ifdef CONFIG_PM_SLEEP2380 2375 static int m3_suspend(struct device *dev) 2381 2376 { … … 2451 2446 } 2452 2447 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 */ 2448 static DEFINE_SIMPLE_DEV_PM_OPS(m3_pm, m3_suspend, m3_resume); 2458 2449 2459 2450 #ifdef CONFIG_SND_MAESTRO3_INPUT … … 2599 2590 card->sync_irq = chip->irq; 2600 2591 2601 #ifdef CONFIG_PM_SLEEP 2592 #ifndef TARGET_OS2 2593 if (IS_ENABLED(CONFIG_PM_SLEEP)) { 2602 2594 chip->suspend_mem = 2603 2595 vmalloc(array_size(sizeof(u16), 2604 2596 REV_B_CODE_MEMORY_LENGTH + 2605 2597 REV_B_DATA_MEMORY_LENGTH)); 2606 if (chip->suspend_mem == NULL)2598 if (!chip->suspend_mem) 2607 2599 dev_warn(card->dev, "can't allocate apm buffer\n"); 2600 } 2608 2601 #endif 2609 2610 2602 err = snd_m3_mixer(chip); 2611 2603 if (err < 0) … … 2718 2710 .probe = snd_m3_probe, 2719 2711 .driver = { 2720 .pm = M3_PM_OPS,2712 .pm = &m3_pm, 2721 2713 }, 2722 2714 }; -
GPL/trunk/alsa-kernel/pci/nm256/nm256.c
r772 r777 1381 1381 } 1382 1382 1383 #ifdef CONFIG_PM_SLEEP1384 1383 /* 1385 1384 * APM event handler, so the card is properly reinitialized after a power … … 1425 1424 } 1426 1425 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 */ 1426 static DEFINE_SIMPLE_DEV_PM_OPS(nm256_pm, nm256_suspend, nm256_resume); 1432 1427 1433 1428 static void snd_nm256_free(struct snd_card *card) … … 1685 1680 .probe = snd_nm256_probe, 1686 1681 .driver = { 1687 .pm = NM256_PM_OPS,1682 .pm = &nm256_pm, 1688 1683 }, 1689 1684 }; -
GPL/trunk/alsa-kernel/pci/rme9652/hdsp.c
r772 r777 4302 4302 }; 4303 4303 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 = 04310 };4311 4312 4304 static int snd_hdsp_hw_rule_in_channels(struct snd_pcm_hw_params *params, 4313 4305 struct snd_pcm_hw_rule *rule) … … 4500 4492 } else if (hdsp->io_type == H9632) { 4501 4493 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); 4504 4497 } 4505 4498 if (hdsp->io_type == H9632) { … … 4576 4569 runtime->hw.channels_max = hdsp->ss_in_channels; 4577 4570 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); 4580 4574 } 4581 4575 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, -
GPL/trunk/alsa-kernel/pci/rme9652/hdspm.c
r772 r777 3084 3084 3085 3085 3086 #define HDSPM_TCO_VIDEO_INPUT_FORMAT(xname , xindex) \3086 #define HDSPM_TCO_VIDEO_INPUT_FORMAT(xname) \ 3087 3087 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 3088 3088 .name = xname, \ … … 3130 3130 3131 3131 3132 #define HDSPM_TCO_LTC_FRAMES(xname , xindex) \3132 #define HDSPM_TCO_LTC_FRAMES(xname) \ 3133 3133 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 3134 3134 .name = xname, \ … … 4631 4631 HDSPM_TCO_LOCK_CHECK("TCO Input Check", 11), 4632 4632 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") 4635 4635 }; 4636 4636 … … 5613 5613 dev_dbg(hdspm->card->dev, 5614 5614 "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), 5617 5616 snd_pcm_sgbuf_get_addr(substream, 0)); 5618 5617 */ … … 5620 5619 dev_dbg(hdspm->card->dev, 5621 5620 "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), 5624 5622 params_rate(params), params_channels(params), 5625 5623 params_buffer_size(params)); … … 6035 6033 } 6036 6034 6037 6038 static const unsigned int hdspm_aes32_sample_rates[] = {6039 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 1920006040 };6041 6042 static const struct snd_pcm_hw_constraint_list6043 hdspm_hw_constraints_aes32_sample_rates = {6044 .count = ARRAY_SIZE(hdspm_aes32_sample_rates),6045 .list = hdspm_aes32_sample_rates,6046 .mask = 06047 };6048 6049 6035 static int snd_hdspm_open(struct snd_pcm_substream *substream) 6050 6036 { … … 6099 6085 6100 6086 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; 6104 6088 } else { 6105 6089 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, -
GPL/trunk/alsa-kernel/pci/trident/trident.h
r772 r777 407 407 int snd_trident_foldback_pcm(struct snd_trident *trident, int device); 408 408 int snd_trident_spdif_pcm(struct snd_trident *trident, int device); 409 int snd_trident_attach_synthesizer(struct snd_trident * trident);410 409 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, 411 410 int client, int port); … … 420 419 struct snd_pcm_substream *substream); 421 420 int 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);426 421 427 422 #endif /* __SOUND_TRIDENT_H */ -
GPL/trunk/alsa-kernel/pci/trident/trident_memory.c
r717 r777 138 138 * check if the given pointer is valid for pages 139 139 */ 140 static int is_valid_page( unsigned long ptr)140 static int is_valid_page(struct snd_trident *trident, unsigned long ptr) 141 141 { 142 142 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"); 144 144 return 0; 145 145 } 146 146 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"); 148 148 return 0; 149 149 } … … 187 187 unsigned long ofs = idx << PAGE_SHIFT; 188 188 dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs); 189 if (! is_valid_page(addr)) {189 if (!is_valid_page(trident, addr)) { 190 190 __snd_util_mem_free(hdr, blk); 191 191 mutex_unlock(&hdr->block_mutex); … … 232 232 for (page = firstpg(blk); page <= lastpg(blk); page++, 233 233 addr += SNDRV_TRIDENT_PAGE_SIZE) { 234 if (! is_valid_page(addr)) {234 if (!is_valid_page(trident, addr)) { 235 235 __snd_util_mem_free(hdr, blk); 236 236 mutex_unlock(&hdr->block_mutex); -
GPL/trunk/alsa-kernel/pci/via82xx.c
r772 r777 352 352 unsigned char old_legacy; 353 353 unsigned char old_legacy_cfg; 354 #ifdef CONFIG_PM_SLEEP355 354 unsigned char legacy_saved; 356 355 unsigned char legacy_cfg_saved; … … 358 357 unsigned char capture_src_saved[2]; 359 358 unsigned int mpu_port_saved; 360 #endif361 359 362 360 unsigned char playback_volume[4][2]; /* for VIA8233/C/8235; default = 0 */ … … 2036 2034 mpu_port &= 0xfffc; 2037 2035 pci_write_config_dword(chip->pci, 0x18, mpu_port | 0x01); 2038 #ifdef CONFIG_PM_SLEEP2039 2036 chip->mpu_port_saved = mpu_port; 2040 #endif2041 2037 } else { 2042 2038 mpu_port = pci_resource_start(chip->pci, 2); … … 2090 2086 snd_via686_create_gameport(chip, &legacy); 2091 2087 2092 #ifdef CONFIG_PM_SLEEP2093 2088 chip->legacy_saved = legacy; 2094 2089 chip->legacy_cfg_saved = legacy_cfg; 2095 #endif2096 2090 2097 2091 return 0; … … 2239 2233 } 2240 2234 2241 #ifdef CONFIG_PM_SLEEP2242 2235 /* 2243 2236 * power management … … 2292 2285 } 2293 2286 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 */ 2287 static DEFINE_SIMPLE_DEV_PM_OPS(snd_via82xx_pm, snd_via82xx_suspend, snd_via82xx_resume); 2299 2288 2300 2289 static void snd_via82xx_free(struct snd_card *card) … … 2581 2570 .probe = snd_via82xx_probe, 2582 2571 .driver = { 2583 .pm = SND_VIA82XX_PM_OPS,2572 .pm = &snd_via82xx_pm, 2584 2573 }, 2585 2574 };
Note:
See TracChangeset
for help on using the changeset viewer.