@@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <media/ths7303.h>
+#include <media/v4l2-async.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-device.h>
@@ -355,6 +356,7 @@ static int ths7303_probe(struct i2c_client *client,
struct ths7303_platform_data *pdata = client->dev.platform_data;
struct ths7303_state *state;
struct v4l2_subdev *sd;
+ int ret;
if (pdata == NULL) {
dev_err(&client->dev, "No platform data\n");
@@ -385,13 +387,20 @@ static int ths7303_probe(struct i2c_client *client,
return -EINVAL;
}
+ state->sd.dev = &client->dev;
+ ret = v4l2_async_register_subdev(&state->sd);
+ if (ret)
+ return ret;
+
return 0;
}
static int ths7303_remove(struct i2c_client *client)
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct ths7303_state *ths7303 = to_state(sd);
+ v4l2_async_unregister_subdev(&ths7303->sd);
v4l2_device_unregister_subdev(sd);
return 0;