@@ -694,7 +694,7 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
694
694
return 0 ;
695
695
}
696
696
697
- static struct snd_soc_dai_driver fsl_sai_dai = {
697
+ static struct snd_soc_dai_driver fsl_sai_dai_template = {
698
698
.probe = fsl_sai_dai_probe ,
699
699
.playback = {
700
700
.stream_name = "CPU-Playback" ,
@@ -965,12 +965,15 @@ static int fsl_sai_probe(struct platform_device *pdev)
965
965
return ret ;
966
966
}
967
967
968
+ memcpy (& sai -> cpu_dai_drv , & fsl_sai_dai_template ,
969
+ sizeof (fsl_sai_dai_template ));
970
+
968
971
/* Sync Tx with Rx as default by following old DT binding */
969
972
sai -> synchronous [RX ] = true;
970
973
sai -> synchronous [TX ] = false;
971
- fsl_sai_dai .symmetric_rates = 1 ;
972
- fsl_sai_dai .symmetric_channels = 1 ;
973
- fsl_sai_dai .symmetric_samplebits = 1 ;
974
+ sai -> cpu_dai_drv .symmetric_rates = 1 ;
975
+ sai -> cpu_dai_drv .symmetric_channels = 1 ;
976
+ sai -> cpu_dai_drv .symmetric_samplebits = 1 ;
974
977
975
978
if (of_find_property (np , "fsl,sai-synchronous-rx" , NULL ) &&
976
979
of_find_property (np , "fsl,sai-asynchronous" , NULL )) {
@@ -987,9 +990,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
987
990
/* Discard all settings for asynchronous mode */
988
991
sai -> synchronous [RX ] = false;
989
992
sai -> synchronous [TX ] = false;
990
- fsl_sai_dai .symmetric_rates = 0 ;
991
- fsl_sai_dai .symmetric_channels = 0 ;
992
- fsl_sai_dai .symmetric_samplebits = 0 ;
993
+ sai -> cpu_dai_drv .symmetric_rates = 0 ;
994
+ sai -> cpu_dai_drv .symmetric_channels = 0 ;
995
+ sai -> cpu_dai_drv .symmetric_samplebits = 0 ;
993
996
}
994
997
995
998
if (of_find_property (np , "fsl,sai-mclk-direction-output" , NULL ) &&
@@ -1018,7 +1021,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
1018
1021
pm_runtime_enable (& pdev -> dev );
1019
1022
1020
1023
ret = devm_snd_soc_register_component (& pdev -> dev , & fsl_component ,
1021
- & fsl_sai_dai , 1 );
1024
+ & sai -> cpu_dai_drv , 1 );
1022
1025
if (ret )
1023
1026
goto err_pm_disable ;
1024
1027
0 commit comments