Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"No surprise here, including only a collection of HD-audio
device-specific small fixes"

* tag 'sound-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda: Disable power-save on KONTRON SinglePC
ALSA: hda/realtek: Add supported ALC257 for ChromeOS
ALSA: hda/realtek: Headset Mic VREF to 100%
ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format
ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI
ALSA: cs35l41: Fix for old systems which do not support command
ALSA: hda: cs35l41: Remove unnecessary boolean state variable firmware_running
ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro

+76 -25
+1 -1
include/sound/cs35l41.h
··· 906 906 bool cs35l41_safe_reset(struct regmap *regmap, enum cs35l41_boost_type b_type); 907 907 int cs35l41_mdsync_up(struct regmap *regmap); 908 908 int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l41_boost_type b_type, 909 - int enable, bool firmware_running); 909 + int enable, struct cs_dsp *dsp); 910 910 911 911 #endif /* __CS35L41_H */
+29 -4
sound/hda/intel-nhlt.c
··· 238 238 239 239 static struct nhlt_specific_cfg * 240 240 nhlt_get_specific_cfg(struct device *dev, struct nhlt_fmt *fmt, u8 num_ch, 241 - u32 rate, u8 vbps, u8 bps) 241 + u32 rate, u8 vbps, u8 bps, bool ignore_vbps) 242 242 { 243 243 struct nhlt_fmt_cfg *cfg = fmt->fmt_config; 244 244 struct wav_fmt *wfmt; ··· 255 255 dev_dbg(dev, "Endpoint format: ch=%d fmt=%d/%d rate=%d\n", 256 256 wfmt->channels, _vbps, _bps, wfmt->samples_per_sec); 257 257 258 + /* 259 + * When looking for exact match of configuration ignore the vbps 260 + * from NHLT table when ignore_vbps is true 261 + */ 258 262 if (wfmt->channels == num_ch && wfmt->samples_per_sec == rate && 259 - vbps == _vbps && bps == _bps) 263 + (ignore_vbps || vbps == _vbps) && bps == _bps) 260 264 return &cfg->config; 261 265 262 266 cfg = (struct nhlt_fmt_cfg *)(cfg->config.caps + cfg->config.size); ··· 293 289 { 294 290 struct nhlt_specific_cfg *cfg; 295 291 struct nhlt_endpoint *epnt; 292 + bool ignore_vbps = false; 296 293 struct nhlt_fmt *fmt; 297 294 int i; 298 295 ··· 303 298 dev_dbg(dev, "Looking for configuration:\n"); 304 299 dev_dbg(dev, " vbus_id=%d link_type=%d dir=%d, dev_type=%d\n", 305 300 bus_id, link_type, dir, dev_type); 306 - dev_dbg(dev, " ch=%d fmt=%d/%d rate=%d\n", num_ch, vbps, bps, rate); 301 + if (link_type == NHLT_LINK_DMIC && bps == 32 && (vbps == 24 || vbps == 32)) { 302 + /* 303 + * The DMIC hardware supports only one type of 32 bits sample 304 + * size, which is 24 bit sampling on the MSB side and bits[1:0] 305 + * are used for indicating the channel number. 306 + * It has been observed that some NHLT tables have the vbps 307 + * specified as 32 while some uses 24. 308 + * The format these variations describe are identical, the 309 + * hardware is configured and behaves the same way. 310 + * Note: when the samples assumed to be vbps=32 then the 'noise' 311 + * introduced by the lower two bits (channel number) have no 312 + * real life implication on audio quality. 313 + */ 314 + dev_dbg(dev, 315 + " ch=%d fmt=%d rate=%d (vbps is ignored for DMIC 32bit format)\n", 316 + num_ch, bps, rate); 317 + ignore_vbps = true; 318 + } else { 319 + dev_dbg(dev, " ch=%d fmt=%d/%d rate=%d\n", num_ch, vbps, bps, rate); 320 + } 307 321 dev_dbg(dev, "Endpoint count=%d\n", nhlt->endpoint_count); 308 322 309 323 epnt = (struct nhlt_endpoint *)nhlt->desc; ··· 331 307 if (nhlt_check_ep_match(dev, epnt, bus_id, link_type, dir, dev_type)) { 332 308 fmt = (struct nhlt_fmt *)(epnt->config.caps + epnt->config.size); 333 309 334 - cfg = nhlt_get_specific_cfg(dev, fmt, num_ch, rate, vbps, bps); 310 + cfg = nhlt_get_specific_cfg(dev, fmt, num_ch, rate, 311 + vbps, bps, ignore_vbps); 335 312 if (cfg) 336 313 return cfg; 337 314 }
+12 -16
sound/pci/hda/cs35l41_hda.c
··· 504 504 505 505 cs_dsp_stop(dsp); 506 506 cs_dsp_power_down(dsp); 507 - cs35l41->firmware_running = false; 508 507 dev_dbg(cs35l41->dev, "Unloaded Firmware\n"); 509 508 } 510 509 ··· 549 550 550 551 cs35l41->playback_started = true; 551 552 552 - if (cs35l41->firmware_running) { 553 + if (cs35l41->cs_dsp.running) { 553 554 regmap_multi_reg_write(reg, cs35l41_hda_config_dsp, 554 555 ARRAY_SIZE(cs35l41_hda_config_dsp)); 555 556 regmap_update_bits(reg, CS35L41_PWR_CTRL2, ··· 579 580 regmap_multi_reg_write(reg, cs35l41_hda_mute, ARRAY_SIZE(cs35l41_hda_mute)); 580 581 } else { 581 582 dev_dbg(dev, "Unmuting\n"); 582 - if (cs35l41->firmware_running) { 583 + if (cs35l41->cs_dsp.running) { 583 584 regmap_multi_reg_write(reg, cs35l41_hda_unmute_dsp, 584 585 ARRAY_SIZE(cs35l41_hda_unmute_dsp)); 585 586 } else { ··· 598 599 dev_dbg(dev, "Play (Complete)\n"); 599 600 600 601 cs35l41_global_enable(dev, reg, cs35l41->hw_cfg.bst_type, 1, 601 - cs35l41->firmware_running); 602 + &cs35l41->cs_dsp); 602 603 cs35l41_mute(dev, false); 603 604 } 604 605 ··· 611 612 612 613 cs35l41_mute(dev, true); 613 614 cs35l41_global_enable(dev, reg, cs35l41->hw_cfg.bst_type, 0, 614 - cs35l41->firmware_running); 615 + &cs35l41->cs_dsp); 615 616 } 616 617 617 618 static void cs35l41_hda_pause_done(struct device *dev) ··· 624 625 regmap_update_bits(reg, CS35L41_PWR_CTRL2, CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT); 625 626 if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST) 626 627 regmap_write(reg, CS35L41_GPIO1_CTRL1, 0x00000001); 627 - if (cs35l41->firmware_running) { 628 + if (cs35l41->cs_dsp.running) { 628 629 cs35l41_set_cspl_mbox_cmd(dev, reg, CSPL_MBOX_CMD_PAUSE); 629 630 regmap_update_bits(reg, CS35L41_PWR_CTRL2, 630 631 CS35L41_VMON_EN_MASK | CS35L41_IMON_EN_MASK, ··· 674 675 break; 675 676 case HDA_GEN_PCM_ACT_CLOSE: 676 677 mutex_lock(&cs35l41->fw_mutex); 677 - if (!cs35l41->firmware_running && cs35l41->request_fw_load && 678 + if (!cs35l41->cs_dsp.running && cs35l41->request_fw_load && 678 679 !cs35l41->fw_request_ongoing) { 679 680 dev_info(dev, "Requesting Firmware Load after HDA_GEN_PCM_ACT_CLOSE\n"); 680 681 cs35l41->fw_request_ongoing = true; ··· 760 761 static int cs35l41_ready_for_reset(struct cs35l41_hda *cs35l41) 761 762 { 762 763 mutex_lock(&cs35l41->fw_mutex); 763 - if (cs35l41->firmware_running) { 764 + if (cs35l41->cs_dsp.running) { 764 765 cs35l41->cs_dsp.running = false; 765 766 cs35l41->cs_dsp.booted = false; 766 - cs35l41->firmware_running = false; 767 767 } 768 768 regcache_mark_dirty(cs35l41->regmap); 769 769 mutex_unlock(&cs35l41->fw_mutex); ··· 923 925 924 926 mutex_lock(&cs35l41->fw_mutex); 925 927 926 - if (cs35l41->firmware_running) { 928 + if (cs35l41->cs_dsp.running) { 927 929 ret = cs35l41_enter_hibernate(cs35l41->dev, cs35l41->regmap, 928 930 cs35l41->hw_cfg.bst_type); 929 931 if (ret) ··· 958 960 959 961 regcache_cache_only(cs35l41->regmap, false); 960 962 961 - if (cs35l41->firmware_running) { 963 + if (cs35l41->cs_dsp.running) { 962 964 ret = cs35l41_exit_hibernate(cs35l41->dev, cs35l41->regmap); 963 965 if (ret) { 964 966 dev_warn(cs35l41->dev, "Unable to exit Hibernate."); ··· 1050 1052 goto clean_dsp; 1051 1053 } 1052 1054 1053 - cs35l41->firmware_running = true; 1054 - 1055 1055 return 0; 1056 1056 1057 1057 clean_dsp: ··· 1059 1063 1060 1064 static void cs35l41_load_firmware(struct cs35l41_hda *cs35l41, bool load) 1061 1065 { 1062 - if (cs35l41->firmware_running && !load) { 1066 + if (cs35l41->cs_dsp.running && !load) { 1063 1067 dev_dbg(cs35l41->dev, "Unloading Firmware\n"); 1064 1068 cs35l41_shutdown_dsp(cs35l41); 1065 - } else if (!cs35l41->firmware_running && load) { 1069 + } else if (!cs35l41->cs_dsp.running && load) { 1066 1070 dev_dbg(cs35l41->dev, "Loading Firmware\n"); 1067 1071 cs35l41_smart_amp(cs35l41); 1068 1072 } else { ··· 1342 1346 cs35l41->acpi_subsystem_id, cs35l41->hw_cfg.bst_type, 1343 1347 cs35l41->hw_cfg.gpio1.func == CS35l41_VSPK_SWITCH, 1344 1348 cs35l41->hw_cfg.spk_pos ? 'R' : 'L', 1345 - cs35l41->firmware_running, cs35l41->speaker_id); 1349 + cs35l41->cs_dsp.running, cs35l41->speaker_id); 1346 1350 1347 1351 return ret; 1348 1352 }
+4
sound/pci/hda/cs35l56_hda_spi.c
··· 21 21 return -ENOMEM; 22 22 23 23 cs35l56->base.dev = &spi->dev; 24 + 25 + #ifdef CS35L56_WAKE_HOLD_TIME_US 26 + cs35l56->base.can_hibernate = true; 27 + #endif 24 28 cs35l56->base.regmap = devm_regmap_init_spi(spi, &cs35l56_regmap_spi); 25 29 if (IS_ERR(cs35l56->base.regmap)) { 26 30 ret = PTR_ERR(cs35l56->base.regmap);
+2
sound/pci/hda/hda_intel.c
··· 2242 2242 SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0), 2243 2243 /* https://bugs.launchpad.net/bugs/1821663 */ 2244 2244 SND_PCI_QUIRK(0x1631, 0xe017, "Packard Bell NEC IMEDIA 5204", 0), 2245 + /* KONTRON SinglePC may cause a stall at runtime resume */ 2246 + SND_PCI_QUIRK(0x1734, 0x1232, "KONTRON SinglePC", 0), 2245 2247 {} 2246 2248 }; 2247 2249 #endif /* CONFIG_PM */
+22
sound/pci/hda/patch_realtek.c
··· 1987 1987 ALC887_FIXUP_ASUS_AUDIO, 1988 1988 ALC887_FIXUP_ASUS_HMIC, 1989 1989 ALCS1200A_FIXUP_MIC_VREF, 1990 + ALC888VD_FIXUP_MIC_100VREF, 1990 1991 }; 1991 1992 1992 1993 static void alc889_fixup_coef(struct hda_codec *codec, ··· 2541 2540 {} 2542 2541 } 2543 2542 }, 2543 + [ALC888VD_FIXUP_MIC_100VREF] = { 2544 + .type = HDA_FIXUP_PINCTLS, 2545 + .v.pins = (const struct hda_pintbl[]) { 2546 + { 0x18, PIN_VREF100 }, /* headset mic */ 2547 + {} 2548 + } 2549 + }, 2544 2550 }; 2545 2551 2546 2552 static const struct snd_pci_quirk alc882_fixup_tbl[] = { ··· 2617 2609 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF), 2618 2610 2619 2611 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2612 + SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF), 2620 2613 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD), 2621 2614 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), 2622 2615 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), ··· 3265 3256 case 0x10ec0230: 3266 3257 case 0x10ec0236: 3267 3258 case 0x10ec0256: 3259 + case 0x10ec0257: 3268 3260 case 0x19e58326: 3269 3261 alc_write_coef_idx(codec, 0x48, 0x0); 3270 3262 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); ··· 3295 3285 case 0x10ec0230: 3296 3286 case 0x10ec0236: 3297 3287 case 0x10ec0256: 3288 + case 0x10ec0257: 3298 3289 case 0x19e58326: 3299 3290 alc_write_coef_idx(codec, 0x48, 0xd011); 3300 3291 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); ··· 6507 6496 case 0x10ec0236: 6508 6497 case 0x10ec0255: 6509 6498 case 0x10ec0256: 6499 + case 0x10ec0257: 6510 6500 case 0x19e58326: 6511 6501 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ 6512 6502 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); ··· 7261 7249 ALC290_FIXUP_SUBWOOFER_HSJACK, 7262 7250 ALC269_FIXUP_THINKPAD_ACPI, 7263 7251 ALC269_FIXUP_DMIC_THINKPAD_ACPI, 7252 + ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO, 7264 7253 ALC255_FIXUP_ACER_MIC_NO_PRESENCE, 7265 7254 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, 7266 7255 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, ··· 7613 7600 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = { 7614 7601 .type = HDA_FIXUP_FUNC, 7615 7602 .v.func = alc269_fixup_pincfg_U7x7_headset_mic, 7603 + }, 7604 + [ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO] = { 7605 + .type = HDA_FIXUP_PINS, 7606 + .v.pins = (const struct hda_pintbl[]) { 7607 + { 0x18, 0x03a19020 }, /* headset mic */ 7608 + { 0x1b, 0x90170150 }, /* speaker */ 7609 + { } 7610 + }, 7616 7611 }, 7617 7612 [ALC269_FIXUP_AMIC] = { 7618 7613 .type = HDA_FIXUP_PINS, ··· 10265 10244 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 10266 10245 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 10267 10246 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 10247 + SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), 10268 10248 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 10269 10249 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 10270 10250 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
+4 -2
sound/soc/codecs/cs35l41-lib.c
··· 16 16 17 17 #include <sound/cs35l41.h> 18 18 19 + #define CS35L41_FIRMWARE_OLD_VERSION 0x001C00 /* v0.28.0 */ 20 + 19 21 static const struct reg_default cs35l41_reg[] = { 20 22 { CS35L41_PWR_CTRL1, 0x00000000 }, 21 23 { CS35L41_PWR_CTRL2, 0x00000000 }, ··· 1216 1214 * the PLL Lock interrupt, in the IRQ handler. 1217 1215 */ 1218 1216 int cs35l41_global_enable(struct device *dev, struct regmap *regmap, enum cs35l41_boost_type b_type, 1219 - int enable, bool firmware_running) 1217 + int enable, struct cs_dsp *dsp) 1220 1218 { 1221 1219 int ret; 1222 1220 unsigned int gpio1_func, pad_control, pwr_ctrl1, pwr_ctrl3, int_status, pup_pdn_mask; ··· 1311 1309 } 1312 1310 regmap_write(regmap, CS35L41_IRQ1_STATUS1, CS35L41_PUP_DONE_MASK); 1313 1311 1314 - if (firmware_running) 1312 + if (dsp->running && dsp->fw_id_version > CS35L41_FIRMWARE_OLD_VERSION) 1315 1313 ret = cs35l41_set_cspl_mbox_cmd(dev, regmap, 1316 1314 CSPL_MBOX_CMD_SPK_OUT_ENABLE); 1317 1315 else
+2 -2
sound/soc/codecs/cs35l41.c
··· 519 519 ARRAY_SIZE(cs35l41_pup_patch)); 520 520 521 521 ret = cs35l41_global_enable(cs35l41->dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type, 522 - 1, cs35l41->dsp.cs_dsp.running); 522 + 1, &cs35l41->dsp.cs_dsp); 523 523 break; 524 524 case SND_SOC_DAPM_POST_PMD: 525 525 ret = cs35l41_global_enable(cs35l41->dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type, 526 - 0, cs35l41->dsp.cs_dsp.running); 526 + 0, &cs35l41->dsp.cs_dsp); 527 527 528 528 regmap_multi_reg_write_bypassed(cs35l41->regmap, 529 529 cs35l41_pdn_patch,