Skip to content

Commit

Permalink
ASoC: Merge up fixes
Browse files Browse the repository at this point in the history
Some of the fixes for the Intel bards overlap with development work that
removed old boards.
  • Loading branch information
Mark Brown committed Aug 23, 2024
2 parents ca39fab + 839a4ec commit b42c0ec
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 10 deletions.
2 changes: 2 additions & 0 deletions sound/soc/amd/acp/acp-sof-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ static const struct platform_device_id board_ids[] = {
},
{ }
};
MODULE_DEVICE_TABLE(platform, board_ids);

static struct platform_driver acp_asoc_audio = {
.driver = {
.name = "sof_mach",
Expand Down
1 change: 1 addition & 0 deletions sound/soc/au1x/db1200.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static const struct platform_device_id db1200_pids[] = {
},
{},
};
MODULE_DEVICE_TABLE(platform, db1200_pids);

/*------------------------- AC97 PART ---------------------------*/

Expand Down
9 changes: 9 additions & 0 deletions sound/soc/codecs/cs-amp-lib-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static void cs_amp_lib_test_init_dummy_cal_blob(struct kunit *test, int num_amps
{
struct cs_amp_lib_test_priv *priv = test->priv;
unsigned int blob_size;
int i;

blob_size = offsetof(struct cirrus_amp_efi_data, data) +
sizeof(struct cirrus_amp_cal_data) * num_amps;
Expand All @@ -49,6 +50,14 @@ static void cs_amp_lib_test_init_dummy_cal_blob(struct kunit *test, int num_amps
priv->cal_blob->count = num_amps;

get_random_bytes(priv->cal_blob->data, sizeof(struct cirrus_amp_cal_data) * num_amps);

/* Ensure all timestamps are non-zero to mark the entry valid. */
for (i = 0; i < num_amps; i++)
priv->cal_blob->data[i].calTime[0] |= 1;

/* Ensure that all UIDs are non-zero and unique. */
for (i = 0; i < num_amps; i++)
*(u8 *)&priv->cal_blob->data[i].calTarget[0] = i + 1;
}

static u64 cs_amp_lib_test_get_target_uid(struct kunit *test)
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/codecs/cs-amp-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid,
for (i = 0; i < efi_data->count; ++i) {
u64 cal_target = cs_amp_cal_target_u64(&efi_data->data[i]);

/* Skip empty entries */
if (!efi_data->data[i].calTime[0] && !efi_data->data[i].calTime[1])
continue;

/* Skip entries with unpopulated silicon ID */
if (cal_target == 0)
continue;
Expand All @@ -193,7 +197,8 @@ static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid,
}
}

if (!cal && (amp_index >= 0) && (amp_index < efi_data->count)) {
if (!cal && (amp_index >= 0) && (amp_index < efi_data->count) &&
(efi_data->data[amp_index].calTime[0] || efi_data->data[amp_index].calTime[1])) {
u64 cal_target = cs_amp_cal_target_u64(&efi_data->data[amp_index]);

/*
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcht_cx2072x.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_cht_cx2072x_dais); i++) {
if (byt_cht_cx2072x_dais[i].codecs->name &&
if (byt_cht_cx2072x_dais[i].num_codecs &&
!strcmp(byt_cht_cx2072x_dais[i].codecs->name,
"i2c-14F10720:00")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcht_da7213.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int bytcht_da7213_probe(struct platform_device *pdev)

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(dailink); i++) {
if (dailink[i].codecs->name &&
if (dailink[i].num_codecs &&
!strcmp(dailink[i].codecs->name, "i2c-DLGS7213:00")) {
dai_index = i;
break;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcht_es8316.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_cht_es8316_dais); i++) {
if (byt_cht_es8316_dais[i].codecs->name &&
if (byt_cht_es8316_dais[i].num_codecs &&
!strcmp(byt_cht_es8316_dais[i].codecs->name,
"i2c-ESSX8316:00")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcr_rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_rt5640_dais); i++) {
if (byt_rt5640_dais[i].codecs->name &&
if (byt_rt5640_dais[i].num_codecs &&
!strcmp(byt_rt5640_dais[i].codecs->name,
"i2c-10EC5640:00")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcr_rt5651.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)

/* fix index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_rt5651_dais); i++) {
if (byt_rt5651_dais[i].codecs->name &&
if (byt_rt5651_dais[i].num_codecs &&
!strcmp(byt_rt5651_dais[i].codecs->name,
"i2c-10EC5651:00")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/bytcr_wm5102.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)

/* find index of codec dai */
for (i = 0; i < ARRAY_SIZE(byt_wm5102_dais); i++) {
if (byt_wm5102_dais[i].codecs->name &&
if (byt_wm5102_dais[i].num_codecs &&
!strcmp(byt_wm5102_dais[i].codecs->name,
"wm5102-codec")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/cht_bsw_rt5645.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)

/* set correct codec name */
for (i = 0; i < ARRAY_SIZE(cht_dailink); i++)
if (cht_dailink[i].codecs->name &&
if (cht_dailink[i].num_codecs &&
!strcmp(cht_dailink[i].codecs->name,
"i2c-10EC5645:00")) {
dai_index = i;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/cht_bsw_rt5672.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)

/* find index of codec dai */
for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) {
if (cht_dailink[i].codecs->name &&
if (cht_dailink[i].num_codecs &&
!strcmp(cht_dailink[i].codecs->name, RT5672_I2C_DEFAULT)) {
dai_index = i;
break;
Expand Down
1 change: 0 additions & 1 deletion sound/soc/intel/common/soc-acpi-intel-cht-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static const struct dmi_system_id lenovo_yoga_tab3_x90[] = {
/* Lenovo Yoga Tab 3 Pro YT3-X90, codec missing from DSDT */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
},
},
Expand Down

0 comments on commit b42c0ec

Please sign in to comment.