From: Girish K S <girishks2000@gmail.com>
To: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca,
t.figa@samsung.com, broonie@opensource.wolfsonmicro.com
Subject: [PATCH V2 3/5] spi: s3c64xx: Added provision for non-gpio i/o's
Date: Wed, 13 Feb 2013 11:25:29 -0800 [thread overview]
Message-ID: <1360783531-32654-4-git-send-email-ks.giri@samsung.com> (raw)
In-Reply-To: <1360783531-32654-1-git-send-email-ks.giri@samsung.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>
---
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]);
}
--
1.7.10.4
WARNING: multiple messages have this Message-ID (diff)
From: Girish K S <girishks2000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.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 [thread overview]
Message-ID: <1360783531-32654-4-git-send-email-ks.giri@samsung.com> (raw)
In-Reply-To: <1360783531-32654-1-git-send-email-ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.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 <ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
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]);
}
--
1.7.10.4
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
WARNING: multiple messages have this Message-ID (diff)
From: girishks2000@gmail.com (Girish K S)
To: linux-arm-kernel@lists.infradead.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 [thread overview]
Message-ID: <1360783531-32654-4-git-send-email-ks.giri@samsung.com> (raw)
In-Reply-To: <1360783531-32654-1-git-send-email-ks.giri@samsung.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>
---
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]);
}
--
1.7.10.4
next prev parent reply other threads:[~2013-02-13 19:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 19:25 [PATCH V2 0/5] Add polling support for 64xx spi controller Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` [PATCH V2 1/5] spi: s3c64xx: modified error interrupt handling and init Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` [PATCH V2 2/5] spi: s3c64xx: added support for polling mode Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` Girish K S [this message]
2013-02-13 19:25 ` [PATCH V2 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` [PATCH V2 4/5] spi: s3c64xx: Added provision for dedicated cs pin Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` [PATCH V2 5/5] spi: s3c64xx: Added support for exynos5440 spi Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 19:25 ` Girish K S
2013-02-13 20:03 [PATCH V2 0/5] Add polling support for 64xx spi controller Girish K S
[not found] ` <1360785828-32767-1-git-send-email-ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-02-13 20:03 ` [PATCH V2 3/5] spi: s3c64xx: Added provision for non-gpio i/o's Girish K S
[not found] ` <1360785828-32767-4-git-send-email-ks.giri-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-03-02 22:56 ` Grant Likely
2013-03-12 5:30 ` 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=1360783531-32654-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.