From patchwork Wed Feb 13 19:25:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: girishks2000@gmail.com X-Patchwork-Id: 2139151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4A8883FCA4 for ; Wed, 13 Feb 2013 19:30:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5hzD-0000ZE-JS; Wed, 13 Feb 2013 19:27:19 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U5hyo-0000VO-KI for linux-arm-kernel@lists.infradead.org; Wed, 13 Feb 2013 19:26:56 +0000 Received: by mail-pa0-f53.google.com with SMTP id bg4so860646pad.12 for ; Wed, 13 Feb 2013 11:26:52 -0800 (PST) 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=slcS3jBvSotEroIwYu+qxtKtpP+2PFFtSTHSPWOBzts=; b=rY09mUP57hkxfhI+tvwhptVq/krtr2jolsgQ9Lfbn5y+pj4L8Rzr9/dliwQlWj2Sbp p9S9Ehds64JOo9J8Mb089Ds/Cz95djexOwyolblI39zSxsV2gFxY90vrkzk44HJ7Sf6H 6XUFhznxtCIGdR4Mx6znhvQ5Yanlyj5RyGjApyGBNeTR1zYuEK08FyMX8MxxK99Ew0wf OsvTYFFSBlyUSUF8AHsOunPS3lC0VNW9zbNRoyd9Mw9Cebg3WWlNipohoeuoeMiTPbK/ nd+egk6fsz1DjP2npea2NvHH5dqxZ9HMQGp3VOTokuxlvyp/SF8T3DUonzv1tSw6GnYB mcqg== X-Received: by 10.66.81.68 with SMTP id y4mr66648136pax.66.1360783612657; Wed, 13 Feb 2013 11:26:52 -0800 (PST) Received: from localhost.localdomain (D32450A4.uspool.samsung.com. [211.36.80.164]) by mx.google.com with ESMTPS id t6sm85719744paz.11.2013.02.13.11.26.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Feb 2013 11:26:52 -0800 (PST) From: Girish K S To: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Date: Wed, 13 Feb 2013 11:25:29 -0800 Message-Id: <1360783531-32654-4-git-send-email-ks.giri@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360783531-32654-1-git-send-email-ks.giri@samsung.com> References: <1360783531-32654-1-git-send-email-ks.giri@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130213_142654_796924_299339C4 X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.53 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (girishks2000[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (girishks2000[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: grant.likely@secretlab.ca, t.figa@samsung.com, broonie@opensource.wolfsonmicro.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Currently the drivers supports only the GPIO based i/o pins. But there are Exynos SoC's that use the same controller with dedicated i/o pins. This patch provides provision to support gpio/dedicated pins. The decision is made by parsing the "gpios" property in the spi node. Signed-off-by: Girish K S --- changes in v2: Removed the gpio quirk. Parse the "gpios" property to decide whether gpio / dedicated i/o lines should be used. drivers/spi/spi-s3c64xx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 45bad5d..a8fe876 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1157,6 +1157,9 @@ static int s3c64xx_spi_parse_dt_gpio(struct s3c64xx_spi_driver_data *sdd) struct device *dev = &sdd->pdev->dev; int idx, gpio, ret; + if (!of_find_property(dev->of_node, "gpios", NULL)) + return 0; + /* find gpios for mosi, miso and clock lines */ for (idx = 0; idx < 3; idx++) { gpio = of_get_gpio(dev->of_node, idx); @@ -1183,6 +1186,11 @@ free_gpio: static void s3c64xx_spi_dt_gpio_free(struct s3c64xx_spi_driver_data *sdd) { unsigned int idx; + struct device *dev = &sdd->pdev->dev; + + if (!of_find_property(dev->of_node, "gpios", NULL)) + return; + for (idx = 0; idx < 3; idx++) gpio_free(sdd->gpios[idx]); }