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>
r = -ENODEV;
goto err_free_mem;
}
r = -ENODEV;
goto err_free_mem;
}
+ clk_prepare_enable(dev->clk);
dev->base = ioremap(mem->start, resource_size(mem));
if (!dev->base) {
dev->base = ioremap(mem->start, resource_size(mem));
if (!dev->base) {
err_unuse_clocks:
iounmap(dev->base);
err_mem_ioremap:
err_unuse_clocks:
iounmap(dev->base);
err_mem_ioremap:
+ clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
dev->clk = NULL;
err_free_mem:
clk_put(dev->clk);
dev->clk = NULL;
err_free_mem:
i2c_del_adapter(&dev->adapter);
put_device(&pdev->dev);
i2c_del_adapter(&dev->adapter);
put_device(&pdev->dev);
+ clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
dev->clk = NULL;
clk_put(dev->clk);
dev->clk = NULL;
/* put I2C into reset */
davinci_i2c_reset_ctrl(i2c_dev, 0);
/* put I2C into reset */
davinci_i2c_reset_ctrl(i2c_dev, 0);
- clk_disable(i2c_dev->clk);
+ clk_disable_unprepare(i2c_dev->clk);
struct platform_device *pdev = to_platform_device(dev);
struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
struct platform_device *pdev = to_platform_device(dev);
struct davinci_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
- clk_enable(i2c_dev->clk);
+ clk_prepare_enable(i2c_dev->clk);
/* take I2C out of reset */
davinci_i2c_reset_ctrl(i2c_dev, 1);
/* take I2C out of reset */
davinci_i2c_reset_ctrl(i2c_dev, 1);