mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Girish K S <girishks2000@gmail.com>
To: spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: grant.likely@secretlab.ca, t.figa@samsung.com,
	broonie@opensource.wolfsonmicro.com,
	Girish K S <girishks2000@gmail.com>
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	[thread overview]
Message-ID: <1366015230-18243-2-git-send-email-ks.giri@samsung.com> (raw)
In-Reply-To: <1366015230-18243-1-git-send-email-ks.giri@samsung.com>

From: Girish K S <girishks2000@gmail.com>

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 <ks.giri@samsung.com>
---
 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]);
 }
-- 
1.7.5.4


  reply	other threads:[~2013-04-15  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15  8:40 [PATCH V4 2/5] spi: s3c64xx: added support for polling mode Girish K S
2013-04-15  8:40 ` Girish K S [this message]
2013-04-16 15:58   ` [PATCH V3 RESEND 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Mark Brown
2013-04-15  8:40 ` [PATCH V4 4/5] spi: s3c64xx: Added provision for dedicated cs pin Girish K S
2013-04-15  8:40 ` [PATCH RESEND V3 5/5] spi: s3c64xx: Added support for exynos5440 spi Girish K S
2013-04-16 11:20 ` [PATCH V4 2/5] spi: s3c64xx: added support for polling mode Mark Brown
2013-04-16 11:28   ` Girish KS
2013-04-16 12:12     ` Mark Brown
2013-04-17 10:22       ` Girish KS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366015230-18243-2-git-send-email-ks.giri@samsung.com \
    --to=girishks2000@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=t.figa@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®