[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1574670712-31992-5-git-send-email-eugen.hristev@microchip.com>
Date: Mon, 25 Nov 2019 08:32:53 +0000
From: <Eugen.Hristev@...rochip.com>
To: <linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <hverkuil@...all.nl>
CC: <Eugen.Hristev@...rochip.com>
Subject: [PATCH 4/5] media: atmel: atmel-isc-base: fix enum calls default
format
From: Eugen Hristev <eugen.hristev@...rochip.com>
With some sensors, the mbus code must match the one that sensor supports.
In this case we should initialize the mbus_code of the fse/fie before
calling the subdev, and not after.
Signed-off-by: Eugen Hristev <eugen.hristev@...rochip.com>
---
drivers/media/platform/atmel/atmel-isc-base.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c
index 7c73bcd..1bb1dd5 100644
--- a/drivers/media/platform/atmel/atmel-isc-base.c
+++ b/drivers/media/platform/atmel/atmel-isc-base.c
@@ -1461,6 +1461,7 @@ static int isc_enum_framesizes(struct file *file, void *fh,
{
struct isc_device *isc = video_drvdata(file);
struct v4l2_subdev_frame_size_enum fse = {
+ .code = isc->config.sd_format->mbus_code,
.index = fsize->index,
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
@@ -1483,8 +1484,6 @@ static int isc_enum_framesizes(struct file *file, void *fh,
if (ret)
return ret;
- fse.code = isc->config.sd_format->mbus_code;
-
fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
fsize->discrete.width = fse.max_width;
fsize->discrete.height = fse.max_height;
@@ -1497,6 +1496,7 @@ static int isc_enum_frameintervals(struct file *file, void *fh,
{
struct isc_device *isc = video_drvdata(file);
struct v4l2_subdev_frame_interval_enum fie = {
+ .code = isc->config.sd_format->mbus_code,
.index = fival->index,
.width = fival->width,
.height = fival->height,
@@ -1521,7 +1521,6 @@ static int isc_enum_frameintervals(struct file *file, void *fh,
if (ret)
return ret;
- fie.code = isc->config.sd_format->mbus_code;
fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
fival->discrete = fie.interval;
--
2.7.4
Powered by blists - more mailing lists