All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] ov9650: add support for asynchronous probing
@ 2016-09-08 13:05 Javier Martinez Canillas
  2016-09-08 17:08 ` H. Nikolaus Schaller
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2016-09-08 13:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Nikolaus Schaller, Javier Martinez Canillas,
	Mauro Carvalho Chehab, Arnd Bergmann, Guennadi Liakhovetski,
	Laurent Pinchart, Hans Verkuil, Andrew Morton, linux-media

Allow the sub-device to be probed asynchronously so a bridge driver that's
waiting for the device can be notified and its .bound callback executed.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/media/i2c/ov9650.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c
index be5a7fd4f076..502c72238a4a 100644
--- a/drivers/media/i2c/ov9650.c
+++ b/drivers/media/i2c/ov9650.c
@@ -23,6 +23,7 @@
 #include <linux/videodev2.h>
 
 #include <media/media-entity.h>
+#include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-event.h>
@@ -1520,6 +1521,10 @@ static int ov965x_probe(struct i2c_client *client,
 	/* Update exposure time min/max to match frame format */
 	ov965x_update_exposure_ctrl(ov965x);
 
+	ret = v4l2_async_register_subdev(sd);
+	if (ret < 0)
+		goto err_ctrls;
+
 	return 0;
 err_ctrls:
 	v4l2_ctrl_handler_free(sd->ctrl_handler);
@@ -1532,7 +1537,7 @@ static int ov965x_remove(struct i2c_client *client)
 {
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 
-	v4l2_device_unregister_subdev(sd);
+	v4l2_async_unregister_subdev(sd);
 	v4l2_ctrl_handler_free(sd->ctrl_handler);
 	media_entity_cleanup(&sd->entity);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] ov9650: add support for asynchronous probing
  2016-09-08 13:05 [PATCH] [media] ov9650: add support for asynchronous probing Javier Martinez Canillas
@ 2016-09-08 17:08 ` H. Nikolaus Schaller
  0 siblings, 0 replies; 2+ messages in thread
From: H. Nikolaus Schaller @ 2016-09-08 17:08 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, Mauro Carvalho Chehab, Arnd Bergmann,
	Guennadi Liakhovetski, Laurent Pinchart, Hans Verkuil,
	Andrew Morton, linux-media


> Am 08.09.2016 um 15:05 schrieb Javier Martinez Canillas <javier@osg.samsung.com>:
> 
> Allow the sub-device to be probed asynchronously so a bridge driver that's
> waiting for the device can be notified and its .bound callback executed.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Tested-by: hns@goldelico.com

> 
> ---
> 
> drivers/media/i2c/ov9650.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c
> index be5a7fd4f076..502c72238a4a 100644
> --- a/drivers/media/i2c/ov9650.c
> +++ b/drivers/media/i2c/ov9650.c
> @@ -23,6 +23,7 @@
> #include <linux/videodev2.h>
> 
> #include <media/media-entity.h>
> +#include <media/v4l2-async.h>
> #include <media/v4l2-ctrls.h>
> #include <media/v4l2-device.h>
> #include <media/v4l2-event.h>
> @@ -1520,6 +1521,10 @@ static int ov965x_probe(struct i2c_client *client,
> 	/* Update exposure time min/max to match frame format */
> 	ov965x_update_exposure_ctrl(ov965x);
> 
> +	ret = v4l2_async_register_subdev(sd);
> +	if (ret < 0)
> +		goto err_ctrls;
> +
> 	return 0;
> err_ctrls:
> 	v4l2_ctrl_handler_free(sd->ctrl_handler);
> @@ -1532,7 +1537,7 @@ static int ov965x_remove(struct i2c_client *client)
> {
> 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
> 
> -	v4l2_device_unregister_subdev(sd);
> +	v4l2_async_unregister_subdev(sd);
> 	v4l2_ctrl_handler_free(sd->ctrl_handler);
> 	media_entity_cleanup(&sd->entity);
> 
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-08 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08 13:05 [PATCH] [media] ov9650: add support for asynchronous probing Javier Martinez Canillas
2016-09-08 17:08 ` H. Nikolaus Schaller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.