diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2015-02-27 11:10:19 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 20:28:54 -0400 |
commit | 9012d0888c8fc473d5760f2367b002dfddee80f9 (patch) | |
tree | 2fb597985af352112adf0f3ab48bc1d5823f6708 /drivers/media/i2c | |
parent | 15af4a532f7fb21f7e02973a4829735ce13190c0 (diff) |
[media] media: i2c: mt9p031: add support for asynchronous probing
Both synchronous and asynchronous mt9p031 subdevice probing
is supported by this patch.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/mt9p031.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index 2bf0e6843955..9258d048a1e3 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | 29 | ||
30 | #include <media/mt9p031.h> | 30 | #include <media/mt9p031.h> |
31 | #include <media/v4l2-async.h> | ||
31 | #include <media/v4l2-ctrls.h> | 32 | #include <media/v4l2-ctrls.h> |
32 | #include <media/v4l2-device.h> | 33 | #include <media/v4l2-device.h> |
33 | #include <media/v4l2-subdev.h> | 34 | #include <media/v4l2-subdev.h> |
@@ -1145,6 +1146,10 @@ static int mt9p031_probe(struct i2c_client *client, | |||
1145 | } | 1146 | } |
1146 | 1147 | ||
1147 | ret = mt9p031_clk_setup(mt9p031); | 1148 | ret = mt9p031_clk_setup(mt9p031); |
1149 | if (ret) | ||
1150 | goto done; | ||
1151 | |||
1152 | ret = v4l2_async_register_subdev(&mt9p031->subdev); | ||
1148 | 1153 | ||
1149 | done: | 1154 | done: |
1150 | if (ret < 0) { | 1155 | if (ret < 0) { |
@@ -1162,7 +1167,7 @@ static int mt9p031_remove(struct i2c_client *client) | |||
1162 | struct mt9p031 *mt9p031 = to_mt9p031(subdev); | 1167 | struct mt9p031 *mt9p031 = to_mt9p031(subdev); |
1163 | 1168 | ||
1164 | v4l2_ctrl_handler_free(&mt9p031->ctrls); | 1169 | v4l2_ctrl_handler_free(&mt9p031->ctrls); |
1165 | v4l2_device_unregister_subdev(subdev); | 1170 | v4l2_async_unregister_subdev(subdev); |
1166 | media_entity_cleanup(&subdev->entity); | 1171 | media_entity_cleanup(&subdev->entity); |
1167 | mutex_destroy(&mt9p031->power_lock); | 1172 | mutex_destroy(&mt9p031->power_lock); |
1168 | 1173 | ||