aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-11-16 04:17:18 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 01:11:21 -0500
commitab6340c4ecc21c01a487e9be15754d5f934a003a (patch)
tree3f957fdfffc82caf864e694dc34d2b48538a129f /sound/soc/sh
parentc2052def9e92de0f702eb38e179b7991f4638351 (diff)
ASoC: fsi: master clock selection 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 master clock selection 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.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index cc81a4966df5..77747b075369 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -264,6 +264,7 @@ struct fsi_priv {
264 264
265 int chan_num:16; 265 int chan_num:16;
266 int clk_master:1; 266 int clk_master:1;
267 int clk_cpg:1;
267 int spdif:1; 268 int spdif:1;
268 269
269 long rate; 270 long rate;
@@ -1779,7 +1780,6 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1779{ 1780{
1780 struct fsi_priv *fsi = fsi_get_priv_frm_dai(dai); 1781 struct fsi_priv *fsi = fsi_get_priv_frm_dai(dai);
1781 set_rate_func set_rate = fsi_get_info_set_rate(fsi); 1782 set_rate_func set_rate = fsi_get_info_set_rate(fsi);
1782 u32 flags = fsi_get_info_flags(fsi);
1783 int ret; 1783 int ret;
1784 1784
1785 /* set master/slave audio interface */ 1785 /* set master/slave audio interface */
@@ -1802,16 +1802,12 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
1802 if (set_rate) 1802 if (set_rate)
1803 dev_warn(dai->dev, "set_rate will be removed soon\n"); 1803 dev_warn(dai->dev, "set_rate will be removed soon\n");
1804 1804
1805 switch (flags & SH_FSI_CLK_MASK) { 1805 if (fsi->clk_cpg)
1806 case SH_FSI_CLK_EXTERNAL:
1807 fsi_clk_init(dai->dev, fsi, 1, 1, 0,
1808 fsi_clk_set_rate_external);
1809 break;
1810 case SH_FSI_CLK_CPG:
1811 fsi_clk_init(dai->dev, fsi, 0, 1, 1, 1806 fsi_clk_init(dai->dev, fsi, 0, 1, 1,
1812 fsi_clk_set_rate_cpg); 1807 fsi_clk_set_rate_cpg);
1813 break; 1808 else
1814 } 1809 fsi_clk_init(dai->dev, fsi, 1, 1, 0,
1810 fsi_clk_set_rate_external);
1815 } 1811 }
1816 1812
1817 /* set format */ 1813 /* set format */
@@ -1989,6 +1985,9 @@ static void fsi_port_info_init(struct fsi_priv *fsi,
1989{ 1985{
1990 if (info->flags & SH_FSI_FMT_SPDIF) 1986 if (info->flags & SH_FSI_FMT_SPDIF)
1991 fsi->spdif = 1; 1987 fsi->spdif = 1;
1988
1989 if (info->flags & SH_FSI_CLK_CPG)
1990 fsi->clk_cpg = 1;
1992} 1991}
1993 1992
1994static void fsi_handler_init(struct fsi_priv *fsi, 1993static void fsi_handler_init(struct fsi_priv *fsi,