From patchwork Sat Jun 22 09:46:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2765471 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE6DF9F472 for ; Sat, 22 Jun 2013 09:49:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DADDB20103 for ; Sat, 22 Jun 2013 09:49:01 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15EA420102 for ; Sat, 22 Jun 2013 09:48:57 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5M9ler7008320; Sat, 22 Jun 2013 04:47:41 -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 r5M9lek2006462; Sat, 22 Jun 2013 04:47:40 -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 04:47:40 -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 r5M9leIK009716; Sat, 22 Jun 2013 04:47:40 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3001E80627; Sat, 22 Jun 2013 04:47:40 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id E19D080626 for ; Sat, 22 Jun 2013 04:47:37 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r5M9lbkW010391 for ; Sat, 22 Jun 2013 04:47:37 -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 r5M9lbr2019817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 22 Jun 2013 04:47:37 -0500 Received: from [216.82.253.67:14108] by server-10.bemta-7.messagelabs.com id 64/1F-09484-9B275C15; Sat, 22 Jun 2013 09:47:37 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-15.tower-158.messagelabs.com!1371894455!3283822!1 X-Originating-IP: [209.85.220.41] 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.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28165 invoked from network); 22 Jun 2013 09:47:36 -0000 Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by server-15.tower-158.messagelabs.com with RC4-SHA encrypted SMTP; 22 Jun 2013 09:47:36 -0000 Received: by mail-pa0-f41.google.com with SMTP id bj3so8989517pad.28 for ; Sat, 22 Jun 2013 02:47:35 -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:in-reply-to:references; bh=o+AEp+93mXPWlSqkkiM9zUYs4ZItHQ6GyplPS4dmm/E=; b=g6BIficqN99b7VO9u63Oh72QZmSVTgB/ctvmKZJBkkfLniZ0HMNSMfgabO3BHlK+cG pYVFFk7QbMMw5Su8nsQg91f2nmBOYMgnwCs+S1oO+Lsr+CIAUkDY7cuvTSlNh/L+1e7m Ark3A4GI2/e9pgq2hTYkgQsXIkX2dQE7V4VKe8dtrLFOJ4ADS3bV1MOGyfkER44DKbLP MqZhtDTviL3l0gMV5y5U1zNHSUWbeWEAsjjeLOF43A8On8XXBTAuijz/R9HqePrXRnAl jX3MlCoVaFNGJUeonAm/ev/oMXr7UlUo31BWin8bgfREYP+EEJnsHRjqU/UYjH+IR0hn 1MzA== X-Received: by 10.66.191.99 with SMTP id gx3mr19927613pac.88.1371894455637; Sat, 22 Jun 2013 02:47:35 -0700 (PDT) Received: from localhost.localdomain ([1.23.213.136]) by mx.google.com with ESMTPSA id b4sm6013656pbm.6.2013.06.22.02.47.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Jun 2013 02:47:34 -0700 (PDT) From: Prabhakar Lad To: Mauro Carvalho Chehab , LMML , Hans Verkuil , Laurent Pinchart Subject: [PATCH 1/2] media: i2c: ths8200: support asynchronous probing Date: Sat, 22 Jun 2013 15:16:34 +0530 Message-ID: <1371894395-14414-2-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371894395-14414-1-git-send-email-prabhakar.csengg@gmail.com> References: <1371894395-14414-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , , , LKML , Rob Herring , Rob Landley , Grant Likely 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" This patch supports both synchronous and asynchronous ths8200 subdevice probing. Signed-off-by: Lad, Prabhakar --- drivers/media/i2c/ths8200.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index a24f90c..cc1339a 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c @@ -21,6 +21,7 @@ #include #include +#include #include #include "ths8200_regs.h" @@ -500,6 +501,7 @@ static int ths8200_probe(struct i2c_client *client, { struct ths8200_state *state; struct v4l2_subdev *sd; + int error; /* Check if the adapter supports the needed features */ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) @@ -517,6 +519,10 @@ static int ths8200_probe(struct i2c_client *client, ths8200_core_init(sd); + error = v4l2_async_register_subdev(&state->sd); + if (error) + return error; + v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name, client->addr << 1, client->adapter->name); @@ -526,12 +532,13 @@ static int ths8200_probe(struct i2c_client *client, static int ths8200_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct ths8200_state *decoder = to_state(sd); v4l2_dbg(1, debug, sd, "%s removed @ 0x%x (%s)\n", client->name, client->addr << 1, client->adapter->name); ths8200_s_power(sd, false); - + v4l2_async_unregister_subdev(&decoder->sd); v4l2_device_unregister_subdev(sd); return 0;