From patchwork Wed May 15 11:57:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2572101 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork2.kernel.org (Postfix) with ESMTP id 71858DF2A2 for ; Wed, 15 May 2013 12:03:25 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4FC1dZV012607; Wed, 15 May 2013 07:01:39 -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 r4FC1dgu005648; Wed, 15 May 2013 07:01:39 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Wed, 15 May 2013 07:01:38 -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 r4FC1dvq018686; Wed, 15 May 2013 07:01:39 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id F380980627; Wed, 15 May 2013 07:01:38 -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 CABD680626 for ; Wed, 15 May 2013 07:01:37 -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 r4FC1bbx010136 for ; Wed, 15 May 2013 07:01:37 -0500 (CDT) Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4FC1bAX017187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 May 2013 07:01:37 -0500 Received: from [216.82.250.99:47634] by server-16.bemta-12.messagelabs.com id 39/56-28654-12973915; Wed, 15 May 2013 12:01:37 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-5.tower-126.messagelabs.com!1368619282!3258793!1 X-Originating-IP: [209.85.192.178] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, ML_RADAR_SPEW_LINKS_14,spamassassin: X-StarScan-Received: X-StarScan-Version: 6.9.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30279 invoked from network); 15 May 2013 12:01:26 -0000 Received: from mail-pd0-f178.google.com (HELO mail-pd0-f178.google.com) (209.85.192.178) by server-5.tower-126.messagelabs.com with RC4-SHA encrypted SMTP; 15 May 2013 12:01:26 -0000 Received: by mail-pd0-f178.google.com with SMTP id w11so1313276pde.37 for ; Wed, 15 May 2013 05:01:17 -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=rBfepTYKIp1dKCQfl3g2sjaBdoYYD/tndibSyVhGqwU=; b=IxKfcyTqEd3E6qkY/DrLPzGepBaX82l065WAtZSqe+j0NeIxWWWadutUUODtqsKrNp kknkq8tGqO6GFP1xRhY1H5VQ5GH+mqYWlEG6UQ58cT59wOAenE7BwzV29BBqy2e/dtsp 1AI+7TYy18sfQ+3/q2hizBRy4WQOo/P0tXuMaEoUmw5D5GURJgbKOTo5N1Eul5xLWOij C4PR/MxhvTHVvn+WAFYBsK+LWmFPxKnjR1idwhZ0FdHvxxd+BQcOX1np1d+NhCzP4y9/ +nLa9fFkloPcnPARGjKfdCJ9YxLoDkknmsrIr1mmzW2OtkcS9xVyHh4ioqxud9lnIQRk ZC4w== X-Received: by 10.66.232.165 with SMTP id tp5mr39260360pac.135.1368619277143; Wed, 15 May 2013 05:01:17 -0700 (PDT) Received: from localhost.localdomain ([59.98.240.128]) by mx.google.com with ESMTPSA id az5sm2610731pbc.18.2013.05.15.05.01.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 May 2013 05:01:16 -0700 (PDT) From: Lad Prabhakar To: LMML Subject: [PATCH 3/6] media: i2c: ths7303: remove unnecessary function ths7303_setup() Date: Wed, 15 May 2013 17:27:19 +0530 Message-ID: <1368619042-28252-4-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1368619042-28252-1-git-send-email-prabhakar.csengg@gmail.com> References: <1368619042-28252-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , Mauro Carvalho Chehab , LKML , Hans Verkuil , Laurent Pinchart , Sylwester Nawrocki , 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 From: Lad, Prabhakar the ths7303_setup() was doing the same thing as ths7303_setval() except that ths7303_setval() sets it to some particular mode. This patch removes ths7303_setup() function and calls ths7303_setval() in the probe setting the device to 480I_576I filter mode in the probe. Signed-off-by: Lad, Prabhakar Cc: Hans Verkuil Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Guennadi Liakhovetski Cc: Sylwester Nawrocki Cc: Sakari Ailus Cc: linux-kernel@vger.kernel.org Cc: davinci-linux-open-source@linux.davincidsp.com --- drivers/media/i2c/ths7303.c | 31 ++++--------------------------- 1 files changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c index 8cddcd0..af06187c 100644 --- a/drivers/media/i2c/ths7303.c +++ b/drivers/media/i2c/ths7303.c @@ -349,30 +349,6 @@ static const struct v4l2_subdev_ops ths7303_ops = { .video = &ths7303_video_ops, }; -static int ths7303_setup(struct v4l2_subdev *sd) -{ - struct ths7303_state *state = to_state(sd); - struct ths7303_platform_data *pdata = &state->pdata; - int ret; - u8 mask; - - mask = 0xf8; - - ret = ths7303_write(sd, THS7303_CHANNEL_1, pdata->ch_1 & mask); - if (ret) - return ret; - - ret = ths7303_write(sd, THS7303_CHANNEL_2, pdata->ch_2 & mask); - if (ret) - return ret; - - ret = ths7303_write(sd, THS7303_CHANNEL_3, pdata->ch_3 & mask); - if (ret) - return ret; - - return 0; -} - static int ths7303_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -402,9 +378,10 @@ static int ths7303_probe(struct i2c_client *client, /* store the driver data to differntiate the chip */ state->driver_data = (int)id->driver_data; - if (ths7303_setup(sd) < 0) { - v4l_err(client, "init failed\n"); - return -EIO; + /* set to default 480I_576I filter mode */ + if (ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I) < 0) { + v4l_err(client, "Setting to 480I_576I filter mode failed!\n"); + return -EINVAL; } return 0;