diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-12 13:32:09 +0800 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-12 13:32:09 +0800 |
commit | 844d0b5a0b42d6c73114a1dc229db751120d226f (patch) | |
tree | faf9f83e78ae24f6730d64999a89c35144da3b8a /drivers/i2c | |
parent | 50260924afd4b745bfb6e5f1caee381a1875fc31 (diff) | |
parent | a0f5e3631b07cabf624e7d818df76d47d9d21017 (diff) | |
download | linux-3.10-844d0b5a0b42d6c73114a1dc229db751120d226f.tar.gz linux-3.10-844d0b5a0b42d6c73114a1dc229db751120d226f.tar.bz2 linux-3.10-844d0b5a0b42d6c73114a1dc229db751120d226f.zip |
Merge branches 'clk/mxs' and 'imx/pinctrl/for-3.5' into mxs/dt/for-3.5
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index dfb84b7ee55..56bce9a8bcb 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -51,6 +51,7 @@ #include <linux/of.h> #include <linux/of_device.h> #include <linux/of_i2c.h> +#include <linux/pinctrl/consumer.h> #include <mach/irqs.h> #include <mach/hardware.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 *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)) { diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 76b8af44f63..7fa73eed84a 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -26,6 +26,7 @@ #include <linux/platform_device.h> #include <linux/jiffies.h> #include <linux/io.h> +#include <linux/pinctrl/consumer.h> #include <mach/common.h> @@ -325,10 +326,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; |