diff mbox

[2/2] mmc: dw_mmc: exynos: Add pinctrl support

Message ID 1360238236-17694-2-git-send-email-sachin.kamat@linaro.org
State Rejected
Headers show

Commit Message

Sachin Kamat Feb. 7, 2013, 11:57 a.m. UTC
Added support for pin configuration using pinctrl subsystem.

Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mmc/host/dw_mmc-exynos.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Comments

Linus Walleij Feb. 7, 2013, 3:30 p.m. UTC | #1
On Thu, Feb 7, 2013 at 12:57 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:

> Added support for pin configuration using pinctrl subsystem.
>
> Cc: Thomas Abraham <thomas.abraham@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

NACK.

In the v3.9 merge window we will merge this patch:
http://marc.info/?l=linux-kernel&m=135887740715083&w=2

That should do the trick. Just define your tables properly.

Yours,
Linus Walleij
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index f15b4d3..31f5f47 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -11,11 +11,13 @@ 
 
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/dw_mmc.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "dw_mmc.h"
 #include "dw_mmc-pltfm.h"
@@ -36,6 +38,8 @@ 
 #define EXYNOS4210_FIXED_CIU_CLK_DIV	2
 #define EXYNOS4412_FIXED_CIU_CLK_DIV	4
 
+static struct pinctrl	*pctrl;
+
 /* Variations in Exynos specific dw-mshc controller */
 enum dw_mci_exynos_type {
 	DW_MCI_TYPE_EXYNOS4210,
@@ -160,6 +164,10 @@  static int dw_mci_exynos_setup_bus(struct dw_mci *host,
 	if (!slot_np)
 		return -EINVAL;
 
+	pctrl = devm_pinctrl_get_select_default(host->dev);
+	if (!IS_ERR(pctrl))
+		return 0;
+
 	/* cmd + clock + bus-width pins */
 	for (idx = 0; idx < NUM_PINS(bus_width); idx++) {
 		gpio = of_get_gpio(slot_np, idx);