aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ov2640.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-26 10:59:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:27:20 -0400
commitd463003b56776576b071c4fcfdf391f4bb32d21c (patch)
tree6efbad02cde400f13894efb5be2291eb4dc47057 /drivers/media/video/ov2640.c
parente8e2c70ce61b42b1d9d8953c8a87feb8ba6c6e74 (diff)
[media] V4L: ov2640: 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>
Diffstat (limited to 'drivers/media/video/ov2640.c')
-rw-r--r--drivers/media/video/ov2640.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/ov2640.c b/drivers/media/video/ov2640.c
index 9ce2fa037b94..78bf602296f7 100644
--- a/drivers/media/video/ov2640.c
+++ b/drivers/media/video/ov2640.c
@@ -19,10 +19,11 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/videodev2.h> 21#include <linux/videodev2.h>
22#include <media/v4l2-chip-ident.h> 22
23#include <media/v4l2-subdev.h>
24#include <media/soc_camera.h> 23#include <media/soc_camera.h>
25#include <media/soc_mediabus.h> 24#include <media/soc_mediabus.h>
25#include <media/v4l2-chip-ident.h>
26#include <media/v4l2-subdev.h>
26 27
27#define VAL_SET(x, mask, rshift, lshift) \ 28#define VAL_SET(x, mask, rshift, lshift) \
28 ((((x) >> rshift) & mask) << lshift) 29 ((((x) >> rshift) & mask) << lshift)
@@ -1083,6 +1084,22 @@ static struct v4l2_subdev_core_ops ov2640_subdev_core_ops = {
1083#endif 1084#endif
1084}; 1085};
1085 1086
1087static int ov2640_g_mbus_config(struct v4l2_subdev *sd,
1088 struct v4l2_mbus_config *cfg)
1089{
1090 struct i2c_client *client = v4l2_get_subdevdata(sd);
1091 struct soc_camera_device *icd = client->dev.platform_data;
1092 struct soc_camera_link *icl = to_soc_camera_link(icd);
1093
1094 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
1095 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
1096 V4L2_MBUS_DATA_ACTIVE_HIGH;
1097 cfg->type = V4L2_MBUS_PARALLEL;
1098 cfg->flags = soc_camera_apply_board_flags(icl, cfg);
1099
1100 return 0;
1101}
1102
1086static struct v4l2_subdev_video_ops ov2640_subdev_video_ops = { 1103static struct v4l2_subdev_video_ops ov2640_subdev_video_ops = {
1087 .s_stream = ov2640_s_stream, 1104 .s_stream = ov2640_s_stream,
1088 .g_mbus_fmt = ov2640_g_fmt, 1105 .g_mbus_fmt = ov2640_g_fmt,
@@ -1091,6 +1108,7 @@ static struct v4l2_subdev_video_ops ov2640_subdev_video_ops = {
1091 .cropcap = ov2640_cropcap, 1108 .cropcap = ov2640_cropcap,
1092 .g_crop = ov2640_g_crop, 1109 .g_crop = ov2640_g_crop,
1093 .enum_mbus_fmt = ov2640_enum_fmt, 1110 .enum_mbus_fmt = ov2640_enum_fmt,
1111 .g_mbus_config = ov2640_g_mbus_config,
1094}; 1112};
1095 1113
1096static struct v4l2_subdev_ops ov2640_subdev_ops = { 1114static struct v4l2_subdev_ops ov2640_subdev_ops = {