Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342723
b: refs/heads/master
c: 2522acd
h: refs/heads/master
i:
  342721: 54c7c78
  342719: 309bc8e
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 20, 2012
1 parent 76d173e commit 0e5071a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab6340c4ecc21c01a487e9be15754d5f934a003a
refs/heads/master: 2522acd28a8558d53f5404054d256c3dbf00b6d2
16 changes: 11 additions & 5 deletions trunk/sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ struct fsi_priv {
int clk_master:1;
int clk_cpg:1;
int spdif:1;
int enable_stream:1;

long rate;
};
Expand Down Expand Up @@ -395,6 +396,11 @@ static int fsi_is_spdif(struct fsi_priv *fsi)
return fsi->spdif;
}

static int fsi_is_enable_stream(struct fsi_priv *fsi)
{
return fsi->enable_stream;
}

static int fsi_is_play(struct snd_pcm_substream *substream)
{
return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
Expand Down Expand Up @@ -1138,10 +1144,9 @@ static int fsi_set_master_clk(struct device *dev, struct fsi_priv *fsi,
*/
static void fsi_pio_push16(struct fsi_priv *fsi, u8 *_buf, int samples)
{
u32 enable_stream = fsi_get_info_flags(fsi) & SH_FSI_ENABLE_STREAM_MODE;
int i;

if (enable_stream) {
if (fsi_is_enable_stream(fsi)) {
/*
* stream mode
* see
Expand Down Expand Up @@ -1299,16 +1304,14 @@ static void fsi_pio_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,

static int fsi_pio_push_init(struct fsi_priv *fsi, struct fsi_stream *io)
{
u32 enable_stream = fsi_get_info_flags(fsi) & SH_FSI_ENABLE_STREAM_MODE;

/*
* we can use 16bit stream mode
* when "playback" and "16bit data"
* and platform allows "stream mode"
* see
* fsi_pio_push16()
*/
if (enable_stream)
if (fsi_is_enable_stream(fsi))
io->bus_option = BUSOP_SET(24, PACKAGE_24BITBUS_BACK) |
BUSOP_SET(16, PACKAGE_16BITBUS_STREAM);
else
Expand Down Expand Up @@ -1988,6 +1991,9 @@ static void fsi_port_info_init(struct fsi_priv *fsi,

if (info->flags & SH_FSI_CLK_CPG)
fsi->clk_cpg = 1;

if (info->flags & SH_FSI_ENABLE_STREAM_MODE)
fsi->enable_stream = 1;
}

static void fsi_handler_init(struct fsi_priv *fsi,
Expand Down

0 comments on commit 0e5071a

Please sign in to comment.