diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2015-09-21 07:23:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-10-01 07:42:00 -0400 |
commit | c7d97499cc8ab9f9cda0af5c1b078480e198eb4c (patch) | |
tree | 02a486267d92d99c74fed5db9020ecc2e659c30a | |
parent | f5b5fbd38776e06df8e74c2fa91a172435400486 (diff) |
[media] tvp5150: add support for asynchronous probing
Allow the subdevice to be probed asynchronously.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/i2c/tvp5150.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 522a865c5c60..3c5fb2509c47 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/videodev2.h> | 10 | #include <linux/videodev2.h> |
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <media/v4l2-async.h> | ||
13 | #include <media/v4l2-device.h> | 14 | #include <media/v4l2-device.h> |
14 | #include <media/tvp5150.h> | 15 | #include <media/tvp5150.h> |
15 | #include <media/v4l2-ctrls.h> | 16 | #include <media/v4l2-ctrls.h> |
@@ -1172,8 +1173,7 @@ static int tvp5150_probe(struct i2c_client *c, | |||
1172 | sd->ctrl_handler = &core->hdl; | 1173 | sd->ctrl_handler = &core->hdl; |
1173 | if (core->hdl.error) { | 1174 | if (core->hdl.error) { |
1174 | res = core->hdl.error; | 1175 | res = core->hdl.error; |
1175 | v4l2_ctrl_handler_free(&core->hdl); | 1176 | goto err; |
1176 | return res; | ||
1177 | } | 1177 | } |
1178 | v4l2_ctrl_handler_setup(&core->hdl); | 1178 | v4l2_ctrl_handler_setup(&core->hdl); |
1179 | 1179 | ||
@@ -1186,9 +1186,17 @@ static int tvp5150_probe(struct i2c_client *c, | |||
1186 | core->rect.left = 0; | 1186 | core->rect.left = 0; |
1187 | core->rect.width = TVP5150_H_MAX; | 1187 | core->rect.width = TVP5150_H_MAX; |
1188 | 1188 | ||
1189 | res = v4l2_async_register_subdev(sd); | ||
1190 | if (res < 0) | ||
1191 | goto err; | ||
1192 | |||
1189 | if (debug > 1) | 1193 | if (debug > 1) |
1190 | tvp5150_log_status(sd); | 1194 | tvp5150_log_status(sd); |
1191 | return 0; | 1195 | return 0; |
1196 | |||
1197 | err: | ||
1198 | v4l2_ctrl_handler_free(&core->hdl); | ||
1199 | return res; | ||
1192 | } | 1200 | } |
1193 | 1201 | ||
1194 | static int tvp5150_remove(struct i2c_client *c) | 1202 | static int tvp5150_remove(struct i2c_client *c) |
@@ -1200,7 +1208,7 @@ static int tvp5150_remove(struct i2c_client *c) | |||
1200 | "tvp5150.c: removing tvp5150 adapter on address 0x%x\n", | 1208 | "tvp5150.c: removing tvp5150 adapter on address 0x%x\n", |
1201 | c->addr << 1); | 1209 | c->addr << 1); |
1202 | 1210 | ||
1203 | v4l2_device_unregister_subdev(sd); | 1211 | v4l2_async_unregister_subdev(sd); |
1204 | v4l2_ctrl_handler_free(&decoder->hdl); | 1212 | v4l2_ctrl_handler_free(&decoder->hdl); |
1205 | return 0; | 1213 | return 0; |
1206 | } | 1214 | } |