Skip to content

Commit e8442d5

Browse files
committed
Merge tag 'sound-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes. The volume became higher than wished, but nothing really stands out -- all small, nice and smooth. A slightly large change is found in qcom USB-audio offload stuff, but this is a regression fix specific to this device, hence it should be safe to apply at this late stage. - Various small fixes for ASoC Cirrus, Realtek, lpass, Intel and Qualcomm drivers - ASoC SoundWire fixes - A few TAS2781 HD-audio side-codec driver fixes - A fix for Qualcomm USB-audio offload breakage - Usual a few HD-audio quirks" * tag 'sound-6.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (35 commits) ALSA: hda/realtek: Fix mute led for HP Laptop 15-dw4xx ALSA: hda: intel-dsp-config: Prevent SEGFAULT if ACPI_HANDLE() is NULL ALSA: usb: qcom: Fix false-positive address space check ASoC: rt5682s: Adjust SAR ADC button mode to fix noise issue ASoC: Intel: PTL: Add entry for HDMI-In capture support to non-I2S codec boards. ASoC: amd: acp: Fix incorrect retrival of acp_chip_info ASoC: Intel: sof_sdw: use PRODUCT_FAMILY for Fatcat series ASoC: qcom: sc8280xp: Fix sound card driver name match data for QCS8275 ALSA: hda/realtek: Fix volume control on Lenovo Thinkbook 13x Gen 4 ALSA: hda/realtek: Support Lenovo Thinkbook 13x Gen 5 ALSA: hda: cs35l41: Support Lenovo Thinkbook 13x Gen 5 ALSA: hda/realtek: Add ALC295 Dell TAS2781 I2C fixup ALSA: hda/tas2781: Fix a potential race condition that causes a NULL pointer in case no efi.get_variable exsits ASoC: qcom: sc8280xp: Enable DAI format configuration for MI2S interfaces ASoC: qcom: q6apm-lpass-dais: Fix missing set_fmt DAI op for I2S ASoC: qcom: audioreach: Fix lpaif_type configuration for the I2S interface ASoC: Intel: catpt: Expose correct bit depth to userspace ALSA: hda/tas2781: Fix the order of TAS2781 calibrated-data ASoC: codecs: lpass-wsa-macro: Fix speaker quality distortion ASoC: codecs: lpass-rx-macro: Fix playback quality distortion ...
2 parents f2738f5 + d33c347 commit e8442d5

32 files changed

+266
-123
lines changed

Documentation/sound/alsa-configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ delayed_register
22932293
notice the need.
22942294
skip_validation
22952295
Skip unit descriptor validation (default: no).
2296-
The option is used to ignores the validation errors with the hexdump
2296+
The option is used to ignore the validation errors with the hexdump
22972297
of the unit descriptor instead of a driver probe error, so that we
22982298
can check its details.
22992299
quirk_flags

include/sound/sdca.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct sdca_device_data {
4646

4747
enum sdca_quirk {
4848
SDCA_QUIRKS_RT712_VB,
49+
SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING,
4950
};
5051

5152
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA)

include/sound/sdca_function.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,27 +1063,30 @@ struct sdca_entity_ge {
10631063
/**
10641064
* struct sdca_entity_hide - information specific to HIDE Entities
10651065
* @hid: HID device structure
1066-
* @hidtx_ids: HIDTx Report ID
10671066
* @num_hidtx_ids: number of HIDTx Report ID
1068-
* @hidrx_ids: HIDRx Report ID
10691067
* @num_hidrx_ids: number of HIDRx Report ID
1070-
* @hide_reside_function_num: indicating which Audio Function Numbers within this Device
1071-
* @max_delay: the maximum time in microseconds allowed for the Device to change the ownership from Device to Host
1072-
* @af_number_list: which Audio Function Numbers within this Device are sending/receiving the messages in this HIDE
1073-
* @hid_desc: HID descriptor for the HIDE Entity
1068+
* @hidtx_ids: HIDTx Report ID
1069+
* @hidrx_ids: HIDRx Report ID
1070+
* @af_number_list: which Audio Function Numbers within this Device are
1071+
* sending/receiving the messages in this HIDE
1072+
* @hide_reside_function_num: indicating which Audio Function Numbers
1073+
* within this Device
1074+
* @max_delay: the maximum time in microseconds allowed for the Device
1075+
* to change the ownership from Device to Host
10741076
* @hid_report_desc: HID Report Descriptor for the HIDE Entity
1077+
* @hid_desc: HID descriptor for the HIDE Entity
10751078
*/
10761079
struct sdca_entity_hide {
10771080
struct hid_device *hid;
10781081
unsigned int *hidtx_ids;
1079-
int num_hidtx_ids;
10801082
unsigned int *hidrx_ids;
1083+
int num_hidtx_ids;
10811084
int num_hidrx_ids;
1085+
unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];
10821086
unsigned int hide_reside_function_num;
10831087
unsigned int max_delay;
1084-
unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];
1085-
struct hid_descriptor hid_desc;
10861088
unsigned char *hid_report_desc;
1089+
struct hid_descriptor hid_desc;
10871090
};
10881091

