Commit 84c760a5 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

[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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0d3263f9
...@@ -115,6 +115,17 @@ static int soc_camera_platform_cropcap(struct v4l2_subdev *sd, ...@@ -115,6 +115,17 @@ static int soc_camera_platform_cropcap(struct v4l2_subdev *sd,
return 0; return 0;
} }
static int soc_camera_platform_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
{
struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
cfg->flags = p->mbus_param;
cfg->type = p->mbus_type;
return 0;
}
static struct v4l2_subdev_video_ops platform_subdev_video_ops = { static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
.s_stream = soc_camera_platform_s_stream, .s_stream = soc_camera_platform_s_stream,
.enum_mbus_fmt = soc_camera_platform_enum_fmt, .enum_mbus_fmt = soc_camera_platform_enum_fmt,
...@@ -123,6 +134,7 @@ static struct v4l2_subdev_video_ops platform_subdev_video_ops = { ...@@ -123,6 +134,7 @@ static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
.try_mbus_fmt = soc_camera_platform_fill_fmt, .try_mbus_fmt = soc_camera_platform_fill_fmt,
.g_mbus_fmt = soc_camera_platform_fill_fmt, .g_mbus_fmt = soc_camera_platform_fill_fmt,
.s_mbus_fmt = soc_camera_platform_fill_fmt, .s_mbus_fmt = soc_camera_platform_fill_fmt,
.g_mbus_config = soc_camera_platform_g_mbus_config,
}; };
static struct v4l2_subdev_ops platform_subdev_ops = { static struct v4l2_subdev_ops platform_subdev_ops = {
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/v4l2-mediabus.h>
struct device; struct device;
...@@ -21,6 +22,8 @@ struct soc_camera_platform_info { ...@@ -21,6 +22,8 @@ struct soc_camera_platform_info {
unsigned long format_depth; unsigned long format_depth;
struct v4l2_mbus_framefmt format; struct v4l2_mbus_framefmt format;
unsigned long bus_param; unsigned long bus_param;
unsigned long mbus_param;
enum v4l2_mbus_type mbus_type;
struct soc_camera_device *icd; struct soc_camera_device *icd;
int (*set_capture)(struct soc_camera_platform_info *info, int enable); int (*set_capture)(struct soc_camera_platform_info *info, int enable);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment