Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sound/soc/sdw_utils/soc_sdw_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x0102,
.part_id = 0x0000, /* TAS2783A */
.name_prefix = "tas2783",
.is_amp = true,
.dais = {
{
.direction = {true, true},
Expand Down Expand Up @@ -417,6 +418,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.part_id = 0x1308,
.name_prefix = "rt1308",
.acpi_id = "10EC1308",
.is_amp = true,
.dais = {
{
.direction = {true, false},
Expand All @@ -440,6 +442,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x025d,
.part_id = 0x1316,
.name_prefix = "rt1316",
.is_amp = true,
.dais = {
{
.direction = {true, true},
Expand All @@ -462,6 +465,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x025d,
.part_id = 0x1318,
.name_prefix = "rt1318",
.is_amp = true,
.dais = {
{
.direction = {true, true},
Expand Down Expand Up @@ -712,6 +716,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x019f,
.part_id = 0x8373,
.name_prefix = "Left",
.is_amp = true,
.dais = {
{
.direction = {true, true},
Expand All @@ -733,6 +738,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x019f,
.part_id = 0x8363,
.name_prefix = "Left",
.is_amp = true,
.dais = {
{
.direction = {true, false},
Expand Down Expand Up @@ -773,6 +779,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x01fa,
.part_id = 0x3556,
.name_prefix = "AMP",
.is_amp = true,
.dais = {
{
.direction = {true, false},
Expand Down Expand Up @@ -801,6 +808,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x01fa,
.part_id = 0x3557,
.name_prefix = "AMP",
.is_amp = true,
.dais = {
{
.direction = {true, false},
Expand Down Expand Up @@ -829,6 +837,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x01fa,
.part_id = 0x3563,
.name_prefix = "AMP",
.is_amp = true,
.dais = {
{
.direction = {true, false},
Expand Down Expand Up @@ -1190,6 +1199,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.vendor_id = 0x0105,
.part_id = 0x55aa, /* amplifier mockup */
.name_prefix = "sdw_mockup_amp1",
.is_amp = true,
.version_id = 0,
.dais = {
{
Expand Down
14 changes: 1 addition & 13 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,6 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
struct snd_soc_acpi_adr_device *adr_dev;
const char *name_prefix = "";
int index = link->num_adr;
bool is_amp = true; /* Set it to false if the codec wiah any NON-AMP DAI type */
int ep_index = 0;
int i, j;

Expand Down Expand Up @@ -1216,7 +1215,6 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
endpoints[ep_index].aggregated = 0;
endpoints[ep_index].group_id = 0;
endpoints[ep_index].group_position = 0;
is_amp = false;
}
ep_index++;
}
Expand All @@ -1230,24 +1228,14 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
return NULL;
}

/*
* codec_info_list[].is_amp is a codec-level override: for multi-function
* codecs we must treat the whole codec as an AMP when it is described as
* such in the codec info table, even if some endpoints were detected as
* non-AMP above. Callers/UCM rely on this to keep name_prefix and AMP
* indexing stable and backwards compatible.
*/
if (codec_info_list[i].is_amp)
is_amp = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_amp remain to be set for multi-function devices, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't set is_amp for the multi-function devices and it will be false by default. In other words, is_amp will be false for multi-function devices.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the removed comment said that we must treat the multi-function codecs as AMP, now we are not going to?
Actually if you say that the is_amp never been set then we never complied with this comment?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the removed comment said that we must treat the multi-function codecs as AMP, now we are not going to? Actually if you say that the is_amp never been set then we never complied with this comment?

Sorry, I misunderstood your previous question. Yes, is_amp is set for a few multi-function codecs that must be treated as amps. This commit doesn't change it. So, yes the is_amp remains to be set for a few specific multi-function codecs that need to be treated as an amp.


adr_dev[index].adr = ((u64)sdw_device->id.class_id & 0xFF) |
((u64)sdw_device->id.part_id & 0xFFFF) << 8 |
((u64)sdw_device->id.mfg_id & 0xFFFF) << 24 |
((u64)(sdw_device->id.unique_id & 0xF) << 40) |
((u64)(sdw_device->id.sdw_version & 0xF) << 44) |
((u64)(sdw_device->bus->link_id & 0xF) << 48);

if (!is_amp) {
if (!codec_info_list[i].is_amp) {
/* For non-amp codecs, get name_prefix from codec_info_list[] */
adr_dev[index].name_prefix = devm_kasprintf(dev, GFP_KERNEL, "%s", name_prefix);
goto done_name_prefix;
Expand Down
Loading