Skip to content

Commit d58c542

Browse files
committed
Merge tag 'sound-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "All small fixes, mostly for usual suspects, HD-audio and USB-audio device-specific fixes / quirks. The Cirrus codec support took the update of SPI header as well. Other than that, there is a regression fix in the sanity check of ALSA timer code" * tag 'sound-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/tas2781: Use correct endian conversion ALSA: usb-audio: Support Yamaha P-125 quirk entry ALSA: hda: cs35l41: Remove redundant call to hda_cs_dsp_control_remove() ALSA: hda: cs35l56: Remove redundant call to hda_cs_dsp_control_remove() ALSA: hda/tas2781: fix wrong calibrated data order ALSA: usb-audio: Add delay quirk for VIVO USB-C-XE710 HEADSET ALSA: hda/realtek: Add support for new HP G12 laptops ALSA: hda/realtek: Fix noise from speakers on Lenovo IdeaPad 3 15IAU7 ALSA: timer: Relax start tick time check for slave timer elements spi: Add empty versions of ACPI functions
2 parents 37b20e9 + 829e2a2 commit d58c542

File tree

8 files changed

+132
-10
lines changed

8 files changed

+132
-10
lines changed

include/linux/spi/spi.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,29 @@ extern int devm_spi_register_controller(struct device *dev,
902902
struct spi_controller *ctlr);
903903
extern void spi_unregister_controller(struct spi_controller *ctlr);
904904

905-
#if IS_ENABLED(CONFIG_ACPI)
905+
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SPI_MASTER)
906906
extern struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
907907
extern struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
908908
struct acpi_device *adev,
909909
int index);
910910
int acpi_spi_count_resources(struct acpi_device *adev);
911+
#else
912+
static inline struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
913+
{
914+
return NULL;
915+
}
916+
917+
static inline struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
918+
struct acpi_device *adev,
919+
int index)
920+
{
921+
return ERR_PTR(-ENODEV);
922+
}
923+
924+
static inline int acpi_spi_count_resources(struct acpi_device *adev)
925+
{
926+
return 0;
927+
}
911928
#endif
912929

