diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-12 01:32:09 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-12 01:32:09 -0400 |
commit | 844d0b5a0b42d6c73114a1dc229db751120d226f (patch) | |
tree | faf9f83e78ae24f6730d64999a89c35144da3b8a /drivers/i2c | |
parent | 50260924afd4b745bfb6e5f1caee381a1875fc31 (diff) | |
parent | a0f5e3631b07cabf624e7d818df76d47d9d21017 (diff) |
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 @@ | |||
51 | #include <linux/of.h> | 51 | #include <linux/of.h> |
52 | #include <linux/of_device.h> | 52 | #include <linux/of_device.h> |
53 | #include <linux/of_i2c.h> | 53 | #include <linux/of_i2c.h> |
54 | #include <linux/pinctrl/consumer.h> | ||
54 | 55 | ||
55 | #include <mach/irqs.h> | 56 | #include <mach/irqs.h> |
56 | #include <mach/hardware.h> | 57 | #include <mach/hardware.h> |
@@ -470,6 +471,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
470 | struct imx_i2c_struct *i2c_imx; | 471 | struct imx_i2c_struct *i2c_imx; |
471 | struct resource *res; | 472 | struct resource *res; |
472 | struct imxi2c_platform_data *pdata = pdev->dev.platform_data; | 473 | struct imxi2c_platform_data *pdata = pdev->dev.platform_data; |
474 | struct pinctrl *pinctrl; | ||
473 | void __iomem *base; | 475 | void __iomem *base; |
474 | resource_size_t res_size; | 476 | resource_size_t res_size; |
475 | int irq, bitrate; | 477 | int irq, bitrate; |
@@ -520,6 +522,12 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
520 | i2c_imx->base = base; | 522 | i2c_imx->base = base; |
521 | i2c_imx->res = res; | 523 | i2c_imx->res = res; |
522 | 524 | ||
525 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
526 | if (IS_ERR(pinctrl)) { | ||
527 | ret = PTR_ERR(pinctrl); | ||
528 | goto fail3; | ||
529 | } | ||
530 | |||
523 | /* Get I2C clock */ | 531 | /* Get I2C clock */ |
524 | i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk"); | 532 | i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk"); |
525 | if (IS_ERR(i2c_imx->clk)) { | 533 | 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 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/pinctrl/consumer.h> | ||
29 | 30 | ||
30 | #include <mach/common.h> | 31 | #include <mach/common.h> |
31 | 32 | ||
@@ -325,10 +326,15 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) | |||
325 | struct device *dev = &pdev->dev; | 326 | struct device *dev = &pdev->dev; |
326 | struct mxs_i2c_dev *i2c; | 327 | struct mxs_i2c_dev *i2c; |
327 | struct i2c_adapter *adap; | 328 | struct i2c_adapter *adap; |
329 | struct pinctrl *pinctrl; | ||
328 | struct resource *res; | 330 | struct resource *res; |
329 | resource_size_t res_size; | 331 | resource_size_t res_size; |
330 | int err, irq; | 332 | int err, irq; |
331 | 333 | ||
334 | pinctrl = devm_pinctrl_get_select_default(dev); | ||
335 | if (IS_ERR(pinctrl)) | ||
336 | return PTR_ERR(pinctrl); | ||
337 | |||
332 | i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL); | 338 | i2c = devm_kzalloc(dev, sizeof(struct mxs_i2c_dev), GFP_KERNEL); |
333 | if (!i2c) | 339 | if (!i2c) |
334 | return -ENOMEM; | 340 | return -ENOMEM; |