Skip to content

Commit

Permalink
Merge tag 'sound-fix-6.9-rc1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Two regression fixes that had been introduced in this merge window,
  additional HD-audio quirks, and a further enhancement for the new
  kunit"

* tag 'sound-fix-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: core: add kunitconfig
  ALSA: hda/realtek: add in quirk for Acer Swift Go 16 - SFG16-71
  Revert "ALSA: usb-audio: Name feature ctl using output if input is PCM"
  ALSA: timer: Fix missing irq-disable at closing
  ALSA: hda/realtek: Add quirk for Lenovo Yoga 9 14IMH9
  • Loading branch information
Linus Torvalds committed Mar 18, 2024
2 parents f6cef5f + 585f5bf commit 5574aaa
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
5 changes: 5 additions & 0 deletions sound/core/.kunitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_KUNIT=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_PCM=y
CONFIG_SND_CORE_TEST=y
2 changes: 1 addition & 1 deletion sound/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static void snd_timer_close_locked(struct snd_timer_instance *timeri,
struct snd_timer *timer = timeri->timer;

if (timer) {
guard(spinlock)(&timer->lock);
guard(spinlock_irq)(&timer->lock);
timeri->flags |= SNDRV_TIMER_IFLG_DEAD;
}

Expand Down
22 changes: 22 additions & 0 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -6891,6 +6891,13 @@ static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
comp_generic_fixup(cdc, action, "i2c", "INT8866", "-%s:00", 1);
}

static void alc256_fixup_acer_sfg16_micmute_led(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
}


/* for alc295_fixup_hp_top_speakers */
#include "hp_x360_helper.c"

Expand Down Expand Up @@ -7360,6 +7367,7 @@ enum {
ALC287_FIXUP_LEGION_16ITHG6,
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
ALC236_FIXUP_DELL_DUAL_CODECS,
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
Expand All @@ -7373,6 +7381,7 @@ enum {
ALC289_FIXUP_DELL_CS35L41_SPI_2,
ALC294_FIXUP_CS35L41_I2C_2,
ALC245_FIXUP_CS35L56_SPI_4_HP_GPIO_LED,
ALC256_FIXUP_ACER_SFG16_MICMUTE_LED,
};

/* A special fixup for Lenovo C940 and Yoga Duet 7;
Expand Down Expand Up @@ -9490,6 +9499,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
},
[ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc287_fixup_yoga9_14iap7_bass_spk_pin,
.chained = true,
.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
},
[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc295_fixup_dell_inspiron_top_speakers,
Expand Down Expand Up @@ -9562,6 +9577,10 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC285_FIXUP_HP_GPIO_LED,
},
[ALC256_FIXUP_ACER_SFG16_MICMUTE_LED] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc256_fixup_acer_sfg16_micmute_led,
},
};

static const struct snd_pci_quirk alc269_fixup_tbl[] = {
Expand Down Expand Up @@ -9605,6 +9624,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
Expand Down Expand Up @@ -10270,6 +10290,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
SND_PCI_QUIRK(0x17aa, 0x38d7, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
Expand Down
49 changes: 14 additions & 35 deletions sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,34 +1652,6 @@ static const struct usb_feature_control_info *get_feature_control_info(int contr
return NULL;
}

static int feature_unit_mutevol_ctl_name(struct usb_mixer_interface *mixer,
struct snd_kcontrol *kctl,
struct usb_audio_term *iterm,
struct usb_audio_term *oterm)
{
struct usb_audio_term *aterm, *bterm;
bool output_first;
int len = 0;

/*
* If the input terminal is USB Streaming, we try getting the name of
* the output terminal first in hopes of getting something more
* descriptive than "PCM".
*/
output_first = iterm && !(iterm->type >> 16) && (iterm->type & 0xff00) == 0x0100;

aterm = output_first ? oterm : iterm;
bterm = output_first ? iterm : oterm;

if (aterm)
len = get_term_name(mixer->chip, aterm, kctl->id.name,
sizeof(kctl->id.name), 1);
if (!len && bterm)
len = get_term_name(mixer->chip, bterm, kctl->id.name,
sizeof(kctl->id.name), 1);
return len;
}

static void __build_feature_ctl(struct usb_mixer_interface *mixer,
const struct usbmix_name_map *imap,
unsigned int ctl_mask, int control,
Expand Down Expand Up @@ -1761,15 +1733,22 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
case UAC_FU_MUTE:
case UAC_FU_VOLUME:
/*
* Determine the control name:
* - If a name id is given in descriptor, use it.
* - If input and output terminals are present, try to derive
* the name from either of these.
* - Otherwise, make up a name using the feature unit ID.
* determine the control name. the rule is:
* - if a name id is given in descriptor, use it.
* - if the connected input can be determined, then use the name
* of terminal type.
* - if the connected output can be determined, use it.
* - otherwise, anonymous name.
*/
if (!len) {
len = feature_unit_mutevol_ctl_name(mixer, kctl, iterm,
oterm);
if (iterm)
len = get_term_name(mixer->chip, iterm,
kctl->id.name,
sizeof(kctl->id.name), 1);
if (!len && oterm)
len = get_term_name(mixer->chip, oterm,
kctl->id.name,
sizeof(kctl->id.name), 1);
if (!len)
snprintf(kctl->id.name, sizeof(kctl->id.name),
"Feature %d", unitid);
Expand Down

0 comments on commit 5574aaa

Please sign in to comment.