10891092
/**

sound/hda/codecs/realtek/alc269.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,6 +3702,7 @@ enum {
37023702
ALC236_FIXUP_DELL_DUAL_CODECS,
37033703
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
37043704
ALC287_FIXUP_TAS2781_I2C,
3705+
ALC295_FIXUP_DELL_TAS2781_I2C,
37053706
ALC245_FIXUP_TAS2781_SPI_2,
37063707
ALC287_FIXUP_TXNW2781_I2C,
37073708
ALC287_FIXUP_YOGA7_14ARB7_I2C,
@@ -5167,6 +5168,12 @@ static const struct hda_fixup alc269_fixups[] = {
51675168
.type = HDA_FIXUP_FUNC,
51685169
.v.func = alc294_fixup_gx502_hp,
51695170
},
5171+
[ALC295_FIXUP_DELL_TAS2781_I2C] = {
5172+
.type = HDA_FIXUP_FUNC,
5173+
.v.func = tas2781_fixup_tias_i2c,
5174+
.chained = true,
5175+
.chain_id = ALC289_FIXUP_DUAL_SPK
5176+
},
51705177
[ALC294_FIXUP_ASUS_GU502_PINS] = {
51715178
.type = HDA_FIXUP_PINS,
51725179
.v.pins = (const struct hda_pintbl[]) {
@@ -6289,8 +6296,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
62896296
SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
62906297
SND_PCI_QUIRK(0x1028, 0x0c28, "Dell Inspiron 16 Plus 7630", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
62916298
SND_PCI_QUIRK(0x1028, 0x0c4d, "Dell", ALC287_FIXUP_CS35L41_I2C_4),
6292-
SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC287_FIXUP_TAS2781_I2C),
6293-
SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC287_FIXUP_TAS2781_I2C),
6299+
SND_PCI_QUIRK(0x1028, 0x0c94, "Dell Polaris 3 metal", ALC295_FIXUP_DELL_TAS2781_I2C),
6300+
SND_PCI_QUIRK(0x1028, 0x0c96, "Dell Polaris 2in1", ALC295_FIXUP_DELL_TAS2781_I2C),
62946301
SND_PCI_QUIRK(0x1028, 0x0cbd, "Dell Oasis 13 CS MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
62956302
SND_PCI_QUIRK(0x1028, 0x0cbe, "Dell Oasis 13 2-IN-1 MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
62966303
SND_PCI_QUIRK(0x1028, 0x0cbf, "Dell Oasis 13 Low Weight MTU-L", ALC289_FIXUP_DELL_CS35L41_SPI_2),
@@ -6469,6 +6476,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
64696476
SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
64706477
SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
64716478
SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
6479+
SND_PCI_QUIRK(0x103c, 0x89a0, "HP Laptop 15-dw4xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
64726480
SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
64736481
SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
64746482
SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
@@ -7071,8 +7079,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
70717079
SND_PCI_QUIRK(0x17aa, 0x38be, "Yoga S980-14.5 proX YC Dual", ALC287_FIXUP_TAS2781_I2C),
70727080
SND_PCI_QUIRK(0x17aa, 0x38bf, "Yoga S980-14.5 proX LX Dual", ALC287_FIXUP_TAS2781_I2C),
70737081
SND_PCI_QUIRK(0x17aa, 0x38c3, "Y980 DUAL", ALC287_FIXUP_TAS2781_I2C),
7074-
SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
7075-
SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_CS35L41_I2C_4),
7082+
SND_PCI_QUIRK(0x17aa, 0x38c7, "Thinkbook 13x Gen 4", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
7083+
SND_PCI_QUIRK(0x17aa, 0x38c8, "Thinkbook 13x Gen 4", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
70767084
SND_PCI_QUIRK(0x17aa, 0x38cb, "Y790 YG DUAL", ALC287_FIXUP_TAS2781_I2C),
70777085
SND_PCI_QUIRK(0x17aa, 0x38cd, "Y790 VECO DUAL", ALC287_FIXUP_TAS2781_I2C),
70787086
SND_PCI_QUIRK(0x17aa, 0x38d2, "Lenovo Yoga 9 14IMH9", ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN),
@@ -7093,6 +7101,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
70937101
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
70947102
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TXNW2781_I2C),
70957103
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TXNW2781_I2C),
7104+
SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
7105+
SND_PCI_QUIRK(0x17aa, 0x392b, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
70967106
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
70977107
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
70987108
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),

sound/hda/codecs/side-codecs/cs35l41_hda_property.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ static const struct cs35l41_config cs35l41_config_table[] = {
135135
{ "17AA38C8", 4, INTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT }, 0, 2, -1, 1000, 4500, 24 },
136136
{ "17AA38F9", 2, EXTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, 0, 0 }, 0, 2, -1, 0, 0, 0 },
137137
{ "17AA38FA", 2, EXTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, 0, 0 }, 0, 2, -1, 0, 0, 0 },
138+
{ "17AA3929", 4, INTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT }, 0, 2, -1, 1000, 4500, 24 },
139+
{ "17AA392B", 4, INTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT }, 0, 2, -1, 1000, 4500, 24 },
138140
{}
139141
};
140142

@@ -558,6 +560,8 @@ static const struct cs35l41_prop_model cs35l41_prop_model_table[] = {
558560
{ "CSC3551", "17AA38C8", generic_dsd_config },
559561
{ "CSC3551", "17AA38F9", generic_dsd_config },
560562
{ "CSC3551", "17AA38FA", generic_dsd_config },
563+
{ "CSC3551", "17AA3929", generic_dsd_config },
564+
{ "CSC3551", "17AA392B", generic_dsd_config },
561565
{}
562566
};
563567

sound/hda/codecs/side-codecs/tas2781_hda.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ const efi_guid_t tasdev_fct_efi_guid[] = {
3333
};
3434
EXPORT_SYMBOL_NS_GPL(tasdev_fct_efi_guid, "SND_HDA_SCODEC_TAS2781");
3535

36+
/*
37+
* The order of calibrated-data writing function is a bit different from the
38+
* order in UEFI. Here is the conversion to match the order of calibrated-data
39+
* writing function.
40+
*/
41+
static void cali_cnv(unsigned char *data, unsigned int base, int offset)
42+
{
43+
struct cali_reg reg_data;
44+
45+
memcpy(&reg_data, &data[base], sizeof(reg_data));
46+
/* the data order has to be swapped between r0_low_reg and inv0_reg */
47+
swap(reg_data.r0_low_reg, reg_data.invr0_reg);
48+
49+
cpu_to_be32_array((__force __be32 *)(data + offset + 1),
50+
(u32 *)&reg_data, TASDEV_CALIB_N);
51+
}
52+
3653
static void tas2781_apply_calib(struct tasdevice_priv *p)
3754
{
3855
struct calidata *cali_data = &p->cali_data;
@@ -103,8 +120,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
103120

104121
data[l] = k;
105122
oft++;
106-
for (i = 0; i < TASDEV_CALIB_N * 4; i++)
107-
data[l + i + 1] = data[4 * oft + i];
123+
cali_cnv(data, 4 * oft, l);
108124
k++;
109125
}
110126
}
@@ -130,9 +146,8 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
130146

