aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-imx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-imx.c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 82f20c60bb7b..e24279725d36 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -51,7 +51,6 @@
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>
55#include <linux/platform_data/i2c-imx.h> 54#include <linux/platform_data/i2c-imx.h>
56 55
57/** Defines ******************************************************************** 56/** Defines ********************************************************************
@@ -148,6 +147,7 @@ static const struct of_device_id i2c_imx_dt_ids[] = {
148 { .compatible = "fsl,imx21-i2c", .data = &imx_i2c_devtype[IMX21_I2C], }, 147 { .compatible = "fsl,imx21-i2c", .data = &imx_i2c_devtype[IMX21_I2C], },
149 { /* sentinel */ } 148 { /* sentinel */ }
150}; 149};
150MODULE_DEVICE_TABLE(of, i2c_imx_dt_ids);
151 151
152static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx) 152static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx)
153{ 153{
@@ -493,24 +493,19 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
493 struct imx_i2c_struct *i2c_imx; 493 struct imx_i2c_struct *i2c_imx;
494 struct resource *res; 494 struct resource *res;
495 struct imxi2c_platform_data *pdata = pdev->dev.platform_data; 495 struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
496 struct pinctrl *pinctrl;
497 void __iomem *base; 496 void __iomem *base;
498 int irq, ret; 497 int irq, ret;
499 u32 bitrate; 498 u32 bitrate;
500 499
501 dev_dbg(&pdev->dev, "<%s>\n", __func__); 500 dev_dbg(&pdev->dev, "<%s>\n", __func__);
502 501
503 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
504 if (!res) {
505 dev_err(&pdev->dev, "can't get device resources\n");
506 return -ENOENT;
507 }
508 irq = platform_get_irq(pdev, 0); 502 irq = platform_get_irq(pdev, 0);
509 if (irq < 0) { 503 if (irq < 0) {
510 dev_err(&pdev->dev, "can't get irq number\n"); 504 dev_err(&pdev->dev, "can't get irq number\n");
511 return -ENOENT; 505 return -ENOENT;
512 } 506 }
513 507
508 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
514 base = devm_ioremap_resource(&pdev->dev, res); 509 base = devm_ioremap_resource(&pdev->dev, res);
515 if (IS_ERR(base)) 510 if (IS_ERR(base))
516 return PTR_ERR(base); 511 return PTR_ERR(base);
@@ -535,12 +530,6 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
535 i2c_imx->adapter.dev.of_node = pdev->dev.of_node; 530 i2c_imx->adapter.dev.of_node = pdev->dev.of_node;
536 i2c_imx->base = base; 531 i2c_imx->base = base;
537 532
538 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
539 if (IS_ERR(pinctrl)) {
540 dev_err(&pdev->dev, "can't get/select pinctrl\n");
541 return PTR_ERR(pinctrl);
542 }
543
544 /* Get I2C clock */ 533 /* Get I2C clock */
545 i2c_imx->clk = devm_clk_get(&pdev->dev, NULL); 534 i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
546 if (IS_ERR(i2c_imx->clk)) { 535 if (IS_ERR(i2c_imx->clk)) {