From patchwork Wed Mar 13 06:43:32 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: 2261891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0B28ADF215 for ; Wed, 13 Mar 2013 06:47:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFfQk-0006Dt-Km; Wed, 13 Mar 2013 06:44:54 +0000 Received: from mail-ia0-x231.google.com ([2607:f8b0:4001:c02::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFfPw-00060Z-IT for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2013 06:44:05 +0000 Received: by mail-ia0-f177.google.com with SMTP id y25so668675iay.8 for ; Tue, 12 Mar 2013 23:44:03 -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=6myuPc/nM47nsl29pkvoQSRHV9n55csc9thQfLDBHrY=; b=TQXIh+lMJ+8kXzoBKL1313qajfj2nsB/4VnpSVSzh+LlfTd9bpy3+GM+xLbULzlTBt jPJcn1WV/SlmStY9dzBeDolFmWBNevOvRpItEfC97G55+OYI56Xbc80c9d7VO14FCA+k Jk+4I25/QUmrfNOqXXL1n7N/tLpyL3Yvahj5ylB8Wg3fF0Z/oeCQn7w9BCZyd4qOYHku 62DqBMof0VMgbtstDWBmxrbP7MyRePSlK3OzaGHh7SQ5ZuolPTXvjZgZvIXAYSNU8/Lm IiBYg9VC6eA6UDKnh7gTmtCV9ujmD7wCsRvuWyAob0NdrMb0zYi0LIz9GV4Sry5FWpN2 q8MQ== X-Received: by 10.50.112.73 with SMTP id io9mr14645044igb.4.1363157043577; Tue, 12 Mar 2013 23:44:03 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id hi4sm1406711igc.6.2013.03.12.23.44.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 23:44:03 -0700 (PDT) From: Girish K S To: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V3 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Date: Wed, 13 Mar 2013 12:13:32 +0530 Message-Id: <1363157014-9615-4-git-send-email-ks.giri@samsung.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1363157014-9615-1-git-send-email-ks.giri@samsung.com> References: <1363157014-9615-1-git-send-email-ks.giri@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130313_024404_688786_AE1FA9D6 X-CRM114-Status: GOOD ( 12.77 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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, Girish K S X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Girish K S 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 --- 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 054b8d4..94716d1 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1112,6 +1112,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); @@ -1138,6 +1141,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]); }