Commit 90d1d08
committed
ASoC: sdw_utils: Call init callbacks on the correct codec DAI
asoc_sdw_rtd_init() needs to call the rtd_init() callbacks for each
codec in a dailink. It was finding the codecs by looking for the
matching DAI name in codec_info_list[] but this is broken because the
DAI name isn't guaranteed to be unique. Parts using the same codec
driver (so the same DAI names) might require different machine driver
setup.
An array of pointers to the codec_info[] entries used to construct the
dailink are saved into the private data of the dailink.
Then asoc_sdw_rtd_init() can then use that array to get the correct
information to initialize support for that codec.
The rtd_init() callbacks in the codec_info[] array take a struct
snd_soc_dai, so the codec DAIs created by ASoC must be matched up with
the corresponding codec_info[] entry used to create the dailink. The
DAI name cannot be used for this because multiple parts in codec_info[]
could have the same DAI names. Instead, the order of codec DAI entries
in struct snd_soc_pcm_runtime is expected to be the same as the order
of codec DAIs in struct snd_soc_dai_link->codecs. As the order of
codec DAI entries in struct snd_soc_dai_link->codecs also matches the
order of their corresponding codec_info[] pointers added to the dailink
private data, it follows that there is a 1:1 mapping with the order of
DAIs returned by for_each_rtd_codec_dais(). In other words:
dailink.codec[i]
was created from endpoint[i]
and
dailink private dai_info[i]
was created from endpoint[i].codec_info
so
for_each_rtd_codec_dais(..., i, ...)
corresponds to endpoint[i]
and dai_info[i]
Change-Id: Idde610bfe8909a40b884e07801f7418c57711774
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>1 parent 29d8e5b commit 90d1d08
File tree
5 files changed
+114
-54
lines changed- include/sound
- sound/soc
- amd/acp
- intel/boards
- sdw_utils
5 files changed
+114
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
998 | 998 | | |
999 | 999 | | |
1000 | 1000 | | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1004 | 1007 | | |
1005 | 1008 | | |
1006 | 1009 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
840 | | - | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
841 | 843 | | |
842 | 844 | | |
843 | | - | |
844 | 845 | | |
845 | 846 | | |
846 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
847 | 852 | | |
848 | | - | |
849 | | - | |
850 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
851 | 858 | | |
852 | 859 | | |
853 | 860 | | |
854 | 861 | | |
855 | 862 | | |
856 | 863 | | |
857 | 864 | | |
858 | | - | |
| 865 | + | |
859 | 866 | | |
860 | 867 | | |
| 868 | + | |
| 869 | + | |
861 | 870 | | |
862 | 871 | | |
863 | 872 | | |
| |||
866 | 875 | | |
867 | 876 | | |
868 | 877 | | |
869 | | - | |
870 | | - | |
871 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
872 | 881 | | |
873 | 882 | | |
874 | 883 | | |
875 | 884 | | |
876 | 885 | | |
877 | 886 | | |
878 | | - | |
| 887 | + | |
879 | 888 | | |
880 | | - | |
881 | | - | |
| 889 | + | |
| 890 | + | |
882 | 891 | | |
883 | 892 | | |
884 | 893 | | |
| |||
887 | 896 | | |
888 | 897 | | |
889 | 898 | | |
890 | | - | |
891 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
892 | 905 | | |
893 | 906 | | |
894 | 907 | | |
895 | 908 | | |
896 | 909 | | |
897 | | - | |
898 | | - | |
| 910 | + | |
899 | 911 | | |
900 | 912 | | |
901 | 913 | | |
902 | | - | |
| 914 | + | |
903 | 915 | | |
904 | 916 | | |
905 | 917 | | |
906 | 918 | | |
907 | 919 | | |
908 | | - | |
| 920 | + | |
909 | 921 | | |
910 | 922 | | |
911 | | - | |
912 | | - | |
| 923 | + | |
913 | 924 | | |
914 | 925 | | |
| 926 | + | |
915 | 927 | | |
916 | 928 | | |
917 | 929 | | |
| |||
1194 | 1206 | | |
1195 | 1207 | | |
1196 | 1208 | | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1205 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1206 | 1224 | | |
1207 | 1225 | | |
1208 | 1226 | | |
| |||
1218 | 1236 | | |
1219 | 1237 | | |
1220 | 1238 | | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1221 | 1262 | | |
1222 | 1263 | | |
1223 | 1264 | | |
| |||
1241 | 1282 | | |
1242 | 1283 | | |
1243 | 1284 | | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1249 | 1288 | | |
1250 | 1289 | | |
1251 | 1290 | | |
| |||
1463 | 1502 | | |
1464 | 1503 | | |
1465 | 1504 | | |
1466 | | - | |
| 1505 | + | |
1467 | 1506 | | |
1468 | 1507 | | |
1469 | 1508 | | |
| |||
0 commit comments