summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2013-08-07 17:05:37 +0800
committerWolfram Sang <wsa@the-dreams.de>2013-08-15 16:11:41 +0200
commit46f2832b9f66b008fb813fe153f27794412fbc4f (patch)
tree02d4ff2b6d55bc720ac041223ae5171736d91ac0 /drivers/i2c
parentd533f0492b6371025a4f88506c7f1828a7a48e81 (diff)
downloadlinux-46f2832b9f66b008fb813fe153f27794412fbc4f.tar.bz2
i2c: imx: enable clk before write to registers
The module clk should be enabled before write to its register in probe(), and the clk can be disabled after. Signed-off-by: Jingchang Lu <b35083@freescale.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 9167d4332d77..7adb35115d95 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -543,6 +543,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
return PTR_ERR(i2c_imx->clk);
}
+ ret = clk_prepare_enable(i2c_imx->clk);
+ if (ret) {
+ dev_err(&pdev->dev, "can't enable I2C clock\n");
+ return ret;
+ }
/* Request IRQ */
ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, 0,
pdev->name, i2c_imx);
@@ -580,6 +585,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
/* Set up platform driver data */
platform_set_drvdata(pdev, i2c_imx);
+ clk_disable_unprepare(i2c_imx->clk);
dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",