Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1210994
| From | Josh Wu <josh.wu@atmel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/3] media: atmel-isi: move configure_geometry() to start_streaming() |
| Date | 2015-08-21 10:10 +0200 |
| Message-ID | <pZPyH-6cu-17@gated-at.bofh.it> (permalink) |
| References | <pZPyG-6cu-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes in v3: None
Changes in v2:
- Add Laurent's reviewed-by tag.
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 b67da70..fe9247a 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);
+ 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;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3 1/3] media: atmel-isi: setup the ISI_CFG2 register directly Josh Wu <josh.wu@atmel.com> - 2015-08-21 10:10 +0200
[PATCH v3 3/3] media: atmel-isi: add sanity check for supported formats in try/set_fmt() Josh Wu <josh.wu@atmel.com> - 2015-08-21 10:10 +0200
Re: [PATCH v3 3/3] media: atmel-isi: add sanity check for supported formats in try/set_fmt() Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2015-08-21 20:30 +0200
Re: [PATCH v3 3/3] media: atmel-isi: add sanity check for supported formats in try/set_fmt() Josh Wu <josh.wu@atmel.com> - 2015-08-24 12:40 +0200
[PATCH v3 2/3] media: atmel-isi: move configure_geometry() to start_streaming() Josh Wu <josh.wu@atmel.com> - 2015-08-21 10:10 +0200
csiph-web