linux/sound/hda/codecs/side-codecs
Philipp Oster b6016332b8 ALSA: hda/tas2781: clear cali_data.total_sz when calibration read fails
tas2563_save_calibration() assigns cali_data.total_sz before it reads the
per-device calibration data from EFI, but its error paths return without
clearing it again. cali_data.cali_reg_array is left all zero, because the
function returns before the register addresses are assigned.

On the first playback tasdev_load_calibrated_data() does

	if (!data || !cali_data->total_sz)
		return;

which passes, since total_sz is still non-zero. It then issues five
4-byte bulk writes to p->r0_reg, p->r0_low_reg, p->invr0_reg, p->pow_reg
and p->tlimit_reg, all of which are 0. Register 0 decodes to book 0 /
page 0 / register 0x00, so the auto-incrementing block write zeroes
registers 0x00 to 0x03. Register 0x03 is PB_CFG1, which holds AMP_LEVEL,
so the amplifier gain is set to its minimum and the speaker stays silent.

This is reproducible on a Lenovo Yoga 7 14ARB7 (two TAS2563 on I2C,
ACPI INT8866) whose factory calibration was never written to UEFI, so the
EFI read fails with EFI_NOT_FOUND. The two woofers driven by the
amplifiers are silent while the tweeters driven directly by the ALC287
play. Reading the amplifier registers over i2c shows PWR_CTL = 0x00
(active) and the TDM slots correctly programmed by the RCA profile, but
PB_CFG1 = 0x00. With this change PB_CFG1 keeps its power-on default of
0x20 and both woofers play.

tas2781_save_calibration() in tas2781_hda.c already clears total_sz on
failure; do the same for the TAS2563 variant.

Signed-off-by: Philipp Oster <philippdev5396@outlook.de>
Link: https://patch.msgid.link/20260720-tas2781-calfix-v1-1-3a5fa6ad90bc@outlook.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-20 20:49:04 +02:00
..
cirrus_scodec_test.c ALSA: hda/cirrus_scodec_test: Use faux_device instead of platform_device 2026-01-16 15:17:53 +01:00
cirrus_scodec.c
cirrus_scodec.h
cs35l41_hda_i2c.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
cs35l41_hda_property.c ALSA: hda: Add Lenovo Legion 7i 16IAX7 17AA3874 quirk 2026-06-25 13:53:39 +02:00
cs35l41_hda_property.h
cs35l41_hda_spi.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
cs35l41_hda.c ALSA: hda: cs35l41: validate and free ACPI mute object 2026-07-15 16:40:08 +02:00
cs35l41_hda.h ALSA: hda/cs35l41: Fix firmware load work teardown 2026-05-15 17:54:47 +02:00
cs35l56_hda_i2c.c ASoC: Use named initializers for arrays of i2c_device_data 2026-05-21 12:30:08 +01:00
cs35l56_hda_spi.c ASoC: cs35l56: Set fw_regs table after getting REVID 2025-09-28 08:27:15 +02:00
cs35l56_hda.c ALSA: hda: cs35l56: Fail if wmfw file is missing 2026-07-13 12:03:48 +02:00
cs35l56_hda.h ALSA: hda: cs35l56: Fix uninitialized value in cs35l56_hda_read_acpi() 2026-04-29 07:50:16 +02:00
hda_component.c ALSA: hda: Fix missing pointer check in hda_component_manager_init function 2025-10-11 08:28:52 +02:00
hda_component.h ALSA: hda/component: Use guard() for mutex locks 2025-08-29 11:52:15 +02:00
Kconfig ALSA: hda/cirrus_scodec: Make Kconfig visible if KUNIT 2026-07-09 18:34:21 +02:00
Makefile
tas2781_hda_i2c.c ALSA: hda/tas2781: clear cali_data.total_sz when calibration read fails 2026-07-20 20:49:04 +02:00
tas2781_hda_spi.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
tas2781_hda.c ASoC: tas2781: Put three different calibrated data solution into the same data structure 2026-02-04 13:38:02 +00:00
tas2781_hda.h ALSA: hda/tas2781: Support L"SmartAmpCalibrationData" to save calibrated data 2025-08-06 08:05:47 +02:00