@@ -824,15 +824,15 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
824
824
{
825
825
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
826
826
struct sdw_intel * sdw = cdns_to_intel (cdns );
827
- struct sdw_cdns_dma_data * dma ;
827
+ struct sdw_cdns_dai_runtime * dai_runtime ;
828
828
struct sdw_cdns_pdi * pdi ;
829
829
struct sdw_stream_config sconfig ;
830
830
struct sdw_port_config * pconfig ;
831
831
int ch , dir ;
832
832
int ret ;
833
833
834
- dma = snd_soc_dai_get_dma_data (dai , substream );
835
- if (!dma )
834
+ dai_runtime = snd_soc_dai_get_dma_data (dai , substream );
835
+ if (!dai_runtime )
836
836
return - EIO ;
837
837
838
838
ch = params_channels (params );
@@ -854,10 +854,10 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
854
854
sdw_cdns_config_stream (cdns , ch , dir , pdi );
855
855
856
856
/* store pdi and hw_params, may be needed in prepare step */
857
- dma -> paused = false;
858
- dma -> suspended = false;
859
- dma -> pdi = pdi ;
860
- dma -> hw_params = params ;
857
+ dai_runtime -> paused = false;
858
+ dai_runtime -> suspended = false;
859
+ dai_runtime -> pdi = pdi ;
860
+ dai_runtime -> hw_params = params ;
861
861
862
862
/* Inform DSP about PDI stream number */
863
863
ret = intel_params_stream (sdw , substream -> stream , dai , params ,
@@ -869,7 +869,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
869
869
sconfig .direction = dir ;
870
870
sconfig .ch_count = ch ;
871
871
sconfig .frame_rate = params_rate (params );
872
- sconfig .type = dma -> stream_type ;
872
+ sconfig .type = dai_runtime -> stream_type ;
873
873
874
874
sconfig .bps = snd_pcm_format_width (params_format (params ));
875
875
@@ -884,7 +884,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
884
884
pconfig -> ch_mask = (1 << ch ) - 1 ;
885
885
886
886
ret = sdw_stream_add_master (& cdns -> bus , & sconfig ,
887
- pconfig , 1 , dma -> stream );
887
+ pconfig , 1 , dai_runtime -> stream );
888
888
if (ret )
889
889
dev_err (cdns -> dev , "add master to stream failed:%d\n" , ret );
890
890
@@ -898,19 +898,19 @@ static int intel_prepare(struct snd_pcm_substream *substream,
898
898
{
899
899
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
900
900
struct sdw_intel * sdw = cdns_to_intel (cdns );
901
- struct sdw_cdns_dma_data * dma ;
901
+ struct sdw_cdns_dai_runtime * dai_runtime ;
902
902
int ch , dir ;
903
903
int ret = 0 ;
904
904
905
- dma = snd_soc_dai_get_dma_data (dai , substream );
906
- if (!dma ) {
907
- dev_err (dai -> dev , "failed to get dma data in %s\n" ,
905
+ dai_runtime = snd_soc_dai_get_dma_data (dai , substream );
906
+ if (!dai_runtime ) {
907
+ dev_err (dai -> dev , "failed to get dai runtime in %s\n" ,
908
908
__func__ );
909
909
return - EIO ;
910
910
}
911
911
912
- if (dma -> suspended ) {
913
- dma -> suspended = false;
912
+ if (dai_runtime -> suspended ) {
913
+ dai_runtime -> suspended = false;
914
914
915
915
/*
916
916
* .prepare() is called after system resume, where we
@@ -921,21 +921,21 @@ static int intel_prepare(struct snd_pcm_substream *substream,
921
921
*/
922
922
923
923
/* configure stream */
924
- ch = params_channels (dma -> hw_params );
924
+ ch = params_channels (dai_runtime -> hw_params );
925
925
if (substream -> stream == SNDRV_PCM_STREAM_CAPTURE )
926
926
dir = SDW_DATA_DIR_RX ;
927
927
else
928
928
dir = SDW_DATA_DIR_TX ;
929
929
930
- intel_pdi_shim_configure (sdw , dma -> pdi );
931
- intel_pdi_alh_configure (sdw , dma -> pdi );
932
- sdw_cdns_config_stream (cdns , ch , dir , dma -> pdi );
930
+ intel_pdi_shim_configure (sdw , dai_runtime -> pdi );
931
+ intel_pdi_alh_configure (sdw , dai_runtime -> pdi );
932
+ sdw_cdns_config_stream (cdns , ch , dir , dai_runtime -> pdi );
933
933
934
934
/* Inform DSP about PDI stream number */
935
935
ret = intel_params_stream (sdw , substream -> stream , dai ,
936
- dma -> hw_params ,
936
+ dai_runtime -> hw_params ,
937
937
sdw -> instance ,
938
- dma -> pdi -> intel_alh_id );
938
+ dai_runtime -> pdi -> intel_alh_id );
939
939
}
940
940
941
941
return ret ;
@@ -946,11 +946,11 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
946
946
{
947
947
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
948
948
struct sdw_intel * sdw = cdns_to_intel (cdns );
949
- struct sdw_cdns_dma_data * dma ;
949
+ struct sdw_cdns_dai_runtime * dai_runtime ;
950
950
int ret ;
951
951
952
- dma = snd_soc_dai_get_dma_data (dai , substream );
953
- if (!dma )
952
+ dai_runtime = snd_soc_dai_get_dma_data (dai , substream );
953
+ if (!dai_runtime )
954
954
return - EIO ;
955
955
956
956
/*
@@ -959,10 +959,10 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
959
959
* DEPREPARED for the first cpu-dai and to RELEASED for the last
960
960
* cpu-dai.
961
961
*/
962
- ret = sdw_stream_remove_master (& cdns -> bus , dma -> stream );
962
+ ret = sdw_stream_remove_master (& cdns -> bus , dai_runtime -> stream );
963
963
if (ret < 0 ) {
964
964
dev_err (dai -> dev , "remove master from stream %s failed: %d\n" ,
965
- dma -> stream -> name , ret );
965
+ dai_runtime -> stream -> name , ret );
966
966
return ret ;
967
967
}
968
968
@@ -972,8 +972,8 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
972
972
return ret ;
973
973
}
974
974
975
- dma -> hw_params = NULL ;
976
- dma -> pdi = NULL ;
975
+ dai_runtime -> hw_params = NULL ;
976
+ dai_runtime -> pdi = NULL ;
977
977
978
978
return 0 ;
979
979
}
@@ -996,25 +996,25 @@ static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai,
996
996
static void * intel_get_sdw_stream (struct snd_soc_dai * dai ,
997
997
int direction )
998
998
{
999
- struct sdw_cdns_dma_data * dma ;
999
+ struct sdw_cdns_dai_runtime * dai_runtime ;
1000
1000
1001
1001
if (direction == SNDRV_PCM_STREAM_PLAYBACK )
1002
- dma = dai -> playback_dma_data ;
1002
+ dai_runtime = dai -> playback_dma_data ;
1003
1003
else
1004
- dma = dai -> capture_dma_data ;
1004
+ dai_runtime = dai -> capture_dma_data ;
1005
1005
1006
- if (!dma )
1006
+ if (!dai_runtime )
1007
1007
return ERR_PTR (- EINVAL );
1008
1008
1009
- return dma -> stream ;
1009
+ return dai_runtime -> stream ;
1010
1010
}
1011
1011
1012
1012
static int intel_trigger (struct snd_pcm_substream * substream , int cmd , struct snd_soc_dai * dai )
1013
1013
{
1014
1014
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
1015
1015
struct sdw_intel * sdw = cdns_to_intel (cdns );
1016
1016
struct sdw_intel_link_res * res = sdw -> link_res ;
1017
- struct sdw_cdns_dma_data * dma ;
1017
+ struct sdw_cdns_dai_runtime * dai_runtime ;
1018
1018
int ret = 0 ;
1019
1019
1020
1020
/*
@@ -1025,9 +1025,9 @@ static int intel_trigger(struct snd_pcm_substream *substream, int cmd, struct sn
1025
1025
if (res -> ops && res -> ops -> trigger )
1026
1026
res -> ops -> trigger (dai , cmd , substream -> stream );
1027
1027
1028
- dma = snd_soc_dai_get_dma_data (dai , substream );
1029
- if (!dma ) {
1030
- dev_err (dai -> dev , "failed to get dma data in %s\n" ,
1028
+ dai_runtime = snd_soc_dai_get_dma_data (dai , substream );
1029
+ if (!dai_runtime ) {
1030
+ dev_err (dai -> dev , "failed to get dai runtime in %s\n" ,
1031
1031
__func__ );
1032
1032
return - EIO ;
1033
1033
}
@@ -1042,17 +1042,17 @@ static int intel_trigger(struct snd_pcm_substream *substream, int cmd, struct sn
1042
1042
* the .trigger callback is used to track the suspend case only.
1043
1043
*/
1044
1044
1045
- dma -> suspended = true;
1045
+ dai_runtime -> suspended = true;
1046
1046
1047
1047
ret = intel_free_stream (sdw , substream -> stream , dai , sdw -> instance );
1048
1048
break ;
1049
1049
1050
1050
case SNDRV_PCM_TRIGGER_PAUSE_PUSH :
1051
- dma -> paused = true;
1051
+ dai_runtime -> paused = true;
1052
1052
break ;
1053
1053
case SNDRV_PCM_TRIGGER_STOP :
1054
1054
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :
1055
- dma -> paused = false;
1055
+ dai_runtime -> paused = false;
1056
1056
break ;
1057
1057
default :
1058
1058
break ;
@@ -1091,25 +1091,25 @@ static int intel_component_dais_suspend(struct snd_soc_component *component)
1091
1091
for_each_component_dais (component , dai ) {
1092
1092
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
1093
1093
struct sdw_intel * sdw = cdns_to_intel (cdns );
1094
- struct sdw_cdns_dma_data * dma ;
1094
+ struct sdw_cdns_dai_runtime * dai_runtime ;
1095
1095
int stream ;
1096
1096
int ret ;
1097
1097
1098
- dma = dai -> playback_dma_data ;
1098
+ dai_runtime = dai -> playback_dma_data ;
1099
1099
stream = SNDRV_PCM_STREAM_PLAYBACK ;
1100
- if (!dma ) {
1101
- dma = dai -> capture_dma_data ;
1100
+ if (!dai_runtime ) {
1101
+ dai_runtime = dai -> capture_dma_data ;
1102
1102
stream = SNDRV_PCM_STREAM_CAPTURE ;
1103
1103
}
1104
1104
1105
- if (!dma )
1105
+ if (!dai_runtime )
1106
1106
continue ;
1107
1107
1108
- if (dma -> suspended )
1108
+ if (dai_runtime -> suspended )
1109
1109
continue ;
1110
1110
1111
- if (dma -> paused ) {
1112
- dma -> suspended = true;
1111
+ if (dai_runtime -> paused ) {
1112
+ dai_runtime -> suspended = true;
1113
1113
1114
1114
ret = intel_free_stream (sdw , stream , dai , sdw -> instance );
1115
1115
if (ret < 0 )
0 commit comments