From: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: inux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Cc: shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
lrg-l0cyMroinI0@public.gmane.org,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
Richard Zhao
<richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: [PATCH 04/11] i2c: imx: add pinctrl support
Date: Fri, 27 Apr 2012 14:55:55 +0800 [thread overview]
Message-ID: <1335509762-7777-5-git-send-email-richard.zhao@freescale.com> (raw)
In-Reply-To: <1335509762-7777-1-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Signed-off-by: Richard Zhao <richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
arch/arm/boot/dts/imx6q-sabrelite.dts | 2 ++
arch/arm/boot/dts/imx6q.dtsi | 16 ++++++++++++++++
drivers/i2c/busses/i2c-imx.c | 9 +++++++++
3 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
index 4663a4e..4e13293 100644
--- a/arch/arm/boot/dts/imx6q-sabrelite.dts
+++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
@@ -50,6 +50,8 @@
i2c@021a0000 { /* I2C1 */
status = "okay";
clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1_1>;
codec: sgtl5000@0a {
compatible = "fsl,sgtl5000";
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 2ba32e7..fe8c80d 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -390,6 +390,22 @@
reg = <0x020e0000 0x4000>;
/* shared pinctrl settings */
+ i2c1 {
+ pinctrl_i2c1_1: i2c1grp-1 {
+ fsl,pins = "MX6Q_PAD_EIM_D21",
+ "MX6Q_PAD_EIM_D28";
+ fsl,hysteresis = <1>;
+ fsl,mux = <0x16 0x11>;
+ fsl,pull = <2>;
+ fsl,pue = <1>;
+ fsl,pke = <1>;
+ fsl,open-drain = <1>;
+ fsl,speed = <2>;
+ fsl,drive-strength = <6>;
+ fsl,slew-rate = <1>;
+ };
+ };
+
uart4 {
pinctrl_uart4_1: uart4grp-1 {
fsl,pins = "MX6Q_PAD_KEY_COL0",
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index dfb84b7..7a52067 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -48,6 +48,7 @@
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/slab.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_i2c.h>
@@ -470,6 +471,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
struct imx_i2c_struct *i2c_imx;
struct resource *res;
struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
+ struct pinctrl *pct;
void __iomem *base;
resource_size_t res_size;
int irq, bitrate;
@@ -520,6 +522,13 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
i2c_imx->base = base;
i2c_imx->res = res;
+ pct = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pct)) {
+ dev_err(&pdev->dev, "can't get/select pinctrl\n");
+ ret = PTR_ERR(pct);
+ goto fail3;
+ }
+
/* Get I2C clock */
i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk");
if (IS_ERR(i2c_imx->clk)) {
--
1.7.5.4
next prev parent reply other threads:[~2012-04-27 6:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-27 6:55 [PATCH 00/11] enable imx6q_sabrelite sgtl5000 audio support Richard Zhao
[not found] ` <1335509762-7777-1-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-27 6:55 ` [PATCH 01/11] dma: imx-sdma: make channel0 operations atomic Richard Zhao
2012-04-27 6:55 ` [PATCH 02/11] ASoC: imx-sgtl5000: add of_node_put when probe fail Richard Zhao
2012-04-27 6:55 ` [PATCH 03/11] ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000 Richard Zhao
2012-04-27 6:55 ` Richard Zhao [this message]
2012-04-27 6:55 ` [PATCH 05/11] ARM: imx6q: move imx6q_sabrelite specific code to a dedicated function Richard Zhao
2012-04-27 6:55 ` [PATCH 06/11] ARM: dts: imx6q-sabrelite: add ssi device Richard Zhao
2012-04-27 6:55 ` [PATCH 07/11] ARM: dts: imx6q-sabrelite: add audmux device Richard Zhao
2012-04-27 6:55 ` [PATCH 08/11] ASoC: imx-audmux: add pinctrl support Richard Zhao
2012-04-27 6:56 ` [PATCH 09/11] ARM: imx6q: add ssi1 clk_lookup Richard Zhao
2012-04-27 6:56 ` [PATCH 10/11] ARM: imx6q_sabrelite: clkdev_add cko1 for sgtl5000 Richard Zhao
2012-04-27 6:56 ` [PATCH 11/11] ARM: dts: imx6q-sabrelite: add sound device imx6q-sabrelite-sgtl5000 Richard Zhao
-- strict thread matches above, loose matches on Subject: below --
2012-04-27 7:02 [PATCH 00/11] enable imx6q_sabrelite sgtl5000 audio support Richard Zhao
[not found] ` <1335510185-7906-1-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-27 7:02 ` [PATCH 04/11] i2c: imx: add pinctrl support Richard Zhao
[not found] ` <1335510185-7906-5-git-send-email-richard.zhao-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-27 8:40 ` Dong Aisheng
[not found] ` <20120427084056.GD826-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-27 9:15 ` Richard Zhao
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=1335509762-7777-5-git-send-email-richard.zhao@freescale.com \
--to=richard.zhao-kzfg59tc24xl57midrcfdg@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=inux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lrg-l0cyMroinI0@public.gmane.org \
--cc=shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.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).