131147
for (j = p->ndev - 1; j >= 0; j--) {
132148
l = j * (cali_data->cali_dat_sz_per_dev + 1);
133-
for (i = TASDEV_CALIB_N * 4; i > 0 ; i--)
134-
data[l + i] = data[p->index * 5 + i];
135-
data[l+i] = j;
149+
cali_cnv(data, cali_data->cali_dat_sz_per_dev * j, l);
150+
data[l] = j;
136151
}
137152
}
138153

@@ -178,6 +193,11 @@ int tas2781_save_calibration(struct tas2781_hda *hda)
178193
efi_status_t status;
179194
int i;
180195

196+
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
197+
dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);
198+
return -EINVAL;
199+
}
200+
181201
if (hda->catlog_id < LENOVO)
182202
efi_guid = tasdev_fct_efi_guid[hda->catlog_id];
183203

sound/hda/codecs/side-codecs/tas2781_hda_i2c.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ static int tas2563_save_calibration(struct tas2781_hda *h)
315315
unsigned int attr;
316316
int ret, i, j, k;
317317

318+
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
319+
dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);
320+
return -EINVAL;
321+
}
322+
318323
cd->cali_dat_sz_per_dev = TAS2563_CAL_DATA_SIZE * TASDEV_CALIB_N;
319324

