Skip to content

Commit f0afb7b

Browse files
committed
Merge tag 'sound-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes again. The only change in the core is about the handling of ALSA compress-offload ioctl numbers for avoiding potential abusing the API (if any). Other than that, all changes are device-specific small fixes and quirks, which should be safe to apply" * tag 'sound-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: amd: yc: Add DMI quirk for HP Laptop 17 cp-2033dx ASoC: Intel: soc-acpi: add support for HP Omen14 ARL ASoC: amd: yc: Add DMI entries to support HP 15-fb1xxx ALSA: hda/realtek: Add quirk for ASUS ROG Strix G712LWS ALSA: hda/cs35l56: Workaround bad dev-index on Lenovo Yoga Book 9i GenX ALSA: hda/realtek: Support mute LED for Yoga with ALC287 ASoC: Intel: fix SND_SOC_SOF dependencies ASoC: rt5660: Fix the dmic data source from GPIO2 ALSA: hda/realtek - Fix mute LED for HP Victus 16-r0xxx ALSA: compress_offload: tighten ioctl command number checks ASoC: Intel: avs: Fix NULL ptr deref on rmmod ASoC: amd: yc: add DMI quirk for ASUS M6501RM
2 parents e1da8eb + 348954f commit f0afb7b

File tree

8 files changed

+170
-56
lines changed

8 files changed

+170
-56
lines changed

sound/core/compress_offload.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,62 +1269,62 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
12691269
stream = &data->stream;
12701270

12711271
guard(mutex)(&stream->device->lock);
1272-
switch (_IOC_NR(cmd)) {
1273-
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
1272+
switch (cmd) {
1273+
case SNDRV_COMPRESS_IOCTL_VERSION:
12741274
return put_user(SNDRV_COMPRESS_VERSION,
12751275
(int __user *)arg) ? -EFAULT : 0;
1276-
case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
1276+
case SNDRV_COMPRESS_GET_CAPS:
12771277
return snd_compr_get_caps(stream, arg);
12781278
#ifndef COMPR_CODEC_CAPS_OVERFLOW
1279-
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
1279+
case SNDRV_COMPRESS_GET_CODEC_CAPS:
12801280
return snd_compr_get_codec_caps(stream, arg);
12811281
#endif
1282-
case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
1282+
case SNDRV_COMPRESS_SET_PARAMS:
12831283
return snd_compr_set_params(stream, arg);
1284-
case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS):
1284+
case SNDRV_COMPRESS_GET_PARAMS:
12851285
return snd_compr_get_params(stream, arg);
1286-
case _IOC_NR(SNDRV_COMPRESS_SET_METADATA):
1286+
case SNDRV_COMPRESS_SET_METADATA:
12871287
return snd_compr_set_metadata(stream, arg);
1288-
case _IOC_NR(SNDRV_COMPRESS_GET_METADATA):
1288+
case SNDRV_COMPRESS_GET_METADATA:
12891289
return snd_compr_get_metadata(stream, arg);
12901290
}
12911291

