From: Lad, Prabhakar <[email protected]>

Both synchronous and asynchronous tvp7002 subdevice probing is supported by
this patch.

Signed-off-by: Lad, Prabhakar <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Cc: Sylwester Nawrocki <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
 drivers/media/i2c/tvp7002.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index f4114bf..d5113d1 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -31,6 +31,7 @@
 #include <linux/v4l2-dv-timings.h>
 
 #include <media/tvp7002.h>
+#include <media/v4l2-async.h>
 #include <media/v4l2-chip-ident.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
@@ -1073,6 +1074,11 @@ static int tvp7002_probe(struct i2c_client *c, const 
struct i2c_device_id *id)
        }
        v4l2_ctrl_handler_setup(&device->hdl);
 
+       device->sd.dev = &c->dev;
+       error = v4l2_async_register_subdev(&device->sd);
+       if (error)
+               goto error;
+
        return 0;
 
 error:
@@ -1097,6 +1103,7 @@ static int tvp7002_remove(struct i2c_client *c)
 
        v4l2_dbg(1, debug, sd, "Removing tvp7002 adapter"
                                "on address 0x%x\n", c->addr);
+       v4l2_async_unregister_subdev(&device->sd);
 #if defined(CONFIG_MEDIA_CONTROLLER)
        media_entity_cleanup(&device->sd.entity);
 #endif
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to