[media] SoC Camera: add support for g_parm / s_parm operations
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Sat, 11 Sep 2010 01:26:16 +0000 (22:26 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:55:39 +0000 (07:55 -0200)
This patch adds support for g_parm / s_parm operations to the SoC Camera
framework. It is usefull for checking/setting camera frame rate.

Example usage can be found in the previous patch from this series,
"SoC Camera: add driver for OV6650 sensor".

Created and tested against linux-2.6.36-rc3 on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/soc_camera.c

index 6876fdcbf8d7bb31f55ef3b15ba88d2ab64e5466..c11a080b06ad449f9cb20dbadc649353a33ba488 100644 (file)
@@ -1146,6 +1146,20 @@ static int default_s_crop(struct soc_camera_device *icd, struct v4l2_crop *a)
        return v4l2_subdev_call(sd, video, s_crop, a);
 }
 
+static int default_g_parm(struct soc_camera_device *icd,
+                         struct v4l2_streamparm *parm)
+{
+       struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+       return v4l2_subdev_call(sd, video, g_parm, parm);
+}
+
+static int default_s_parm(struct soc_camera_device *icd,
+                         struct v4l2_streamparm *parm)
+{
+       struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+       return v4l2_subdev_call(sd, video, s_parm, parm);
+}
+
 static void soc_camera_device_init(struct device *dev, void *pdata)
 {
        dev->platform_data      = pdata;
@@ -1177,6 +1191,10 @@ int soc_camera_host_register(struct soc_camera_host *ici)
                ici->ops->get_crop = default_g_crop;
        if (!ici->ops->cropcap)
                ici->ops->cropcap = default_cropcap;
+       if (!ici->ops->set_parm)
+               ici->ops->set_parm = default_s_parm;
+       if (!ici->ops->get_parm)
+               ici->ops->get_parm = default_g_parm;
 
        mutex_lock(&list_lock);
        list_for_each_entry(ix, &hosts, list) {