summaryrefslogtreecommitdiff
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2014-03-04 19:24:08 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-12-24 01:27:25 +0100
commit42b9a12dcdf5912392c7a5db56ec611eb98a7c53 (patch)
tree6e677b252d40ea44b0fcdc030cf32f6cbb79b44f /drivers/media/platform
parent4034a058e47c5ddc15fb4c35def7dd39b7e3d842 (diff)
mxc_v4l2_capture: add mxc_camera_common_lock/unlock, fix device name
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit c9419af618e4e7944b56f65dce29f2f409681997) (cherry picked from commit 2e65a3ea2a4e3b27f7599db74d9c47a510c6dee8) Conflicts: drivers/media/platform/mxc/capture/mxc_v4l2_capture.c (cherry picked from commit 912f823a874ab9afb499c2ea344c6622db9d54ec)
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/mxc/capture/mxc_v4l2_capture.c18
-rw-r--r--drivers/media/platform/mxc/capture/mxc_v4l2_capture.h3
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
index 34b2e90860d7..a2877e84a53a 100644
--- a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
@@ -34,6 +34,7 @@
#include <linux/fb.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
+#include <linux/mutex.h>
#include <linux/mxcfb.h>
#include <linux/of_device.h>
#include <media/v4l2-chip-ident.h>
@@ -2660,6 +2661,7 @@ static int init_camera_struct(cam_data *cam, struct platform_device *pdev)
int ipu_id, csi_id, mclk_source;
int ret = 0;
struct v4l2_device *v4l2_dev;
+ static int camera_id;
pr_debug("In MVC: init_camera_struct\n");
@@ -2780,7 +2782,7 @@ static int init_camera_struct(cam_data *cam, struct platform_device *pdev)
cam->self = kmalloc(sizeof(struct v4l2_int_device), GFP_KERNEL);
cam->self->module = THIS_MODULE;
- sprintf(cam->self->name, "mxc_v4l2_cap%d", cam->csi);
+ sprintf(cam->self->name, "mxc_v4l2_cap%d", camera_id++);
cam->self->type = v4l2_int_type_master;
cam->self->u.master = &mxc_v4l2_master;
@@ -3145,6 +3147,20 @@ static void mxc_v4l2_master_detach(struct v4l2_int_device *slave)
vidioc_int_dev_exit(slave);
}
+DEFINE_MUTEX(camera_common_mutex);
+
+void mxc_camera_common_lock(void)
+{
+ mutex_lock(&camera_common_mutex);
+}
+EXPORT_SYMBOL(mxc_camera_common_lock);
+
+void mxc_camera_common_unlock(void)
+{
+ mutex_unlock(&camera_common_mutex);
+}
+EXPORT_SYMBOL(mxc_camera_common_unlock);
+
/*!
* Entry point for the V4L2
*
diff --git a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h
index d6be97cdea88..8a18c33b48dc 100644
--- a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h
+++ b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h
@@ -262,4 +262,7 @@ struct sensor_data {
};
void set_mclk_rate(uint32_t *p_mclk_freq, uint32_t csi);
+void mxc_camera_common_lock(void);
+void mxc_camera_common_unlock(void);
+
#endif /* __MXC_V4L2_CAPTURE_H__ */