Skip to content

Commit bee20fd

Browse files
committed
ASoC: sdw_utils: add vendor_id to asoc_sdw_codec_info
struct asoc_sdw_codec_info has part_id which is not sufficient to uniquely identify devices. This change adds the vendor_id field and updates the codec_info list with the corresponding vendor id as per the Manufacturer's id in https://mid.mipi.org/ Signed-off-by: Niranjan H Y <niranjan.hy@ti.com>
1 parent a3a5425 commit bee20fd

3 files changed

Lines changed: 47 additions & 7 deletions

File tree

include/sound/soc_sdw_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ struct asoc_sdw_aux_info {
7171
};
7272

7373
struct asoc_sdw_codec_info {
74+
const int vendor_id;
7475
const int part_id;
7576
const int version_id;
7677
const char *name_prefix;

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const struct snd_kcontrol_new rt700_controls[] = {
7373

7474
struct asoc_sdw_codec_info codec_info_list[] = {
7575
{
76+
.vendor_id = 0x0102,
7677
.part_id = 0x0000, /* TAS2783A */
7778
.name_prefix = "tas2783",
7879
.dais = {
@@ -92,6 +93,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
9293
.dai_num = 1,
9394
},
9495
{
96+
.vendor_id = 0x025d,
9597
.part_id = 0x700,
9698
.name_prefix = "rt700",
9799
.dais = {
@@ -110,6 +112,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
110112
.dai_num = 1,
111113
},
112114
{
115+
.vendor_id = 0x025d,
113116
.part_id = 0x711,
114117
.name_prefix = "rt711",
115118
.version_id = 3,
@@ -131,6 +134,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
131134
.dai_num = 1,
132135
},
133136
{
137+
.vendor_id = 0x025d,
134138
.part_id = 0x711,
135139
.name_prefix = "rt711",
136140
.version_id = 2,
@@ -152,6 +156,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
152156
.dai_num = 1,
153157
},
154158
{
159+
.vendor_id = 0x025d,
155160
.part_id = 0x712,
156161
.name_prefix = "rt712",
157162
.version_id = 3,
@@ -194,6 +199,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
194199
.dai_num = 3,
195200
},
196201
{
202+
.vendor_id = 0x025d,
197203
.part_id = 0x1712,
198204
.name_prefix = "rt712-dmic",
199205
.version_id = 3,
@@ -209,6 +215,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
209215
.dai_num = 1,
210216
},
211217
{
218+
.vendor_id = 0x025d,
212219
.part_id = 0x713,
213220
.name_prefix = "rt713",
214221
.version_id = 3,
@@ -237,6 +244,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
237244
.dai_num = 2,
238245
},
239246
{
247+
.vendor_id = 0x025d,
240248
.part_id = 0x1713,
241249
.name_prefix = "rt713-dmic",
242250
.version_id = 3,
@@ -252,6 +260,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
252260
.dai_num = 1,
253261
},
254262
{
263+
.vendor_id = 0x025d,
255264
.part_id = 0x1308,
256265
.name_prefix = "rt1308",
257266
.acpi_id = "10EC1308",
@@ -275,6 +284,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
275284
.ops = &soc_sdw_rt1308_i2s_ops,
276285
},
277286
{
287+
.vendor_id = 0x025d,
278288
.part_id = 0x1316,
279289
.name_prefix = "rt1316",
280290
.dais = {
@@ -296,6 +306,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
296306
.dai_num = 1,
297307
},
298308
{
309+
.vendor_id = 0x025d,
299310
.part_id = 0x1318,
300311
.name_prefix = "rt1318",
301312
.dais = {
@@ -317,6 +328,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
317328
.dai_num = 1,
318329
},
319330
{
331+
.vendor_id = 0x025d,
320332
.part_id = 0x1320,
321333
.name_prefix = "rt1320",
322334
.dais = {
@@ -338,6 +350,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
338350
.dai_num = 1,
339351
},
340352
{
353+
.vendor_id = 0x025d,
341354
.part_id = 0x1321,
342355
.name_prefix = "rt1320",
343356
.dais = {
@@ -359,6 +372,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
359372
.dai_num = 1,
360373
},
361374
{
375+
.vendor_id = 0x025d,
362376
.part_id = 0x714,
363377
.name_prefix = "rt714",
364378
.version_id = 3,
@@ -375,6 +389,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
375389
.dai_num = 1,
376390
},
377391
{
392+
.vendor_id = 0x025d,
378393
.part_id = 0x715,
379394
.name_prefix = "rt715",
380395
.version_id = 3,
@@ -391,6 +406,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
391406
.dai_num = 1,
392407
},
393408
{
409+
.vendor_id = 0x025d,
394410
.part_id = 0x714,
395411
.name_prefix = "rt714",
396412
.version_id = 2,
@@ -407,6 +423,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
407423
.dai_num = 1,
408424
},
409425
{
426+
.vendor_id = 0x025d,
410427
.part_id = 0x715,
411428
.name_prefix = "rt715",
412429
.version_id = 2,
@@ -423,6 +440,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
423440
.dai_num = 1,
424441
},
425442
{
443+
.vendor_id = 0x025d,
426444
.part_id = 0x721,
427445
.name_prefix = "rt721",
428446
.version_id = 3,
@@ -466,6 +484,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
466484
.dai_num = 3,
467485
},
468486
{
487+
.vendor_id = 0x025d,
469488
.part_id = 0x722,
470489
.name_prefix = "rt722",
471490
.version_id = 3,
@@ -513,6 +532,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
513532
.dai_num = 3,
514533
},
515534
{
535+
.vendor_id = 0x019f,
516536
.part_id = 0x8373,
517537
.name_prefix = "Left",
518538
.dais = {
@@ -533,6 +553,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
533553
.dai_num = 1,
534554
},
535555
{
556+
.vendor_id = 0x019f,
536557
.part_id = 0x8363,
537558
.name_prefix = "Left",
538559
.dais = {
@@ -553,6 +574,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
553574
.dai_num = 1,
554575
},
555576
{
577+
.vendor_id = 0x025d,
556578
.part_id = 0x5682,
557579
.name_prefix = "rt5682",
558580
.dais = {
@@ -571,6 +593,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
571593
.dai_num = 1,
572594
},
573595
{
596+
.vendor_id = 0x01fa,
574597
.part_id = 0x3556,
575598
.name_prefix = "AMP",
576599
.dais = {
@@ -598,6 +621,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
598621
.dai_num = 2,
599622
},
600623
{
624+
.vendor_id = 0x01fa,
601625
.part_id = 0x3557,
602626
.name_prefix = "AMP",
603627
.dais = {
@@ -625,6 +649,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
625649
.dai_num = 2,
626650
},
627651
{
652+
.vendor_id = 0x01fa,
628653
.part_id = 0x3563,
629654
.name_prefix = "AMP",
630655
.dais = {
@@ -652,6 +677,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
652677
.dai_num = 2,
653678
},
654679
{
680+
.vendor_id = 0x01fa,
655681
.part_id = 0x4242,
656682
.name_prefix = "cs42l42",
657683
.dais = {
@@ -670,6 +696,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
670696
.dai_num = 1,
671697
},
672698
{
699+
.vendor_id = 0x01fa,
673700
.part_id = 0x4243,
674701
.name_prefix = "cs42l43",
675702
.count_sidecar = asoc_sdw_bridge_cs35l56_count_sidecar,
@@ -724,6 +751,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
724751
.dai_num = 4,
725752
},
726753
{
754+
.vendor_id = 0x01fa,
727755
.part_id = 0x4245,
728756
.name_prefix = "cs42l45",
729757
.dais = {
@@ -760,6 +788,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
760788
.aux_num = 1,
761789
},
762790
{
791+
.vendor_id = 0x01fa,
763792
.part_id = 0x4747,
764793
.name_prefix = "cs47l47",
765794
.dais = {
@@ -796,6 +825,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
796825
.aux_num = 1,
797826
},
798827
{
828+
.vendor_id = 0x0105,
799829
.part_id = 0xaaaa, /* generic codec mockup */
800830
.name_prefix = "sdw_mockup_mmulti-function",
801831
.version_id = 0,
@@ -822,6 +852,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
822852
.dai_num = 3,
823853
},
824854
{
855+
.vendor_id = 0x0105,
825856
.part_id = 0xaa55, /* headset codec mockup */
826857
.name_prefix = "sdw_mockup_headset0",
827858
.version_id = 0,
@@ -836,6 +867,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
836867
.dai_num = 1,
837868
},
838869
{
870+
.vendor_id = 0x0105,
839871
.part_id = 0x55aa, /* amplifier mockup */
840872
.name_prefix = "sdw_mockup_amp1",
841873
.version_id = 0,
@@ -850,6 +882,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
850882
.dai_num = 1,
851883
},
852884
{
885+
.vendor_id = 0x0105,
853886
.part_id = 0x5555,
854887
.name_prefix = "sdw_mockup_mic0",
855888
.version_id = 0,
@@ -874,9 +907,10 @@ EXPORT_SYMBOL_NS(asoc_sdw_get_codec_info_list_count, "SND_SOC_SDW_UTILS");
874907

875908
struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr)
876909
{
877-
unsigned int part_id, sdw_version;
910+
unsigned int vendor_id, part_id, sdw_version;
878911
int i;
879912

913+
vendor_id = SDW_MFG_ID(adr);
880914
part_id = SDW_PART_ID(adr);
881915
sdw_version = SDW_VERSION(adr);
882916
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
@@ -885,6 +919,7 @@ struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr)
885919
* version_id is not specified in the codec info.
886920
*/
887921
if (part_id == codec_info_list[i].part_id &&
922+
vendor_id == codec_info_list[i].vendor_id &&
888923
(!codec_info_list[i].version_id ||
889924
sdw_version == codec_info_list[i].version_id))
890925
return &codec_info_list[i];
@@ -899,6 +934,7 @@ static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_sdw_id(const struct
899934

900935
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
901936
if (id->part_id == codec_info_list[i].part_id &&
937+
id->mfg_id == codec_info_list[i].vendor_id &&
902938
(!codec_info_list[i].version_id ||
903939
id->sdw_version == codec_info_list[i].version_id))
904940
return &codec_info_list[i];
@@ -1003,8 +1039,8 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
10031039
ret = snd_soc_add_card_controls(card, codec_info->dais[dai_index].controls,
10041040
codec_info->dais[dai_index].num_controls);
10051041
if (ret) {
1006-
dev_err(card->dev, "%#x controls addition failed: %d\n",
1007-
codec_info->part_id, ret);
1042+
dev_err(card->dev, "%#x-%#x controls addition failed: %d\n",
1043+
codec_info->vendor_id, codec_info->part_id, ret);
10081044
return ret;
10091045
}
10101046
}
@@ -1013,8 +1049,8 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
10131049
codec_info->dais[dai_index].widgets,
10141050
codec_info->dais[dai_index].num_widgets);
10151051
if (ret) {
1016-
dev_err(card->dev, "%#x widgets addition failed: %d\n",
1017-
codec_info->part_id, ret);
1052+
dev_err(card->dev, "%#x-%#x widgets addition failed: %d\n",
1053+
codec_info->vendor_id, codec_info->part_id, ret);
10181054
return ret;
10191055
}
10201056
}

sound/soc/sof/intel/hda.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,9 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
11791179
struct snd_soc_acpi_endpoint *endpoints;
11801180
int amp_group_id = 1;
11811181

1182+
if (sdw_device->id.mfg_id != codec_info_list[i].vendor_id)
1183+
continue;
1184+
11821185
if (sdw_device->id.part_id != codec_info_list[i].part_id)
11831186
continue;
11841187

@@ -1193,8 +1196,8 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
11931196
* dereference
11941197
*/
11951198
if (!name_prefix) {
1196-
dev_err(dev, "codec_info_list name_prefix of part id %#x is missing\n",
1197-
codec_info_list[i].part_id);
1199+
dev_err(dev, "codec_info_list name_prefix of part id %#x-%#x is missing\n",
1200+
codec_info_list[i].vendor_id, codec_info_list[i].part_id);
11981201
return NULL;
11991202
}
12001203
for (j = 0; j < codec_info_list[i].dai_num; j++) {

0 commit comments

Comments
 (0)