Skip to content

Commit ddfe803

Browse files
committed
Merge tag 'sound-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All small changes, mostly device-specific: - A regression fix for PCM WC-page allocation on x86 - A regression fix for i915 audio component binding - Fixes for (longstanding) beep handling bug - Runtime PM fixes for Intel LPE HDMI audio - A couple of pending FireWire fixes - Usual HD-audio and USB-audio quirks, new Intel dspconf entries" * tag 'sound-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Add quirk for Clevo NS50PU ALSA: hda: Fix discovery of i915 graphics PCI device ALSA: hda/via: Fix missing beep setup ALSA: hda/conexant: Fix missing beep setup ALSA: memalloc: Drop x86-specific hack for WC allocations ALSA: hda/realtek: Add quirk for Clevo PD70PNT ALSA: x86: intel_hdmi_audio: use pm_runtime_resume_and_get() ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay ALSA: hda: intel-nhlt: remove use of __func__ in dev_dbg ALSA: hda: intel-dspcfg: use SOF for UpExtreme and UpExtreme11 boards firewire: convert sysfs sprintf/snprintf family to sysfs_emit firewire: cdev: fix potential leak of kernel stack due to uninitialized value ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly ALSA: hda/realtek - ALC897 headset MIC no sound ALSA: usb-audio: US16x08: Move overflow check before array access ALSA: hda/realtek: Add mute LED quirk for HP Omen laptop
2 parents de5c208 + 627ce0d commit ddfe803

File tree

13 files changed

+90
-58
lines changed

13 files changed

+90
-58
lines changed

drivers/firewire/core-cdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg)
12111211
struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2;
12121212
struct fw_card *card = client->device->card;
12131213
struct timespec64 ts = {0, 0};
1214-
u32 cycle_time;
1214+
u32 cycle_time = 0;
12151215
int ret = 0;
12161216

12171217
local_irq_disable();

drivers/firewire/core-device.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ static ssize_t rom_index_show(struct device *dev,
372372
struct fw_device *device = fw_device(dev->parent);
373373
struct fw_unit *unit = fw_unit(dev);
374374

375-
return snprintf(buf, PAGE_SIZE, "%d\n",
376-
(int)(unit->directory - device->config_rom));
375+
return sysfs_emit(buf, "%td\n", unit->directory - device->config_rom);
377376
}
378377

379378
static struct device_attribute fw_unit_attributes[] = {
@@ -403,8 +402,7 @@ static ssize_t guid_show(struct device *dev,
403402
int ret;
404403

405404
down_read(&fw_device_rwsem);
406-
ret = snprintf(buf, PAGE_SIZE, "0x%08x%08x\n",
407-
device->config_rom[3], device->config_rom[4]);
405+
ret = sysfs_emit(buf, "0x%08x%08x\n", device->config_rom[3], device->config_rom[4]);
408406
up_read(&fw_device_rwsem);
409407

410408
return ret;

sound/core/memalloc.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -431,33 +431,17 @@ static const struct snd_malloc_ops snd_dma_iram_ops = {
431431
*/
432432
static void *snd_dma_dev_alloc(struct snd_dma_buffer *dmab, size_t size)
433433
{
434-
void *p;
435-
436-
p = dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
437-
#ifdef CONFIG_X86
438-
if (p && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
439-
set_memory_wc((unsigned long)p, PAGE_ALIGN(size) >> PAGE_SHIFT);
440-
#endif
441-
return p;
434+
return dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
442435
}
443436

444437
static void snd_dma_dev_free(struct snd_dma_buffer *dmab)
445438
{
446-
#ifdef CONFIG_X86
447-
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
448-
set_memory_wb((unsigned long)dmab->area,
449-
PAGE_ALIGN(dmab->bytes) >> PAGE_SHIFT);
450-
#endif
451439
dma_free_coherent(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
452440
}
453441

454442
static int snd_dma_dev_mmap(struct snd_dma_buffer *dmab,
455443
struct vm_area_struct *area)
456444
{
457-
#ifdef CONFIG_X86
458-
if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
459-
area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
460-
#endif
461445
return dma_mmap_coherent(dmab->dev.dev, area,
462446
dmab->area, dmab->addr, dmab->bytes);
463447
}
@@ -471,10 +455,6 @@ static const struct snd_malloc_ops snd_dma_dev_ops = {
471455
/*
472456
* Write-combined pages
473457
*/
474-
#ifdef CONFIG_X86
475-
/* On x86, share the same ops as the standard dev ops */
476-
#define snd_dma_wc_ops snd_dma_dev_ops
477-
#else /* CONFIG_X86 */
478458
static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
479459
{
480460
return dma_alloc_wc(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
@@ -497,7 +477,6 @@ static const struct snd_malloc_ops snd_dma_wc_ops = {
497477
.free = snd_dma_wc_free,
498478
.mmap = snd_dma_wc_mmap,
499479
};
500-
#endif /* CONFIG_X86 */
501480

502481
#ifdef CONFIG_SND_DMA_SGBUF
503482
static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size);

sound/hda/hdac_i915.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,18 @@ static int i915_component_master_match(struct device *dev, int subcomponent,
119119
/* check whether Intel graphics is present and reachable */
120120
static int i915_gfx_present(struct pci_dev *hdac_pci)
121121
{
122-
unsigned int class = PCI_BASE_CLASS_DISPLAY << 16;
123122
struct pci_dev *display_dev = NULL;
124-
bool match = false;
125123

126-
do {
127-
display_dev = pci_get_class(class, display_dev);
128-
129-
if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL &&
124+
for_each_pci_dev(display_dev) {
125+
if (display_dev->vendor == PCI_VENDOR_ID_INTEL &&
126+
(display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY &&
130127
connectivity_check(display_dev, hdac_pci)) {
131128
pci_dev_put(display_dev);
132-
match = true;
129+
return true;
133130
}
134-
} while (!match && display_dev);
131+
}
135132

136-
return match;
133+
return false;
137134
}
138135

139136
/**

sound/hda/intel-dsp-config.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ static const struct config_entry config_table[] = {
196196
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
197197
}
198198
},
199+
{
200+
.ident = "UP-WHL",
201+
.matches = {
202+
DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
203+
}
204+
},
199205
{}
200206
}
201207
},
@@ -358,6 +364,12 @@ static const struct config_entry config_table[] = {
358364
DMI_MATCH(DMI_SYS_VENDOR, "Google"),
359365
}
360366
},
367+
{
368+
.ident = "UPX-TGL",
369+
.matches = {
370+
DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
371+
}
372+
},
361373
{}
362374
}
363375
},

sound/hda/intel-nhlt.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
5555

5656
/* find max number of channels based on format_configuration */
5757
if (fmt_configs->fmt_count) {
58-
dev_dbg(dev, "%s: found %d format definitions\n",
59-
__func__, fmt_configs->fmt_count);
58+
dev_dbg(dev, "found %d format definitions\n",
59+
fmt_configs->fmt_count);
6060

6161
for (i = 0; i < fmt_configs->fmt_count; i++) {
6262
struct wav_fmt_ext *fmt_ext;
@@ -66,9 +66,9 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
6666
if (fmt_ext->fmt.channels > max_ch)
6767
max_ch = fmt_ext->fmt.channels;
6868
}
69-
dev_dbg(dev, "%s: max channels found %d\n", __func__, max_ch);
69+
dev_dbg(dev, "max channels found %d\n", max_ch);
7070
} else {
71-
dev_dbg(dev, "%s: No format information found\n", __func__);
71+
dev_dbg(dev, "No format information found\n");
7272
}
7373

7474
if (cfg->device_config.config_type != NHLT_CONFIG_TYPE_MIC_ARRAY) {
@@ -95,17 +95,16 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
9595
}
9696

9797
if (dmic_geo > 0) {
98-
dev_dbg(dev, "%s: Array with %d dmics\n", __func__, dmic_geo);
98+
dev_dbg(dev, "Array with %d dmics\n", dmic_geo);
9999
}
100100
if (max_ch > dmic_geo) {
101-
dev_dbg(dev, "%s: max channels %d exceed dmic number %d\n",
102-
__func__, max_ch, dmic_geo);
101+
dev_dbg(dev, "max channels %d exceed dmic number %d\n",
102+
max_ch, dmic_geo);
103103
}
104104
}
105105
}
106106

107-
dev_dbg(dev, "%s: dmic number %d max_ch %d\n",
108-
__func__, dmic_geo, max_ch);
107+
dev_dbg(dev, "dmic number %d max_ch %d\n", dmic_geo, max_ch);
109108

110109
return dmic_geo;
111110
}

sound/pci/hda/hda_auto_parser.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ static void set_pin_targets(struct hda_codec *codec,
819819
snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
820820
}
821821

822-
static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
822+
void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth)
823823
{
824824
const char *modelname = codec->fixup_name;
825825

@@ -829,7 +829,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
829829
if (++depth > 10)
830830
break;
831831
if (fix->chained_before)
832-
apply_fixup(codec, fix->chain_id, action, depth + 1);
832+
__snd_hda_apply_fixup(codec, fix->chain_id, action, depth + 1);
833833

834834
switch (fix->type) {
835835
case HDA_FIXUP_PINS:
@@ -870,6 +870,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
870870
id = fix->chain_id;
871871
}
872872
}
873+
EXPORT_SYMBOL_GPL(__snd_hda_apply_fixup);
873874

874875
/**
875876
* snd_hda_apply_fixup - Apply the fixup chain with the given action
@@ -879,7 +880,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
879880
void snd_hda_apply_fixup(struct hda_codec *codec, int action)
880881
{
881882
if (codec->fixup_list)
882-
apply_fixup(codec, codec->fixup_id, action, 0);
883+
__snd_hda_apply_fixup(codec, codec->fixup_id, action, 0);
883884
}
884885
EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
885886

sound/pci/hda/hda_local.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ void snd_hda_apply_verbs(struct hda_codec *codec);
348348
void snd_hda_apply_pincfgs(struct hda_codec *codec,
349349
const struct hda_pintbl *cfg);
350350
void snd_hda_apply_fixup(struct hda_codec *codec, int action);
351+
void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
351352
void snd_hda_pick_fixup(struct hda_codec *codec,
352353
const struct hda_model_fixup *models,
353354
const struct snd_pci_quirk *quirk,

sound/pci/hda/patch_conexant.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,11 +1079,11 @@ static int patch_conexant_auto(struct hda_codec *codec)
10791079
if (err < 0)
10801080
goto error;
10811081

1082-
err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1082+
err = cx_auto_parse_beep(codec);
10831083
if (err < 0)
10841084
goto error;
10851085

1086-
err = cx_auto_parse_beep(codec);
1086+
err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
10871087
if (err < 0)
10881088
goto error;
10891089

sound/pci/hda/patch_realtek.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2634,6 +2634,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
26342634
SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26352635
SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26362636
SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2637+
SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26372638
SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26382639
SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
26392640
SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
@@ -7004,6 +7005,7 @@ enum {
70047005
ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
70057006
ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
70067007
ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7008+
ALC298_FIXUP_LENOVO_C940_DUET7,
70077009
ALC287_FIXUP_13S_GEN2_SPEAKERS,
70087010
ALC256_FIXUP_SET_COEF_DEFAULTS,
70097011
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
@@ -7022,6 +7024,23 @@ enum {
70227024
ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
70237025
};
70247026

7027+
/* A special fixup for Lenovo C940 and Yoga Duet 7;
7028+
* both have the very same PCI SSID, and we need to apply different fixups
7029+
* depending on the codec ID
7030+
*/
7031+
static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7032+
const struct hda_fixup *fix,
7033+
int action)
7034+
{
7035+
int id;
7036+
7037+
if (codec->core.vendor_id == 0x10ec0298)
7038+
id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7039+
else
7040+
id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7041+
__snd_hda_apply_fixup(codec, id, action, 0);
7042+
}
7043+
70257044
static const struct hda_fixup alc269_fixups[] = {
70267045
[ALC269_FIXUP_GPIO2] = {
70277046
.type = HDA_FIXUP_FUNC,
@@ -8721,6 +8740,10 @@ static const struct hda_fixup alc269_fixups[] = {
87218740
.chained = true,
87228741
.chain_id = ALC269_FIXUP_HEADSET_MODE,
87238742
},
8743+
[ALC298_FIXUP_LENOVO_C940_DUET7] = {
8744+
.type = HDA_FIXUP_FUNC,
8745+
.v.func = alc298_fixup_lenovo_c940_duet7,
8746+
},
87248747
[ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
87258748
.type = HDA_FIXUP_VERBS,
87268749
.v.verbs = (const struct hda_verb[]) {
@@ -9022,6 +9045,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
90229045
ALC285_FIXUP_HP_GPIO_AMP_INIT),
90239046
SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
90249047
ALC285_FIXUP_HP_GPIO_AMP_INIT),
9048+
SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
90259049
SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
90269050
SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
90279051
SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
@@ -9187,6 +9211,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
91879211
SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91889212
SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91899213
SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9214+
SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91909215
SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91919216
SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
91929217
SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -9273,7 +9298,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
92739298
SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
92749299
SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
92759300
SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9276-
SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
9301+
SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
92779302
SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
92789303
SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
92799304
SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
@@ -10737,6 +10762,7 @@ enum {
1073710762
ALC668_FIXUP_MIC_DET_COEF,
1073810763
ALC897_FIXUP_LENOVO_HEADSET_MIC,
1073910764
ALC897_FIXUP_HEADSET_MIC_PIN,
10765+
ALC897_FIXUP_HP_HSMIC_VERB,
1074010766
};
1074110767

1074210768
static const struct hda_fixup alc662_fixups[] = {
@@ -11156,6 +11182,13 @@ static const struct hda_fixup alc662_fixups[] = {
1115611182
.chained = true,
1115711183
.chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
1115811184
},
11185+
[ALC897_FIXUP_HP_HSMIC_VERB] = {
11186+
.type = HDA_FIXUP_PINS,
11187+
.v.pins = (const struct hda_pintbl[]) {
11188+
{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11189+
{ }
11190+
},
11191+
},
1115911192
};
1116011193

1116111194
static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -11181,6 +11214,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1118111214
SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
1118211215
SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
1118311216
SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11217+
SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
1118411218
SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
1118511219
SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
1118611220
SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),

0 commit comments

Comments
 (0)