summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-11-24 02:44:06 +0000
committerPaul Mundt <lethal@linux-sh.org>2010-11-24 15:29:56 +0900
commitd4bc99b977e3a1dd10a84a01ebe59ac2ccebf0cd (patch)
tree441a72709a1dd40ac84b89cec8b036f00960a96b /sound/soc/sh
parente8ee13a818db4954517cea7da6e7c15b9656eb00 (diff)
downloadblackbird-op-linux-d4bc99b977e3a1dd10a84a01ebe59ac2ccebf0cd.tar.gz
blackbird-op-linux-d4bc99b977e3a1dd10a84a01ebe59ac2ccebf0cd.zip
ARM: mach-shmobile: ap4evb: FSI clock use proper process for HDMI
Current AP4 FSI set_rate function used bogus clock process which didn't care enable/disable and clk->usecound. To solve this issue, this patch also modify FSI driver to call set_rate with enough options. This patch modify it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 507e709f2807..136414f163e9 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -132,6 +132,8 @@ struct fsi_priv {
struct fsi_stream playback;
struct fsi_stream capture;
+ long rate;
+
u32 mst_ctrl;
};
@@ -854,10 +856,17 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
{
struct fsi_priv *fsi = fsi_get_priv(substream);
int is_play = fsi_is_play(substream);
+ struct fsi_master *master = fsi_get_master(fsi);
+ int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
fsi_irq_disable(fsi, is_play);
fsi_clk_ctrl(fsi, 0);
+ set_rate = master->info->set_rate;
+ if (set_rate && fsi->rate)
+ set_rate(dai->dev, fsi_is_port_a(fsi), fsi->rate, 0);
+ fsi->rate = 0;
+
pm_runtime_put_sync(dai->dev);
}
@@ -891,9 +900,10 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
{
struct fsi_priv *fsi = fsi_get_priv(substream);
struct fsi_master *master = fsi_get_master(fsi);
- int (*set_rate)(int is_porta, int rate) = master->info->set_rate;
+ int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
int fsi_ver = master->core->ver;
int is_play = fsi_is_play(substream);
+ long rate = params_rate(params);
int ret;
/* if slave mode, set_rate is not needed */
@@ -901,10 +911,15 @@ static int fsi_dai_hw_params(struct snd_pcm_substream *substream,
return 0;
/* it is error if no set_rate */
+ set_rate = master->info->set_rate;
if (!set_rate)
return -EIO;
- ret = set_rate(fsi_is_port_a(fsi), params_rate(params));
+ ret = set_rate(dai->dev, fsi_is_port_a(fsi), rate, 1);
+ if (ret < 0) /* error */
+ return ret;
+
+ fsi->rate = rate;
if (ret > 0) {
u32 data = 0;
OpenPOWER on IntegriCloud