[PATCH] soc_camera_platform: add set_fmt callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows the platform camera to arrange a change in the capture format.

Signed-off-by: Baruch Siach <baruch@xxxxxxxxxx>
---
 drivers/media/video/soc_camera_platform.c |    3 +++
 include/media/soc_camera_platform.h       |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c
index 248c986..208fd42 100644
--- a/drivers/media/video/soc_camera_platform.c
+++ b/drivers/media/video/soc_camera_platform.c
@@ -61,6 +61,9 @@ static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd,
 {
 	struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
 
+	if (p->try_fmt)
+		return p->try_fmt(p, mf);
+
 	mf->width	= p->format.width;
 	mf->height	= p->format.height;
 	mf->code	= p->format.code;
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 0ecefe2..0558ffc 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -22,6 +22,8 @@ struct soc_camera_platform_info {
 	struct v4l2_mbus_framefmt format;
 	unsigned long bus_param;
 	struct device *dev;
+	int (*try_fmt)(struct soc_camera_platform_info *info,
+			struct v4l2_mbus_framefmt *mf);
 	int (*set_capture)(struct soc_camera_platform_info *info, int enable);
 };
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux