aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ov9740.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-26 11:30:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:27:26 -0400
commite534c9eac0951b28b0462ffac0043a698436a922 (patch)
treec945d447616f23e6fb3b4a755a747b02a4b8bae9 /drivers/media/video/ov9740.c
parentde2e388d74c77f45eab65c83749b0a4b9eb843d9 (diff)
[media] V4L: ov9740: 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/ov9740.c')
-rw-r--r--drivers/media/video/ov9740.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/drivers/media/video/ov9740.c b/drivers/media/video/ov9740.c
index edd1ffcca30b..67b7020c933e 100644
--- a/drivers/media/video/ov9740.c
+++ b/drivers/media/video/ov9740.c
@@ -14,8 +14,10 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <media/v4l2-chip-ident.h> 17
18#include <media/soc_camera.h> 18#include <media/soc_camera.h>
19#include <media/soc_mediabus.h>
20#include <media/v4l2-chip-ident.h>
19 21
20#define to_ov9740(sd) container_of(sd, struct ov9740_priv, subdev) 22#define to_ov9740(sd) container_of(sd, struct ov9740_priv, subdev)
21 23
@@ -949,13 +951,30 @@ static struct soc_camera_ops ov9740_ops = {
949 .num_controls = ARRAY_SIZE(ov9740_controls), 951 .num_controls = ARRAY_SIZE(ov9740_controls),
950}; 952};
951 953
954static int ov9740_g_mbus_config(struct v4l2_subdev *sd,
955 struct v4l2_mbus_config *cfg)
956{
957 struct i2c_client *client = v4l2_get_subdevdata(sd);
958 struct soc_camera_device *icd = client->dev.platform_data;
959 struct soc_camera_link *icl = to_soc_camera_link(icd);
960
961 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
962 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
963 V4L2_MBUS_DATA_ACTIVE_HIGH;
964 cfg->type = V4L2_MBUS_PARALLEL;
965 cfg->flags = soc_camera_apply_board_flags(icl, cfg);
966
967 return 0;
968}
969
952static struct v4l2_subdev_video_ops ov9740_video_ops = { 970static struct v4l2_subdev_video_ops ov9740_video_ops = {
953 .s_stream = ov9740_s_stream, 971 .s_stream = ov9740_s_stream,
954 .s_mbus_fmt = ov9740_s_fmt, 972 .s_mbus_fmt = ov9740_s_fmt,
955 .try_mbus_fmt = ov9740_try_fmt, 973 .try_mbus_fmt = ov9740_try_fmt,
956 .enum_mbus_fmt = ov9740_enum_fmt, 974 .enum_mbus_fmt = ov9740_enum_fmt,
957 .cropcap = ov9740_cropcap, 975 .cropcap = ov9740_cropcap,
958 .g_crop = ov9740_g_crop, 976 .g_crop = ov9740_g_crop,
977 .g_mbus_config = ov9740_g_mbus_config,
959}; 978};
960 979
961static struct v4l2_subdev_core_ops ov9740_core_ops = { 980static struct v4l2_subdev_core_ops ov9740_core_ops = {