12921292
if (stream->direction == SND_COMPRESS_ACCEL) {
12931293
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
1294-
switch (_IOC_NR(cmd)) {
1295-
case _IOC_NR(SNDRV_COMPRESS_TASK_CREATE):
1294+
switch (cmd) {
1295+
case SNDRV_COMPRESS_TASK_CREATE:
12961296
return snd_compr_task_create(stream, arg);
1297-
case _IOC_NR(SNDRV_COMPRESS_TASK_FREE):
1297+
case SNDRV_COMPRESS_TASK_FREE:
12981298
return snd_compr_task_seq(stream, arg, snd_compr_task_free_one);
1299-
case _IOC_NR(SNDRV_COMPRESS_TASK_START):
1299+
case SNDRV_COMPRESS_TASK_START:
13001300
return snd_compr_task_start_ioctl(stream, arg);
1301-
case _IOC_NR(SNDRV_COMPRESS_TASK_STOP):
1301+
case SNDRV_COMPRESS_TASK_STOP:
13021302
return snd_compr_task_seq(stream, arg, snd_compr_task_stop_one);
1303-
case _IOC_NR(SNDRV_COMPRESS_TASK_STATUS):
1303+
case SNDRV_COMPRESS_TASK_STATUS:
13041304
return snd_compr_task_status_ioctl(stream, arg);
13051305
}
13061306
#endif
13071307
return -ENOTTY;
13081308
}
13091309

1310-
switch (_IOC_NR(cmd)) {
1311-
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
1310+
switch (cmd) {
1311+
case SNDRV_COMPRESS_TSTAMP:
13121312
return snd_compr_tstamp(stream, arg);
1313-
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
1313+
case SNDRV_COMPRESS_AVAIL:
13141314
return snd_compr_ioctl_avail(stream, arg);
1315-
case _IOC_NR(SNDRV_COMPRESS_PAUSE):
1315+
case SNDRV_COMPRESS_PAUSE:
13161316
return snd_compr_pause(stream);
1317-
case _IOC_NR(SNDRV_COMPRESS_RESUME):
1317+
case SNDRV_COMPRESS_RESUME:
13181318
return snd_compr_resume(stream);
1319-
case _IOC_NR(SNDRV_COMPRESS_START):
1319+
case SNDRV_COMPRESS_START:
13201320
return snd_compr_start(stream);
1321-
case _IOC_NR(SNDRV_COMPRESS_STOP):
1321+
case SNDRV_COMPRESS_STOP:
13221322
return snd_compr_stop(stream);
1323-
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
1323+
case SNDRV_COMPRESS_DRAIN:
13241324
return snd_compr_drain(stream);
1325-
case _IOC_NR(SNDRV_COMPRESS_PARTIAL_DRAIN):
1325+
case SNDRV_COMPRESS_PARTIAL_DRAIN:
13261326
return snd_compr_partial_drain(stream);
1327-
case _IOC_NR(SNDRV_COMPRESS_NEXT_TRACK):
1327+
case SNDRV_COMPRESS_NEXT_TRACK:
13281328
return snd_compr_next_track(stream);
13291329
}
13301330

sound/pci/hda/cs35l56_hda.c

Lines changed: 82 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,52 @@ static int cs35l56_hda_system_resume(struct device *dev)
873873
return 0;
874874
}
875875

876+
static int cs35l56_hda_fixup_yoga9(struct cs35l56_hda *cs35l56, int *bus_addr)
877+
{
878+
/* The cirrus,dev-index property has the wrong values */
879+
switch (*bus_addr) {
880+
case 0x30:
881+
cs35l56->index = 1;
882+
return 0;
883+
case 0x31:
884+
cs35l56->index = 0;
885+
return 0;
886+
default:
887+
/* There is a pseudo-address for broadcast to both amps - ignore it */
888+
dev_dbg(cs35l56->base.dev, "Ignoring I2C address %#x\n", *bus_addr);
889+
return 0;
890+
}
891+
}
892+
893+
static const struct {
894+
const char *sub;
895+
int (*fixup_fn)(struct cs35l56_hda *cs35l56, int *bus_addr);
896+
} cs35l56_hda_fixups[] = {
897+
{
898+
.sub = "17AA390B", /* Lenovo Yoga Book 9i GenX */
899+
.fixup_fn = cs35l56_hda_fixup_yoga9,
900+
},
901+
};
902+
903+
static int cs35l56_hda_apply_platform_fixups(struct cs35l56_hda *cs35l56, const char *sub,
904+
int *bus_addr)
905+
{
906+
int i;
907+
908+
if (IS_ERR(sub))
909+
return 0;
910+
911+
for (i = 0; i < ARRAY_SIZE(cs35l56_hda_fixups); i++) {
912+
if (strcasecmp(cs35l56_hda_fixups[i].sub, sub) == 0) {
913+
dev_dbg(cs35l56->base.dev, "Applying fixup for %s\n",
914+
cs35l56_hda_fixups[i].sub);
915+
return (cs35l56_hda_fixups[i].fixup_fn)(cs35l56, bus_addr);
916+
}
917+
}
918+
919+
return 0;
920+
}
921+
876922
static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
877923
{
878924
u32 values[HDA_MAX_COMPONENTS];
@@ -897,39 +943,47 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
897943
ACPI_COMPANION_SET(cs35l56->base.dev, adev);
898944
}
899945

900-
property = "cirrus,dev-index";
901-
ret = device_property_count_u32(cs35l56->base.dev, property);
902-
if (ret <= 0)
903-
goto err;
904-
905-
if (ret > ARRAY_SIZE(values)) {
906-
ret = -EINVAL;
907-
goto err;
908-
}
909-
nval = ret;
946+
/* Initialize things that could be overwritten by a fixup */
947+
cs35l56->index = -1;
910948

911-
ret = device_property_read_u32_array(cs35l56->base.dev, property, values, nval);
949+
sub = acpi_get_subsystem_id(ACPI_HANDLE(cs35l56->base.dev));
950+
ret = cs35l56_hda_apply_platform_fixups(cs35l56, sub, &id);
912951
if (ret)
913-
goto err;
952+
return ret;
914953

915-
cs35l56->index = -1;
916-
for (i = 0; i < nval; i++) {
917-
if (values[i] == id) {
918-
cs35l56->index = i;
919-
break;
920-
}
921-
}
922-
/*
923-
* It's not an error for the ID to be missing: for I2C there can be
924-
* an alias address that is not a real device. So reject silently.
925-
*/
926954
if (cs35l56->index == -1) {
927-
dev_dbg(cs35l56->base.dev, "No index found in %s\n", property);
928-
ret = -ENODEV;
929-
goto err;
930-
}
955+
property = "cirrus,dev-index";
956+
ret = device_property_count_u32(cs35l56->base.dev, property);
957+
if (ret <= 0)
958+
goto err;
931959

932-
sub = acpi_get_subsystem_id(ACPI_HANDLE(cs35l56->base.dev));
960+
if (ret > ARRAY_SIZE(values)) {
961+
ret = -EINVAL;
962+
goto err;
963+
}
964+
nval = ret;
965+
966+
ret = device_property_read_u32_array(cs35l56->base.dev, property, values, nval);
967+
if (ret)
968+
goto err;
969+
970+
for (i = 0; i < nval; i++) {
971+
if (values[i] == id) {
972+
cs35l56->index = i;
973+
break;
974+
}
975+
}
976+
977+
/*
978+
* It's not an error for the ID to be missing: for I2C there can be
979+
* an alias address that is not a real device. So reject silently.
980+
*/
981+
if (cs35l56->index == -1) {
982+
dev_dbg(cs35l56->base.dev, "No index found in %s\n", property);
983+
ret = -ENODEV;
984+
goto err;
985+
}
986+
}
933987

