Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kuninori Morimoto and committed by
Mauro Carvalho Chehab
e7d403f5 9fe6206f

+39 -3
+39 -3
drivers/media/video/soc_camera_platform.c
··· 56 56 return p->bus_param; 57 57 } 58 58 59 - static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, 60 - struct v4l2_mbus_framefmt *mf) 59 + static int soc_camera_platform_fill_fmt(struct v4l2_subdev *sd, 60 + struct v4l2_mbus_framefmt *mf) 61 61 { 62 62 struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); 63 63 ··· 65 65 mf->height = p->format.height; 66 66 mf->code = p->format.code; 67 67 mf->colorspace = p->format.colorspace; 68 + mf->field = p->format.field; 68 69 69 70 return 0; 70 71 } ··· 84 83 return 0; 85 84 } 86 85 86 + static int soc_camera_platform_g_crop(struct v4l2_subdev *sd, 87 + struct v4l2_crop *a) 88 + { 89 + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); 90 + 91 + a->c.left = 0; 92 + a->c.top = 0; 93 + a->c.width = p->format.width; 94 + a->c.height = p->format.height; 95 + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 96 + 97 + return 0; 98 + } 99 + 100 + static int soc_camera_platform_cropcap(struct v4l2_subdev *sd, 101 + struct v4l2_cropcap *a) 102 + { 103 + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); 104 + 105 + a->bounds.left = 0; 106 + a->bounds.top = 0; 107 + a->bounds.width = p->format.width; 108 + a->bounds.height = p->format.height; 109 + a->defrect = a->bounds; 110 + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 111 + a->pixelaspect.numerator = 1; 112 + a->pixelaspect.denominator = 1; 113 + 114 + return 0; 115 + } 116 + 87 117 static struct v4l2_subdev_video_ops platform_subdev_video_ops = { 88 118 .s_stream = soc_camera_platform_s_stream, 89 - .try_mbus_fmt = soc_camera_platform_try_fmt, 90 119 .enum_mbus_fmt = soc_camera_platform_enum_fmt, 120 + .cropcap = soc_camera_platform_cropcap, 121 + .g_crop = soc_camera_platform_g_crop, 122 + .try_mbus_fmt = soc_camera_platform_fill_fmt, 123 + .g_mbus_fmt = soc_camera_platform_fill_fmt, 124 + .s_mbus_fmt = soc_camera_platform_fill_fmt, 91 125 }; 92 126 93 127 static struct v4l2_subdev_ops platform_subdev_ops = {