diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-05-11 05:14:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:05:37 -0400 |
commit | e7d403f55675d9153de893345ec155af82fd993c (patch) | |
tree | fd46440ffc4e49153ef3afdecbb5ca39061fe93c /drivers | |
parent | 9fe6206f400646a2322096b56c59891d530e8d51 (diff) |
V4L/DVB: soc_camera_platform: Add necessary v4l2_subdev_video_ops method
These function are needed to use camera.
This patch was tested with sh_mobile_ceu_camera
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/soc_camera_platform.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c index 248c986f098..bf406e89c99 100644 --- a/drivers/media/video/soc_camera_platform.c +++ b/drivers/media/video/soc_camera_platform.c | |||
@@ -56,8 +56,8 @@ soc_camera_platform_query_bus_param(struct soc_camera_device *icd) | |||
56 | return p->bus_param; | 56 | return p->bus_param; |
57 | } | 57 | } |
58 | 58 | ||
59 | static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, | 59 | static int soc_camera_platform_fill_fmt(struct v4l2_subdev *sd, |
60 | struct v4l2_mbus_framefmt *mf) | 60 | struct v4l2_mbus_framefmt *mf) |
61 | { | 61 | { |
62 | struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); | 62 | struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); |
63 | 63 | ||
@@ -65,6 +65,7 @@ static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, | |||
65 | mf->height = p->format.height; | 65 | mf->height = p->format.height; |
66 | mf->code = p->format.code; | 66 | mf->code = p->format.code; |
67 | mf->colorspace = p->format.colorspace; | 67 | mf->colorspace = p->format.colorspace; |
68 | mf->field = p->format.field; | ||
68 | 69 | ||
69 | return 0; | 70 | return 0; |
70 | } | 71 | } |
@@ -83,10 +84,45 @@ static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int ind | |||
83 | return 0; | 84 | return 0; |
84 | } | 85 | } |
85 | 86 | ||
87 | static int soc_camera_platform_g_crop(struct v4l2_subdev *sd, | ||
88 | struct v4l2_crop *a) | ||
89 | { | ||
90 | struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); | ||
91 | |||
92 | a->c.left = 0; | ||
93 | a->c.top = 0; | ||
94 | a->c.width = p->format.width; | ||
95 | a->c.height = p->format.height; | ||
96 | a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
97 | |||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | static int soc_camera_platform_cropcap(struct v4l2_subdev *sd, | ||
102 | struct v4l2_cropcap *a) | ||
103 | { | ||
104 | struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); | ||
105 | |||
106 | a->bounds.left = 0; | ||
107 | a->bounds.top = 0; | ||
108 | a->bounds.width = p->format.width; | ||
109 | a->bounds.height = p->format.height; | ||
110 | a->defrect = a->bounds; | ||
111 | a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | ||
112 | a->pixelaspect.numerator = 1; | ||
113 | a->pixelaspect.denominator = 1; | ||
114 | |||
115 | return 0; | ||
116 | } | ||
117 | |||
86 | static struct v4l2_subdev_video_ops platform_subdev_video_ops = { | 118 | static struct v4l2_subdev_video_ops platform_subdev_video_ops = { |
87 | .s_stream = soc_camera_platform_s_stream, | 119 | .s_stream = soc_camera_platform_s_stream, |
88 | .try_mbus_fmt = soc_camera_platform_try_fmt, | ||
89 | .enum_mbus_fmt = soc_camera_platform_enum_fmt, | 120 | .enum_mbus_fmt = soc_camera_platform_enum_fmt, |
121 | .cropcap = soc_camera_platform_cropcap, | ||
122 | .g_crop = soc_camera_platform_g_crop, | ||
123 | .try_mbus_fmt = soc_camera_platform_fill_fmt, | ||
124 | .g_mbus_fmt = soc_camera_platform_fill_fmt, | ||
125 | .s_mbus_fmt = soc_camera_platform_fill_fmt, | ||
90 | }; | 126 | }; |
91 | 127 | ||
92 | static struct v4l2_subdev_ops platform_subdev_ops = { | 128 | static struct v4l2_subdev_ops platform_subdev_ops = { |