diff options
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/media/v4l2-i2c-drv-legacy.h | 23 | ||||
-rw-r--r-- | linux/include/media/v4l2-i2c-drv.h | 15 |
2 files changed, 20 insertions, 18 deletions
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h index 31d6e103c..2887c53f7 100644 --- a/linux/include/media/v4l2-i2c-drv-legacy.h +++ b/linux/include/media/v4l2-i2c-drv-legacy.h @@ -37,7 +37,7 @@ struct v4l2_i2c_driver_data { }; static struct v4l2_i2c_driver_data v4l2_i2c_data; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) static const struct i2c_client_address_data addr_data; #else static struct i2c_client_address_data addr_data; @@ -77,25 +77,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state) #else static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_resume_helper(struct i2c_client *client) #else static int v4l2_i2c_drv_resume_helper(struct device * dev) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0; @@ -107,14 +107,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev) static struct i2c_driver v4l2_i2c_driver_legacy = { .driver = { .owner = THIS_MODULE, -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif }, .attach_adapter = v4l2_i2c_drv_probe_legacy, .detach_client = v4l2_i2c_drv_detach_legacy, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif @@ -123,18 +123,19 @@ static struct i2c_driver v4l2_i2c_driver_legacy = { /* ----------------------------------------------------------------------- */ /* i2c implementation */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) static struct i2c_driver v4l2_i2c_driver = { .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, }; -#endif + #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 +#endif static int __init v4l2_i2c_drv_init(void) { @@ -151,7 +152,7 @@ static int __init v4l2_i2c_drv_init(void) v4l2_i2c_driver_legacy.command = v4l2_i2c_data.command; err = i2c_add_driver(&v4l2_i2c_driver_legacy); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) if (err) return err; v4l2_i2c_driver.driver.name = v4l2_i2c_data.name; @@ -176,7 +177,7 @@ static int __init v4l2_i2c_drv_init(void) static void __exit v4l2_i2c_drv_cleanup(void) { i2c_del_driver(&v4l2_i2c_driver_legacy); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) i2c_del_driver(&v4l2_i2c_driver); #endif } diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h index 9333e56b3..734035ccf 100644 --- a/linux/include/media/v4l2-i2c-drv.h +++ b/linux/include/media/v4l2-i2c-drv.h @@ -44,13 +44,14 @@ struct v4l2_i2c_driver_data { static struct v4l2_i2c_driver_data v4l2_i2c_data; static struct i2c_driver v4l2_i2c_driver; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + #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 */ @@ -111,25 +112,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) return 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state) #else static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) static int v4l2_i2c_drv_resume_helper(struct i2c_client *client) #else static int v4l2_i2c_drv_resume_helper(struct device * dev) #endif { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) struct i2c_client *client = container_of(dev, struct i2c_client, dev); #endif return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0; @@ -140,14 +141,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev) static struct i2c_driver v4l2_i2c_driver = { .driver = { .owner = THIS_MODULE, -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif }, .attach_adapter = v4l2_i2c_drv_probe_legacy, .detach_client = v4l2_i2c_drv_detach_legacy, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20) .suspend = v4l2_i2c_drv_suspend_helper, .resume = v4l2_i2c_drv_resume_helper, #endif |