aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-26 11:28:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:27:25 -0400
commitde2e388d74c77f45eab65c83749b0a4b9eb843d9 (patch)
treee4d804a594fd1bab847f81a7263fd53d11afe7be
parent00cf08f5dcef58878633746a3b10389cb6ce5e4e (diff)
[media] V4L: ov9640: 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/ov9640.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c
index 3681a6ff0815..4156c9f6375b 100644
--- a/drivers/media/video/ov9640.c
+++ b/drivers/media/video/ov9640.c
@@ -25,9 +25,11 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/videodev2.h> 27#include <linux/videodev2.h>
28
29#include <media/soc_camera.h>
30#include <media/soc_mediabus.h>
28#include <media/v4l2-chip-ident.h> 31#include <media/v4l2-chip-ident.h>
29#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
30#include <media/soc_camera.h>
31 33
32#include "ov9640.h" 34#include "ov9640.h"
33 35
@@ -722,6 +724,22 @@ static struct v4l2_subdev_core_ops ov9640_core_ops = {
722 724
723}; 725};
724 726
727static int ov9640_g_mbus_config(struct v4l2_subdev *sd,
728 struct v4l2_mbus_config *cfg)
729{
730 struct i2c_client *client = v4l2_get_subdevdata(sd);
731 struct soc_camera_device *icd = client->dev.platform_data;
732 struct soc_camera_link *icl = to_soc_camera_link(icd);
733
734 cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
735 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
736 V4L2_MBUS_DATA_ACTIVE_HIGH;
737 cfg->type = V4L2_MBUS_PARALLEL;
738 cfg->flags = soc_camera_apply_board_flags(icl, cfg);
739
740 return 0;
741}
742
725static struct v4l2_subdev_video_ops ov9640_video_ops = { 743static struct v4l2_subdev_video_ops ov9640_video_ops = {
726 .s_stream = ov9640_s_stream, 744 .s_stream = ov9640_s_stream,
727 .s_mbus_fmt = ov9640_s_fmt, 745 .s_mbus_fmt = ov9640_s_fmt,
@@ -729,7 +747,7 @@ static struct v4l2_subdev_video_ops ov9640_video_ops = {
729 .enum_mbus_fmt = ov9640_enum_fmt, 747 .enum_mbus_fmt = ov9640_enum_fmt,
730 .cropcap = ov9640_cropcap, 748 .cropcap = ov9640_cropcap,
731 .g_crop = ov9640_g_crop, 749 .g_crop = ov9640_g_crop,
732 750 .g_mbus_config = ov9640_g_mbus_config,
733}; 751};
734 752
735static struct v4l2_subdev_ops ov9640_subdev_ops = { 753static struct v4l2_subdev_ops ov9640_subdev_ops = {