aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/hw_random/omap-rng.c2
-rw-r--r--drivers/i2c/busses/i2c-omap.c47
-rw-r--r--drivers/media/video/omap24xxcam.c8
-rw-r--r--drivers/mmc/host/omap.c24
-rw-r--r--drivers/mmc/host/omap_hsmmc.c4
-rw-r--r--drivers/spi/omap2_mcspi.c4
-rw-r--r--drivers/spi/omap_uwire.c9
-rw-r--r--drivers/w1/masters/omap_hdq.c4
-rw-r--r--drivers/watchdog/omap_wdt.c94
9 files changed, 69 insertions, 127 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index ba68a4671cb5..538313f9e7ac 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -102,7 +102,7 @@ static int __init omap_rng_probe(struct platform_device *pdev)
102 return -EBUSY; 102 return -EBUSY;
103 103
104 if (cpu_is_omap24xx()) { 104 if (cpu_is_omap24xx()) {
105 rng_ick = clk_get(&pdev->dev, "rng_ick"); 105 rng_ick = clk_get(&pdev->dev, "ick");
106 if (IS_ERR(rng_ick)) { 106 if (IS_ERR(rng_ick)) {
107 dev_err(&pdev->dev, "Could not get rng_ick\n"); 107 dev_err(&pdev->dev, "Could not get rng_ick\n");
108 ret = PTR_ERR(rng_ick); 108 ret = PTR_ERR(rng_ick);
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index be8ee2cac8bb..ece0125a1ee5 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -193,22 +193,24 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
193 193
194static int __init omap_i2c_get_clocks(struct omap_i2c_dev *dev) 194static int __init omap_i2c_get_clocks(struct omap_i2c_dev *dev)
195{ 195{
196 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 196 int ret;
197 dev->iclk = clk_get(dev->dev, "i2c_ick"); 197
198 if (IS_ERR(dev->iclk)) { 198 dev->iclk = clk_get(dev->dev, "ick");
199 dev->iclk = NULL; 199 if (IS_ERR(dev->iclk)) {
200 return -ENODEV; 200 ret = PTR_ERR(dev->iclk);
201 } 201 dev->iclk = NULL;
202 return ret;
202 } 203 }
203 204
204 dev->fclk = clk_get(dev->dev, "i2c_fck"); 205 dev->fclk = clk_get(dev->dev, "fck");
205 if (IS_ERR(dev->fclk)) { 206 if (IS_ERR(dev->fclk)) {
207 ret = PTR_ERR(dev->fclk);
206 if (dev->iclk != NULL) { 208 if (dev->iclk != NULL) {
207 clk_put(dev->iclk); 209 clk_put(dev->iclk);
208 dev->iclk = NULL; 210 dev->iclk = NULL;
209 } 211 }
210 dev->fclk = NULL; 212 dev->fclk = NULL;
211 return -ENODEV; 213 return ret;
212 } 214 }
213 215
214 return 0; 216 return 0;
@@ -218,18 +220,15 @@ static void omap_i2c_put_clocks(struct omap_i2c_dev *dev)
218{ 220{
219 clk_put(dev->fclk); 221 clk_put(dev->fclk);
220 dev->fclk = NULL; 222 dev->fclk = NULL;
221 if (dev->iclk != NULL) { 223 clk_put(dev->iclk);
222 clk_put(dev->iclk); 224 dev->iclk = NULL;
223 dev->iclk = NULL;
224 }
225} 225}
226 226
227static void omap_i2c_unidle(struct omap_i2c_dev *dev) 227static void omap_i2c_unidle(struct omap_i2c_dev *dev)
228{ 228{
229 WARN_ON(!dev->idle); 229 WARN_ON(!dev->idle);
230 230
231 if (dev->iclk != NULL) 231 clk_enable(dev->iclk);
232 clk_enable(dev->iclk);
233 clk_enable(dev->fclk); 232 clk_enable(dev->fclk);
234 dev->idle = 0; 233 dev->idle = 0;
235 if (dev->iestate) 234 if (dev->iestate)
@@ -254,8 +253,7 @@ static void omap_i2c_idle(struct omap_i2c_dev *dev)
254 } 253 }
255 dev->idle = 1; 254 dev->idle = 1;
256 clk_disable(dev->fclk); 255 clk_disable(dev->fclk);
257 if (dev->iclk != NULL) 256 clk_disable(dev->iclk);
258 clk_disable(dev->iclk);
259} 257}
260 258
261static int omap_i2c_init(struct omap_i2c_dev *dev) 259static int omap_i2c_init(struct omap_i2c_dev *dev)
@@ -312,15 +310,14 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
312 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 310 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
313 311
314 if (cpu_class_is_omap1()) { 312 if (cpu_class_is_omap1()) {
315 struct clk *armxor_ck; 313 /*
316 314 * The I2C functional clock is the armxor_ck, so there's
317 armxor_ck = clk_get(NULL, "armxor_ck"); 315 * no need to get "armxor_ck" separately. Now, if OMAP2420
318 if (IS_ERR(armxor_ck)) 316 * always returns 12MHz for the functional clock, we can
319 dev_warn(dev->dev, "Could not get armxor_ck\n"); 317 * do this bit unconditionally.
320 else { 318 */
321 fclk_rate = clk_get_rate(armxor_ck); 319 fclk_rate = clk_get_rate(dev->fclk);
322 clk_put(armxor_ck); 320
323 }
324 /* TRM for 5912 says the I2C clock must be prescaled to be 321 /* TRM for 5912 says the I2C clock must be prescaled to be
325 * between 7 - 12 MHz. The XOR input clock is typically 322 * between 7 - 12 MHz. The XOR input clock is typically
326 * 12, 13 or 19.2 MHz. So we should have code that produces: 323 * 12, 13 or 19.2 MHz. So we should have code that produces:
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 73eb656acfe3..805faaea6449 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -80,17 +80,17 @@ static int omap24xxcam_clock_get(struct omap24xxcam_device *cam)
80{ 80{
81 int rval = 0; 81 int rval = 0;
82 82
83 cam->fck = clk_get(cam->dev, "cam_fck"); 83 cam->fck = clk_get(cam->dev, "fck");
84 if (IS_ERR(cam->fck)) { 84 if (IS_ERR(cam->fck)) {
85 dev_err(cam->dev, "can't get cam_fck"); 85 dev_err(cam->dev, "can't get camera fck");
86 rval = PTR_ERR(cam->fck); 86 rval = PTR_ERR(cam->fck);
87 omap24xxcam_clock_put(cam); 87 omap24xxcam_clock_put(cam);
88 return rval; 88 return rval;
89 } 89 }
90 90
91 cam->ick = clk_get(cam->dev, "cam_ick"); 91 cam->ick = clk_get(cam->dev, "ick");
92 if (IS_ERR(cam->ick)) { 92 if (IS_ERR(cam->ick)) {
93 dev_err(cam->dev, "can't get cam_ick"); 93 dev_err(cam->dev, "can't get camera ick");
94 rval = PTR_ERR(cam->ick); 94 rval = PTR_ERR(cam->ick);
95 omap24xxcam_clock_put(cam); 95 omap24xxcam_clock_put(cam);
96 } 96 }
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 67d7b7fef084..5570849188cc 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1460,18 +1460,12 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
1460 if (!host->virt_base) 1460 if (!host->virt_base)
1461 goto err_ioremap; 1461 goto err_ioremap;
1462 1462
1463 if (cpu_is_omap24xx()) { 1463 host->iclk = clk_get(&pdev->dev, "ick");
1464 host->iclk = clk_get(&pdev->dev, "mmc_ick"); 1464 if (IS_ERR(host->iclk))
1465 if (IS_ERR(host->iclk)) 1465 goto err_free_mmc_host;
1466 goto err_free_mmc_host; 1466 clk_enable(host->iclk);
1467 clk_enable(host->iclk);
1468 }
1469
1470 if (!cpu_is_omap24xx())
1471 host->fclk = clk_get(&pdev->dev, "mmc_ck");
1472 else
1473 host->fclk = clk_get(&pdev->dev, "mmc_fck");
1474 1467
1468 host->fclk = clk_get(&pdev->dev, "fck");
1475 if (IS_ERR(host->fclk)) { 1469 if (IS_ERR(host->fclk)) {
1476 ret = PTR_ERR(host->fclk); 1470 ret = PTR_ERR(host->fclk);
1477 goto err_free_iclk; 1471 goto err_free_iclk;
@@ -1536,10 +1530,10 @@ static int mmc_omap_remove(struct platform_device *pdev)
1536 if (host->pdata->cleanup) 1530 if (host->pdata->cleanup)
1537 host->pdata->cleanup(&pdev->dev); 1531 host->pdata->cleanup(&pdev->dev);
1538 1532
1539 if (host->iclk && !IS_ERR(host->iclk)) 1533 mmc_omap_fclk_enable(host, 0);
1540 clk_put(host->iclk); 1534 clk_put(host->fclk);
1541 if (host->fclk && !IS_ERR(host->fclk)) 1535 clk_disable(host->iclk);
1542 clk_put(host->fclk); 1536 clk_put(host->iclk);
1543 1537
1544 iounmap(host->virt_base); 1538 iounmap(host->virt_base);
1545 release_mem_region(pdev->resource[0].start, 1539 release_mem_region(pdev->resource[0].start,
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a631c81dce12..3916a5618e28 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -956,13 +956,13 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
956 956
957 sema_init(&host->sem, 1); 957 sema_init(&host->sem, 1);
958 958
959 host->iclk = clk_get(&pdev->dev, "mmchs_ick"); 959 host->iclk = clk_get(&pdev->dev, "ick");
960 if (IS_ERR(host->iclk)) { 960 if (IS_ERR(host->iclk)) {
961 ret = PTR_ERR(host->iclk); 961 ret = PTR_ERR(host->iclk);
962 host->iclk = NULL; 962 host->iclk = NULL;
963 goto err1; 963 goto err1;
964 } 964 }
965 host->fclk = clk_get(&pdev->dev, "mmchs_fck"); 965 host->fclk = clk_get(&pdev->dev, "fck");
966 if (IS_ERR(host->fclk)) { 966 if (IS_ERR(host->fclk)) {
967 ret = PTR_ERR(host->fclk); 967 ret = PTR_ERR(host->fclk);
968 host->fclk = NULL; 968 host->fclk = NULL;
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 454a2712e629..b91ee1ae975d 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -1021,13 +1021,13 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1021 spin_lock_init(&mcspi->lock); 1021 spin_lock_init(&mcspi->lock);
1022 INIT_LIST_HEAD(&mcspi->msg_queue); 1022 INIT_LIST_HEAD(&mcspi->msg_queue);
1023 1023
1024 mcspi->ick = clk_get(&pdev->dev, "mcspi_ick"); 1024 mcspi->ick = clk_get(&pdev->dev, "ick");
1025 if (IS_ERR(mcspi->ick)) { 1025 if (IS_ERR(mcspi->ick)) {
1026 dev_dbg(&pdev->dev, "can't get mcspi_ick\n"); 1026 dev_dbg(&pdev->dev, "can't get mcspi_ick\n");
1027 status = PTR_ERR(mcspi->ick); 1027 status = PTR_ERR(mcspi->ick);
1028 goto err1a; 1028 goto err1a;
1029 } 1029 }
1030 mcspi->fck = clk_get(&pdev->dev, "mcspi_fck"); 1030 mcspi->fck = clk_get(&pdev->dev, "fck");
1031 if (IS_ERR(mcspi->fck)) { 1031 if (IS_ERR(mcspi->fck)) {
1032 dev_dbg(&pdev->dev, "can't get mcspi_fck\n"); 1032 dev_dbg(&pdev->dev, "can't get mcspi_fck\n");
1033 status = PTR_ERR(mcspi->fck); 1033 status = PTR_ERR(mcspi->fck);
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index bab6ff061e91..394b616eafe3 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -506,11 +506,12 @@ static int __init uwire_probe(struct platform_device *pdev)
506 506
507 dev_set_drvdata(&pdev->dev, uwire); 507 dev_set_drvdata(&pdev->dev, uwire);
508 508
509 uwire->ck = clk_get(&pdev->dev, "armxor_ck"); 509 uwire->ck = clk_get(&pdev->dev, "fck");
510 if (!uwire->ck || IS_ERR(uwire->ck)) { 510 if (IS_ERR(uwire->ck)) {
511 dev_dbg(&pdev->dev, "no mpu_xor_clk ?\n"); 511 status = PTR_ERR(uwire->ck);
512 dev_dbg(&pdev->dev, "no functional clock?\n");
512 spi_master_put(master); 513 spi_master_put(master);
513 return -ENODEV; 514 return status;
514 } 515 }
515 clk_enable(uwire->ck); 516 clk_enable(uwire->ck);
516 517
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index c973889110c8..a7e3b706b9d3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -590,8 +590,8 @@ static int __init omap_hdq_probe(struct platform_device *pdev)
590 } 590 }
591 591
592 /* get interface & functional clock objects */ 592 /* get interface & functional clock objects */
593 hdq_data->hdq_ick = clk_get(&pdev->dev, "hdq_ick"); 593 hdq_data->hdq_ick = clk_get(&pdev->dev, "ick");
594 hdq_data->hdq_fck = clk_get(&pdev->dev, "hdq_fck"); 594 hdq_data->hdq_fck = clk_get(&pdev->dev, "fck");
595 595
596 if (IS_ERR(hdq_data->hdq_ick) || IS_ERR(hdq_data->hdq_fck)) { 596 if (IS_ERR(hdq_data->hdq_ick) || IS_ERR(hdq_data->hdq_fck)) {
597 dev_dbg(&pdev->dev, "Can't get HDQ clock objects\n"); 597 dev_dbg(&pdev->dev, "Can't get HDQ clock objects\n");
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 2f2ce7429f5b..aa5ad6e33f02 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -60,9 +60,8 @@ struct omap_wdt_dev {
60 void __iomem *base; /* physical */ 60 void __iomem *base; /* physical */
61 struct device *dev; 61 struct device *dev;
62 int omap_wdt_users; 62 int omap_wdt_users;
63 struct clk *armwdt_ck; 63 struct clk *ick;
64 struct clk *mpu_wdt_ick; 64 struct clk *fck;
65 struct clk *mpu_wdt_fck;
66 struct resource *mem; 65 struct resource *mem;
67 struct miscdevice omap_wdt_miscdev; 66 struct miscdevice omap_wdt_miscdev;
68}; 67};
@@ -146,13 +145,8 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
146 if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users))) 145 if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users)))
147 return -EBUSY; 146 return -EBUSY;
148 147
149 if (cpu_is_omap16xx()) 148 clk_enable(wdev->ick); /* Enable the interface clock */
150 clk_enable(wdev->armwdt_ck); /* Enable the clock */ 149 clk_enable(wdev->fck); /* Enable the functional clock */
151
152 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
153 clk_enable(wdev->mpu_wdt_ick); /* Enable the interface clock */
154 clk_enable(wdev->mpu_wdt_fck); /* Enable the functional clock */
155 }
156 150
157 /* initialize prescaler */ 151 /* initialize prescaler */
158 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) 152 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01)
@@ -181,13 +175,8 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
181 175
182 omap_wdt_disable(wdev); 176 omap_wdt_disable(wdev);
183 177
184 if (cpu_is_omap16xx()) 178 clk_disable(wdev->ick);
185 clk_disable(wdev->armwdt_ck); /* Disable the clock */ 179 clk_disable(wdev->fck);
186
187 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
188 clk_disable(wdev->mpu_wdt_ick); /* Disable the clock */
189 clk_disable(wdev->mpu_wdt_fck); /* Disable the clock */
190 }
191#else 180#else
192 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n"); 181 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
193#endif 182#endif
@@ -303,44 +292,19 @@ static int __init omap_wdt_probe(struct platform_device *pdev)
303 wdev->omap_wdt_users = 0; 292 wdev->omap_wdt_users = 0;
304 wdev->mem = mem; 293 wdev->mem = mem;
305 294
306 if (cpu_is_omap16xx()) { 295 wdev->ick = clk_get(&pdev->dev, "ick");
307 wdev->armwdt_ck = clk_get(&pdev->dev, "armwdt_ck"); 296 if (IS_ERR(wdev->ick)) {
308 if (IS_ERR(wdev->armwdt_ck)) { 297 ret = PTR_ERR(wdev->ick);
309 ret = PTR_ERR(wdev->armwdt_ck); 298 wdev->ick = NULL;
310 wdev->armwdt_ck = NULL; 299 goto err_clk;
311 goto err_clk;
312 }
313 } 300 }
314 301 wdev->fck = clk_get(&pdev->dev, "fck");
315 if (cpu_is_omap24xx()) { 302 if (IS_ERR(wdev->fck)) {
316 wdev->mpu_wdt_ick = clk_get(&pdev->dev, "mpu_wdt_ick"); 303 ret = PTR_ERR(wdev->fck);
317 if (IS_ERR(wdev->mpu_wdt_ick)) { 304 wdev->fck = NULL;
318 ret = PTR_ERR(wdev->mpu_wdt_ick); 305 goto err_clk;
319 wdev->mpu_wdt_ick = NULL;
320 goto err_clk;
321 }
322 wdev->mpu_wdt_fck = clk_get(&pdev->dev, "mpu_wdt_fck");
323 if (IS_ERR(wdev->mpu_wdt_fck)) {
324 ret = PTR_ERR(wdev->mpu_wdt_fck);
325 wdev->mpu_wdt_fck = NULL;
326 goto err_clk;
327 }
328 } 306 }
329 307
330 if (cpu_is_omap34xx()) {
331 wdev->mpu_wdt_ick = clk_get(&pdev->dev, "wdt2_ick");
332 if (IS_ERR(wdev->mpu_wdt_ick)) {
333 ret = PTR_ERR(wdev->mpu_wdt_ick);
334 wdev->mpu_wdt_ick = NULL;
335 goto err_clk;
336 }
337 wdev->mpu_wdt_fck = clk_get(&pdev->dev, "wdt2_fck");
338 if (IS_ERR(wdev->mpu_wdt_fck)) {
339 ret = PTR_ERR(wdev->mpu_wdt_fck);
340 wdev->mpu_wdt_fck = NULL;
341 goto err_clk;
342 }
343 }
344 wdev->base = ioremap(res->start, res->end - res->start + 1); 308 wdev->base = ioremap(res->start, res->end - res->start + 1);
345 if (!wdev->base) { 309 if (!wdev->base) {
346 ret = -ENOMEM; 310 ret = -ENOMEM;
@@ -380,12 +344,10 @@ err_ioremap:
380 wdev->base = NULL; 344 wdev->base = NULL;
381 345
382err_clk: 346err_clk:
383 if (wdev->armwdt_ck) 347 if (wdev->ick)
384 clk_put(wdev->armwdt_ck); 348 clk_put(wdev->ick);
385 if (wdev->mpu_wdt_ick) 349 if (wdev->fck)
386 clk_put(wdev->mpu_wdt_ick); 350 clk_put(wdev->fck);
387 if (wdev->mpu_wdt_fck)
388 clk_put(wdev->mpu_wdt_fck);
389 kfree(wdev); 351 kfree(wdev);
390 352
391err_kzalloc: 353err_kzalloc:
@@ -417,20 +379,8 @@ static int omap_wdt_remove(struct platform_device *pdev)
417 release_mem_region(res->start, res->end - res->start + 1); 379 release_mem_region(res->start, res->end - res->start + 1);
418 platform_set_drvdata(pdev, NULL); 380 platform_set_drvdata(pdev, NULL);
419 381
420 if (wdev->armwdt_ck) { 382 clk_put(wdev->ick);
421 clk_put(wdev->armwdt_ck); 383 clk_put(wdev->fck);
422 wdev->armwdt_ck = NULL;
423 }
424
425 if (wdev->mpu_wdt_ick) {
426 clk_put(wdev->mpu_wdt_ick);
427 wdev->mpu_wdt_ick = NULL;
428 }
429
430 if (wdev->mpu_wdt_fck) {
431 clk_put(wdev->mpu_wdt_fck);
432 wdev->mpu_wdt_fck = NULL;
433 }
434 iounmap(wdev->base); 384 iounmap(wdev->base);
435 385
436 kfree(wdev); 386 kfree(wdev);