From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Josh Wu <josh.wu@atmel.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming()
Date: Fri, 31 Jul 2015 17:37:52 +0300 [thread overview]
Message-ID: <1972518.SdailnKCEF@avalon> (raw)
In-Reply-To: <1434537579-23417-2-git-send-email-josh.wu@atmel.com>
Hi Josh,
Thank you for the patch.
On Wednesday 17 June 2015 18:39:39 Josh Wu wrote:
> As in set_fmt() function we only need to know which format is been set,
> we don't need to access the ISI hardware in this moment.
>
> So move the configure_geometry(), which access the ISI hardware, to
> start_streaming() will make code more consistent and simpler.
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
>
> drivers/media/platform/soc_camera/atmel-isi.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
> b/drivers/media/platform/soc_camera/atmel-isi.c index 8bc40ca..b01086d
> 100644
> --- a/drivers/media/platform/soc_camera/atmel-isi.c
> +++ b/drivers/media/platform/soc_camera/atmel-isi.c
> @@ -390,6 +390,11 @@ static int start_streaming(struct vb2_queue *vq,
> unsigned int count) /* Disable all interrupts */
> isi_writel(isi, ISI_INTDIS, (u32)~0UL);
>
> + ret = configure_geometry(isi, icd->user_width, icd->user_height,
> + icd->current_fmt->code);
I would also make configure_geometry a void function, as the only failure case
really can't occur.
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + if (ret < 0)
> + return ret;
> +
> spin_lock_irq(&isi->lock);
> /* Clear any pending interrupt */
> isi_readl(isi, ISI_STATUS);
> @@ -477,8 +482,6 @@ static int isi_camera_init_videobuf(struct vb2_queue *q,
> static int isi_camera_set_fmt(struct soc_camera_device *icd,
> struct v4l2_format *f)
> {
> - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
> - struct atmel_isi *isi = ici->priv;
> struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
> const struct soc_camera_format_xlate *xlate;
> struct v4l2_pix_format *pix = &f->fmt.pix;
> @@ -511,16 +514,6 @@ static int isi_camera_set_fmt(struct soc_camera_device
> *icd, if (mf->code != xlate->code)
> return -EINVAL;
>
> - /* Enable PM and peripheral clock before operate isi registers */
> - pm_runtime_get_sync(ici->v4l2_dev.dev);
> -
> - ret = configure_geometry(isi, pix->width, pix->height, xlate->code);
> -
> - pm_runtime_put(ici->v4l2_dev.dev);
> -
> - if (ret < 0)
> - return ret;
> -
> pix->width = mf->width;
> pix->height = mf->height;
> pix->field = mf->field;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-07-31 14:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 10:39 [PATCH 1/2] media: atmel-isi: setup the ISI_CFG2 register directly Josh Wu
2015-06-17 10:39 ` [PATCH 2/2] media: atmel-isi: move configure_geometry() to start_streaming() Josh Wu
2015-07-31 14:37 ` Laurent Pinchart [this message]
2015-08-03 3:56 ` Josh Wu
2015-08-03 13:27 ` Laurent Pinchart
2015-08-04 6:19 ` Josh Wu
2015-08-30 9:26 ` Guennadi Liakhovetski
2015-08-30 10:16 ` Guennadi Liakhovetski
2015-07-31 2:54 ` [PATCH 1/2] media: atmel-isi: setup the ISI_CFG2 register directly Josh Wu
2015-07-31 14:32 ` Laurent Pinchart
2015-08-30 8:48 ` Guennadi Liakhovetski
2015-08-31 10:53 ` 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=1972518.SdailnKCEF@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--cc=josh.wu@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/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.