934988
if (IS_ERR(sub)) {
935989
dev_info(cs35l56->base.dev,

sound/pci/hda/patch_realtek.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7497,6 +7497,9 @@ static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
74977497
};
74987498
struct alc_spec *spec = codec->spec;
74997499

7500+
/* Support Audio mute LED and Mic mute LED on keyboard */
7501+
hda_fixup_ideapad_acpi(codec, fix, action);
7502+
75007503
switch (action) {
75017504
case HDA_FIXUP_ACT_PRE_PROBE:
75027505
snd_hda_apply_pincfgs(codec, pincfgs);
@@ -10814,6 +10817,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1081410817
SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
1081510818
SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
1081610819
SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
10820+
SND_PCI_QUIRK(0x103c, 0x8bbe, "HP Victus 16-r0xxx (MB 8BBE)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
1081710821
SND_PCI_QUIRK(0x103c, 0x8bc8, "HP Victus 15-fa1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
1081810822
SND_PCI_QUIRK(0x103c, 0x8bcd, "HP Omen 16-xd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
1081910823
SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
@@ -11006,6 +11010,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
1100611010
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
1100711011
SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
1100811012
SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
11013+
SND_PCI_QUIRK(0x1043, 0x1a8e, "ASUS G712LWS", ALC294_FIXUP_LENOVO_MIC_LOCATION),
1100911014
SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
1101011015
SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
1101111016
SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
416416
DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
417417
}
418418
},
419+
{
420+
.driver_data = &acp6x_card,
421+
.matches = {
422+
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
423+
DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"),
424+
}
425+
},
419426
{
420427
.driver_data = &acp6x_card,
421428
.matches = {
@@ -535,6 +542,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
535542
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"),
536543
}
537544
},
545+
{
546+
.driver_data = &acp6x_card,
547+
.matches = {
548+
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
549+
DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"),
550+
}
551+
},
538552
{
539553
.driver_data = &acp6x_card,
540554
.matches = {
@@ -584,6 +598,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
584598
DMI_MATCH(DMI_BOARD_NAME, "8A7F"),
585599
}
586600
},
601+
{
602+
.driver_data = &acp6x_card,
603+
.matches = {
604+
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
605+
DMI_MATCH(DMI_BOARD_NAME, "8A81"),
606+
}
607+
},
587608
{
588609
.driver_data = &acp6x_card,
589610
.matches = {

sound/soc/codecs/rt5660.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,14 +1315,17 @@ static int rt5660_i2c_probe(struct i2c_client *i2c)
13151315
regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
13161316
RT5660_GP1_PIN_MASK, RT5660_GP1_PIN_DMIC1_SCL);
13171317

1318-
if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2)
1318+
if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2) {
13191319
regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
13201320
RT5660_SEL_DMIC_DATA_MASK,
13211321
RT5660_SEL_DMIC_DATA_GPIO2);
1322-
else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P)
1322+
regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
1323+
RT5660_GP2_PIN_MASK, RT5660_GP2_PIN_DMIC1_SDA);
1324+
} else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P) {
13231325
regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
13241326
RT5660_SEL_DMIC_DATA_MASK,
13251327
RT5660_SEL_DMIC_DATA_IN1P);
1328+
}
13261329
}
13271330

