diff options
author | Troy Kisky <troy.kisky@boundarydevices.com> | 2014-03-04 19:24:08 -0700 |
---|---|---|
committer | Troy Kisky <troy.kisky@boundarydevices.com> | 2014-04-24 18:59:42 -0700 |
commit | c9419af618e4e7944b56f65dce29f2f409681997 (patch) | |
tree | 4c0248dbfefef1f4bdd123ae98ec4ef6ae384817 /drivers/media | |
parent | 0819a33c3c4bd7be2bc3b837a5cf5a5eebb7411b (diff) |
mxc_v4l2_capture: add mxc_camera_common_lock/unlock, fix device name
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/mxc/capture/mxc_v4l2_capture.c | 18 | ||||
-rw-r--r-- | drivers/media/platform/mxc/capture/mxc_v4l2_capture.h | 3 |
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 42d757b2c948..6a0d097a5961 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> @@ -2672,6 +2673,7 @@ static int init_camera_struct(cam_data *cam, struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; int ipu_id, csi_id, mclk_source; int ret = 0; + static int camera_id; pr_debug("%s\n", __func__); @@ -2777,7 +2779,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; @@ -3126,6 +3128,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 48fa4fd3eb83..5835daedf4c0 100644 --- a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h +++ b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.h @@ -260,4 +260,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__ */ |