mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 16:30:02 -04:00
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
This commit is contained in:
@@ -1269,62 +1269,62 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
||||
stream = &data->stream;
|
||||
|
||||
guard(mutex)(&stream->device->lock);
|
||||
switch (_IOC_NR(cmd)) {
|
||||
case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):
|
||||
switch (cmd) {
|
||||
case SNDRV_COMPRESS_IOCTL_VERSION:
|
||||
return put_user(SNDRV_COMPRESS_VERSION,
|
||||
(int __user *)arg) ? -EFAULT : 0;
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
|
||||
case SNDRV_COMPRESS_GET_CAPS:
|
||||
return snd_compr_get_caps(stream, arg);
|
||||
#ifndef COMPR_CODEC_CAPS_OVERFLOW
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
|
||||
case SNDRV_COMPRESS_GET_CODEC_CAPS:
|
||||
return snd_compr_get_codec_caps(stream, arg);
|
||||
#endif
|
||||
case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
|
||||
case SNDRV_COMPRESS_SET_PARAMS:
|
||||
return snd_compr_set_params(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_PARAMS):
|
||||
case SNDRV_COMPRESS_GET_PARAMS:
|
||||
return snd_compr_get_params(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_SET_METADATA):
|
||||
case SNDRV_COMPRESS_SET_METADATA:
|
||||
return snd_compr_set_metadata(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_GET_METADATA):
|
||||
case SNDRV_COMPRESS_GET_METADATA:
|
||||
return snd_compr_get_metadata(stream, arg);
|
||||
}
|
||||
|
||||
if (stream->direction == SND_COMPRESS_ACCEL) {
|
||||
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
|
||||
switch (_IOC_NR(cmd)) {
|
||||
case _IOC_NR(SNDRV_COMPRESS_TASK_CREATE):
|
||||
switch (cmd) {
|
||||
case SNDRV_COMPRESS_TASK_CREATE:
|
||||
return snd_compr_task_create(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_TASK_FREE):
|
||||
case SNDRV_COMPRESS_TASK_FREE:
|
||||
return snd_compr_task_seq(stream, arg, snd_compr_task_free_one);
|
||||
case _IOC_NR(SNDRV_COMPRESS_TASK_START):
|
||||
case SNDRV_COMPRESS_TASK_START:
|
||||
return snd_compr_task_start_ioctl(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_TASK_STOP):
|
||||
case SNDRV_COMPRESS_TASK_STOP:
|
||||
return snd_compr_task_seq(stream, arg, snd_compr_task_stop_one);
|
||||
case _IOC_NR(SNDRV_COMPRESS_TASK_STATUS):
|
||||
case SNDRV_COMPRESS_TASK_STATUS:
|
||||
return snd_compr_task_status_ioctl(stream, arg);
|
||||
}
|
||||
#endif
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
switch (_IOC_NR(cmd)) {
|
||||
case _IOC_NR(SNDRV_COMPRESS_TSTAMP):
|
||||
switch (cmd) {
|
||||
case SNDRV_COMPRESS_TSTAMP:
|
||||
return snd_compr_tstamp(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_AVAIL):
|
||||
case SNDRV_COMPRESS_AVAIL:
|
||||
return snd_compr_ioctl_avail(stream, arg);
|
||||
case _IOC_NR(SNDRV_COMPRESS_PAUSE):
|
||||
case SNDRV_COMPRESS_PAUSE:
|
||||
return snd_compr_pause(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_RESUME):
|
||||
case SNDRV_COMPRESS_RESUME:
|
||||
return snd_compr_resume(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_START):
|
||||
case SNDRV_COMPRESS_START:
|
||||
return snd_compr_start(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_STOP):
|
||||
case SNDRV_COMPRESS_STOP:
|
||||
return snd_compr_stop(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_DRAIN):
|
||||
case SNDRV_COMPRESS_DRAIN:
|
||||
return snd_compr_drain(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_PARTIAL_DRAIN):
|
||||
case SNDRV_COMPRESS_PARTIAL_DRAIN:
|
||||
return snd_compr_partial_drain(stream);
|
||||
case _IOC_NR(SNDRV_COMPRESS_NEXT_TRACK):
|
||||
case SNDRV_COMPRESS_NEXT_TRACK:
|
||||
return snd_compr_next_track(stream);
|
||||
}
|
||||
|
||||
|
||||
@@ -873,6 +873,52 @@ static int cs35l56_hda_system_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l56_hda_fixup_yoga9(struct cs35l56_hda *cs35l56, int *bus_addr)
|
||||
{
|
||||
/* The cirrus,dev-index property has the wrong values */
|
||||
switch (*bus_addr) {
|
||||
case 0x30:
|
||||
cs35l56->index = 1;
|
||||
return 0;
|
||||
case 0x31:
|
||||
cs35l56->index = 0;
|
||||
return 0;
|
||||
default:
|
||||
/* There is a pseudo-address for broadcast to both amps - ignore it */
|
||||
dev_dbg(cs35l56->base.dev, "Ignoring I2C address %#x\n", *bus_addr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct {
|
||||
const char *sub;
|
||||
int (*fixup_fn)(struct cs35l56_hda *cs35l56, int *bus_addr);
|
||||
} cs35l56_hda_fixups[] = {
|
||||
{
|
||||
.sub = "17AA390B", /* Lenovo Yoga Book 9i GenX */
|
||||
.fixup_fn = cs35l56_hda_fixup_yoga9,
|
||||
},
|
||||
};
|
||||
|
||||
static int cs35l56_hda_apply_platform_fixups(struct cs35l56_hda *cs35l56, const char *sub,
|
||||
int *bus_addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (IS_ERR(sub))
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(cs35l56_hda_fixups); i++) {
|
||||
if (strcasecmp(cs35l56_hda_fixups[i].sub, sub) == 0) {
|
||||
dev_dbg(cs35l56->base.dev, "Applying fixup for %s\n",
|
||||
cs35l56_hda_fixups[i].sub);
|
||||
return (cs35l56_hda_fixups[i].fixup_fn)(cs35l56, bus_addr);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
|
||||
{
|
||||
u32 values[HDA_MAX_COMPONENTS];
|
||||
@@ -897,39 +943,47 @@ static int cs35l56_hda_read_acpi(struct cs35l56_hda *cs35l56, int hid, int id)
|
||||
ACPI_COMPANION_SET(cs35l56->base.dev, adev);
|
||||
}
|
||||
|
||||
property = "cirrus,dev-index";
|
||||
ret = device_property_count_u32(cs35l56->base.dev, property);
|
||||
if (ret <= 0)
|
||||
goto err;
|
||||
|
||||
if (ret > ARRAY_SIZE(values)) {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
nval = ret;
|
||||
|
||||
ret = device_property_read_u32_array(cs35l56->base.dev, property, values, nval);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
/* Initialize things that could be overwritten by a fixup */
|
||||
cs35l56->index = -1;
|
||||
for (i = 0; i < nval; i++) {
|
||||
if (values[i] == id) {
|
||||
cs35l56->index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* It's not an error for the ID to be missing: for I2C there can be
|
||||
* an alias address that is not a real device. So reject silently.
|
||||
*/
|
||||
if (cs35l56->index == -1) {
|
||||
dev_dbg(cs35l56->base.dev, "No index found in %s\n", property);
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
|
||||
sub = acpi_get_subsystem_id(ACPI_HANDLE(cs35l56->base.dev));
|
||||
ret = cs35l56_hda_apply_platform_fixups(cs35l56, sub, &id);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (cs35l56->index == -1) {
|
||||
property = "cirrus,dev-index";
|
||||
ret = device_property_count_u32(cs35l56->base.dev, property);
|
||||
if (ret <= 0)
|
||||
goto err;
|
||||
|
||||
if (ret > ARRAY_SIZE(values)) {
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
nval = ret;
|
||||
|
||||
ret = device_property_read_u32_array(cs35l56->base.dev, property, values, nval);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < nval; i++) {
|
||||
if (values[i] == id) {
|
||||
cs35l56->index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* It's not an error for the ID to be missing: for I2C there can be
|
||||
* an alias address that is not a real device. So reject silently.
|
||||
*/
|
||||
if (cs35l56->index == -1) {
|
||||
dev_dbg(cs35l56->base.dev, "No index found in %s\n", property);
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ERR(sub)) {
|
||||
dev_info(cs35l56->base.dev,
|
||||
|
||||
@@ -7497,6 +7497,9 @@ static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
|
||||
};
|
||||
struct alc_spec *spec = codec->spec;
|
||||
|
||||
/* Support Audio mute LED and Mic mute LED on keyboard */
|
||||
hda_fixup_ideapad_acpi(codec, fix, action);
|
||||
|
||||
switch (action) {
|
||||
case HDA_FIXUP_ACT_PRE_PROBE:
|
||||
snd_hda_apply_pincfgs(codec, pincfgs);
|
||||
@@ -10814,6 +10817,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x103c, 0x8b97, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
|
||||
SND_PCI_QUIRK(0x103c, 0x8bb3, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8bb4, "HP Slim OMEN", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x103c, 0x8bbe, "HP Victus 16-r0xxx (MB 8BBE)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8bc8, "HP Victus 15-fa1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
|
||||
SND_PCI_QUIRK(0x103c, 0x8bcd, "HP Omen 16-xd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
|
||||
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[] = {
|
||||
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a63, "ASUS UX3405MA", ALC245_FIXUP_CS35L41_SPI_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a83, "ASUS UM5302LA", ALC294_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a8e, "ASUS G712LWS", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||
SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2),
|
||||
SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
|
||||
SND_PCI_QUIRK(0x1043, 0x1b13, "ASUS U41SV/GA403U", ALC285_FIXUP_ASUS_GA403U_HEADSET_MIC),
|
||||
|
||||
@@ -416,6 +416,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
@@ -535,6 +542,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
@@ -584,6 +598,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "8A7F"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "8A81"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
|
||||
@@ -1315,14 +1315,17 @@ static int rt5660_i2c_probe(struct i2c_client *i2c)
|
||||
regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
|
||||
RT5660_GP1_PIN_MASK, RT5660_GP1_PIN_DMIC1_SCL);
|
||||
|
||||
if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2)
|
||||
if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2) {
|
||||
regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
|
||||
RT5660_SEL_DMIC_DATA_MASK,
|
||||
RT5660_SEL_DMIC_DATA_GPIO2);
|
||||
else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P)
|
||||
regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
|
||||
RT5660_GP2_PIN_MASK, RT5660_GP2_PIN_DMIC1_SDA);
|
||||
} else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P) {
|
||||
regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1,
|
||||
RT5660_SEL_DMIC_DATA_MASK,
|
||||
RT5660_SEL_DMIC_DATA_IN1P);
|
||||
}
|
||||
}
|
||||
|
||||
return devm_snd_soc_register_component(&i2c->dev,
|
||||
|
||||
@@ -1570,11 +1570,13 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen
|
||||
{
|
||||
struct snd_soc_acpi_mach *mach;
|
||||
struct snd_soc_dai *dai, *save;
|
||||
struct avs_mach_pdata *pdata;
|
||||
struct hda_codec *codec;
|
||||
char name[32];
|
||||
|
||||
mach = dev_get_platdata(component->card->dev);
|
||||
codec = mach->pdata;
|
||||
pdata = mach->pdata;
|
||||
codec = pdata->codec;
|
||||
snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
|
||||
|
||||
for_each_component_dais_safe(component, dai, save) {
|
||||
|
||||
@@ -11,7 +11,7 @@ menuconfig SND_SOC_INTEL_MACH
|
||||
kernel: saying N will just cause the configurator to skip all
|
||||
the questions about Intel ASoC machine drivers.
|
||||
|
||||
if SND_SOC_INTEL_MACH
|
||||
if SND_SOC_INTEL_MACH && (SND_SOC_SOF_INTEL_COMMON || !SND_SOC_SOF_INTEL_COMMON)
|
||||
|
||||
config SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES
|
||||
bool "Use more user friendly long card names"
|
||||
|
||||
@@ -238,6 +238,15 @@ static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
|
||||
}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
|
||||
{
|
||||
.adr = 0x000330025D131601ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.name_prefix = "rt1316-1"
|
||||
}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_adr_device rt1320_2_single_adr[] = {
|
||||
{
|
||||
.adr = 0x000230025D132001ull,
|
||||
@@ -368,6 +377,20 @@ static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_link_adr arl_rt711_l0_rt1316_l3[] = {
|
||||
{
|
||||
.mask = BIT(0),
|
||||
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
|
||||
.adr_d = rt711_sdca_0_adr,
|
||||
},
|
||||
{
|
||||
.mask = BIT(3),
|
||||
.num_adr = ARRAY_SIZE(rt1316_3_single_adr),
|
||||
.adr_d = rt1316_3_single_adr,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_link_adr arl_rt722_l0_rt1320_l2[] = {
|
||||
{
|
||||
.mask = BIT(0),
|
||||
@@ -481,6 +504,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {
|
||||
.sof_tplg_filename = "sof-arl-cs42l43-l2.tplg",
|
||||
.get_function_tplg_files = sof_sdw_get_tplg_files,
|
||||
},
|
||||
{
|
||||
.link_mask = BIT(0) | BIT(3),
|
||||
.links = arl_rt711_l0_rt1316_l3,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_tplg_filename = "sof-arl-rt711-l0-rt1316-l3.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0x1, /* link0 required */
|
||||
.links = arl_rvp,
|
||||
|
||||
Reference in New Issue
Block a user