913930
/*

sound/core/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static int snd_timer_start1(struct snd_timer_instance *timeri,
547547
/* check the actual time for the start tick;
548548
* bail out as error if it's way too low (< 100us)
549549
*/
550-
if (start) {
550+
if (start && !(timer->hw.flags & SNDRV_TIMER_HW_SLAVE)) {
551551
if ((u64)snd_timer_hw_resolution(timer) * ticks < 100000)
552552
return -EINVAL;
553553
}

sound/pci/hda/cs35l41_hda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const struct reg_sequence cs35l41_hda_mute[] = {
134134
};
135135

136136
static const struct cs_dsp_client_ops client_ops = {
137-
.control_remove = hda_cs_dsp_control_remove,
137+
/* cs_dsp requires the client to provide this even if it is empty */
138138
};
139139

140140
static int cs35l41_request_tuning_param_file(struct cs35l41_hda *cs35l41, char *tuning_filename,

sound/pci/hda/cs35l56_hda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static void cs35l56_hda_remove_controls(struct cs35l56_hda *cs35l56)
413413
}
414414

415415
static const struct cs_dsp_client_ops cs35l56_hda_client_ops = {
416-
.control_remove = hda_cs_dsp_control_remove,
416+
/* cs_dsp requires the client to provide this even if it is empty */
417417
};
418418

419419
static int cs35l56_hda_request_firmware_file(struct cs35l56_hda *cs35l56,

sound/pci/hda/patch_realtek.c

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
*/
1212

1313
#include <linux/acpi.h>
14+
#include <linux/cleanup.h>
1415
#include <linux/init.h>
1516
#include <linux/delay.h>
1617
#include <linux/slab.h>
1718
#include <linux/pci.h>
1819
#include <linux/dmi.h>
1920
#include <linux/module.h>
21+
#include <linux/i2c.h>
2022
#include <linux/input.h>
2123
#include <linux/leds.h>
2224
#include <linux/ctype.h>
25+
#include <linux/spi/spi.h>
2326
#include <sound/core.h>
2427
#include <sound/jack.h>
2528
#include <sound/hda_codec.h>
@@ -583,7 +586,6 @@ static void alc_shutup_pins(struct hda_codec *codec)
583586
switch (codec->core.vendor_id) {
584587
case 0x10ec0236:
585588
case 0x10ec0256:
586-
case 0x10ec0257:
587589
case 0x19e58326:
588590
case 0x10ec0283:
589591
case 0x10ec0285:
@@ -6856,6 +6858,86 @@ static void comp_generic_fixup(struct hda_codec *cdc, int action, const char *bu
68566858
}
68576859
}
68586860

6861+
static void cs35lxx_autodet_fixup(struct hda_codec *cdc,
6862+
const struct hda_fixup *fix,
6863+
int action)
6864+
{
6865+
struct device *dev = hda_codec_dev(cdc);
6866+
struct acpi_device *adev;
6867+
struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
6868+
const char *bus = NULL;
6869+
static const struct {
6870+
const char *hid;
6871+
const char *name;
6872+
} acpi_ids[] = {{ "CSC3554", "cs35l54-hda" },
6873+
{ "CSC3556", "cs35l56-hda" },
6874+
{ "CSC3557", "cs35l57-hda" }};
6875+
char *match;
6876+
int i, count = 0, count_devindex = 0;
6877+
6878+
switch (action) {
6879+
case HDA_FIXUP_ACT_PRE_PROBE:
6880+
for (i = 0; i < ARRAY_SIZE(acpi_ids); ++i) {
6881+
adev = acpi_dev_get_first_match_dev(acpi_ids[i].hid, NULL, -1);
6882+
if (adev)
6883+
break;
6884+
}
6885+
if (!adev) {
6886+
dev_err(dev, "Failed to find ACPI entry for a Cirrus Amp\n");
6887+
return;
6888+
}
6889+
6890+
count = i2c_acpi_client_count(adev);
6891+
if (count > 0) {
6892+
bus = "i2c";
6893+
} else {
6894+
count = acpi_spi_count_resources(adev);
6895+
if (count > 0)
6896+
bus = "spi";
6897+
}
6898+
6899+
fwnode = fwnode_handle_get(acpi_fwnode_handle(adev));
6900+
acpi_dev_put(adev);
6901+
6902+
if (!bus) {
6903+
dev_err(dev, "Did not find any buses for %s\n", acpi_ids[i].hid);
6904+
return;
6905+
}
6906+
6907+
if (!fwnode) {
6908+
dev_err(dev, "Could not get fwnode for %s\n", acpi_ids[i].hid);
6909+
return;
6910+
}
6911+
6912+
/*
6913+
* When available the cirrus,dev-index property is an accurate
6914+
* count of the amps in a system and is used in preference to
6915+
* the count of bus devices that can contain additional address
6916+
* alias entries.
6917+
*/
6918+
count_devindex = fwnode_property_count_u32(fwnode, "cirrus,dev-index");
6919+
if (count_devindex > 0)
6920+
count = count_devindex;
6921+
6922+
match = devm_kasprintf(dev, GFP_KERNEL, "-%%s:00-%s.%%d", acpi_ids[i].name);
6923+
if (!match)
6924+
return;
6925+
dev_info(dev, "Found %d %s on %s (%s)\n", count, acpi_ids[i].hid, bus, match);
6926+
comp_generic_fixup(cdc, action, bus, acpi_ids[i].hid, match, count);
6927+
6928+
break;
6929+
case HDA_FIXUP_ACT_FREE:
6930+
/*
6931+
* Pass the action on to comp_generic_fixup() so that
6932+
* hda_component_manager functions can be called in just once
6933+
* place. In this context the bus, hid, match_str or count
6934+
* values do not need to be calculated.
6935+
*/
6936+
comp_generic_fixup(cdc, action, NULL, NULL, NULL, 0);
6937+
break;
6938+
}
6939+
}
6940+
68596941
static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
68606942
{
68616943
comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
@@ -7528,6 +7610,7 @@ enum {
75287610
ALC256_FIXUP_CHROME_BOOK,
75297611
ALC287_FIXUP_LENOVO_14ARP8_LEGION_IAH7,
75307612
ALC287_FIXUP_LENOVO_SSID_17AA3820,
7613+
ALCXXX_FIXUP_CS35LXX,
75317614
};
75327615

75337616
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -9857,6 +9940,10 @@ static const struct hda_fixup alc269_fixups[] = {
98579940
.type = HDA_FIXUP_FUNC,
98589941
.v.func = alc287_fixup_lenovo_ssid_17aa3820,
98599942
},
9943+
[ALCXXX_FIXUP_CS35LXX] = {
9944+
.type = HDA_FIXUP_FUNC,
9945+
.v.func = cs35lxx_autodet_fixup,
9946+
},
98609947
};
98619948

98629949
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -10271,6 +10358,17 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1027110358
SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
1027210359
SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
1027310360
SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
10361+
SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALCXXX_FIXUP_CS35LXX),
10362+
SND_PCI_QUIRK(0x103c, 0x8d08, "HP EliteBook 1045 14 G12", ALCXXX_FIXUP_CS35LXX),
10363+
SND_PCI_QUIRK(0x103c, 0x8d85, "HP EliteBook 1040 14 G12", ALCXXX_FIXUP_CS35LXX),
10364+
SND_PCI_QUIRK(0x103c, 0x8d86, "HP Elite x360 1040 14 G12", ALCXXX_FIXUP_CS35LXX),
10365+
SND_PCI_QUIRK(0x103c, 0x8d8c, "HP EliteBook 830 13 G12", ALCXXX_FIXUP_CS35LXX),
10366+
SND_PCI_QUIRK(0x103c, 0x8d8d, "HP Elite x360 830 13 G12", ALCXXX_FIXUP_CS35LXX),
10367+
SND_PCI_QUIRK(0x103c, 0x8d8e, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX),
10368+
SND_PCI_QUIRK(0x103c, 0x8d8f, "HP EliteBook 840 14 G12", ALCXXX_FIXUP_CS35LXX),
10369+
SND_PCI_QUIRK(0x103c, 0x8d90, "HP EliteBook 860 16 G12", ALCXXX_FIXUP_CS35LXX),
10370+
SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALCXXX_FIXUP_CS35LXX),
10371+
SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALCXXX_FIXUP_CS35LXX),
1027410372
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
1027510373
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
1027610374
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),

