diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2014-12-03 12:37:10 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-12-05 11:30:26 -0500 |
commit | 0821c3bc5df805aef1f5989b7a7dacc2491a0e5b (patch) | |
tree | 492358fbec814691376470d201ce75c0de5b54fa | |
parent | 23834a4116cd468d62e1092234e46ec1919a9e86 (diff) |
ARM: 8245/1: pcmcia: soc-common: enable/disable socket clocks
Call clk_prepare_enable() during hw_init() and clk_disable_unprepare()
during hw_shutdown() to ensure that the clock rates returned by
clk_get_rate() are correct.
It is safe to call enable/disable functions even on NULL clock, so this
patch will not break cases when the socket clock is not set.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/pcmcia/soc_common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index a2bc6ee1702e..933f4657515b 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -120,6 +120,8 @@ static void __soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt, | |||
120 | 120 | ||
121 | if (skt->ops->hw_shutdown) | 121 | if (skt->ops->hw_shutdown) |
122 | skt->ops->hw_shutdown(skt); | 122 | skt->ops->hw_shutdown(skt); |
123 | |||
124 | clk_disable_unprepare(skt->clk); | ||
123 | } | 125 | } |
124 | 126 | ||
125 | static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | 127 | static void soc_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) |
@@ -131,6 +133,8 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | |||
131 | { | 133 | { |
132 | int ret = 0, i; | 134 | int ret = 0, i; |
133 | 135 | ||
136 | clk_prepare_enable(skt->clk); | ||
137 | |||
134 | if (skt->ops->hw_init) { | 138 | if (skt->ops->hw_init) { |
135 | ret = skt->ops->hw_init(skt); | 139 | ret = skt->ops->hw_init(skt); |
136 | if (ret) | 140 | if (ret) |