V4L/DVB (11377): v4l: increase version numbers of drivers converted to v4l2_subdev.
[pandora-kernel.git] / include / media / saa7146.h
index c5a6e22..7a9f76e 100644 (file)
 #include <linux/stringify.h>
 #include <linux/mutex.h>
 #include <linux/scatterlist.h>
+#include <media/v4l2-device.h>
 
 #include <linux/vmalloc.h>     /* for vmalloc() */
 #include <linux/mm.h>          /* for vmalloc_to_page() */
 
-#define SAA7146_VERSION_CODE 0x000500  /* 0.5.0 */
+#define SAA7146_VERSION_CODE 0x000600  /* 0.6.0 */
 
 #define saa7146_write(sxy,adr,dat)    writel((dat),(sxy->mem+(adr)))
 #define saa7146_read(sxy,adr)         readl(sxy->mem+(adr))
@@ -110,6 +111,8 @@ struct saa7146_dev
 
        struct list_head                item;
 
+       struct v4l2_device              v4l2_dev;
+
        /* different device locks */
        spinlock_t                      slock;
        struct mutex                    lock;
@@ -145,6 +148,11 @@ struct saa7146_dev
        struct saa7146_dma              d_rps1;
 };
 
+static inline struct saa7146_dev *to_saa7146_dev(struct v4l2_device *v4l2_dev)
+{
+       return container_of(v4l2_dev, struct saa7146_dev, v4l2_dev);
+}
+
 /* from saa7146_i2c.c */
 int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate);