Commit 6555cfc5 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab

[media] media: i2c: adv7343: add support for asynchronous probing

Both synchronous and asynchronous adv7343 subdevice probing is supported by
this patch.
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 0fb0f8f5
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <media/adv7343.h> #include <media/adv7343.h>
#include <media/v4l2-async.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
...@@ -445,16 +446,21 @@ static int adv7343_probe(struct i2c_client *client, ...@@ -445,16 +446,21 @@ static int adv7343_probe(struct i2c_client *client,
ADV7343_GAIN_DEF); ADV7343_GAIN_DEF);
state->sd.ctrl_handler = &state->hdl; state->sd.ctrl_handler = &state->hdl;
if (state->hdl.error) { if (state->hdl.error) {
int err = state->hdl.error; err = state->hdl.error;
goto done;
v4l2_ctrl_handler_free(&state->hdl);
return err;
} }
v4l2_ctrl_handler_setup(&state->hdl); v4l2_ctrl_handler_setup(&state->hdl);
err = adv7343_initialize(&state->sd); err = adv7343_initialize(&state->sd);
if (err) if (err)
goto done;
err = v4l2_async_register_subdev(&state->sd);
done:
if (err < 0)
v4l2_ctrl_handler_free(&state->hdl); v4l2_ctrl_handler_free(&state->hdl);
return err; return err;
} }
...@@ -463,6 +469,7 @@ static int adv7343_remove(struct i2c_client *client) ...@@ -463,6 +469,7 @@ static int adv7343_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client); struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct adv7343_state *state = to_state(sd); struct adv7343_state *state = to_state(sd);
v4l2_async_unregister_subdev(&state->sd);
v4l2_device_unregister_subdev(sd); v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&state->hdl); v4l2_ctrl_handler_free(&state->hdl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment