From patchwork Sat May 25 17:39:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 2613881 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 448E03FD4E for ; Sat, 25 May 2013 17:43:31 +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 r4PHfl7Q018783; Sat, 25 May 2013 12:41:47 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4PHflTT004282; Sat, 25 May 2013 12:41:47 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Sat, 25 May 2013 12:41:46 -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 r4PHfk2R030363; Sat, 25 May 2013 12:41:46 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id DEB5F80627; Sat, 25 May 2013 12:41:46 -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 6B3D78062D for ; Sat, 25 May 2013 12:40:29 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4PHeTBS023864 for ; Sat, 25 May 2013 12:40:29 -0500 (CDT) Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4PHeSqv001782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 25 May 2013 12:40:29 -0500 Received: from [216.82.242.131:17649] by server-9.bemta-8.messagelabs.com id 20/12-20388-C87F0A15; Sat, 25 May 2013 17:40:28 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-10.tower-76.messagelabs.com!1369503626!21619893!1 X-Originating-IP: [209.85.160.45] 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.8.6.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30488 invoked from network); 25 May 2013 17:40:27 -0000 Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by server-10.tower-76.messagelabs.com with RC4-SHA encrypted SMTP; 25 May 2013 17:40:27 -0000 Received: by mail-pb0-f45.google.com with SMTP id mc17so5390332pbc.4 for ; Sat, 25 May 2013 10:40:26 -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=hCUTDfL1RTByvqYOoeZ1jqSX6WJ1sCeeMNJN7pDjET4=; b=SeU28ZwItBjLydniRETjrR90GOjSd/KsczYMBLHjD5u52cCEKWopKWZgGGHbSkkdCL M0EmDLgVdv2H/vMliUqKrpAMFWQtavuSfgfM7tVQLrS1b6q8iRsdoXi75djnw0SaXkSH /TP5+0pTiMJXXrccs2gF/OsoApDCUxAUR7+VQKRP51tyFXrd7f7NYzS7+vvk+smBfmT8 JzGJmT6PSGn3zKc6FJtgEIaZ98AdfTUk+AhLhlmkSWOki9sJVYpaLBIdJsEfhW1w4UQe O4ytyWg6l31iDZ2zBqaz/EmgbAbul6mbfxvpLkMtO4jsgPThnMlV31vVaQO+ZtoWR9XQ XUfQ== X-Received: by 10.68.101.226 with SMTP id fj2mr23045311pbb.6.1369503626568; Sat, 25 May 2013 10:40:26 -0700 (PDT) Received: from localhost.localdomain ([112.79.40.180]) by mx.google.com with ESMTPSA id gi2sm21262517pbb.2.2013.05.25.10.40.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 25 May 2013 10:40:25 -0700 (PDT) From: Prabhakar Lad To: Hans Verkuil , Mauro Carvalho Chehab , LMML , Laurent Pinchart Subject: [PATCH v2 3/4] media: i2c: ths7303: remove unnecessary function ths7303_setup() Date: Sat, 25 May 2013 23:09:35 +0530 Message-ID: <1369503576-22271-4-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1369503576-22271-1-git-send-email-prabhakar.csengg@gmail.com> References: <1369503576-22271-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , Mauro Carvalho Chehab , LKML , Hans Verkuil , Laurent Pinchart 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: 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..af06187 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;