From patchwork Mon Apr 15 08:40:28 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: 2444281 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id D35A4DF2E5 for ; Mon, 15 Apr 2013 08:41:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UReyF-0006ZM-79; Mon, 15 Apr 2013 08:41:03 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UReyD-0006ZE-L0 for spi-devel-general@lists.sourceforge.net; Mon, 15 Apr 2013 08:41:01 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.45 as permitted sender) client-ip=209.85.220.45; envelope-from=girishks2000@gmail.com; helo=mail-pa0-f45.google.com; Received: from mail-pa0-f45.google.com ([209.85.220.45]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1UReyC-0002A8-Qz for spi-devel-general@lists.sourceforge.net; Mon, 15 Apr 2013 08:41:01 +0000 Received: by mail-pa0-f45.google.com with SMTP id kl13so2435218pab.18 for ; Mon, 15 Apr 2013 01:40:54 -0700 (PDT) X-Received: by 10.66.251.231 with SMTP id zn7mr28355444pac.71.1366015254950; Mon, 15 Apr 2013 01:40:54 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id fa5sm19493310pbb.35.2013.04.15.01.40.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 01:40:54 -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 RESEND 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Date: Mon, 15 Apr 2013 14:10:28 +0530 Message-Id: <1366015230-18243-2-git-send-email-ks.giri@samsung.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1366015230-18243-1-git-send-email-ks.giri@samsung.com> References: <1366015230-18243-1-git-send-email-ks.giri@samsung.com> X-Spam-Score: -1.4 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 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) -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 X-Headers-End: 1UReyC-0002A8-Qz Cc: t.figa@samsung.com, broonie@opensource.wolfsonmicro.com, Girish K S X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index a6fdc71..79de18f 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1111,6 +1111,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); @@ -1137,6 +1140,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]); }