From patchwork Mon Jun 3 17:26:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 2654011 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork1.kernel.org (Postfix) with ESMTP id 8A8733FC23 for ; Mon, 3 Jun 2013 17:28:40 +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 r53HRXjW031115; Mon, 3 Jun 2013 12:27:33 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r53HRXBh002512; Mon, 3 Jun 2013 12:27:33 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 3 Jun 2013 12:27:32 -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 r53HRXlQ006153; Mon, 3 Jun 2013 12:27:33 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C8BD680628; Mon, 3 Jun 2013 12:27:32 -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 2D37180626 for ; Mon, 3 Jun 2013 12:27:31 -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 r53HRVGf005769 for ; Mon, 3 Jun 2013 12:27:31 -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 r53HRUYl028965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Jun 2013 12:27:30 -0500 Received: from [216.82.242.147:38689] by server-14.bemta-8.messagelabs.com id 45/5A-07081-202DCA15; Mon, 03 Jun 2013 17:27:30 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-5.tower-95.messagelabs.com!1370280448!20324853!1 X-Originating-IP: [209.85.192.174] 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 4189 invoked from network); 3 Jun 2013 17:27:29 -0000 Received: from mail-pd0-f174.google.com (HELO mail-pd0-f174.google.com) (209.85.192.174) by server-5.tower-95.messagelabs.com with RC4-SHA encrypted SMTP; 3 Jun 2013 17:27:29 -0000 Received: by mail-pd0-f174.google.com with SMTP id 3so5950173pdj.5 for ; Mon, 03 Jun 2013 10:27:28 -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=ojSna+Ne3Bs/I7VZTLGgC8UPtI+t0RnY+YwgpwYEbLc=; b=aEqwhCILaBl4ec3+az9ataaa+GeqfEMriHNo8qFG6H7oIkC2AJpFBDjKkJV3sYDY4R uOGPW6HYyvSTfGBpMu2xAPibvBqhpktlEwfUxfSc5SqVosA40/xO5Nyv5N7Ne3EGvJlk hQ/6yx/2V8oQiMjj5Rb6nYioKgl3Iw3/1bDG+FC4s7jT3jmJhY8L9G1UFUyJ3WUrzQnH Khj3ccc1JL5q1WlIU6yiJYW0I68f2QUl0zrOcynHb0hDkFPfTqiL9zCd3AP+Fyw8rvS6 niAKjwhWc5T13Aya28V8QF/Cql35TAL6IkaQtnZapEtQGcZh91ycd//HqjsSGbh++C0r orpw== X-Received: by 10.66.189.130 with SMTP id gi2mr25452531pac.89.1370280448194; Mon, 03 Jun 2013 10:27:28 -0700 (PDT) Received: from localhost.localdomain ([112.79.40.197]) by mx.google.com with ESMTPSA id dr6sm63894157pac.11.2013.06.03.10.27.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Jun 2013 10:27:27 -0700 (PDT) From: Prabhakar Lad To: Hans Verkuil , Mauro Carvalho Chehab , LMML , Laurent Pinchart Subject: [PATCH 2/2] media: i2c: ths8200: add support v4l-async Date: Mon, 3 Jun 2013 22:56:18 +0530 Message-ID: <1370280378-2570-3-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1370280378-2570-1-git-send-email-prabhakar.csengg@gmail.com> References: <1370280378-2570-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , LKML 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 From: Lad, Prabhakar This patch supports ths8200 driver for v4l-async subdevice probing. Signed-off-by: Lad, Prabhakar --- drivers/media/i2c/ths8200.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index 9396829..d1bddcc 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" @@ -504,6 +505,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)) @@ -521,6 +523,11 @@ static int ths8200_probe(struct i2c_client *client, ths8200_core_init(sd); + state->sd.dev = &client->dev; + 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); @@ -530,12 +537,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;