Commit 1f40caa0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A small set of HD-audio and USB-audio fixes as well as a couple of
  ALSA core fixes. Most of them are fix-ups for the newly added CS35L41
  codec"

* tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/cs8409: Add new Warlock SKUs to patch_cs8409
  ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro
  ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void
  ALSA: hda: cs35l41: Tidyup code
  ALSA: hda: cs35l41: Make use of the helper function dev_err_probe()
  ALSA: hda: cs35l41: Add missing default cases
  ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace
  ALSA: hda: cs35l41: Add calls to newly added test key function
  ALSA: hda: cs35l41: Avoid overwriting register patch
  ALSA: core: Fix SSID quirk lookup for subvendor=0
  ALSA: usb-audio: add mapping for MSI MPG X570S Carbon Max Wifi.
  ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
parents 75242f31 2a1355f0
......@@ -1111,29 +1111,14 @@ EXPORT_SYMBOL(snd_card_file_remove);
*/
int snd_power_ref_and_wait(struct snd_card *card)
{
wait_queue_entry_t wait;
int result = 0;
snd_power_ref(card);
/* fastpath */
if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0)
return 0;
init_waitqueue_entry(&wait, current);
add_wait_queue(&card->power_sleep, &wait);
while (1) {
if (card->shutdown) {
result = -ENODEV;
break;
}
if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0)
break;
snd_power_unref(card);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(30 * HZ);
snd_power_ref(card);
}
remove_wait_queue(&card->power_sleep, &wait);
return result;
wait_event_cmd(card->power_sleep,
card->shutdown ||
snd_power_get_state(card) == SNDRV_CTL_POWER_D0,
snd_power_unref(card), snd_power_ref(card));
return card->shutdown ? -ENODEV : 0;
}
EXPORT_SYMBOL_GPL(snd_power_ref_and_wait);
......
......@@ -112,7 +112,7 @@ snd_pci_quirk_lookup_id(u16 vendor, u16 device,
{
const struct snd_pci_quirk *q;
for (q = list; q->subvendor; q++) {
for (q = list; q->subvendor || q->subdevice; q++) {
if (q->subvendor != vendor)
continue;
if (!q->subdevice ||
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0
*
* cs35l41_hda.h -- CS35L41 ALSA HDA audio driver
* CS35L41 ALSA HDA audio driver
*
* Copyright 2021 Cirrus Logic, Inc.
*
......@@ -64,6 +64,6 @@ struct cs35l41_hda {
int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int irq,
struct regmap *regmap);
int cs35l41_hda_remove(struct device *dev);
void cs35l41_hda_remove(struct device *dev);
#endif /*__CS35L41_HDA_H__*/
......@@ -32,7 +32,9 @@ static int cs35l41_hda_i2c_probe(struct i2c_client *clt, const struct i2c_device
static int cs35l41_hda_i2c_remove(struct i2c_client *clt)
{
return cs35l41_hda_remove(&clt->dev);
cs35l41_hda_remove(&clt->dev);
return 0;
}
static const struct i2c_device_id cs35l41_hda_i2c_id[] = {
......@@ -58,9 +60,9 @@ static struct i2c_driver cs35l41_i2c_driver = {
.probe = cs35l41_hda_i2c_probe,
.remove = cs35l41_hda_i2c_remove,
};
module_i2c_driver(cs35l41_i2c_driver);
MODULE_DESCRIPTION("HDA CS35L41 driver");
MODULE_IMPORT_NS(SND_HDA_SCODEC_CS35L41);
MODULE_AUTHOR("Lucas Tanure <tanureal@opensource.cirrus.com>");
MODULE_LICENSE("GPL");
......@@ -30,7 +30,9 @@ static int cs35l41_hda_spi_probe(struct spi_device *spi)
static int cs35l41_hda_spi_remove(struct spi_device *spi)
{
return cs35l41_hda_remove(&spi->dev);
cs35l41_hda_remove(&spi->dev);
return 0;
}
static const struct spi_device_id cs35l41_hda_spi_id[] = {
......@@ -55,9 +57,9 @@ static struct spi_driver cs35l41_spi_driver = {
.probe = cs35l41_hda_spi_probe,
.remove = cs35l41_hda_spi_remove,
};
module_spi_driver(cs35l41_spi_driver);
MODULE_DESCRIPTION("HDA CS35L41 driver");
MODULE_IMPORT_NS(SND_HDA_SCODEC_CS35L41);
MODULE_AUTHOR("Lucas Tanure <tanureal@opensource.cirrus.com>");
MODULE_LICENSE("GPL");
......@@ -490,6 +490,8 @@ const struct snd_pci_quirk cs8409_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0ADC, "Warlock", CS8409_WARLOCK),
SND_PCI_QUIRK(0x1028, 0x0AF4, "Warlock", CS8409_WARLOCK),
SND_PCI_QUIRK(0x1028, 0x0AF5, "Warlock", CS8409_WARLOCK),
SND_PCI_QUIRK(0x1028, 0x0BB5, "Warlock N3 15 TGL-U Nuvoton EC", CS8409_WARLOCK),
SND_PCI_QUIRK(0x1028, 0x0BB6, "Warlock V3 15 TGL-U Nuvoton EC", CS8409_WARLOCK),
SND_PCI_QUIRK(0x1028, 0x0A77, "Cyborg", CS8409_CYBORG),
SND_PCI_QUIRK(0x1028, 0x0A78, "Cyborg", CS8409_CYBORG),
SND_PCI_QUIRK(0x1028, 0x0A79, "Cyborg", CS8409_CYBORG),
......
......@@ -6948,6 +6948,7 @@ enum {
ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
ALC287_FIXUP_LEGION_16ACHG6,
ALC287_FIXUP_CS35L41_I2C_2,
ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
};
static const struct hda_fixup alc269_fixups[] = {
......@@ -8698,6 +8699,16 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs35l41_fixup_i2c_two,
},
[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
.type = HDA_FIXUP_VERBS,
.v.verbs = (const struct hda_verb[]) {
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
{ 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
{ }
},
.chained = true,
.chain_id = ALC285_FIXUP_HP_MUTE_LED,
},
};
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
......@@ -8911,6 +8922,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
......
......@@ -431,6 +431,14 @@ static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
{}
};
/* MSI MPG X570S Carbon Max Wifi with ALC4080 */
static const struct usbmix_name_map msi_mpg_x570s_carbon_max_wifi_alc4080_map[] = {
{ 29, "Speaker Playback" },
{ 30, "Front Headphone Playback" },
{ 32, "IEC958 Playback" },
{}
};
/*
* Control map entries
*/
......@@ -577,6 +585,10 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
.map = trx40_mobo_map,
.connector_map = trx40_mobo_connector_map,
},
{ /* MSI MPG X570S Carbon Max Wifi */
.id = USB_ID(0x0db0, 0x419c),
.map = msi_mpg_x570s_carbon_max_wifi_alc4080_map,
},
{ /* MSI TRX40 */
.id = USB_ID(0x0db0, 0x543d),
.map = trx40_mobo_map,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment