From patchwork Tue May 14 06:47:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2563131 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork1.kernel.org (Postfix) with ESMTP id 3AF9B3FC5A for ; Tue, 14 May 2013 06:48:09 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4E6m8Hs005278 for ; Tue, 14 May 2013 01:48:08 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4E6m8eW006090 for ; Tue, 14 May 2013 01:48:08 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 14 May 2013 01:48:08 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4E6m8mv011111 for ; Tue, 14 May 2013 01:48:08 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 80E2180628 for ; Tue, 14 May 2013 01:48:08 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 068AE80626 for ; Tue, 14 May 2013 01:47:59 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r4E6lw6g028507 for ; Tue, 14 May 2013 01:47:58 -0500 (CDT) Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4E6lw4D001330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 May 2013 01:47:58 -0500 Received: from [216.82.253.163:58669] by server-12.bemta-7.messagelabs.com id CA/61-15214-E1ED1915; Tue, 14 May 2013 06:47:58 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-11.tower-166.messagelabs.com!1368514076!1572736!1 X-Originating-IP: [209.85.210.52] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12647 invoked from network); 14 May 2013 06:47:57 -0000 Received: from mail-da0-f52.google.com (HELO mail-da0-f52.google.com) (209.85.210.52) by server-11.tower-166.messagelabs.com with RC4-SHA encrypted SMTP; 14 May 2013 06:47:57 -0000 Received: by mail-da0-f52.google.com with SMTP id o9so119489dan.25 for ; Mon, 13 May 2013 23:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=gtd56FRZe0ILNSGq/WEXPqc9ck/pFOUyefe8GXT/6yU=; b=dS5dh0jLhFYaqHjw/vPg0KA68qnJ1KfbRowmUwqjirIkzM9LHm4ebjffDQ7iXIEttT XK4aZswcejSxEteggYuBQPALfW9afcl+Qewplm7+0A0IBRurI6wycjZwCYA9TBGFehU0 zOreiK/jwsTXOpPH5wqAuDODRD0wCJGcje0GY6/cDC/AwaGaEYJ02uN9J41HFmHSxcqc b8WUGmRXuQHNcx+fvWKvqpxeBcqaPIXqRtODVR/rPn8/qu/3WDBEKn1i/s6L+L8j31wv t3pq5twZ/wynvU9dUeotbD6Egeg5J7fSTUhrYgYFEEN+h24sTQMra82KWxh7McKRHMWG mIGA== X-Received: by 10.68.176.133 with SMTP id ci5mr32532914pbc.21.1368514076721; Mon, 13 May 2013 23:47:56 -0700 (PDT) Received: from localhost.localdomain ([59.98.240.128]) by mx.google.com with ESMTPSA id lq4sm12114995pab.19.2013.05.13.23.47.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 23:47:55 -0700 (PDT) From: Lad Prabhakar To: LMML Subject: [PATCH RFC v3 1/4] media: i2c: adv7343: add support for asynchronous probing Date: Tue, 14 May 2013 12:17:33 +0530 Message-ID: <1368514056-28859-2-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1368514056-28859-1-git-send-email-prabhakar.csengg@gmail.com> References: <1368514056-28859-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , Mauro Carvalho Chehab , LKML , Sakari Ailus , Laurent Pinchart , Guennadi Liakhovetski X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com From: Lad, Prabhakar Both synchronous and asynchronous adv7343 subdevice probing is supported by this patch. Signed-off-by: Lad, Prabhakar Cc: Guennadi Liakhovetski Cc: Laurent Pinchart Cc: Hans Verkuil Cc: Sakari Ailus Cc: Mauro Carvalho Chehab --- drivers/media/i2c/adv7343.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c index 9fc2b98..469e262 100644 --- a/drivers/media/i2c/adv7343.c +++ b/drivers/media/i2c/adv7343.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -455,16 +456,22 @@ static int adv7343_probe(struct i2c_client *client, ADV7343_GAIN_DEF); state->sd.ctrl_handler = &state->hdl; if (state->hdl.error) { - int err = state->hdl.error; - - v4l2_ctrl_handler_free(&state->hdl); - return err; + err = state->hdl.error; + goto done; } v4l2_ctrl_handler_setup(&state->hdl); err = adv7343_initialize(&state->sd); if (err) + goto done; + + state->sd.dev = &client->dev; + err = v4l2_async_register_subdev(&state->sd); + +done: + if (err < 0) v4l2_ctrl_handler_free(&state->hdl); + return err; } @@ -473,6 +480,7 @@ static int adv7343_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); struct adv7343_state *state = to_state(sd); + v4l2_async_unregister_subdev(&state->sd); v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&state->hdl);