Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=88307eb3c69c80a705072e68463d8f72005fc027
Commit:     88307eb3c69c80a705072e68463d8f72005fc027
Parent:     1a39275a3f2fc6fbdb876f5121d67d4b13310c5b
Author:     Hans Verkuil <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 14 04:49:16 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:01:23 2008 -0200

    V4L/DVB (6460): v4l2-i2c-drv: add legacy_probe function pointer
    
    Some devices do complicated tests whether the device can be probed or not.
    Add a legacy_probe function pointer to support that.
    
    Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 include/media/v4l2-i2c-drv-legacy.h |    6 ++++++
 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 c059b32..433c984 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 {
        int (*remove)(struct i2c_client *client);
        int (*suspend)(struct i2c_client *client, pm_message_t state);
        int (*resume)(struct i2c_client *client);
+       int (*legacy_probe)(struct i2c_adapter *adapter);
        int legacy_class;
 };
 
@@ -45,6 +46,11 @@ static int v4l2_i2c_drv_attach_legacy(struct i2c_adapter 
*adapter, int address,
 
 static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter)
 {
+       if (v4l2_i2c_data.legacy_probe) {
+               if (v4l2_i2c_data.legacy_probe(adapter))
+                       return i2c_probe(adapter, &addr_data, 
v4l2_i2c_drv_attach_legacy);
+               return 0;
+       }
        if (adapter->class & v4l2_i2c_data.legacy_class)
                return i2c_probe(adapter, &addr_data, 
v4l2_i2c_drv_attach_legacy);
        return 0;
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 547db60..bc61ab2 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -29,6 +29,7 @@ struct v4l2_i2c_driver_data {
        int (*remove)(struct i2c_client *client);
        int (*suspend)(struct i2c_client *client, pm_message_t state);
        int (*resume)(struct i2c_client *client);
+       int (*legacy_probe)(struct i2c_adapter *adapter);
        int legacy_class;
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to