From patchwork Sat Jun 22 10:07:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2765561 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C3A83C0AB1 for ; Sat, 22 Jun 2013 10:09:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F191920103 for ; Sat, 22 Jun 2013 10:09:36 +0000 (UTC) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D599C20102 for ; Sat, 22 Jun 2013 10:09:35 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5MA87ba002167; Sat, 22 Jun 2013 05:08:07 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5MA875G026298; Sat, 22 Jun 2013 05:08:07 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Sat, 22 Jun 2013 05:08:07 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5MA87A8021806; Sat, 22 Jun 2013 05:08:07 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id EB18080627; Sat, 22 Jun 2013 05:08:06 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 558FC80626 for ; Sat, 22 Jun 2013 05:08:05 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5MA84xZ029762 for ; Sat, 22 Jun 2013 05:08:04 -0500 (CDT) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5MA84Hd021434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 22 Jun 2013 05:08:04 -0500 Received: from [216.82.242.131:9417] by server-5.bemta-8.messagelabs.com id 55/CF-07470-48775C15; Sat, 22 Jun 2013 10:08:04 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-7.tower-76.messagelabs.com!1371895682!31597874!1 X-Originating-IP: [209.85.160.46] X-SpamReason: No, hits=0.2 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, RCVD_ILLEGAL_IP,spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.9; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9273 invoked from network); 22 Jun 2013 10:08:03 -0000 Received: from mail-pb0-f46.google.com (HELO mail-pb0-f46.google.com) (209.85.160.46) by server-7.tower-76.messagelabs.com with RC4-SHA encrypted SMTP; 22 Jun 2013 10:08:03 -0000 Received: by mail-pb0-f46.google.com with SMTP id rq2so8877755pbb.33 for ; Sat, 22 Jun 2013 03:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=2NpZiypAZ57r03R170MLb8NP5hRh3ULHOXTxFa+2lpI=; b=SEFc3v23LVOCqidq3PQL8xgJq8Zg+llyOHTljTg9XHBKXsQoYqEjCk7Z1FWyA6aHBj eXQdOOZ8lkm88Vd9yi2iiD0WGgR7NkV2EVJh9XvK+Kw2V10Mwynv9vqmc+/217ojWo8l hBMDYCrO1l9y/+QhvIMQ9Eiu8WHG6XCYArMA1QHU8VvGItkYbpSNu2UxrtBtwC49X4vo LwkxuIX38Ud5hECKc+97e2hWGho/JJBg9x9YrEqysN6k//ET0E76ghP9ea6z0XuZoxHC 0FAY7xEiennuI8trZVNu1a25ttTpPeK7+fgPspO60LwQfck0wDDCWPCf0bPYyawa4BuY WYNA== X-Received: by 10.68.163.68 with SMTP id yg4mr15926997pbb.64.1371895682355; Sat, 22 Jun 2013 03:08:02 -0700 (PDT) Received: from localhost.localdomain ([1.23.214.121]) by mx.google.com with ESMTPSA id gb2sm8294324pbd.38.2013.06.22.03.07.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Jun 2013 03:08:01 -0700 (PDT) From: Prabhakar Lad To: Mauro Carvalho Chehab , LMML , Hans Verkuil , Laurent Pinchart Subject: [PATCH] media: i2c: adv7343: add support for asynchronous probing Date: Sat, 22 Jun 2013 15:37:37 +0530 Message-ID: <1371895657-2898-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 CC: DLOS , LKML , Sakari Ailus , 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@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Guennadi Liakhovetski --- drivers/media/i2c/adv7343.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c index 7606218..8080c2c 100644 --- a/drivers/media/i2c/adv7343.c +++ b/drivers/media/i2c/adv7343.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -445,16 +446,21 @@ 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; + + err = v4l2_async_register_subdev(&state->sd); + +done: + if (err < 0) v4l2_ctrl_handler_free(&state->hdl); + return err; } @@ -463,6 +469,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);