Skip to content

Commit e5a00da

Browse files
soyersoyertiwai
authored andcommitted
ALSA: hda: tas2781: fix tas2563 EFI data endianness
Before conversion to unify the calibration data management, the tas2563_apply_calib() function performed the big endian conversion and wrote the calibration data to the device. The writing is now done by the common tasdev_load_calibrated_data() function, but without conversion. Put the values into the calibration data buffer with the expected endianness. Fixes: 4fe2385 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib") Cc: <[email protected]> Signed-off-by: Gergo Koteles <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent aea3493 commit e5a00da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ static int tas2563_save_calibration(struct tas2781_hda *h)
310310
struct cali_reg *r = &cd->cali_reg_array;
311311
unsigned int offset = 0;
312312
unsigned char *data;
313+
__be32 bedata;
313314
efi_status_t status;
314315
unsigned int attr;
315316
int ret, i, j, k;
@@ -351,6 +352,8 @@ static int tas2563_save_calibration(struct tas2781_hda *h)
351352
i, j, status);
352353
return -EINVAL;
353354
}
355+
bedata = cpu_to_be32(*(uint32_t *)&data[offset]);
356+
memcpy(&data[offset], &bedata, sizeof(bedata));
354357
offset += TAS2563_CAL_DATA_SIZE;
355358
}
356359
}

0 commit comments

Comments
 (0)