Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: designware: Add clk_{un}prepare() support

clk_{un}prepare is mandatory for platforms using common clock framework. Since
this driver is used by SPEAr platform, which supports common clock framework,
add clk_{un}prepare() support for designware i2c.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

authored by

Viresh Kumar and committed by
Wolfram Sang
e1fac69f 3bf3b289

+5 -5
+5 -5
drivers/i2c/busses/i2c-designware-platdrv.c
··· 96 96 r = -ENODEV; 97 97 goto err_free_mem; 98 98 } 99 - clk_enable(dev->clk); 99 + clk_prepare_enable(dev->clk); 100 100 101 101 dev->functionality = 102 102 I2C_FUNC_I2C | ··· 156 156 err_iounmap: 157 157 iounmap(dev->base); 158 158 err_unuse_clocks: 159 - clk_disable(dev->clk); 159 + clk_disable_unprepare(dev->clk); 160 160 clk_put(dev->clk); 161 161 dev->clk = NULL; 162 162 err_free_mem: ··· 178 178 i2c_del_adapter(&dev->adapter); 179 179 put_device(&pdev->dev); 180 180 181 - clk_disable(dev->clk); 181 + clk_disable_unprepare(dev->clk); 182 182 clk_put(dev->clk); 183 183 dev->clk = NULL; 184 184 ··· 205 205 struct platform_device *pdev = to_platform_device(dev); 206 206 struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); 207 207 208 - clk_disable(i_dev->clk); 208 + clk_disable_unprepare(i_dev->clk); 209 209 210 210 return 0; 211 211 } ··· 215 215 struct platform_device *pdev = to_platform_device(dev); 216 216 struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); 217 217 218 - clk_enable(i_dev->clk); 218 + clk_prepare_enable(i_dev->clk); 219 219 i2c_dw_init(i_dev); 220 220 221 221 return 0;