diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-07-06 16:21:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-07-06 16:21:23 -0400 |
commit | 524cd267e54a5314aa83f058bc7991b21a1cfad5 (patch) | |
tree | 0e8fd3f21a6cad040134248fff2a0a2b9095198e /drivers | |
parent | ebaaa25de8376292b2dfc8252f5213e3a28bac70 (diff) | |
parent | 094479915618c526a1409dd6704bcb4ff2c5c1c2 (diff) |
Merge branch 'for-3.6/common-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/clk
From Stephen Warren <swarren@wwwdotorg.org>:
This branch contains numerous changes required as a baseline in order to
convert Tegra to the common clock framework. The intention was to also
include patches to actually convert Tegra to the common clock framework.
However, those patches appeared late in the kernel cycle and currently
cause regressions on some boards, so were dropped for now.
* 'for-3.6/common-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
ARM: tegra: Provide clock for only one PWM controller
ARM: tegra: Fix PWM clock programming
ARM: tegra: dma: rename driver name for clock to "tegra-apbdma"
ARM: tegra: Remove second instance of uart clk
crypto: add clk_prepare/clk_unprepare
ASoC: tegra: add clk_prepare/clk_unprepare
staging: nvec: add clk_prepare/clk_unprepare
spi/tegra: add clk_prepare/clk_unprepare
Input: tegra-kbc - add clk_prepare/clk_unprepare
USB: ehci-tegra: add clk_prepare/clk_unprepare
mmc: tegra: add clk_prepare/clk_unprepare
i2c: tegra: Add clk_prepare/clk_unprepare
ARM: tegra: add clk_prepare/clk_unprepare
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/tegra-aes.c | 12 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 10 | ||||
-rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-tegra.c | 6 | ||||
-rw-r--r-- | drivers/spi/spi-tegra.c | 4 | ||||
-rw-r--r-- | drivers/staging/nvec/nvec.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 20 |
7 files changed, 32 insertions, 32 deletions
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index 422a9766c7c9..ac236f6724f4 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c | |||
@@ -572,7 +572,7 @@ static void aes_workqueue_handler(struct work_struct *work) | |||
572 | struct tegra_aes_dev *dd = aes_dev; | 572 | struct tegra_aes_dev *dd = aes_dev; |
573 | int ret; | 573 | int ret; |
574 | 574 | ||
575 | ret = clk_enable(dd->aes_clk); | 575 | ret = clk_prepare_enable(dd->aes_clk); |
576 | if (ret) | 576 | if (ret) |
577 | BUG_ON("clock enable failed"); | 577 | BUG_ON("clock enable failed"); |
578 | 578 | ||
@@ -581,7 +581,7 @@ static void aes_workqueue_handler(struct work_struct *work) | |||
581 | ret = tegra_aes_handle_req(dd); | 581 | ret = tegra_aes_handle_req(dd); |
582 | } while (!ret); | 582 | } while (!ret); |
583 | 583 | ||
584 | clk_disable(dd->aes_clk); | 584 | clk_disable_unprepare(dd->aes_clk); |
585 | } | 585 | } |
586 | 586 | ||
587 | static irqreturn_t aes_irq(int irq, void *dev_id) | 587 | static irqreturn_t aes_irq(int irq, void *dev_id) |
@@ -673,7 +673,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata, | |||
673 | /* take mutex to access the aes hw */ | 673 | /* take mutex to access the aes hw */ |
674 | mutex_lock(&aes_lock); | 674 | mutex_lock(&aes_lock); |
675 | 675 | ||
676 | ret = clk_enable(dd->aes_clk); | 676 | ret = clk_prepare_enable(dd->aes_clk); |
677 | if (ret) | 677 | if (ret) |
678 | return ret; | 678 | return ret; |
679 | 679 | ||
@@ -700,7 +700,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata, | |||
700 | } | 700 | } |
701 | 701 | ||
702 | out: | 702 | out: |
703 | clk_disable(dd->aes_clk); | 703 | clk_disable_unprepare(dd->aes_clk); |
704 | mutex_unlock(&aes_lock); | 704 | mutex_unlock(&aes_lock); |
705 | 705 | ||
706 | dev_dbg(dd->dev, "%s: done\n", __func__); | 706 | dev_dbg(dd->dev, "%s: done\n", __func__); |
@@ -758,7 +758,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, | |||
758 | 758 | ||
759 | dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; | 759 | dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; |
760 | 760 | ||
761 | ret = clk_enable(dd->aes_clk); | 761 | ret = clk_prepare_enable(dd->aes_clk); |
762 | if (ret) | 762 | if (ret) |
763 | return ret; | 763 | return ret; |
764 | 764 | ||
@@ -788,7 +788,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, | |||
788 | memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ); | 788 | memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ); |
789 | 789 | ||
790 | out: | 790 | out: |
791 | clk_disable(dd->aes_clk); | 791 | clk_disable_unprepare(dd->aes_clk); |
792 | mutex_unlock(&aes_lock); | 792 | mutex_unlock(&aes_lock); |
793 | 793 | ||
794 | dev_dbg(dd->dev, "%s: done\n", __func__); | 794 | dev_dbg(dd->dev, "%s: done\n", __func__); |
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 8b2e555a9563..3da7ee3eb505 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -341,7 +341,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) | |||
341 | u32 val; | 341 | u32 val; |
342 | int err = 0; | 342 | int err = 0; |
343 | 343 | ||
344 | clk_enable(i2c_dev->clk); | 344 | clk_prepare_enable(i2c_dev->clk); |
345 | 345 | ||
346 | tegra_periph_reset_assert(i2c_dev->clk); | 346 | tegra_periph_reset_assert(i2c_dev->clk); |
347 | udelay(2); | 347 | udelay(2); |
@@ -372,7 +372,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) | |||
372 | if (tegra_i2c_flush_fifos(i2c_dev)) | 372 | if (tegra_i2c_flush_fifos(i2c_dev)) |
373 | err = -ETIMEDOUT; | 373 | err = -ETIMEDOUT; |
374 | 374 | ||
375 | clk_disable(i2c_dev->clk); | 375 | clk_disable_unprepare(i2c_dev->clk); |
376 | 376 | ||
377 | if (i2c_dev->irq_disabled) { | 377 | if (i2c_dev->irq_disabled) { |
378 | i2c_dev->irq_disabled = 0; | 378 | i2c_dev->irq_disabled = 0; |
@@ -546,14 +546,14 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
546 | if (i2c_dev->is_suspended) | 546 | if (i2c_dev->is_suspended) |
547 | return -EBUSY; | 547 | return -EBUSY; |
548 | 548 | ||
549 | clk_enable(i2c_dev->clk); | 549 | clk_prepare_enable(i2c_dev->clk); |
550 | for (i = 0; i < num; i++) { | 550 | for (i = 0; i < num; i++) { |
551 | int stop = (i == (num - 1)) ? 1 : 0; | 551 | int stop = (i == (num - 1)) ? 1 : 0; |
552 | ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], stop); | 552 | ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], stop); |
553 | if (ret) | 553 | if (ret) |
554 | break; | 554 | break; |
555 | } | 555 | } |
556 | clk_disable(i2c_dev->clk); | 556 | clk_disable_unprepare(i2c_dev->clk); |
557 | return ret ?: i; | 557 | return ret ?: i; |
558 | } | 558 | } |
559 | 559 | ||
@@ -666,7 +666,7 @@ static int __devinit tegra_i2c_probe(struct platform_device *pdev) | |||
666 | goto err_free; | 666 | goto err_free; |
667 | } | 667 | } |
668 | 668 | ||
669 | clk_enable(i2c_dev->i2c_clk); | 669 | clk_prepare_enable(i2c_dev->i2c_clk); |
670 | 670 | ||
671 | i2c_set_adapdata(&i2c_dev->adapter, i2c_dev); | 671 | i2c_set_adapdata(&i2c_dev->adapter, i2c_dev); |
672 | i2c_dev->adapter.owner = THIS_MODULE; | 672 | i2c_dev->adapter.owner = THIS_MODULE; |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 4ffe64d53107..2c1c9ed1bd9f 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
@@ -492,7 +492,7 @@ static int tegra_kbc_start(struct tegra_kbc *kbc) | |||
492 | unsigned int debounce_cnt; | 492 | unsigned int debounce_cnt; |
493 | u32 val = 0; | 493 | u32 val = 0; |
494 | 494 | ||
495 | clk_enable(kbc->clk); | 495 | clk_prepare_enable(kbc->clk); |
496 | 496 | ||
497 | /* Reset the KBC controller to clear all previous status.*/ | 497 | /* Reset the KBC controller to clear all previous status.*/ |
498 | tegra_periph_reset_assert(kbc->clk); | 498 | tegra_periph_reset_assert(kbc->clk); |
@@ -556,7 +556,7 @@ static void tegra_kbc_stop(struct tegra_kbc *kbc) | |||
556 | disable_irq(kbc->irq); | 556 | disable_irq(kbc->irq); |
557 | del_timer_sync(&kbc->timer); | 557 | del_timer_sync(&kbc->timer); |
558 | 558 | ||
559 | clk_disable(kbc->clk); | 559 | clk_disable_unprepare(kbc->clk); |
560 | } | 560 | } |
561 | 561 | ||
562 | static int tegra_kbc_open(struct input_dev *dev) | 562 | static int tegra_kbc_open(struct input_dev *dev) |
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 6e5338a071ce..0810ccc23d7e 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c | |||
@@ -337,7 +337,7 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev) | |||
337 | rc = PTR_ERR(clk); | 337 | rc = PTR_ERR(clk); |
338 | goto err_clk_get; | 338 | goto err_clk_get; |
339 | } | 339 | } |
340 | clk_enable(clk); | 340 | clk_prepare_enable(clk); |
341 | pltfm_host->clk = clk; | 341 | pltfm_host->clk = clk; |
342 | 342 | ||
343 | host->mmc->pm_caps = plat->pm_flags; | 343 | host->mmc->pm_caps = plat->pm_flags; |
@@ -352,7 +352,7 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev) | |||
352 | return 0; | 352 | return 0; |
353 | 353 | ||
354 | err_add_host: | 354 | err_add_host: |
355 | clk_disable(pltfm_host->clk); | 355 | clk_disable_unprepare(pltfm_host->clk); |
356 | clk_put(pltfm_host->clk); | 356 | clk_put(pltfm_host->clk); |
357 | err_clk_get: | 357 | err_clk_get: |
358 | if (gpio_is_valid(plat->wp_gpio)) | 358 | if (gpio_is_valid(plat->wp_gpio)) |
@@ -393,7 +393,7 @@ static int __devexit sdhci_tegra_remove(struct platform_device *pdev) | |||
393 | if (gpio_is_valid(plat->power_gpio)) | 393 | if (gpio_is_valid(plat->power_gpio)) |
394 | gpio_free(plat->power_gpio); | 394 | gpio_free(plat->power_gpio); |
395 | 395 | ||
396 | clk_disable(pltfm_host->clk); | 396 | clk_disable_unprepare(pltfm_host->clk); |
397 | clk_put(pltfm_host->clk); | 397 | clk_put(pltfm_host->clk); |
398 | 398 | ||
399 | sdhci_pltfm_free(pdev); | 399 | sdhci_pltfm_free(pdev); |
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index ae6d78a3e912..7f99ff3553a6 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c | |||
@@ -261,7 +261,7 @@ static void spi_tegra_start_transfer(struct spi_device *spi, | |||
261 | clk_set_rate(tspi->clk, speed); | 261 | clk_set_rate(tspi->clk, speed); |
262 | 262 | ||
263 | if (tspi->cur_speed == 0) | 263 | if (tspi->cur_speed == 0) |
264 | clk_enable(tspi->clk); | 264 | clk_prepare_enable(tspi->clk); |
265 | 265 | ||
266 | tspi->cur_speed = speed; | 266 | tspi->cur_speed = speed; |
267 | 267 | ||
@@ -373,7 +373,7 @@ static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req) | |||
373 | spi = m->state; | 373 | spi = m->state; |
374 | spi_tegra_start_message(spi, m); | 374 | spi_tegra_start_message(spi, m); |
375 | } else { | 375 | } else { |
376 | clk_disable(tspi->clk); | 376 | clk_disable_unprepare(tspi->clk); |
377 | tspi->cur_speed = 0; | 377 | tspi->cur_speed = 0; |
378 | } | 378 | } |
379 | } | 379 | } |
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 3c60088871e0..9356886f489b 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c | |||
@@ -675,7 +675,7 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec) | |||
675 | { | 675 | { |
676 | u32 val; | 676 | u32 val; |
677 | 677 | ||
678 | clk_enable(nvec->i2c_clk); | 678 | clk_prepare_enable(nvec->i2c_clk); |
679 | 679 | ||
680 | tegra_periph_reset_assert(nvec->i2c_clk); | 680 | tegra_periph_reset_assert(nvec->i2c_clk); |
681 | udelay(2); | 681 | udelay(2); |
@@ -695,14 +695,14 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec) | |||
695 | 695 | ||
696 | enable_irq(nvec->irq); | 696 | enable_irq(nvec->irq); |
697 | 697 | ||
698 | clk_disable(nvec->i2c_clk); | 698 | clk_disable_unprepare(nvec->i2c_clk); |
699 | } | 699 | } |
700 | 700 | ||
701 | static void nvec_disable_i2c_slave(struct nvec_chip *nvec) | 701 | static void nvec_disable_i2c_slave(struct nvec_chip *nvec) |
702 | { | 702 | { |
703 | disable_irq(nvec->irq); | 703 | disable_irq(nvec->irq); |
704 | writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG); | 704 | writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG); |
705 | clk_disable(nvec->i2c_clk); | 705 | clk_disable_unprepare(nvec->i2c_clk); |
706 | } | 706 | } |
707 | 707 | ||
708 | static void nvec_power_off(void) | 708 | static void nvec_power_off(void) |
@@ -812,7 +812,7 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev) | |||
812 | 812 | ||
813 | tegra_init_i2c_slave(nvec); | 813 | tegra_init_i2c_slave(nvec); |
814 | 814 | ||
815 | clk_enable(i2c_clk); | 815 | clk_prepare_enable(i2c_clk); |
816 | 816 | ||
817 | 817 | ||
818 | /* enable event reporting */ | 818 | /* enable event reporting */ |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 68548236ec42..ab8a3bf628e3 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -46,8 +46,8 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd) | |||
46 | { | 46 | { |
47 | struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); | 47 | struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); |
48 | 48 | ||
49 | clk_enable(tegra->emc_clk); | 49 | clk_prepare_enable(tegra->emc_clk); |
50 | clk_enable(tegra->clk); | 50 | clk_prepare_enable(tegra->clk); |
51 | tegra_usb_phy_power_on(tegra->phy); | 51 | tegra_usb_phy_power_on(tegra->phy); |
52 | tegra->host_resumed = 1; | 52 | tegra->host_resumed = 1; |
53 | } | 53 | } |
@@ -58,8 +58,8 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd) | |||
58 | 58 | ||
59 | tegra->host_resumed = 0; | 59 | tegra->host_resumed = 0; |
60 | tegra_usb_phy_power_off(tegra->phy); | 60 | tegra_usb_phy_power_off(tegra->phy); |
61 | clk_disable(tegra->clk); | 61 | clk_disable_unprepare(tegra->clk); |
62 | clk_disable(tegra->emc_clk); | 62 | clk_disable_unprepare(tegra->emc_clk); |
63 | } | 63 | } |
64 | 64 | ||
65 | static int tegra_ehci_internal_port_reset( | 65 | static int tegra_ehci_internal_port_reset( |
@@ -671,7 +671,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
671 | goto fail_clk; | 671 | goto fail_clk; |
672 | } | 672 | } |
673 | 673 | ||
674 | err = clk_enable(tegra->clk); | 674 | err = clk_prepare_enable(tegra->clk); |
675 | if (err) | 675 | if (err) |
676 | goto fail_clken; | 676 | goto fail_clken; |
677 | 677 | ||
@@ -682,7 +682,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
682 | goto fail_emc_clk; | 682 | goto fail_emc_clk; |
683 | } | 683 | } |
684 | 684 | ||
685 | clk_enable(tegra->emc_clk); | 685 | clk_prepare_enable(tegra->emc_clk); |
686 | clk_set_rate(tegra->emc_clk, 400000000); | 686 | clk_set_rate(tegra->emc_clk, 400000000); |
687 | 687 | ||
688 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 688 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -782,10 +782,10 @@ fail: | |||
782 | fail_phy: | 782 | fail_phy: |
783 | iounmap(hcd->regs); | 783 | iounmap(hcd->regs); |
784 | fail_io: | 784 | fail_io: |
785 | clk_disable(tegra->emc_clk); | 785 | clk_disable_unprepare(tegra->emc_clk); |
786 | clk_put(tegra->emc_clk); | 786 | clk_put(tegra->emc_clk); |
787 | fail_emc_clk: | 787 | fail_emc_clk: |
788 | clk_disable(tegra->clk); | 788 | clk_disable_unprepare(tegra->clk); |
789 | fail_clken: | 789 | fail_clken: |
790 | clk_put(tegra->clk); | 790 | clk_put(tegra->clk); |
791 | fail_clk: | 791 | fail_clk: |
@@ -820,10 +820,10 @@ static int tegra_ehci_remove(struct platform_device *pdev) | |||
820 | tegra_usb_phy_close(tegra->phy); | 820 | tegra_usb_phy_close(tegra->phy); |
821 | iounmap(hcd->regs); | 821 | iounmap(hcd->regs); |
822 | 822 | ||
823 | clk_disable(tegra->clk); | 823 | clk_disable_unprepare(tegra->clk); |
824 | clk_put(tegra->clk); | 824 | clk_put(tegra->clk); |
825 | 825 | ||
826 | clk_disable(tegra->emc_clk); | 826 | clk_disable_unprepare(tegra->emc_clk); |
827 | clk_put(tegra->emc_clk); | 827 | clk_put(tegra->emc_clk); |
828 | 828 | ||
829 | kfree(tegra); | 829 | kfree(tegra); |