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: Fri, 6 Mar 2015 18:16:30 +0800 [thread overview]
Message-ID: <54F97E7E.1000109@atmel.com> (raw)
In-Reply-To: <16387779.aQaQKCyNOp@avalon>
On 3/5/2015 6:39 PM, Laurent Pinchart wrote:
> Hi Josh,
>
> Thank you for the patch.
>
> On Thursday 05 March 2015 13:00:59 Josh Wu wrote:
>> 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.
> Then the driver will access registers with the peripheral clock disabled, for
> instance in isi_camera_set_fmt() (calling configure_geometry),
> isi_camera_set_bus_param() or atmel_isi_probe(). Isn't that a problem ? Or are
> all registers guaranteed to be accessible (and retained) when the clock is
> disabled ?
So far, I don't see any problem yet. But I'd like to be sure of that.
I'll give you the feedback after more test.
Thanks for make me head up.
Best Regards,
Josh Wu
>
>> 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)
WARNING: multiple messages have this Message-ID (diff)
From: Josh Wu <josh.wu@atmel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
"Guennadi Liakhovetski" <g.liakhovetski@gmx.de>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] media: atmel-isi: move the peripheral clock to start/stop_stream() function
Date: Fri, 6 Mar 2015 18:16:30 +0800 [thread overview]
Message-ID: <54F97E7E.1000109@atmel.com> (raw)
In-Reply-To: <16387779.aQaQKCyNOp@avalon>
On 3/5/2015 6:39 PM, Laurent Pinchart wrote:
> Hi Josh,
>
> Thank you for the patch.
>
> On Thursday 05 March 2015 13:00:59 Josh Wu wrote:
>> 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.
> Then the driver will access registers with the peripheral clock disabled, for
> instance in isi_camera_set_fmt() (calling configure_geometry),
> isi_camera_set_bus_param() or atmel_isi_probe(). Isn't that a problem ? Or are
> all registers guaranteed to be accessible (and retained) when the clock is
> disabled ?
So far, I don't see any problem yet. But I'd like to be sure of that.
I'll give you the feedback after more test.
Thanks for make me head up.
Best Regards,
Josh Wu
>
>> 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)
next prev parent reply other threads:[~2015-03-06 10:16 UTC|newest]
Thread overview: 26+ 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
2015-03-05 5:00 ` [PATCH 1/3] media: atmel-isi: move the peripheral clock to start/stop_stream() function Josh Wu
2015-03-05 5:00 ` Josh Wu
2015-03-05 10:39 ` Laurent Pinchart
2015-03-05 10:39 ` Laurent Pinchart
2015-03-06 10:16 ` Josh Wu [this message]
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 5:01 ` Josh Wu
2015-03-05 10:36 ` Laurent Pinchart
2015-03-05 10:36 ` Laurent Pinchart
2015-03-06 10:10 ` Josh Wu
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 5:01 ` Josh Wu
2015-03-05 10:41 ` Laurent Pinchart
2015-03-05 10:41 ` Laurent Pinchart
2015-03-06 10:13 ` Josh Wu
2015-03-06 10:13 ` Josh Wu
2015-03-06 20:25 ` Guennadi Liakhovetski
2015-03-06 20:25 ` Guennadi Liakhovetski
2015-03-08 0:28 ` Laurent Pinchart
2015-03-08 0:28 ` Laurent Pinchart
2015-03-09 1:33 ` Josh Wu
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=54F97E7E.1000109@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.