summaryrefslogtreecommitdiff
path: root/drivers/media/video/s5p-fimc/fimc-mdevice.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2011-08-25 02:25:10 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-07 00:39:33 +0400
commit131b6c619758ed8fd16d26b06a423801a497b867 (patch)
tree88c5069c9e9782a073c2dd72536db42f7dc27694 /drivers/media/video/s5p-fimc/fimc-mdevice.c
parente578588eb01d9493513ca1527f464715cfd3f47f (diff)
downloadlinux-131b6c619758ed8fd16d26b06a423801a497b867.tar.xz
[media] s5p-fimc: Convert to the new control framework
Convert the v4l controls code to use the new control framework. fimc_ctrls_activate/deactivate functions are introduced for the transparent DMA transfer mode (JPEG), where the rotation and flipping controls are not supported. The capture video node does not inherit sensors' controls when the subdevs are configured by the user space (user_subdev_api == true). However by default after the driver's initialization the 'user-subdev_api' flag is false and any sensor controls will also be available at the video node. When the pipeline links are disconnected through the media device the FIMC and any sensor inherited controls are destroyed and then again created when the pipeline connection completes. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-mdevice.c')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-mdevice.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c
index 50f3fcaa4e77..13ce2a43027c 100644
--- a/drivers/media/video/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c
@@ -22,6 +22,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/version.h>
+#include <media/v4l2-ctrls.h>
#include <media/media-device.h>
#include "fimc-core.h"
@@ -649,15 +650,23 @@ static int fimc_md_link_notify(struct media_pad *source,
ret = __fimc_pipeline_shutdown(fimc);
fimc->pipeline.sensor = NULL;
fimc->pipeline.csis = NULL;
+
+ mutex_lock(&fimc->lock);
+ fimc_ctrls_delete(fimc->vid_cap.ctx);
+ mutex_unlock(&fimc->lock);
return ret;
}
/*
* Link activation. Enable power of pipeline elements only if the
* pipeline is already in use, i.e. its video node is opened.
+ * Recreate the controls destroyed during the link deactivation.
*/
mutex_lock(&fimc->lock);
- if (fimc->vid_cap.refcnt > 0)
+ if (fimc->vid_cap.refcnt > 0) {
ret = __fimc_pipeline_initialize(fimc, source->entity, true);
+ if (!ret)
+ ret = fimc_capture_ctrls_create(fimc);
+ }
mutex_unlock(&fimc->lock);
return ret ? -EPIPE : ret;