Skip to content

Commit 16f0596

Browse files
committed
Merge tag 'sound-5.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A couple of small fixes are found in the ALSA core side at this time; a fix in the new LED handling code and a long-standing (and likely no one would notice) ioctl bug. The rest are usual HD-audio fixes, mostly device-specific quirks but also one major regression fix that was introduced in 5.13" * tag 'sound-5.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: update the power_state during the direct-complete ALSA: timer: Fix master timer notification ALSA: control led: fix memory leak in snd_ctl_led_register ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx ALSA: hda/cirrus: Set Initial DMIC volume to -26 dB ALSA: hda: Fix a regression in Capture Switch mixer read ALSA: hda: Add AlderLake-M PCI ID
2 parents 3a3c5ab + b8b90c1 commit 16f0596

File tree

8 files changed

+45
-12
lines changed

8 files changed

+45
-12
lines changed

sound/core/control_led.c

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ MODULE_LICENSE("GPL");
1717
#define MAX_LED (((SNDRV_CTL_ELEM_ACCESS_MIC_LED - SNDRV_CTL_ELEM_ACCESS_SPK_LED) \
1818
>> SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) + 1)
1919

20+
#define to_led_card_dev(_dev) \
21+
container_of(_dev, struct snd_ctl_led_card, dev)
22+
2023
enum snd_ctl_led_mode {
2124
MODE_FOLLOW_MUTE = 0,
2225
MODE_FOLLOW_ROUTE,
@@ -371,6 +374,21 @@ static void snd_ctl_led_disconnect(struct snd_card *card)
371374
snd_ctl_led_refresh();
372375
}
373376

377+
static void snd_ctl_led_card_release(struct device *dev)
378+
{
379+
struct snd_ctl_led_card *led_card = to_led_card_dev(dev);
380+
381+
kfree(led_card);
382+
}
383+
384+
static void snd_ctl_led_release(struct device *dev)
385+
{
386+
}
387+
388+
static void snd_ctl_led_dev_release(struct device *dev)
389+
{
390+
}
391+
374392
/*
375393
* sysfs
376394
*/
@@ -663,6 +681,7 @@ static void snd_ctl_led_sysfs_add(struct snd_card *card)
663681
led_card->number = card->number;
664682
led_card->led = led;
665683
device_initialize(&led_card->dev);
684+
led_card->dev.release = snd_ctl_led_card_release;
666685
if (dev_set_name(&led_card->dev, "card%d", card->number) < 0)
667686
goto cerr;
668687
led_card->dev.parent = &led->dev;
@@ -681,7 +700,6 @@ static void snd_ctl_led_sysfs_add(struct snd_card *card)
681700
put_device(&led_card->dev);
682701
cerr2:
683702
printk(KERN_ERR "snd_ctl_led: unable to add card%d", card->number);
684-
kfree(led_card);
685703
}
686704
}
687705

@@ -700,8 +718,7 @@ static void snd_ctl_led_sysfs_remove(struct snd_card *card)
700718
snprintf(link_name, sizeof(link_name), "led-%s", led->name);
701719
sysfs_remove_link(&card->ctl_dev.kobj, link_name);
702720
sysfs_remove_link(&led_card->dev.kobj, "card");
703-
device_del(&led_card->dev);
704-
kfree(led_card);
721+
device_unregister(&led_card->dev);
705722
led->cards[card->number] = NULL;
706723
}
707724
}
@@ -723,6 +740,7 @@ static int __init snd_ctl_led_init(void)
723740

724741
device_initialize(&snd_ctl_led_dev);
725742
snd_ctl_led_dev.class = sound_class;
743+
snd_ctl_led_dev.release = snd_ctl_led_dev_release;
726744
dev_set_name(&snd_ctl_led_dev, "ctl-led");
727745
if (device_add(&snd_ctl_led_dev)) {
728746
put_device(&snd_ctl_led_dev);
@@ -733,15 +751,16 @@ static int __init snd_ctl_led_init(void)
733751
INIT_LIST_HEAD(&led->controls);
734752
device_initialize(&led->dev);
735753
led->dev.parent = &snd_ctl_led_dev;
754+
led->dev.release = snd_ctl_led_release;
736755
led->dev.groups = snd_ctl_led_dev_attr_groups;
737756
dev_set_name(&led->dev, led->name);
738757
if (device_add(&led->dev)) {
739758
put_device(&led->dev);
740759
for (; group > 0; group--) {
741760
led = &snd_ctl_leds[group - 1];
742-
device_del(&led->dev);
761+
device_unregister(&led->dev);
743762
}
744-
device_del(&snd_ctl_led_dev);
763+
device_unregister(&snd_ctl_led_dev);
745764
return -ENOMEM;
746765
}
747766
}
@@ -767,9 +786,9 @@ static void __exit snd_ctl_led_exit(void)
767786
}
768787
for (group = 0; group < MAX_LED; group++) {
769788
led = &snd_ctl_leds[group];
770-
device_del(&led->dev);
789+
device_unregister(&led->dev);
771790
}
772-
device_del(&snd_ctl_led_dev);
791+
device_unregister(&snd_ctl_led_dev);
773792
snd_ctl_led_clean(NULL);
774793
}
775794

