diff options
Diffstat (limited to 'sound/soc/sh/fsi.c')
-rw-r--r-- | sound/soc/sh/fsi.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 22037f1c76fb..e74c4ebc957a 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -267,6 +267,8 @@ struct fsi_priv { | |||
267 | int clk_cpg:1; | 267 | int clk_cpg:1; |
268 | int spdif:1; | 268 | int spdif:1; |
269 | int enable_stream:1; | 269 | int enable_stream:1; |
270 | int bit_clk_inv:1; | ||
271 | int lr_clk_inv:1; | ||
270 | 272 | ||
271 | long rate; | 273 | long rate; |
272 | }; | 274 | }; |
@@ -1645,6 +1647,16 @@ static int fsi_hw_startup(struct fsi_priv *fsi, | |||
1645 | 1647 | ||
1646 | /* clock inversion (CKG2) */ | 1648 | /* clock inversion (CKG2) */ |
1647 | data = 0; | 1649 | data = 0; |
1650 | if (fsi->bit_clk_inv) | ||
1651 | data |= (1 << 0); | ||
1652 | if (fsi->lr_clk_inv) | ||
1653 | data |= (1 << 4); | ||
1654 | if (fsi_is_clk_master(fsi)) | ||
1655 | data <<= 8; | ||
1656 | /* FIXME | ||
1657 | * | ||
1658 | * SH_FSI_xxx_INV style will be removed | ||
1659 | */ | ||
1648 | if (SH_FSI_LRM_INV & flags) | 1660 | if (SH_FSI_LRM_INV & flags) |
1649 | data |= 1 << 12; | 1661 | data |= 1 << 12; |
1650 | if (SH_FSI_BRM_INV & flags) | 1662 | if (SH_FSI_BRM_INV & flags) |
@@ -1796,6 +1808,27 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) | |||
1796 | return -EINVAL; | 1808 | return -EINVAL; |
1797 | } | 1809 | } |
1798 | 1810 | ||
1811 | /* set clock inversion */ | ||
1812 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { | ||
1813 | case SND_SOC_DAIFMT_NB_IF: | ||
1814 | fsi->bit_clk_inv = 0; | ||
1815 | fsi->lr_clk_inv = 1; | ||
1816 | break; | ||
1817 | case SND_SOC_DAIFMT_IB_NF: | ||
1818 | fsi->bit_clk_inv = 1; | ||
1819 | fsi->lr_clk_inv = 0; | ||
1820 | break; | ||
1821 | case SND_SOC_DAIFMT_IB_IF: | ||
1822 | fsi->bit_clk_inv = 1; | ||
1823 | fsi->lr_clk_inv = 1; | ||
1824 | break; | ||
1825 | case SND_SOC_DAIFMT_NB_NF: | ||
1826 | default: | ||
1827 | fsi->bit_clk_inv = 0; | ||
1828 | fsi->lr_clk_inv = 0; | ||
1829 | break; | ||
1830 | } | ||
1831 | |||
1799 | if (fsi_is_clk_master(fsi)) { | 1832 | if (fsi_is_clk_master(fsi)) { |
1800 | /* | 1833 | /* |
1801 | * CAUTION | 1834 | * CAUTION |