diff options
| -rw-r--r-- | sound/soc/sh/fsi.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 6efe6c9a41f6..bddc353254ac 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
| @@ -211,8 +211,7 @@ struct fsi_priv { | |||
| 211 | struct fsi_stream playback; | 211 | struct fsi_stream playback; |
| 212 | struct fsi_stream capture; | 212 | struct fsi_stream capture; |
| 213 | 213 | ||
| 214 | u32 do_fmt; | 214 | u32 fmt; |
| 215 | u32 di_fmt; | ||
| 216 | 215 | ||
| 217 | int chan_num:16; | 216 | int chan_num:16; |
| 218 | int clk_master:1; | 217 | int clk_master:1; |
| @@ -1191,8 +1190,8 @@ static int fsi_hw_startup(struct fsi_priv *fsi, | |||
| 1191 | fsi_reg_write(fsi, CKG2, data); | 1190 | fsi_reg_write(fsi, CKG2, data); |
| 1192 | 1191 | ||
| 1193 | /* set format */ | 1192 | /* set format */ |
| 1194 | fsi_reg_write(fsi, DO_FMT, fsi->do_fmt); | 1193 | fsi_reg_write(fsi, DO_FMT, fsi->fmt); |
| 1195 | fsi_reg_write(fsi, DI_FMT, fsi->di_fmt); | 1194 | fsi_reg_write(fsi, DI_FMT, fsi->fmt); |
| 1196 | 1195 | ||
| 1197 | /* spdif ? */ | 1196 | /* spdif ? */ |
| 1198 | if (fsi_is_spdif(fsi)) { | 1197 | if (fsi_is_spdif(fsi)) { |
| @@ -1270,42 +1269,33 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd, | |||
| 1270 | 1269 | ||
| 1271 | static int fsi_set_fmt_dai(struct fsi_priv *fsi, unsigned int fmt) | 1270 | static int fsi_set_fmt_dai(struct fsi_priv *fsi, unsigned int fmt) |
| 1272 | { | 1271 | { |
| 1273 | u32 data = 0; | ||
| 1274 | |||
| 1275 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | 1272 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { |
| 1276 | case SND_SOC_DAIFMT_I2S: | 1273 | case SND_SOC_DAIFMT_I2S: |
| 1277 | data = CR_I2S; | 1274 | fsi->fmt = CR_I2S; |
| 1278 | fsi->chan_num = 2; | 1275 | fsi->chan_num = 2; |
| 1279 | break; | 1276 | break; |
| 1280 | case SND_SOC_DAIFMT_LEFT_J: | 1277 | case SND_SOC_DAIFMT_LEFT_J: |
| 1281 | data = CR_PCM; | 1278 | fsi->fmt = CR_PCM; |
| 1282 | fsi->chan_num = 2; | 1279 | fsi->chan_num = 2; |
| 1283 | break; | 1280 | break; |
| 1284 | default: | 1281 | default: |
| 1285 | return -EINVAL; | 1282 | return -EINVAL; |
| 1286 | } | 1283 | } |
| 1287 | 1284 | ||
| 1288 | fsi->do_fmt = data; | ||
| 1289 | fsi->di_fmt = data; | ||
| 1290 | |||
| 1291 | return 0; | 1285 | return 0; |
| 1292 | } | 1286 | } |
| 1293 | 1287 | ||
| 1294 | static int fsi_set_fmt_spdif(struct fsi_priv *fsi) | 1288 | static int fsi_set_fmt_spdif(struct fsi_priv *fsi) |
| 1295 | { | 1289 | { |
| 1296 | struct fsi_master *master = fsi_get_master(fsi); | 1290 | struct fsi_master *master = fsi_get_master(fsi); |
| 1297 | u32 data = 0; | ||
| 1298 | 1291 | ||
| 1299 | if (fsi_version(master) < 2) | 1292 | if (fsi_version(master) < 2) |
| 1300 | return -EINVAL; | 1293 | return -EINVAL; |
| 1301 | 1294 | ||
| 1302 | data = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM; | 1295 | fsi->fmt = CR_BWS_16 | CR_DTMD_SPDIF_PCM | CR_PCM; |
| 1303 | fsi->chan_num = 2; | 1296 | fsi->chan_num = 2; |
| 1304 | fsi->spdif = 1; | 1297 | fsi->spdif = 1; |
| 1305 | 1298 | ||
| 1306 | fsi->do_fmt = data; | ||
| 1307 | fsi->di_fmt = data; | ||
| 1308 | |||
| 1309 | return 0; | 1299 | return 0; |
| 1310 | } | 1300 | } |
| 1311 | 1301 | ||
