]> err.no Git - linux-2.6/blobdiff - include/media/soc_camera.h
Merge branch 'core/rodata' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux...
[linux-2.6] / include / media / soc_camera.h
index 3e48e435b21a3deba53fa4e1cf4c3af5d2f01330..6a8c8be7a1aed7694aac8148b605a3f8448f1a59 100644 (file)
@@ -38,8 +38,8 @@ struct soc_camera_device {
        struct soc_camera_ops *ops;
        struct video_device *vdev;
        const struct soc_camera_data_format *current_fmt;
-       int (*probe)(struct soc_camera_device *icd);
-       void (*remove)(struct soc_camera_device *icd);
+       const struct soc_camera_data_format *formats;
+       int num_formats;
        struct module *owner;
        /* soc_camera.c private count. Only accessed with video_lock held */
        int use_count;
@@ -48,6 +48,7 @@ struct soc_camera_device {
 struct soc_camera_file {
        struct soc_camera_device *icd;
        struct videobuf_queue vb_vidq;
+       spinlock_t *lock;
 };
 
 struct soc_camera_host {
@@ -56,9 +57,13 @@ struct soc_camera_host {
        unsigned char nr;                               /* Host number */
        size_t msize;
        struct videobuf_queue_ops *vbq_ops;
-       struct module *owner;
        void *priv;
        char *drv_name;
+       struct soc_camera_host_ops *ops;
+};
+
+struct soc_camera_host_ops {
+       struct module *owner;
        int (*add)(struct soc_camera_device *);
        void (*remove)(struct soc_camera_device *);
        int (*set_fmt_cap)(struct soc_camera_device *, __u32,
@@ -69,6 +74,8 @@ struct soc_camera_host {
        int (*try_bus_param)(struct soc_camera_device *, __u32);
        int (*set_bus_param)(struct soc_camera_device *, __u32);
        unsigned int (*poll)(struct file *, poll_table *);
+       spinlock_t* (*spinlock_alloc)(struct soc_camera_file *);
+       void (*spinlock_free)(spinlock_t *);
 };
 
 struct soc_camera_link {
@@ -88,8 +95,7 @@ static inline struct soc_camera_host *to_soc_camera_host(struct device *dev)
        return container_of(dev, struct soc_camera_host, dev);
 }
 
-extern int soc_camera_host_register(struct soc_camera_host *ici,
-                                    struct module *owner);
+extern int soc_camera_host_register(struct soc_camera_host *ici);
 extern void soc_camera_host_unregister(struct soc_camera_host *ici);
 extern int soc_camera_device_register(struct soc_camera_device *icd);
 extern void soc_camera_device_unregister(struct soc_camera_device *icd);
@@ -106,6 +112,8 @@ struct soc_camera_data_format {
 
 struct soc_camera_ops {
        struct module *owner;
+       int (*probe)(struct soc_camera_device *);
+       void (*remove)(struct soc_camera_device *);
        int (*init)(struct soc_camera_device *);
        int (*release)(struct soc_camera_device *);
        int (*start_capture)(struct soc_camera_device *);
@@ -121,8 +129,6 @@ struct soc_camera_ops {
        int (*get_register)(struct soc_camera_device *, struct v4l2_register *);
        int (*set_register)(struct soc_camera_device *, struct v4l2_register *);
 #endif
-       const struct soc_camera_data_format *formats;
-       int num_formats;
        int (*get_control)(struct soc_camera_device *, struct v4l2_control *);
        int (*set_control)(struct soc_camera_device *, struct v4l2_control *);
        const struct v4l2_queryctrl *controls;