diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2013-12-20 08:11:35 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-08 12:20:32 -0500 |
commit | a5a7ee7c98bc2a7d0324de661778783ab2c29343 (patch) | |
tree | a870fcfb5826979acd20794b54ebae3476a4dc97 /sound/soc/fsl | |
parent | 6de8387905a69568489284b4660737eebb0db8cf (diff) |
ASoC: fsl-ssi: Drop ac97 specific trigger function
The normal trigger function can now be used for AC97. Drop AC97 trigger
function.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index a96ab4e60652..94dedcb0868d 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -1052,6 +1052,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
1052 | { | 1052 | { |
1053 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 1053 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
1054 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); | 1054 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai); |
1055 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | ||
1055 | unsigned long flags; | 1056 | unsigned long flags; |
1056 | 1057 | ||
1057 | switch (cmd) { | 1058 | switch (cmd) { |
@@ -1082,6 +1083,12 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, | |||
1082 | return -EINVAL; | 1083 | return -EINVAL; |
1083 | } | 1084 | } |
1084 | 1085 | ||
1086 | if (ssi_private->imx_ac97) { | ||
1087 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1088 | write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor); | ||
1089 | else | ||
1090 | write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor); | ||
1091 | } | ||
1085 | 1092 | ||
1086 | return 0; | 1093 | return 0; |
1087 | } | 1094 | } |
@@ -1129,58 +1136,6 @@ static const struct snd_soc_component_driver fsl_ssi_component = { | |||
1129 | .name = "fsl-ssi", | 1136 | .name = "fsl-ssi", |
1130 | }; | 1137 | }; |
1131 | 1138 | ||
1132 | /** | ||
1133 | * fsl_ssi_ac97_trigger: start and stop the AC97 receive/transmit. | ||
1134 | * | ||
1135 | * This function is called by ALSA to start, stop, pause, and resume the | ||
1136 | * transfer of data. | ||
1137 | */ | ||
1138 | static int fsl_ssi_ac97_trigger(struct snd_pcm_substream *substream, int cmd, | ||
1139 | struct snd_soc_dai *dai) | ||
1140 | { | ||
1141 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
1142 | struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata( | ||
1143 | rtd->cpu_dai); | ||
1144 | struct ccsr_ssi __iomem *ssi = ssi_private->ssi; | ||
1145 | |||
1146 | switch (cmd) { | ||
1147 | case SNDRV_PCM_TRIGGER_START: | ||
1148 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | ||
1149 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1150 | write_ssi_mask(&ssi->sier, 0, CCSR_SSI_SIER_TIE | | ||
1151 | CCSR_SSI_SIER_TFE0_EN); | ||
1152 | else | ||
1153 | write_ssi_mask(&ssi->sier, 0, CCSR_SSI_SIER_RIE | | ||
1154 | CCSR_SSI_SIER_RFF0_EN); | ||
1155 | break; | ||
1156 | |||
1157 | case SNDRV_PCM_TRIGGER_STOP: | ||
1158 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | ||
1159 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1160 | write_ssi_mask(&ssi->sier, CCSR_SSI_SIER_TIE | | ||
1161 | CCSR_SSI_SIER_TFE0_EN, 0); | ||
1162 | else | ||
1163 | write_ssi_mask(&ssi->sier, CCSR_SSI_SIER_RIE | | ||
1164 | CCSR_SSI_SIER_RFF0_EN, 0); | ||
1165 | break; | ||
1166 | |||
1167 | default: | ||
1168 | return -EINVAL; | ||
1169 | } | ||
1170 | |||
1171 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1172 | write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor); | ||
1173 | else | ||
1174 | write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor); | ||
1175 | |||
1176 | return 0; | ||
1177 | } | ||
1178 | |||
1179 | static const struct snd_soc_dai_ops fsl_ssi_ac97_dai_ops = { | ||
1180 | .startup = fsl_ssi_startup, | ||
1181 | .trigger = fsl_ssi_ac97_trigger, | ||
1182 | }; | ||
1183 | |||
1184 | static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { | 1139 | static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { |
1185 | .ac97_control = 1, | 1140 | .ac97_control = 1, |
1186 | .playback = { | 1141 | .playback = { |
@@ -1197,7 +1152,7 @@ static struct snd_soc_dai_driver fsl_ssi_ac97_dai = { | |||
1197 | .rates = SNDRV_PCM_RATE_48000, | 1152 | .rates = SNDRV_PCM_RATE_48000, |
1198 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 1153 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
1199 | }, | 1154 | }, |
1200 | .ops = &fsl_ssi_ac97_dai_ops, | 1155 | .ops = &fsl_ssi_dai_ops, |
1201 | }; | 1156 | }; |
1202 | 1157 | ||
1203 | 1158 | ||