sound/core/timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
520520
return;
521521
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
522522
return;
523+
event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
523524
list_for_each_entry(ts, &ti->slave_active_head, active_list)
524525
if (ts->ccallback)
525-
ts->ccallback(ts, event + 100, &tstamp, resolution);
526+
ts->ccallback(ts, event, &tstamp, resolution);
526527
}
527528

528529
/* start/continue a master timer */

sound/hda/intel-dsp-config.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ static const struct config_entry config_table[] = {
331331
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
332332
.device = 0x51c8,
333333
},
334+
{
335+
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
336+
.device = 0x51cc,
337+
},
334338
#endif
335339

336340
};

sound/pci/hda/hda_codec.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,13 +2917,18 @@ static int hda_codec_runtime_resume(struct device *dev)
29172917
#ifdef CONFIG_PM_SLEEP
29182918
static int hda_codec_pm_prepare(struct device *dev)
29192919
{
2920+
dev->power.power_state = PMSG_SUSPEND;
29202921
return pm_runtime_suspended(dev);
29212922
}
29222923

29232924
static void hda_codec_pm_complete(struct device *dev)
29242925
{
29252926
struct hda_codec *codec = dev_to_hda_codec(dev);
29262927

2928+
/* If no other pm-functions are called between prepare() and complete() */
2929+
if (dev->power.power_state.event == PM_EVENT_SUSPEND)
2930+
dev->power.power_state = PMSG_RESUME;
2931+
29272932
if (pm_runtime_suspended(dev) && (codec->jackpoll_interval ||
29282933
hda_codec_need_resume(codec) || codec->forced_resume))
29292934
pm_request_resume(dev);

sound/pci/hda/hda_generic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,6 +3520,7 @@ static int cap_sw_put(struct snd_kcontrol *kcontrol,
35203520
static const struct snd_kcontrol_new cap_sw_temp = {
35213521
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
35223522
.name = "Capture Switch",
3523+
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
35233524
.info = cap_sw_info,
35243525
.get = cap_sw_get,
35253526
.put = cap_sw_put,

sound/pci/hda/hda_intel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,9 @@ static const struct pci_device_id azx_ids[] = {
24852485
/* Alderlake-P */
24862486
{ PCI_DEVICE(0x8086, 0x51c8),
24872487
.driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
2488+
/* Alderlake-M */
2489+
{ PCI_DEVICE(0x8086, 0x51cc),
2490+
.driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
24882491
/* Elkhart Lake */
24892492
{ PCI_DEVICE(0x8086, 0x4b55),
24902493
.driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},

sound/pci/hda/patch_cirrus.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,10 +2206,9 @@ static void cs8409_cs42l42_fixups(struct hda_codec *codec,
22062206
break;
22072207
case HDA_FIXUP_ACT_PROBE:
22082208

2209-
/* Set initial volume on Bullseye to -26 dB */
2210-
if (codec->fixup_id == CS8409_BULLSEYE)
2211-
snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID,
2212-
HDA_INPUT, 0, 0xff, 0x19);
2209+
/* Set initial DMIC volume to -26 dB */
2210+
snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID,
2211+
HDA_INPUT, 0, 0xff, 0x19);
22132212
snd_hda_gen_add_kctl(&spec->gen,
22142213
NULL, &cs8409_cs42l42_hp_volume_mixer);
22152214
snd_hda_gen_add_kctl(&spec->gen,

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8303,6 +8303,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
83038303
SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
83048304
SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
83058305
SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8306+
SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
83068307
SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
83078308
SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
83088309
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),

0 commit comments

Comments
 (0)