aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2012-04-17 07:34:31 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-05-12 08:28:15 -0400
commite1fac69f3b2c0430f56f47bf98eebac8b2da395c (patch)
treec94ca003bcb3e5972542c84783fc5274a919e5e5 /drivers
parent3bf3b289c233c28aaef16546168a994070aa24a0 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index f08d0248cf6b..0506fef8dc00 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -96,7 +96,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
96 r = -ENODEV; 96 r = -ENODEV;
97 goto err_free_mem; 97 goto err_free_mem;
98 } 98 }
99 clk_enable(dev->clk); 99 clk_prepare_enable(dev->clk);
100 100
101 dev->functionality = 101 dev->functionality =
102 I2C_FUNC_I2C | 102 I2C_FUNC_I2C |
@@ -156,7 +156,7 @@ err_free_irq:
156err_iounmap: 156err_iounmap:
157 iounmap(dev->base); 157 iounmap(dev->base);
158err_unuse_clocks: 158err_unuse_clocks:
159 clk_disable(dev->clk); 159 clk_disable_unprepare(dev->clk);
160 clk_put(dev->clk); 160 clk_put(dev->clk);
161 dev->clk = NULL; 161 dev->clk = NULL;
162err_free_mem: 162err_free_mem:
@@ -178,7 +178,7 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev)
178 i2c_del_adapter(&dev->adapter); 178 i2c_del_adapter(&dev->adapter);
179 put_device(&pdev->dev); 179 put_device(&pdev->dev);
180 180
181 clk_disable(dev->clk); 181 clk_disable_unprepare(dev->clk);
182 clk_put(dev->clk); 182 clk_put(dev->clk);
183 dev->clk = NULL; 183 dev->clk = NULL;
184 184
@@ -205,7 +205,7 @@ static int dw_i2c_suspend(struct device *dev)
205 struct platform_device *pdev = to_platform_device(dev); 205 struct platform_device *pdev = to_platform_device(dev);
206 struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); 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 return 0; 210 return 0;
211} 211}
@@ -215,7 +215,7 @@ static int dw_i2c_resume(struct device *dev)
215 struct platform_device *pdev = to_platform_device(dev); 215 struct platform_device *pdev = to_platform_device(dev);
216 struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev); 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 i2c_dw_init(i_dev); 219 i2c_dw_init(i_dev);
220 220
221 return 0; 221 return 0;