13281331
return devm_snd_soc_register_component(&i2c->dev,

sound/soc/intel/avs/pcm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,11 +1570,13 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen
15701570
{
15711571
struct snd_soc_acpi_mach *mach;
15721572
struct snd_soc_dai *dai, *save;
1573+
struct avs_mach_pdata *pdata;
15731574
struct hda_codec *codec;
15741575
char name[32];
15751576

15761577
mach = dev_get_platdata(component->card->dev);
1577-
codec = mach->pdata;
1578+
pdata = mach->pdata;
1579+
codec = pdata->codec;
15781580
snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
15791581

15801582
for_each_component_dais_safe(component, dai, save) {

sound/soc/intel/boards/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ menuconfig SND_SOC_INTEL_MACH
1111
kernel: saying N will just cause the configurator to skip all
1212
the questions about Intel ASoC machine drivers.
1313

14-
if SND_SOC_INTEL_MACH
14+
if SND_SOC_INTEL_MACH && (SND_SOC_SOF_INTEL_COMMON || !SND_SOC_SOF_INTEL_COMMON)
1515

1616
config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
1717
bool "Use more user friendly long card names"

sound/soc/intel/common/soc-acpi-intel-arl-match.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
238238
}
239239
};
240240

241+
static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
242+
{
243+
.adr = 0x000330025D131601ull,
244+
.num_endpoints = 1,
245+
.endpoints = &single_endpoint,
246+
.name_prefix = "rt1316-1"
247+
}
248+
};
249+
241250
static const struct snd_soc_acpi_adr_device rt1320_2_single_adr[] = {
242251
{
243252
.adr = 0x000230025D132001ull,
@@ -368,6 +377,20 @@ static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = {
368377
{}
369378
};
370379

380+
static const struct snd_soc_acpi_link_adr arl_rt711_l0_rt1316_l3[] = {
381+
{
382+
.mask = BIT(0),
383+
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
384+
.adr_d = rt711_sdca_0_adr,
385+
},
386+
{
387+
.mask = BIT(3),
388+
.num_adr = ARRAY_SIZE(rt1316_3_single_adr),
389+
.adr_d = rt1316_3_single_adr,
390+
},
391+
{}
392+
};
393+
371394
static const struct snd_soc_acpi_link_adr arl_rt722_l0_rt1320_l2[] = {
372395
{
373396
.mask = BIT(0),
@@ -481,6 +504,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {
481504
.sof_tplg_filename = "sof-arl-cs42l43-l2.tplg",
482505
.get_function_tplg_files = sof_sdw_get_tplg_files,
483506
},
507+
{
508+
.link_mask = BIT(0) | BIT(3),
509+
.links = arl_rt711_l0_rt1316_l3,
510+
.drv_name = "sof_sdw",
511+
.sof_tplg_filename = "sof-arl-rt711-l0-rt1316-l3.tplg",
512+
},
484513
{
485514
.link_mask = 0x1, /* link0 required */
486515
.links = arl_rvp,

0 commit comments

Comments
 (0)