linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: josh.wu@atmel.com (Josh Wu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] media: atmel-isi: move the peripheral clock to start/stop_stream() function
Date: Thu, 5 Mar 2015 13:00:59 +0800	[thread overview]
Message-ID: <1425531661-20040-2-git-send-email-josh.wu@atmel.com> (raw)
In-Reply-To: <1425531661-20040-1-git-send-email-josh.wu@atmel.com>

As the clock_start/stop() use to control the mclk for the sensor not the
ISI peripheral clock.
So we move them to start/stop_stream() function.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
---

 drivers/media/platform/soc_camera/atmel-isi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index 1208818..eb179e7 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -386,6 +386,10 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 	struct atmel_isi *isi = ici->priv;
 	int ret;
 
+	ret = clk_prepare_enable(isi->pclk);
+	if (ret)
+		return ret;
+
 	/* Reset ISI */
 	ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
 	if (ret < 0) {
@@ -445,6 +449,8 @@ static void stop_streaming(struct vb2_queue *vq)
 	ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
 	if (ret < 0)
 		dev_err(icd->parent, "Disable ISI timed out\n");
+
+	clk_disable_unprepare(isi->pclk);
 }
 
 static struct vb2_ops isi_video_qops = {
@@ -723,14 +729,9 @@ static int isi_camera_clock_start(struct soc_camera_host *ici)
 	struct atmel_isi *isi = ici->priv;
 	int ret;
 
-	ret = clk_prepare_enable(isi->pclk);
-	if (ret)
-		return ret;
-
 	if (!IS_ERR(isi->mck)) {
 		ret = clk_prepare_enable(isi->mck);
 		if (ret) {
-			clk_disable_unprepare(isi->pclk);
 			return ret;
 		}
 	}
@@ -745,7 +746,6 @@ static void isi_camera_clock_stop(struct soc_camera_host *ici)
 
 	if (!IS_ERR(isi->mck))
 		clk_disable_unprepare(isi->mck);
-	clk_disable_unprepare(isi->pclk);
 }
 
 static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
-- 
1.9.1

  reply	other threads:[~2015-03-05  5:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  5:00 [PATCH 0/3] media: atmel-isi: rework on the clock part and add runtime pm support Josh Wu
2015-03-05  5:00 ` Josh Wu [this message]
2015-03-05 10:39   ` [PATCH 1/3] media: atmel-isi: move the peripheral clock to start/stop_stream() function Laurent Pinchart
2015-03-06 10:16     ` Josh Wu
2015-03-05  5:01 ` [PATCH 2/3] media: atmel-isi: add runtime pm support Josh Wu
2015-03-05 10:36   ` Laurent Pinchart
2015-03-06 10:10     ` Josh Wu
2015-03-05  5:01 ` [PATCH 3/3] media: atmel-isi: remove mck back compatiable code as we don't need it Josh Wu
2015-03-05 10:41   ` Laurent Pinchart
2015-03-06 10:13     ` Josh Wu
2015-03-06 20:25       ` Guennadi Liakhovetski
2015-03-08  0:28         ` Laurent Pinchart
2015-03-09  1:33           ` Josh Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425531661-20040-2-git-send-email-josh.wu@atmel.com \
    --to=josh.wu@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).