diff options
-rw-r--r-- | include/media/v4l2-i2c-drv-legacy.h | 6 | ||||
-rw-r--r-- | include/media/v4l2-i2c-drv.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h index c059b32844c1..433c984eefa5 100644 --- a/include/media/v4l2-i2c-drv-legacy.h +++ b/include/media/v4l2-i2c-drv-legacy.h | |||
@@ -29,6 +29,7 @@ struct v4l2_i2c_driver_data { | |||
29 | int (*remove)(struct i2c_client *client); | 29 | int (*remove)(struct i2c_client *client); |
30 | int (*suspend)(struct i2c_client *client, pm_message_t state); | 30 | int (*suspend)(struct i2c_client *client, pm_message_t state); |
31 | int (*resume)(struct i2c_client *client); | 31 | int (*resume)(struct i2c_client *client); |
32 | int (*legacy_probe)(struct i2c_adapter *adapter); | ||
32 | int legacy_class; | 33 | int legacy_class; |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -45,6 +46,11 @@ static int v4l2_i2c_drv_attach_legacy(struct i2c_adapter *adapter, int address, | |||
45 | 46 | ||
46 | static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) | 47 | static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) |
47 | { | 48 | { |
49 | if (v4l2_i2c_data.legacy_probe) { | ||
50 | if (v4l2_i2c_data.legacy_probe(adapter)) | ||
51 | return i2c_probe(adapter, &addr_data, v4l2_i2c_drv_attach_legacy); | ||
52 | return 0; | ||
53 | } | ||
48 | if (adapter->class & v4l2_i2c_data.legacy_class) | 54 | if (adapter->class & v4l2_i2c_data.legacy_class) |
49 | return i2c_probe(adapter, &addr_data, v4l2_i2c_drv_attach_legacy); | 55 | return i2c_probe(adapter, &addr_data, v4l2_i2c_drv_attach_legacy); |
50 | return 0; | 56 | return 0; |
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h index 547db60d3640..bc61ab27779d 100644 --- a/include/media/v4l2-i2c-drv.h +++ b/include/media/v4l2-i2c-drv.h | |||
@@ -29,6 +29,7 @@ struct v4l2_i2c_driver_data { | |||
29 | int (*remove)(struct i2c_client *client); | 29 | int (*remove)(struct i2c_client *client); |
30 | int (*suspend)(struct i2c_client *client, pm_message_t state); | 30 | int (*suspend)(struct i2c_client *client, pm_message_t state); |
31 | int (*resume)(struct i2c_client *client); | 31 | int (*resume)(struct i2c_client *client); |
32 | int (*legacy_probe)(struct i2c_adapter *adapter); | ||
32 | int legacy_class; | 33 | int legacy_class; |
33 | }; | 34 | }; |
34 | 35 | ||