diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-05-16 10:35:25 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-16 10:35:25 -0400 |
commit | 3c0dec5f58b3c7b3627715126d1bf9b030a076f0 (patch) | |
tree | 4bf8f56fca3bf6be109209b116fc8e32cb2e0f9e /drivers/mmc | |
parent | fcd8d84a585f3578a9ebdd27e757495a27415322 (diff) | |
parent | 7e0fa1b5fa91d9aa456d102c273b2cf0f2e95d39 (diff) |
Merge branch 'clk-next' of git://git.linaro.org/people/mturquette/linux into next/clock
* 'clk-next' of git://git.linaro.org/people/mturquette/linux:
clk: Fix CLK_SET_RATE_GATE flag validation in clk_set_rate().
clk: Provide dummy clk_unregister()
ARM: Kirkwood: Replace clock gating
ARM: Orion: Audio: Add clk/clkdev support
ARM: Orion: PCIE: Add support for clk
ARM: Orion: XOR: Add support for clk
ARM: Orion: CESA: Add support for clk
ARM: Orion: SDIO: Add support for clk.
ARM: Orion: NAND: Add support for clk, if there is one.
ARM: Orion: EHCI: Add support for enabling clocks
ARM: Orion: SATA: Add per channel clk/clkdev support.
ARM: Orion: UART: Get the clock rate via clk_get_rate().
ARM: Orion: WDT: Add clk/clkdev support
ARM: Orion: Eth: Add clk/clkdev support.
ARM: Orion: SPI: Add clk/clkdev support.
ARM: Orion: Add clocks using the generic clk infrastructure.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/mmc')
-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); |