mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongjin Kim <tobetter@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Dongjin Kim <tobetter@gmail.com>,
	Thomas Abraham <thomas.ab@samsung.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Chris Ball <cjb@laptop.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mmc: dw_mmc: No bus setup if default pinctrl is used
Date: Fri,  8 Feb 2013 03:17:58 +0900	[thread overview]
Message-ID: <1360261079-24361-1-git-send-email-tobetter@gmail.com> (raw)

Legacy gpio based bus setup is failed when the bus pins are listed with the
property 'pinctrl-0' and 'pinctrl-names', instead of 'gpios'. The default
pinctrls are handled by device core before probe, no need to configure the
pins again in a device driver.

[    1.190000] Synopsys Designware Multimedia Card Interface Driver
[    1.195000] dwmmc_exynos 12550000.mshc: Using PIO mode.
[    1.200000] dwmmc_exynos 12550000.mshc: DW MMC controller at irq 109, 32 bit host data width, 128 deep fifo
[    1.210000] dwmmc_exynos 12550000.mshc: invalid gpio: -2
[    1.215000] dwmmc_exynos: probe of 12550000.mshc failed with error -22

Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
---
 drivers/mmc/host/dw_mmc-exynos.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index aafd485..f568c32 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -156,12 +156,19 @@ static int dw_mci_exynos_setup_bus(struct dw_mci *host,
 				struct device_node *slot_np, u8 bus_width)
 {
 	int idx, gpio, ret;
+	int nr_pins = NUM_PINS(bus_width);
 
 	if (!slot_np)
 		return -EINVAL;
 
+#if defined(CONFIG_PINCTRL)
+	/* Default pinctrl is used */
+	if (!IS_ERR(host->dev->pins->default_state))
+		nr_pins = 0;
+#endif
+
 	/* cmd + clock + bus-width pins */
-	for (idx = 0; idx < NUM_PINS(bus_width); idx++) {
+	for (idx = 0; idx < nr_pins; idx++) {
 		gpio = of_get_gpio(slot_np, idx);
 		if (!gpio_is_valid(gpio)) {
 			dev_err(host->dev, "invalid gpio: %d\n", gpio);
-- 
1.7.10.4


             reply	other threads:[~2013-02-07 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 18:17 Dongjin Kim [this message]
2013-02-07 19:03 ` Linus Walleij
2013-02-07 19:49   ` Dongjin Kim

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=1360261079-24361-1-git-send-email-tobetter@gmail.com \
    --to=tobetter@gmail.com \
    --cc=cjb@laptop.org \
    --cc=jh80.chung@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    --cc=thomas.ab@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®