Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342724
b: refs/heads/master
c: 3449f5f
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 20, 2012
1 parent 0e5071a commit d04a3c4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2522acd28a8558d53f5404054d256c3dbf00b6d2
refs/heads/master: 3449f5fab8c51e37a8a48bc2516588c615373191
33 changes: 33 additions & 0 deletions trunk/sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ struct fsi_priv {
int clk_cpg:1;
int spdif:1;
int enable_stream:1;
int bit_clk_inv:1;
int lr_clk_inv:1;

long rate;
};
Expand Down Expand Up @@ -1645,6 +1647,16 @@ static int fsi_hw_startup(struct fsi_priv *fsi,

/* clock inversion (CKG2) */
data = 0;
if (fsi->bit_clk_inv)
data |= (1 << 0);
if (fsi->lr_clk_inv)
data |= (1 << 4);
if (fsi_is_clk_master(fsi))
data <<= 8;
/* FIXME
*
* SH_FSI_xxx_INV style will be removed
*/
if (SH_FSI_LRM_INV & flags)
data |= 1 << 12;
if (SH_FSI_BRM_INV & flags)
Expand Down Expand Up @@ -1796,6 +1808,27 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL;
}

/* set clock inversion */
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_IF:
fsi->bit_clk_inv = 0;
fsi->lr_clk_inv = 1;
break;
case SND_SOC_DAIFMT_IB_NF:
fsi->bit_clk_inv = 1;
fsi->lr_clk_inv = 0;
break;
case SND_SOC_DAIFMT_IB_IF:
fsi->bit_clk_inv = 1;
fsi->lr_clk_inv = 1;
break;
case SND_SOC_DAIFMT_NB_NF:
default:
fsi->bit_clk_inv = 0;
fsi->lr_clk_inv = 0;
break;
}

if (fsi_is_clk_master(fsi)) {
/*
* CAUTION
Expand Down

0 comments on commit d04a3c4

Please sign in to comment.