aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-27 09:06:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:27:35 -0400
commit84c760a5dec0edab857cc02c29ef334722520310 (patch)
tree8787b475e626795c39089202e155d160689db7d7
parent0d3263f9ad74d60cdcc2beaa365913be85769696 (diff)
[media] V4L: soc_camera_platform: support the new mbus-config subdev ops
Extend the driver to also support [gs]_mbus_config() subdevice video operations. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/soc_camera_platform.c12
-rw-r--r--include/media/soc_camera_platform.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c
index 8069cd6bc5e8..7045e458a66e 100644
--- a/drivers/media/video/soc_camera_platform.c
+++ b/drivers/media/video/soc_camera_platform.c
@@ -115,6 +115,17 @@ static int soc_camera_platform_cropcap(struct v4l2_subdev *sd,
115 return 0; 115 return 0;
116} 116}
117 117
118static int soc_camera_platform_g_mbus_config(struct v4l2_subdev *sd,
119 struct v4l2_mbus_config *cfg)
120{
121 struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
122
123 cfg->flags = p->mbus_param;
124 cfg->type = p->mbus_type;
125
126 return 0;
127}
128
118static struct v4l2_subdev_video_ops platform_subdev_video_ops = { 129static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
119 .s_stream = soc_camera_platform_s_stream, 130 .s_stream = soc_camera_platform_s_stream,
120 .enum_mbus_fmt = soc_camera_platform_enum_fmt, 131 .enum_mbus_fmt = soc_camera_platform_enum_fmt,
@@ -123,6 +134,7 @@ static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
123 .try_mbus_fmt = soc_camera_platform_fill_fmt, 134 .try_mbus_fmt = soc_camera_platform_fill_fmt,
124 .g_mbus_fmt = soc_camera_platform_fill_fmt, 135 .g_mbus_fmt = soc_camera_platform_fill_fmt,
125 .s_mbus_fmt = soc_camera_platform_fill_fmt, 136 .s_mbus_fmt = soc_camera_platform_fill_fmt,
137 .g_mbus_config = soc_camera_platform_g_mbus_config,
126}; 138};
127 139
128static struct v4l2_subdev_ops platform_subdev_ops = { 140static struct v4l2_subdev_ops platform_subdev_ops = {
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 74f0fa15ca47..a15f92be8aba 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/videodev2.h> 14#include <linux/videodev2.h>
15#include <media/soc_camera.h> 15#include <media/soc_camera.h>
16#include <media/v4l2-mediabus.h>
16 17
17struct device; 18struct device;
18 19
@@ -21,6 +22,8 @@ struct soc_camera_platform_info {
21 unsigned long format_depth; 22 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 23 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 24 unsigned long bus_param;
25 unsigned long mbus_param;
26 enum v4l2_mbus_type mbus_type;
24 struct soc_camera_device *icd; 27 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 28 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 29};