sound/pci/hda/tas2781_hda_i2c.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
//
33
// TAS2781 HDA I2C driver
44
//
5-
// Copyright 2023 Texas Instruments, Inc.
5+
// Copyright 2023 - 2024 Texas Instruments, Inc.
66
//
77
// Author: Shenghao Ding <[email protected]>
8+
// Current maintainer: Baojun Xu <[email protected]>
89

10+
#include <asm/unaligned.h>
911
#include <linux/acpi.h>
1012
#include <linux/crc8.h>
1113
#include <linux/crc32.h>
@@ -519,20 +521,22 @@ static void tas2781_apply_calib(struct tasdevice_priv *tas_priv)
519521
static const unsigned char rgno_array[CALIB_MAX] = {
520522
0x74, 0x0c, 0x14, 0x70, 0x7c,
521523
};
522-
unsigned char *data;
524+
int offset = 0;
523525
int i, j, rc;
526+
__be32 data;
524527

525528
for (i = 0; i < tas_priv->ndev; i++) {
526-
data = tas_priv->cali_data.data +
527-
i * TASDEVICE_SPEAKER_CALIBRATION_SIZE;
528529
for (j = 0; j < CALIB_MAX; j++) {
530+
data = cpu_to_be32(
531+
*(uint32_t *)&tas_priv->cali_data.data[offset]);
529532
rc = tasdevice_dev_bulk_write(tas_priv, i,
530533
TASDEVICE_REG(0, page_array[j], rgno_array[j]),
531-
&(data[4 * j]), 4);
534+
(unsigned char *)&data, 4);
532535
if (rc < 0)
533536
dev_err(tas_priv->dev,
534537
"chn %d calib %d bulk_wr err = %d\n",
535538
i, j, rc);
539+
offset += 4;
536540
}
537541
}
538542
}

sound/usb/quirks-table.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ YAMAHA_DEVICE(0x105a, NULL),
273273
YAMAHA_DEVICE(0x105b, NULL),
274274
YAMAHA_DEVICE(0x105c, NULL),
275275
YAMAHA_DEVICE(0x105d, NULL),
276+
YAMAHA_DEVICE(0x1718, "P-125"),
276277
{
277278
USB_DEVICE(0x0499, 0x1503),
278279
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {

sound/usb/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
22212221
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
22222222
DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
22232223
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
2224+
DEVICE_FLG(0x2d95, 0x8021, /* VIVO USB-C-XE710 HEADSET */
2225+
QUIRK_FLAG_CTL_MSG_DELAY_1M),
22242226
DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
22252227
QUIRK_FLAG_IGNORE_CTL_ERROR),
22262228
DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */

0 commit comments

Comments
 (0)