320325
/* extra byte for each device is the device number */

sound/hda/core/intel-dsp-config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ static int snd_intel_dsp_check_soundwire(struct pci_dev *pci)
650650
int ret;
651651

652652
handle = ACPI_HANDLE(&pci->dev);
653+
if (!handle)
654+
return -ENODEV;
653655

654656
ret = sdw_intel_acpi_scan(handle, &info);
655657
if (ret < 0)

sound/soc/amd/acp/acp-i2s.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int acp_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
7373
unsigned int fmt)
7474
{
7575
struct device *dev = cpu_dai->component->dev;
76-
struct acp_chip_info *chip = dev_get_platdata(dev);
76+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
7777
int mode;
7878

7979
mode = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
@@ -199,7 +199,7 @@ static int acp_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_
199199
u32 reg_val, fmt_reg, tdm_fmt;
200200
u32 lrclk_div_val, bclk_div_val;
201201

202-
chip = dev_get_platdata(dev);
202+
chip = dev_get_drvdata(dev->parent);
203203
rsrc = chip->rsrc;
204204

205205
/* These values are as per Hardware Spec */
@@ -386,7 +386,7 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct
386386
{
387387
struct acp_stream *stream = substream->runtime->private_data;
388388
struct device *dev = dai->component->dev;
389-
struct acp_chip_info *chip = dev_get_platdata(dev);
389+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
390390
struct acp_resource *rsrc = chip->rsrc;
391391
u32 val, period_bytes, reg_val, ier_val, water_val, buf_size, buf_reg;
392392

@@ -516,14 +516,13 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct
516516
static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
517517
{
518518
struct device *dev = dai->component->dev;
519-
struct acp_chip_info *chip = dev_get_platdata(dev);
519+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
520520
struct acp_resource *rsrc = chip->rsrc;
521521
struct acp_stream *stream = substream->runtime->private_data;
522522
u32 reg_dma_size = 0, reg_fifo_size = 0, reg_fifo_addr = 0;
523523
u32 phy_addr = 0, acp_fifo_addr = 0, ext_int_ctrl;
524524
unsigned int dir = substream->stream;
525525

526-
chip = dev_get_platdata(dev);
527526
switch (dai->driver->id) {
528527
case I2S_SP_INSTANCE:
529528
if (dir == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -632,7 +631,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d
632631
{
633632
struct acp_stream *stream = substream->runtime->private_data;
634633
struct device *dev = dai->component->dev;
635-
struct acp_chip_info *chip = dev_get_platdata(dev);
634+
struct acp_chip_info *chip = dev_get_drvdata(dev->parent);
636635
struct acp_resource *rsrc = chip->rsrc;
637636
unsigned int dir = substream->stream;
638637
unsigned int irq_bit = 0;

sound/soc/amd/acp/acp-sdw-legacy-mach.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ static const struct dmi_system_id soc_sdw_quirk_table[] = {
7979
},
8080
.driver_data = (void *)(ASOC_SDW_CODEC_SPKR),
8181
},
82+
{
83+
.callback = soc_sdw_quirk_cb,
84+
.matches = {
85+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
86+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0DD3"),
87+
},
88+
.driver_data = (void *)(ASOC_SDW_CODEC_SPKR),
89+
},
90+
{
91+
.callback = soc_sdw_quirk_cb,
92+
.matches = {
93+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
94+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0DD4"),
95+
},
96+
.driver_data = (void *)(ASOC_SDW_CODEC_SPKR),
97+
},
8298
{}
8399
};
84100

0 commit comments

Comments
 (0)