Skip to content

Commit db8f726

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 8258520 commit db8f726

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 = 0x5572,
7778
.name_prefix = "tac5572",
7879
.dais = {
@@ -113,6 +114,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
113114
.dai_num = 3,
114115
},
115116
{
117+
.vendor_id = 0x0102,
116118
.part_id = 0x5672,
117119
.name_prefix = "tac5672",
118120
.dais = {
@@ -153,6 +155,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
153155
.dai_num = 3,
154156
},
155157
{
158+
.vendor_id = 0x0102,
156159
.part_id = 0x5682,
157160
.name_prefix = "tac5682",
158161
.dais = {
@@ -193,6 +196,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
193196
.dai_num = 3,
194197
},
195198
{
199+
.vendor_id = 0x0102,
196200
.part_id = 0x2883,
197201
.name_prefix = "tas2883",
198202
.dais = {
@@ -220,6 +224,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
220224
.dai_num = 2,
221225
},
222226
{
227+
.vendor_id = 0x0102,
223228
.part_id = 0x0000, /* TAS2783A */
224229
.name_prefix = "tas2783",
225230
.dais = {
@@ -239,6 +244,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
239244
.dai_num = 1,
240245
},
241246
{
247+
.vendor_id = 0x025d,
242248
.part_id = 0x700,
243249
.name_prefix = "rt700",
244250
.dais = {
@@ -257,6 +263,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
257263
.dai_num = 1,
258264
},
259265
{
266+
.vendor_id = 0x025d,
260267
.part_id = 0x711,
261268
.name_prefix = "rt711",
262269
.version_id = 3,
@@ -278,6 +285,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
278285
.dai_num = 1,
279286
},
280287
{
288+
.vendor_id = 0x025d,
281289
.part_id = 0x711,
282290
.name_prefix = "rt711",
283291
.version_id = 2,
@@ -299,6 +307,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
299307
.dai_num = 1,
300308
},
301309
{
310+
.vendor_id = 0x025d,
302311
.part_id = 0x712,
303312
.name_prefix = "rt712",
304313
.version_id = 3,
@@ -341,6 +350,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
341350
.dai_num = 3,
342351
},
343352
{
353+
.vendor_id = 0x025d,
344354
.part_id = 0x1712,
345355
.name_prefix = "rt712-dmic",
346356
.version_id = 3,
@@ -356,6 +366,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
356366
.dai_num = 1,
357367
},
358368
{
369+
.vendor_id = 0x025d,
359370
.part_id = 0x713,
360371
.name_prefix = "rt713",
361372
.version_id = 3,
@@ -384,6 +395,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
384395
.dai_num = 2,
385396
},
386397
{
398+
.vendor_id = 0x025d,
387399
.part_id = 0x1713,
388400
.name_prefix = "rt713-dmic",
389401
.version_id = 3,
@@ -399,6 +411,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
399411
.dai_num = 1,
400412
},
401413
{
414+
.vendor_id = 0x025d,
402415
.part_id = 0x1308,
403416
.name_prefix = "rt1308",
404417
.acpi_id = "10EC1308",
@@ -422,6 +435,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
422435
.ops = &soc_sdw_rt1308_i2s_ops,
423436
},
424437
{
438+
.vendor_id = 0x025d,
425439
.part_id = 0x1316,
426440
.name_prefix = "rt1316",
427441
.dais = {
@@ -443,6 +457,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
443457
.dai_num = 1,
444458
},
445459
{
460+
.vendor_id = 0x025d,
446461
.part_id = 0x1318,
447462
.name_prefix = "rt1318",
448463
.dais = {
@@ -464,6 +479,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
464479
.dai_num = 1,
465480
},
466481
{
482+
.vendor_id = 0x025d,
467483
.part_id = 0x1320,
468484
.name_prefix = "rt1320",
469485
.dais = {
@@ -485,6 +501,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
485501
.dai_num = 1,
486502
},
487503
{
504+
.vendor_id = 0x025d,
488505
.part_id = 0x1321,
489506
.name_prefix = "rt1320",
490507
.dais = {
@@ -506,6 +523,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
506523
.dai_num = 1,
507524
},
508525
{
526+
.vendor_id = 0x025d,
509527
.part_id = 0x714,
510528
.name_prefix = "rt714",
511529
.version_id = 3,
@@ -522,6 +540,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
522540
.dai_num = 1,
523541
},
524542
{
543+
.vendor_id = 0x025d,
525544
.part_id = 0x715,
526545
.name_prefix = "rt715",
527546
.version_id = 3,
@@ -538,6 +557,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
538557
.dai_num = 1,
539558
},
540559
{
560+
.vendor_id = 0x025d,
541561
.part_id = 0x714,
542562
.name_prefix = "rt714",
543563
.version_id = 2,
@@ -554,6 +574,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
554574
.dai_num = 1,
555575
},
556576
{
577+
.vendor_id = 0x025d,
557578
.part_id = 0x715,
558579
.name_prefix = "rt715",
559580
.version_id = 2,
@@ -570,6 +591,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
570591
.dai_num = 1,
571592
},
572593
{
594+
.vendor_id = 0x025d,
573595
.part_id = 0x721,
574596
.name_prefix = "rt721",
575597
.version_id = 3,
@@ -613,6 +635,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
613635
.dai_num = 3,
614636
},
615637
{
638+
.vendor_id = 0x025d,
616639
.part_id = 0x722,
617640
.name_prefix = "rt722",
618641
.version_id = 3,
@@ -660,6 +683,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
660683
.dai_num = 3,
661684
},
662685
{
686+
.vendor_id = 0x019f,
663687
.part_id = 0x8373,
664688
.name_prefix = "Left",
665689
.dais = {
@@ -680,6 +704,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
680704
.dai_num = 1,
681705
},
682706
{
707+
.vendor_id = 0x019f,
683708
.part_id = 0x8363,
684709
.name_prefix = "Left",
685710
.dais = {
@@ -700,6 +725,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
700725
.dai_num = 1,
701726
},
702727
{
728+
.vendor_id = 0x025d,
703729
.part_id = 0x5682,
704730
.name_prefix = "rt5682",
705731
.dais = {
@@ -718,6 +744,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
718744
.dai_num = 1,
719745
},
720746
{
747+
.vendor_id = 0x01fa,
721748
.part_id = 0x3556,
722749
.name_prefix = "AMP",
723750
.dais = {
@@ -745,6 +772,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
745772
.dai_num = 2,
746773
},
747774
{
775+
.vendor_id = 0x01fa,
748776
.part_id = 0x3557,
749777
.name_prefix = "AMP",
750778
.dais = {
@@ -772,6 +800,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
772800
.dai_num = 2,
773801
},
774802
{
803+
.vendor_id = 0x01fa,
775804
.part_id = 0x3563,
776805
.name_prefix = "AMP",
777806
.dais = {
@@ -799,6 +828,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
799828
.dai_num = 2,
800829
},
801830
{
831+
.vendor_id = 0x01fa,
802832
.part_id = 0x4242,
803833
.name_prefix = "cs42l42",
804834
.dais = {
@@ -817,6 +847,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
817847
.dai_num = 1,
818848
},
819849
{
850+
.vendor_id = 0x01fa,
820851
.part_id = 0x4243,
821852
.name_prefix = "cs42l43",
822853
.count_sidecar = asoc_sdw_bridge_cs35l56_count_sidecar,
@@ -871,6 +902,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
871902
.dai_num = 4,
872903
},
873904
{
905+
.vendor_id = 0x01fa,
874906
.part_id = 0x4245,
875907
.name_prefix = "cs42l45",
876908
.dais = {
@@ -907,6 +939,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
907939
.aux_num = 1,
908940
},
909941
{
942+
.vendor_id = 0x01fa,
910943
.part_id = 0x4747,
911944
.name_prefix = "cs47l47",
912945
.dais = {
@@ -1021,9 +1054,10 @@ EXPORT_SYMBOL_NS(asoc_sdw_get_codec_info_list_count, "SND_SOC_SDW_UTILS");
10211054

10221055
struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr)
10231056
{
1024-
unsigned int part_id, sdw_version;
1057+
unsigned int vendor_id, part_id, sdw_version;
10251058
int i;
10261059

1060+
vendor_id = SDW_MFG_ID(adr);
10271061
part_id = SDW_PART_ID(adr);
10281062
sdw_version = SDW_VERSION(adr);
10291063
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
@@ -1032,6 +1066,7 @@ struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr)
10321066
* version_id is not specified in the codec info.
10331067
*/
10341068
if (part_id == codec_info_list[i].part_id &&
1069+
vendor_id == codec_info_list[i].vendor_id &&
10351070
(!codec_info_list[i].version_id ||
10361071
sdw_version == codec_info_list[i].version_id))
10371072
return &codec_info_list[i];
@@ -1046,6 +1081,7 @@ static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_sdw_id(const struct
10461081

10471082
for (i = 0; i < ARRAY_SIZE(codec_info_list); i++)
10481083
if (id->part_id == codec_info_list[i].part_id &&
1084+
id->mfg_id == codec_info_list[i].vendor_id &&
10491085
(!codec_info_list[i].version_id ||
10501086
id->sdw_version == codec_info_list[i].version_id))
10511087
return &codec_info_list[i];
@@ -1150,8 +1186,8 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
11501186
ret = snd_soc_add_card_controls(card, codec_info->dais[dai_index].controls,
11511187
codec_info->dais[dai_index].num_controls);
11521188
if (ret) {
1153-
dev_err(card->dev, "%#x controls addition failed: %d\n",
1154-
codec_info->part_id, ret);
1189+
dev_err(card->dev, "%#x-%#x controls addition failed: %d\n",
1190+
codec_info->vendor_id, codec_info->part_id, ret);
11551191
return ret;
11561192
}
11571193
}
@@ -1160,8 +1196,8 @@ int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
11601196
codec_info->dais[dai_index].widgets,
11611197
codec_info->dais[dai_index].num_widgets);
11621198
if (ret) {
1163-
dev_err(card->dev, "%#x widgets addition failed: %d\n",
1164-
codec_info->part_id, ret);
1199+
dev_err(card->dev, "%#x-%#x widgets addition failed: %d\n",
1200+
codec_info->vendor_id, codec_info->part_id, ret);
11651201
return ret;
11661202
}
11671203
}

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)