From: b29396@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: imx6q: switch to use pinctrl driver
Date: Sat, 14 Apr 2012 00:18:35 +0800 [thread overview]
Message-ID: <1334333915-1174-3-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1334333915-1174-1-git-send-email-b29396@freescale.com>
From: Dong Aisheng <dong.aisheng@linaro.org>
---
This patch is used for test the new pinctrl driver.
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
arch/arm/boot/dts/imx6q-arm2.dts | 4 +++
arch/arm/boot/dts/imx6q.dtsi | 40 ++++++++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci-esdhc-imx.c | 12 ++++++++++
3 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index ce1c823..ee2ee98 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -44,10 +44,14 @@
fsl,card-wired;
vmmc-supply = <®_3p3v>;
status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usdhc4_1>;
};
uart4: uart at 021f0000 {
status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart4_1>;
};
};
};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 4905f51..5f3505c 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -386,7 +386,47 @@
};
iomuxc at 020e0000 {
+ compatible = "fsl,imx6q-iomuxc";
reg = <0x020e0000 0x4000>;
+
+ /* shared pinctrl settings */
+ uart4 {
+ pinctrl_uart4_1: uart4grp-1 {
+ fsl,pins = "MX6Q_PAD_KEY_COL0",
+ "MX6Q_PAD_KEY_ROW0";
+ fsl,mux = <4 4>;
+ fsl,pull = <2>;
+ fsl,pue = <1>;
+ fsl,pke = <1>;
+ fsl,speed = <2>;
+ fsl,drive-strength = <6>;
+ fsl,slew-rate = <1>;
+ fsl,hysteresis = <1>;
+ };
+ };
+
+ usdhc4 {
+ pinctrl_usdhc4_1: usdhc4grp-1 {
+ fsl,pins = "MX6Q_PAD_SD4_CMD",
+ "MX6Q_PAD_SD4_CLK",
+ "MX6Q_PAD_SD4_DAT0",
+ "MX6Q_PAD_SD4_DAT1",
+ "MX6Q_PAD_SD4_DAT2",
+ "MX6Q_PAD_SD4_DAT3",
+ "MX6Q_PAD_SD4_DAT4",
+ "MX6Q_PAD_SD4_DAT5",
+ "MX6Q_PAD_SD4_DAT6",
+ "MX6Q_PAD_SD4_DAT7";
+ fsl,mux = <0 0 1 1 1 1 1 1 1 1>;
+ fsl,pull = <1>;
+ fsl,pue = <1>;
+ fsl,pke = <1>;
+ fsl,speed = <1>;
+ fsl,drive-strength = <3>;
+ fsl,slew-rate = <1>;
+ fsl,hysteresis = <1>;
+ };
+ };
};
dcic at 020e4000 { /* DCIC1 */
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 6193a0d..84ef749 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -24,6 +24,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
#include <mach/esdhc.h>
#include "sdhci-pltfm.h"
#include "sdhci-esdhc.h"
@@ -68,6 +69,7 @@ struct pltfm_imx_data {
int flags;
u32 scratchpad;
enum imx_esdhc_type devtype;
+ struct pinctrl *p;
struct esdhc_platform_data boarddata;
};
@@ -467,6 +469,12 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
clk_prepare_enable(clk);
pltfm_host->clk = clk;
+ imx_data->p = pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(imx_data->p)) {
+ err = PTR_ERR(imx_data->p);
+ goto pin_err;
+ }
+
if (!is_imx25_esdhc(imx_data))
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
@@ -559,6 +567,8 @@ no_card_detect_irq:
gpio_free(boarddata->wp_gpio);
no_card_detect_pin:
no_board_data:
+ pinctrl_put(imx_data->p);
+pin_err:
clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
err_clk_get:
@@ -586,6 +596,8 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev)
gpio_free(boarddata->cd_gpio);
}
+ pinctrl_put(imx_data->p);
+
clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
kfree(imx_data);
--
1.7.0.4
next prev parent reply other threads:[~2012-04-13 16:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 16:18 [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
2012-04-13 16:18 ` Dong Aisheng [this message]
2012-04-14 13:53 ` [PATCH 3/3] ARM: imx6q: switch to use pinctrl driver Sascha Hauer
2012-04-15 4:03 ` Dong Aisheng
2012-04-15 7:37 ` Shawn Guo
2012-04-16 3:35 ` Dong Aisheng
2012-04-20 1:08 ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 8:23 ` Linus Walleij
2012-04-24 8:46 ` Dong Aisheng
2012-04-17 20:23 ` Stephen Warren
2012-04-13 18:17 ` [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
2012-04-14 13:48 ` Sascha Hauer
2012-04-15 3:49 ` Dong Aisheng
2012-04-15 14:17 ` Shawn Guo
2012-04-15 14:45 ` Sascha Hauer
2012-04-15 17:29 ` Sascha Hauer
2012-04-16 1:47 ` Shawn Guo
2012-04-16 18:01 ` Stephen Warren
2012-04-16 3:47 ` Dong Aisheng
2012-04-16 3:46 ` Shawn Guo
2012-04-17 9:57 ` Dong Aisheng
2012-04-17 12:30 ` Sascha Hauer
2012-04-18 3:38 ` Dong Aisheng
[not found] ` <1334333915-1174-2-git-send-email-b29396@freescale.com>
2012-04-17 20:12 ` [PATCH 2/3] pinctrl: pinctrl-imx: add imx6q pinctrl driver Stephen Warren
2012-04-18 3:40 ` Dong Aisheng
2012-04-17 20:58 ` [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Stephen Warren
2012-04-18 7:19 ` Dong Aisheng
2012-04-18 18:06 ` Stephen Warren
2012-04-19 15:28 ` Shawn Guo
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=1334333915-1174-3-git-send-email-b29396@freescale.com \
--to=b29396@freescale.com \
--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).