diff options
Diffstat (limited to 'drivers/mmc/host/sdhci-s3c.c')
| -rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 2903949594c6..a54dd5d7a5f9 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
| @@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) | |||
| 211 | if (ourhost->cur_clk != best_src) { | 211 | if (ourhost->cur_clk != best_src) { |
| 212 | struct clk *clk = ourhost->clk_bus[best_src]; | 212 | struct clk *clk = ourhost->clk_bus[best_src]; |
| 213 | 213 | ||
| 214 | clk_enable(clk); | 214 | clk_prepare_enable(clk); |
| 215 | clk_disable(ourhost->clk_bus[ourhost->cur_clk]); | 215 | clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]); |
| 216 | 216 | ||
| 217 | /* turn clock off to card before changing clock source */ | 217 | /* turn clock off to card before changing clock source */ |
| 218 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); | 218 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); |
| @@ -607,7 +607,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | /* enable the local io clock and keep it running for the moment. */ | 609 | /* enable the local io clock and keep it running for the moment. */ |
| 610 | clk_enable(sc->clk_io); | 610 | clk_prepare_enable(sc->clk_io); |
| 611 | 611 | ||
| 612 | for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { | 612 | for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { |
| 613 | struct clk *clk; | 613 | struct clk *clk; |
| @@ -638,7 +638,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | #ifndef CONFIG_PM_RUNTIME | 640 | #ifndef CONFIG_PM_RUNTIME |
| 641 | clk_enable(sc->clk_bus[sc->cur_clk]); | 641 | clk_prepare_enable(sc->clk_bus[sc->cur_clk]); |
| 642 | #endif | 642 | #endif |
| 643 | 643 | ||
| 644 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 644 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -747,13 +747,14 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
| 747 | sdhci_s3c_setup_card_detect_gpio(sc); | 747 | sdhci_s3c_setup_card_detect_gpio(sc); |
| 748 | 748 | ||
| 749 | #ifdef CONFIG_PM_RUNTIME | 749 | #ifdef CONFIG_PM_RUNTIME |
| 750 | clk_disable(sc->clk_io); | 750 | if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL) |
| 751 | clk_disable_unprepare(sc->clk_io); | ||
| 751 | #endif | 752 | #endif |
| 752 | return 0; | 753 | return 0; |
| 753 | 754 | ||
| 754 | err_req_regs: | 755 | err_req_regs: |
| 755 | #ifndef CONFIG_PM_RUNTIME | 756 | #ifndef CONFIG_PM_RUNTIME |
| 756 | clk_disable(sc->clk_bus[sc->cur_clk]); | 757 | clk_disable_unprepare(sc->clk_bus[sc->cur_clk]); |
| 757 | #endif | 758 | #endif |
| 758 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { | 759 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { |
| 759 | if (sc->clk_bus[ptr]) { | 760 | if (sc->clk_bus[ptr]) { |
| @@ -762,7 +763,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) | |||
| 762 | } | 763 | } |
| 763 | 764 | ||
| 764 | err_no_busclks: | 765 | err_no_busclks: |
| 765 | clk_disable(sc->clk_io); | 766 | clk_disable_unprepare(sc->clk_io); |
| 766 | clk_put(sc->clk_io); | 767 | clk_put(sc->clk_io); |
| 767 | 768 | ||
| 768 | err_io_clk: | 769 | err_io_clk: |
| @@ -794,7 +795,8 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) | |||
| 794 | gpio_free(sc->ext_cd_gpio); | 795 | gpio_free(sc->ext_cd_gpio); |
| 795 | 796 | ||
| 796 | #ifdef CONFIG_PM_RUNTIME | 797 | #ifdef CONFIG_PM_RUNTIME |
| 797 | clk_enable(sc->clk_io); | 798 | if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL) |
| 799 | clk_prepare_enable(sc->clk_io); | ||
| 798 | #endif | 800 | #endif |
| 799 | sdhci_remove_host(host, 1); | 801 | sdhci_remove_host(host, 1); |
| 800 | 802 | ||
| @@ -802,14 +804,14 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) | |||
| 802 | pm_runtime_disable(&pdev->dev); | 804 | pm_runtime_disable(&pdev->dev); |
| 803 | 805 | ||
| 804 | #ifndef CONFIG_PM_RUNTIME | 806 | #ifndef CONFIG_PM_RUNTIME |
| 805 | clk_disable(sc->clk_bus[sc->cur_clk]); | 807 | clk_disable_unprepare(sc->clk_bus[sc->cur_clk]); |
| 806 | #endif | 808 | #endif |
| 807 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { | 809 | for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { |
| 808 | if (sc->clk_bus[ptr]) { | 810 | if (sc->clk_bus[ptr]) { |
| 809 | clk_put(sc->clk_bus[ptr]); | 811 | clk_put(sc->clk_bus[ptr]); |
| 810 | } | 812 | } |
| 811 | } | 813 | } |
| 812 | clk_disable(sc->clk_io); | 814 | clk_disable_unprepare(sc->clk_io); |
| 813 | clk_put(sc->clk_io); | 815 | clk_put(sc->clk_io); |
| 814 | 816 | ||
| 815 | if (pdev->dev.of_node) { | 817 | if (pdev->dev.of_node) { |
| @@ -849,8 +851,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev) | |||
| 849 | 851 | ||
| 850 | ret = sdhci_runtime_suspend_host(host); | 852 | ret = sdhci_runtime_suspend_host(host); |
| 851 | 853 | ||
| 852 | clk_disable(ourhost->clk_bus[ourhost->cur_clk]); | 854 | clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]); |
| 853 | clk_disable(busclk); | 855 | clk_disable_unprepare(busclk); |
| 854 | return ret; | 856 | return ret; |
| 855 | } | 857 | } |
| 856 | 858 | ||
| @@ -861,8 +863,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev) | |||
| 861 | struct clk *busclk = ourhost->clk_io; | 863 | struct clk *busclk = ourhost->clk_io; |
| 862 | int ret; | 864 | int ret; |
| 863 | 865 | ||
| 864 | clk_enable(busclk); | 866 | clk_prepare_enable(busclk); |
| 865 | clk_enable(ourhost->clk_bus[ourhost->cur_clk]); | 867 | clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]); |
| 866 | ret = sdhci_runtime_resume_host(host); | 868 | ret = sdhci_runtime_resume_host(host); |
| 867 | return ret; | 869 | return ret; |
| 868 | } | 870 | } |
