diff options
Diffstat (limited to 'drivers/mmc/host/mvsdio.c')
-rw-r--r-- | drivers/mmc/host/mvsdio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index eeb8cd125b0c..3b9136c1a475 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/dma-mapping.h> | 19 | #include <linux/dma-mapping.h> |
20 | #include <linux/scatterlist.h> | 20 | #include <linux/scatterlist.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/clk.h> | ||
22 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
23 | #include <linux/mmc/host.h> | 24 | #include <linux/mmc/host.h> |
24 | 25 | ||
@@ -51,6 +52,7 @@ struct mvsd_host { | |||
51 | struct device *dev; | 52 | struct device *dev; |
52 | struct resource *res; | 53 | struct resource *res; |
53 | int irq; | 54 | int irq; |
55 | struct clk *clk; | ||
54 | int gpio_card_detect; | 56 | int gpio_card_detect; |
55 | int gpio_write_protect; | 57 | int gpio_write_protect; |
56 | }; | 58 | }; |
@@ -770,6 +772,13 @@ static int __init mvsd_probe(struct platform_device *pdev) | |||
770 | } else | 772 | } else |
771 | host->irq = irq; | 773 | host->irq = irq; |
772 | 774 | ||
775 | /* Not all platforms can gate the clock, so it is not | ||
776 | an error if the clock does not exists. */ | ||
777 | host->clk = clk_get(&pdev->dev, NULL); | ||
778 | if (!IS_ERR(host->clk)) { | ||
779 | clk_prepare_enable(host->clk); | ||
780 | } | ||
781 | |||
773 | if (mvsd_data->gpio_card_detect) { | 782 | if (mvsd_data->gpio_card_detect) { |
774 | ret = gpio_request(mvsd_data->gpio_card_detect, | 783 | ret = gpio_request(mvsd_data->gpio_card_detect, |
775 | DRIVER_NAME " cd"); | 784 | DRIVER_NAME " cd"); |
@@ -854,6 +863,11 @@ static int __exit mvsd_remove(struct platform_device *pdev) | |||
854 | mvsd_power_down(host); | 863 | mvsd_power_down(host); |
855 | iounmap(host->base); | 864 | iounmap(host->base); |
856 | release_resource(host->res); | 865 | release_resource(host->res); |
866 | |||
867 | if (!IS_ERR(host->clk)) { | ||
868 | clk_disable_unprepare(host->clk); | ||
869 | clk_put(host->clk); | ||
870 | } | ||
857 | mmc_free_host(mmc); | 871 | mmc_free_host(mmc); |
858 | } | 872 | } |
859 | platform_set_drvdata(pdev, NULL); | 873 | platform_set_drvdata(pdev, NULL); |