From 15afbc68780f8c06c5b5590adcbf7534ee1920b3 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sun, 6 May 2012 20:27:17 +0800 Subject: i2c: imx: adopt pinctrl support Cc: linux-i2c@vger.kernel.org Cc: Wolfram Sang Signed-off-by: Shawn Guo Acked-by: Dong Aisheng --- drivers/i2c/busses/i2c-imx.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/i2c') diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index dfb84b7ee550..56bce9a8bcbb 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -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 *pinctrl; void __iomem *base; resource_size_t res_size; int irq, bitrate; @@ -520,6 +522,12 @@ static int __init i2c_imx_probe(struct platform_device *pdev) i2c_imx->base = base; i2c_imx->res = res; + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) { + ret = PTR_ERR(pinctrl); + goto fail3; + } + /* Get I2C clock */ i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk"); if (IS_ERR(i2c_imx->clk)) { -- cgit v1.2.1 From d98d033c15b77d51ed723ba10c49fa13233e59c1 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sun, 6 May 2012 22:59:45 +0800 Subject: i2c: mxs: adopt pinctrl support Cc: linux-i2c@vger.kernel.org Cc: Wolfram Sang Signed-off-by: Shawn Guo --- drivers/i2c/busses/i2c-mxs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/i2c') diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 3d471d56bf15..7c7711dc19d1 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -323,10 +324,15 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct mxs_i2c_dev *i2c; struct i2c_adapter *adap; + struct pinctrl *pinctrl; struct resource *res; resource_size_t res_size; int err, irq; + pinctrl = devm_pinctrl_get_select_default(dev); + if (IS_ERR(pinctrl)) + return PTR_ERR(pinctrl); + i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL); if (!i2c) return -ENOMEM; -- cgit v1.2.1