Commit

408249089c48df1a4d23f60b831be3f3c311e6d1

ALSA: hda/tas2781: Accept V1 calibration data without CRC

Some Lenovo BIOSes (e.g. Legion Pro 7 16IRX9H, SSID 17aa:38cd) store
valid V1 calibration data in the CALI_DATA EFI variable but leave the
TimeStamp and CRC fields zeroed. The driver rejects such data, so the
amplifiers always run with default parameters on these machines.

The rejection was silent until
commit 4fe238513407 ("ALSA: hda/tas2781: Move and unified the
calibrated-data getting function for SPI and I2C into the tas2781_hda lib")
turned it into "V1 CRC error".

The stored values are consistent (R0 = 3.82/3.83 ohm, 1/R0 matching
within 1e-4), so accept V1 data when both TimeStamp and CRC are zero
and the first device entry is non-zero, and emit a warning.

Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver")
Cc: stable@vger.kernel.org
Signed-off-by: Mohamed Yassine Jebabli <med.jebabli@gmail.com>
Link: https://patch.msgid.link/20261001-tas2781-v1-nocrc-v1-1-ff0c1032ce76@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Mohamed Yassine Jebabli <med.jebabli@gmail.com> · 2026-10-01 10:24 UTC · committed by Takashi Iwai

Browse files
1 file changed, +15 −3
modified sound/hda/codecs/side-codecs/tas2781_hda.c
@@ -139,9 +139,21 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
139 139 */
140 140 crc = crc32(~0, data, 84) ^ ~0;
141 141 if (crc != tmp_val[21]) {
142 - cali_data->total_sz = 0;
143 - dev_err(p->dev, "%s: V1 CRC error\n", __func__);
144 - return;
142 + /*
143 + * Some Lenovo BIOSes (e.g. Legion Pro 7 16IRX9H,
144 + * SSID 17aa:38cd) store valid V1 calibration data
145 + * but leave TimeStamp and CRC zeroed.
146 + */
147 + if (!tmp_val[20] && !tmp_val[21] &&
148 + tmp_val[0] && tmp_val[1]) {
149 + dev_warn(p->dev,
150 + "%s: V1 data without CRC, accepting\n",
151 + __func__);
152 + } else {
153 + cali_data->total_sz = 0;
154 + dev_err(p->dev, "%s: V1 CRC error\n", __func__);
155 + return;
156 + }
145 157 }
146 158
147 159 for (j = p->ndev - 1; j >= 0; j--) {