@@ -780,13 +780,6 @@ static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
780
780
sof_sdw_quirk = quirk_entry -> value ;
781
781
}
782
782
783
- static struct snd_soc_dai_link_component platform_component [] = {
784
- {
785
- /* name might be overridden during probe */
786
- .name = "0000:00:1f.3"
787
- }
788
- };
789
-
790
783
static const struct snd_soc_ops sdw_ops = {
791
784
.startup = asoc_sdw_startup ,
792
785
.prepare = asoc_sdw_prepare ,
@@ -836,6 +829,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
836
829
struct snd_soc_dai_link_ch_map * codec_maps ;
837
830
struct snd_soc_dai_link_component * codecs ;
838
831
struct snd_soc_dai_link_component * cpus ;
832
+ struct snd_soc_dai_link_component * platform ;
839
833
int num_cpus = hweight32 (sof_dai -> link_mask [stream ]);
840
834
int num_codecs = sof_dai -> num_devs [stream ];
841
835
int playback , capture ;
@@ -876,6 +870,10 @@ static int create_sdw_dailink(struct snd_soc_card *card,
876
870
if (!codecs )
877
871
return - ENOMEM ;
878
872
873
+ platform = devm_kzalloc (dev , sizeof (* platform ), GFP_KERNEL );
874
+ if (!platform )
875
+ return - ENOMEM ;
876
+
879
877
codec_maps = devm_kcalloc (dev , num_codecs , sizeof (* codec_maps ), GFP_KERNEL );
880
878
if (!codec_maps )
881
879
return - ENOMEM ;
@@ -917,8 +915,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
917
915
capture = (stream == SNDRV_PCM_STREAM_CAPTURE );
918
916
919
917
asoc_sdw_init_dai_link (dev , * dai_links , be_id , name , playback , capture ,
920
- cpus , num_cpus , platform_component ,
921
- ARRAY_SIZE (platform_component ), codecs , num_codecs ,
918
+ cpus , num_cpus , platform , 1 , codecs , num_codecs ,
922
919
1 , asoc_sdw_rtd_init , & sdw_ops );
923
920
924
921
/*
@@ -994,8 +991,7 @@ static int create_ssp_dailinks(struct snd_soc_card *card,
994
991
995
992
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , name ,
996
993
playback , capture , cpu_dai_name ,
997
- platform_component -> name ,
998
- ARRAY_SIZE (platform_component ), codec_name ,
994
+ "dummy" , codec_name ,
999
995
ssp_info -> dais [0 ].dai_name , 1 , NULL ,
1000
996
ssp_info -> ops );
1001
997
if (ret )
@@ -1019,8 +1015,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
1019
1015
1020
1016
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , "dmic01" ,
1021
1017
0 , 1 , // DMIC only supports capture
1022
- "DMIC01 Pin" , platform_component -> name ,
1023
- ARRAY_SIZE (platform_component ),
1018
+ "DMIC01 Pin" , "dummy" ,
1024
1019
"dmic-codec" , "dmic-hifi" , 1 ,
1025
1020
asoc_sdw_dmic_init , NULL );
1026
1021
if (ret )
@@ -1030,8 +1025,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
1030
1025
1031
1026
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , "dmic16k" ,
1032
1027
0 , 1 , // DMIC only supports capture
1033
- "DMIC16k Pin" , platform_component -> name ,
1034
- ARRAY_SIZE (platform_component ),
1028
+ "DMIC16k Pin" , "dummy" ,
1035
1029
"dmic-codec" , "dmic-hifi" , 1 ,
1036
1030
/* don't call asoc_sdw_dmic_init() twice */
1037
1031
NULL , NULL );
@@ -1074,8 +1068,7 @@ static int create_hdmi_dailinks(struct snd_soc_card *card,
1074
1068
1075
1069
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , name ,
1076
1070
1 , 0 , // HDMI only supports playback
1077
- cpu_dai_name , platform_component -> name ,
1078
- ARRAY_SIZE (platform_component ),
1071
+ cpu_dai_name , "dummy" ,
1079
1072
codec_name , codec_dai_name , 1 ,
1080
1073
i == 0 ? sof_sdw_hdmi_init : NULL , NULL );
1081
1074
if (ret )
@@ -1101,8 +1094,7 @@ static int create_bt_dailinks(struct snd_soc_card *card,
1101
1094
int ret ;
1102
1095
1103
1096
ret = asoc_sdw_init_simple_dai_link (dev , * dai_links , be_id , name ,
1104
- 1 , 1 , cpu_dai_name , platform_component -> name ,
1105
- ARRAY_SIZE (platform_component ),
1097
+ 1 , 1 , cpu_dai_name , "dummy" ,
1106
1098
snd_soc_dummy_dlc .name , snd_soc_dummy_dlc .dai_name ,
1107
1099
1 , NULL , NULL );
1108
1100
if (ret )
0 commit comments