History

ASoC: SOF: Intel: Add a is_amp flag to fix the wrong name prefix

According to the Intel sof design, it will create the name prefix appended with amp index for the amp codec only, such as: rt1318-1, rt1318-2, etc... But the rt1320 is a codec with amp and mic codec functions, it doesn't have the amp index in its name prefix as above. And then it will be hard to identify the codec if in multi-rt1320 case. So we add a flag to force the amp index to be appended.

Derek Fang committed 7 months ago

Commit dd4a1961 parent 9033f7b2 files · +12 −0Browse files

Unified · Split

2 files
  1. include/sound/soc_sdw_utils.h +2 −0
  2. sound/soc/sof/intel/hda.c +10 −0
include/sound/soc_sdw_utils.h+2−0
@@ -83,6 +83,8 @@ struct asoc_sdw_codec_info { · 82 unmodified lines
8383 const int dai_num;
8484 struct asoc_sdw_aux_info auxs[SOC_SDW_MAX_AUX_NUM];
8585 const int aux_num;
86+ /* Force AMP-style name_prefix handling (append AMP index) even if MIC/Jack DAIs exist */
87+ const bool is_amp;
8688
8789 int (*codec_card_late_probe)(struct snd_soc_card *card);
8890
sound/soc/sof/intel/hda.c+10−0
@@ -1232,6 +1232,16 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev, · 1231 unmodified lines
12321232 return NULL;
12331233 }
12341234
1235+ /*
1236+ * codec_info_list[].is_amp is a codec-level override: for multi-function
1237+ * codecs we must treat the whole codec as an AMP when it is described as
1238+ * such in the codec info table, even if some endpoints were detected as
1239+ * non-AMP above. Callers/UCM rely on this to keep name_prefix and AMP
1240+ * indexing stable and backwards compatible.
1241+ */
1242+ if (codec_info_list[i].is_amp)
1243+ is_amp = true;
1244+
12351245 adr_dev[index].adr = ((u64)sdw_device->id.class_id & 0xFF) |
12361246 ((u64)sdw_device->id.part_id & 0xFFFF) << 8 |
12371247 ((u64)sdw_device->id.mfg_id & 0xFFFF) << 24 |

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t