@@ -637,7 +637,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
637
637
goto err_no_busclks ;
638
638
}
639
639
640
+ #ifndef CONFIG_PM_RUNTIME
640
641
clk_enable (sc -> clk_bus [sc -> cur_clk ]);
642
+ #endif
641
643
642
644
res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
643
645
host -> ioaddr = devm_request_and_ioremap (& pdev -> dev , res );
@@ -744,10 +746,15 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
744
746
gpio_is_valid (pdata -> ext_cd_gpio ))
745
747
sdhci_s3c_setup_card_detect_gpio (sc );
746
748
749
+ #ifdef CONFIG_PM_RUNTIME
750
+ clk_disable (sc -> clk_io );
751
+ #endif
747
752
return 0 ;
748
753
749
754
err_req_regs :
755
+ #ifndef CONFIG_PM_RUNTIME
750
756
clk_disable (sc -> clk_bus [sc -> cur_clk ]);
757
+ #endif
751
758
for (ptr = 0 ; ptr < MAX_BUS_CLK ; ptr ++ ) {
752
759
if (sc -> clk_bus [ptr ]) {
753
760
clk_put (sc -> clk_bus [ptr ]);
@@ -786,12 +793,17 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
786
793
if (gpio_is_valid (sc -> ext_cd_gpio ))
787
794
gpio_free (sc -> ext_cd_gpio );
788
795
796
+ #ifdef CONFIG_PM_RUNTIME
797
+ clk_enable (sc -> clk_io );
798
+ #endif
789
799
sdhci_remove_host (host , 1 );
790
800
791
801
pm_runtime_dont_use_autosuspend (& pdev -> dev );
792
802
pm_runtime_disable (& pdev -> dev );
793
803
804
+ #ifndef CONFIG_PM_RUNTIME
794
805
clk_disable (sc -> clk_bus [sc -> cur_clk ]);
806
+ #endif
795
807
for (ptr = 0 ; ptr < MAX_BUS_CLK ; ptr ++ ) {
796
808
if (sc -> clk_bus [ptr ]) {
797
809
clk_put (sc -> clk_bus [ptr ]);
@@ -831,15 +843,28 @@ static int sdhci_s3c_resume(struct device *dev)
831
843
static int sdhci_s3c_runtime_suspend (struct device * dev )
832
844
{
833
845
struct sdhci_host * host = dev_get_drvdata (dev );
846
+ struct sdhci_s3c * ourhost = to_s3c (host );
847
+ struct clk * busclk = ourhost -> clk_io ;
848
+ int ret ;
849
+
850
+ ret = sdhci_runtime_suspend_host (host );
834
851
835
- return sdhci_runtime_suspend_host (host );
852
+ clk_disable (ourhost -> clk_bus [ourhost -> cur_clk ]);
853
+ clk_disable (busclk );
854
+ return ret ;
836
855
}
837
856
838
857
static int sdhci_s3c_runtime_resume (struct device * dev )
839
858
{
840
859
struct sdhci_host * host = dev_get_drvdata (dev );
860
+ struct sdhci_s3c * ourhost = to_s3c (host );
861
+ struct clk * busclk = ourhost -> clk_io ;
862
+ int ret ;
841
863
842
- return sdhci_runtime_resume_host (host );
864
+ clk_enable (busclk );
865
+ clk_enable (ourhost -> clk_bus [ourhost -> cur_clk ]);
866
+ ret = sdhci_runtime_resume_host (host );
867
+ return ret ;
843
868
}
844
869
#endif
845
870
0 commit comments