From patchwork Wed Feb 13 20:03:46 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: 2139301 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 5A186DFE75 for ; Wed, 13 Feb 2013 20:05:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1U5iZx-0007ej-0z; Wed, 13 Feb 2013 20:05:17 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1U5iZu-0007eE-AX for spi-devel-general@lists.sourceforge.net; Wed, 13 Feb 2013 20:05:14 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.44 as permitted sender) client-ip=209.85.220.44; envelope-from=girishks2000@gmail.com; helo=mail-pa0-f44.google.com; Received: from mail-pa0-f44.google.com ([209.85.220.44]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1U5iZq-0004IH-Ck for spi-devel-general@lists.sourceforge.net; Wed, 13 Feb 2013 20:05:14 +0000 Received: by mail-pa0-f44.google.com with SMTP id kp1so920303pab.17 for ; Wed, 13 Feb 2013 12:05:04 -0800 (PST) X-Received: by 10.66.146.72 with SMTP id ta8mr24162177pab.24.1360785904480; Wed, 13 Feb 2013 12:05:04 -0800 (PST) Received: from localhost.localdomain (D32450A5.uspool.samsung.com. [211.36.80.165]) by mx.google.com with ESMTPS id bi8sm85923751pab.15.2013.02.13.12.05.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Feb 2013 12:05:04 -0800 (PST) From: Girish K S To: spi-devel-general@lists.sourceforge.net Subject: [PATCH V2 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Date: Wed, 13 Feb 2013 12:03:46 -0800 Message-Id: <1360785828-32767-4-git-send-email-ks.giri@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360785828-32767-1-git-send-email-ks.giri@samsung.com> References: <1360785828-32767-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: 1U5iZq-0004IH-Ck 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 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]); }