From: thomas.abraham@linaro.org (Thomas Abraham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface
Date: Sun, 11 Mar 2012 18:16:05 +0530 [thread overview]
Message-ID: <1331469965-28846-6-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1331469965-28846-1-git-send-email-thomas.abraham@linaro.org>
The platform specific callback to setup the sdhci pin mux and pin config
is removed and the pinctrl subsystem interface is used to setup the
mux and config.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
drivers/mmc/host/sdhci-s3c.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index ea0767e..76c1c36 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/mmc/host.h>
@@ -50,6 +51,7 @@ struct sdhci_s3c {
struct platform_device *pdev;
struct resource *ioarea;
struct s3c_sdhci_platdata *pdata;
+ struct pinctrl *pinctrl;
unsigned int cur_clk;
int ext_cd_irq;
int ext_cd_gpio;
@@ -529,6 +531,9 @@ static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
platform_get_device_id(pdev)->driver_data;
}
+#include <plat/map-s5p.h>
+#include <plat/map-base.h>
+
static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
{
struct s3c_sdhci_platdata *pdata;
@@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
struct sdhci_s3c *sc;
struct resource *res;
int ret, irq, ptr, clks;
+ char *pstate;
if (!pdev->dev.platform_data && !pdev->dev.of_node) {
dev_err(dev, "no device data specified\n");
@@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
}
/* Ensure we have minimal gpio selected CMD/CLK/Detect */
- if (pdata->cfg_gpio)
- pdata->cfg_gpio(pdev, pdata->max_width);
+ pstate = pdata->max_width ? "sdhci-pcfg8" : "sdhci-pcfg4";
+ sc->pinctrl = pinctrl_get_select(&pdev->dev, pstate);
+ if (IS_ERR(sc->pinctrl)) {
+ dev_err(dev, "failed to setup pin configuration\n");
+ ret = -ENXIO;
+ goto err_req_regs;
+ }
host->hw_name = "samsung-hsmmc";
host->ops = &sdhci_s3c_ops;
--
1.6.6.rc2
next prev parent reply other threads:[~2012-03-11 12:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-11 12:46 [PATCH 0/5] pinctrl: add new Samsung pinctrl driver and add Exynos4 support Thomas Abraham
2012-03-11 12:46 ` [PATCH 1/5] pinctrl: add samsung pinctrl and gpiolib driver Thomas Abraham
2012-03-19 21:45 ` Stephen Warren
2012-03-11 12:46 ` [PATCH 2/5] pinctrl: add exynos4 specific pins, groups, functions and gpio chip data Thomas Abraham
2012-03-11 12:46 ` [PATCH 3/5] ARM: Exynos4: Add pinctrl devices and pin maps Thomas Abraham
2012-03-11 21:17 ` Kukjin Kim
2012-03-12 4:22 ` Thomas Abraham
2012-03-11 12:46 ` [PATCH 4/5] ARM: Exynos: Enable pinctrl driver support for Origen board Thomas Abraham
2012-03-11 12:46 ` Thomas Abraham [this message]
2012-03-11 21:25 ` [PATCH 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface Kukjin Kim
2012-03-12 4:28 ` Thomas Abraham
2012-03-12 2:38 ` Kyungmin Park
2012-03-12 4:37 ` Thomas Abraham
2012-03-12 14:21 ` Mark Brown
2012-03-12 14:31 ` Thomas Abraham
2012-03-12 16:12 ` Mark Brown
2012-03-19 21:55 ` Stephen Warren
2012-03-13 10:13 ` [PATCH 0/5] pinctrl: add new Samsung pinctrl driver and add Exynos4 support Linus Walleij
2012-03-13 10:18 ` Thomas Abraham
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=1331469965-28846-6-git-send-email-thomas.abraham@linaro.org \
--to=thomas.abraham@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).