aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-11-16 04:17:30 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 01:11:21 -0500
commit2522acd28a8558d53f5404054d256c3dbf00b6d2 (patch)
treefa75258098d6545f49c7e235889c7516a438256b /sound/soc/sh
parentab6340c4ecc21c01a487e9be15754d5f934a003a (diff)
ASoC: fsi: stream mode become independent from platform flags
Current FSI driver is using platform information pointer, but it is not good design for DT support. This patch makes stream mode format independent from platform information pointer. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 77747b075369..22037f1c76fb 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -266,6 +266,7 @@ struct fsi_priv {
266 int clk_master:1; 266 int clk_master:1;
267 int clk_cpg:1; 267 int clk_cpg:1;
268 int spdif:1; 268 int spdif:1;
269 int enable_stream:1;
269 270
270 long rate; 271 long rate;
271}; 272};
@@ -395,6 +396,11 @@ static int fsi_is_spdif(struct fsi_priv *fsi)
395 return fsi->spdif; 396 return fsi->spdif;
396} 397}
397 398
399static int fsi_is_enable_stream(struct fsi_priv *fsi)
400{
401 return fsi->enable_stream;
402}
403
398static int fsi_is_play(struct snd_pcm_substream *substream) 404static int fsi_is_play(struct snd_pcm_substream *substream)
399{ 405{
400 return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; 406 return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
@@ -1138,10 +1144,9 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
1138 */ 1144 */
1139static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int samples) 1145static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int samples)
1140{ 1146{
1141 u32 enable_stream = fsi_get_info_flags(fsi) & SH_FSI_ENABLE_STREAM_MODE;
1142 int i; 1147 int i;
1143 1148
1144 if (enable_stream) { 1149 if (fsi_is_enable_stream(fsi)) {
1145 /* 1150 /*
1146 * stream mode 1151 * stream mode
1147 * see 1152 * see
@@ -1299,8 +1304,6 @@ static void fsi_pio_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
1299 1304
1300static int fsi_pio_push_init(struct fsi_priv *fsi, struct fsi_stream *io) 1305static int fsi_pio_push_init(struct fsi_priv *fsi, struct fsi_stream *io)
1301{ 1306{
1302 u32 enable_stream = fsi_get_info_flags(fsi) & SH_FSI_ENABLE_STREAM_MODE;
1303
1304 /* 1307 /*
1305 * we can use 16bit stream mode 1308 * we can use 16bit stream mode
1306 * when "playback" and "16bit data" 1309 * when "playback" and "16bit data"
@@ -1308,7 +1311,7 @@ static int fsi_pio_push_init(struct fsi_priv *fsi, struct fsi_stream *io)
1308 * see 1311 * see
1309 * fsi_pio_push16() 1312 * fsi_pio_push16()
1310 */ 1313 */
1311 if (enable_stream) 1314 if (fsi_is_enable_stream(fsi))
1312 io->bus_option = BUSOP_SET(24, PACKAGE_24BITBUS_BACK) | 1315 io->bus_option = BUSOP_SET(24, PACKAGE_24BITBUS_BACK) |
1313 BUSOP_SET(16, PACKAGE_16BITBUS_STREAM); 1316 BUSOP_SET(16, PACKAGE_16BITBUS_STREAM);
1314 else 1317 else
@@ -1988,6 +1991,9 @@ static void fsi_port_info_init(struct fsi_priv *fsi,
1988 1991
1989 if (info->flags & SH_FSI_CLK_CPG) 1992 if (info->flags & SH_FSI_CLK_CPG)
1990 fsi->clk_cpg = 1; 1993 fsi->clk_cpg = 1;
1994
1995 if (info->flags & SH_FSI_ENABLE_STREAM_MODE)
1996 fsi->enable_stream = 1;
1991} 1997}
1992 1998
1993static void fsi_handler_init(struct fsi_priv *fsi, 1999static void fsi_handler_init(struct fsi_priv *fsi,