summaryrefslogtreecommitdiff
path: root/linux/include/media/v4l2-i2c-drv-legacy.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux/include/media/v4l2-i2c-drv-legacy.h')
-rw-r--r--linux/include/media/v4l2-i2c-drv-legacy.h10
1 files changed, 7 insertions, 3 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);