aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-davinci.c
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2012-08-30 14:10:36 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-09-14 09:20:33 -0400
commit2bdbfa9c4a14f0015d1e189b17175a989d7c2a40 (patch)
tree7fe9ffd44ad3e42765f6c599f7b41c73cb234608 /drivers/i2c/busses/i2c-davinci.c
parentc5d3cd6dc2dc106ca9fcc8cb6587754ee6cfc86e (diff)
i2c: davinci: preparation for switch to common clock framework
As a first step towards migrating davinci platforms to use common clock framework, replace all instances of clk_enable() with clk_prepare_enable() and clk_disable() with clk_disable_unprepare(). Until the platform is switched to use the CONFIG_HAVE_CLK_PREPARE Kconfig variable, this just adds a might_sleep() call and would work without any issues. This will make it easy later to switch to common clk based implementation of clk driver from DaVinci specific driver. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-davinci.c')
-rw-r--r--drivers/i2c/busses/i2c-davinci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index b6185dccdf4a..85ce548ff152 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -704,7 +704,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
704 r = -ENODEV; 704 r = -ENODEV;
705 goto err_free_mem; 705 goto err_free_mem;
706 } 706 }
707 clk_enable(dev->clk); 707 clk_prepare_enable(dev->clk);
708 708
709 dev->base = ioremap(mem->start, resource_size(mem)); 709 dev->base = ioremap(mem->start, resource_size(mem));
710 if (!dev->base) { 710 if (!dev->base) {
@@ -751,7 +751,7 @@ err_free_irq:
751err_unuse_clocks: 751err_unuse_clocks:
752 iounmap(dev->base); 752 iounmap(dev->base);
753err_mem_ioremap: 753err_mem_ioremap:
754 clk_disable(dev->clk); 754 clk_disable_unprepare(dev->clk);
755 clk_put(dev->clk); 755 clk_put(dev->clk);
756 dev->clk = NULL; 756 dev->clk = NULL;
757err_free_mem: 757err_free_mem:
@@ -775,7 +775,7 @@ static int davinci_i2c_remove(struct platform_device *pdev)
775 i2c_del_adapter(&dev->adapter); 775 i2c_del_adapter(&dev->adapter);
776 put_device(&pdev->dev); 776 put_device(&pdev->dev);
777 777
778 clk_disable(dev->clk); 778 clk_disable_unprepare(dev->clk);
779 clk_put(dev->clk); 779 clk_put(dev->clk);
780 dev->clk = NULL; 780 dev->clk = NULL;
781 781
@@ -797,7 +797,7 @@ static int davinci_i2c_suspend(struct device *dev)
797 797
798 /* put I2C into reset */ 798 /* put I2C into reset */
799 davinci_i2c_reset_ctrl(i2c_dev, 0); 799 davinci_i2c_reset_ctrl(i2c_dev, 0);
800 clk_disable(i2c_dev->clk); 800 clk_disable_unprepare(i2c_dev->clk);
801 801
802 return 0; 802 return 0;
803} 803}
@@ -807,7 +807,7 @@ static int davinci_i2c_resume(struct device *dev)
807 struct platform_device *pdev = to_platform_device(dev); 807 struct platform_device *pdev = to_platform_device(dev);
808 struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev); 808 struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
809 809
810 clk_enable(i2c_dev->clk); 810 clk_prepare_enable(i2c_dev->clk);
811 /* take I2C out of reset */ 811 /* take I2C out of reset */
812 davinci_i2c_reset_ctrl(i2c_dev, 1); 812 davinci_i2c_reset_ctrl(i2c_dev, 1);
813 813