summaryrefslogtreecommitdiff
path: root/linux/include
diff options
context:
space:
mode:
Diffstat (limited to 'linux/include')
-rw-r--r--linux/include/media/v4l2-i2c-drv-legacy.h10
-rw-r--r--linux/include/media/v4l2-i2c-drv.h9
2 files changed, 14 insertions, 5 deletions
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h
index 7494bdcc3..e95e2a072 100644
--- a/linux/include/media/v4l2-i2c-drv-legacy.h
+++ b/linux/include/media/v4l2-i2c-drv-legacy.h
@@ -35,6 +35,9 @@ struct v4l2_i2c_driver_data {
#else
int legacy_id;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ const struct i2c_device_id *id_table;
+#endif
};
static struct v4l2_i2c_driver_data v4l2_i2c_data;
@@ -167,9 +170,7 @@ static struct i2c_driver v4l2_i2c_driver = {
.resume = v4l2_i2c_drv_resume_helper,
};
#endif
-
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 26)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static int compat_legacy_probe(struct i2c_client *client)
{
return v4l2_i2c_data.probe(client, NULL);
@@ -212,6 +213,9 @@ static int __init v4l2_i2c_drv_init(void)
v4l2_i2c_driver.probe = compat_legacy_probe;
#endif
v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
+#endif
err = i2c_add_driver(&v4l2_i2c_driver);
if (err)
i2c_del_driver(&v4l2_i2c_driver_legacy);
diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h
index 5b4959620..73d713f07 100644
--- a/linux/include/media/v4l2-i2c-drv.h
+++ b/linux/include/media/v4l2-i2c-drv.h
@@ -40,18 +40,20 @@ struct v4l2_i2c_driver_data {
#else
int legacy_id;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ const struct i2c_device_id *id_table;
+#endif
};
static struct v4l2_i2c_driver_data v4l2_i2c_data;
static struct i2c_driver v4l2_i2c_driver;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 26)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static int compat_legacy_probe(struct i2c_client *client)
{
return v4l2_i2c_data.probe(client, NULL);
}
#endif
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
/* Bus-based I2C implementation for kernels >= 2.6.22 */
@@ -69,6 +71,9 @@ static int __init v4l2_i2c_drv_init(void)
v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
+#endif
return i2c_add_driver(&v4l2_i2c_driver);
}