From patchwork Thu Sep 8 13:05:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9321301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA5126077F for ; Thu, 8 Sep 2016 13:06:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B6A42972F for ; Thu, 8 Sep 2016 13:06:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9004929845; Thu, 8 Sep 2016 13:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C92B12972F for ; Thu, 8 Sep 2016 13:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934873AbcIHNGA (ORCPT ); Thu, 8 Sep 2016 09:06:00 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:48379 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbcIHNF7 (ORCPT ); Thu, 8 Sep 2016 09:05:59 -0400 Received: from localhost (localhost [127.0.0.1]) by s-opensource.com (Postfix) with ESMTP id 03D3EA0E77; Thu, 8 Sep 2016 13:06:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from s-opensource.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cZktPOYHz34S; Thu, 8 Sep 2016 13:05:58 +0000 (UTC) Received: from minerva.sisa.samsung.com (host-28.58.217.201.copaco.com.py [201.217.58.28]) by s-opensource.com (Postfix) with ESMTPSA id 4C44CA0E61; Thu, 8 Sep 2016 13:05:52 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: "H . Nikolaus Schaller" , Javier Martinez Canillas , Mauro Carvalho Chehab , Arnd Bergmann , Guennadi Liakhovetski , Laurent Pinchart , Hans Verkuil , Andrew Morton , linux-media@vger.kernel.org Subject: [PATCH] [media] ov9650: add support for asynchronous probing Date: Thu, 8 Sep 2016 09:05:40 -0400 Message-Id: <1473339940-24572-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 #include +#include #include #include #include @@ -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);