linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 4/6] pcmcia: soc-common: enable/disable socket clocks
Date: Mon, 24 Nov 2014 23:05:34 +0000	[thread overview]
Message-ID: <1416870336-30114-5-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1416870336-30114-1-git-send-email-dbaryshkov@gmail.com>

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>
---
 drivers/pcmcia/soc_common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index a2bc6ee..933f465 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,
 
 	if (skt->ops->hw_shutdown)
 		skt->ops->hw_shutdown(skt);
+
+	clk_disable_unprepare(skt->clk);
 }
 
 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)
 {
 	int ret = 0, i;
 
+	clk_prepare_enable(skt->clk);
+
 	if (skt->ops->hw_init) {
 		ret = skt->ops->hw_init(skt);
 		if (ret)
-- 
2.1.3


  parent reply	other threads:[~2014-11-24 23:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 23:05 [PATCH V2 0/6] ARM: sa1100: use clock api to get cpu freq in fb and pcmcia drivers Dmitry Eremin-Solenikov
2014-11-24 23:05 ` [PATCH V2 1/6] ARM: sa1100: add cpu clock Dmitry Eremin-Solenikov
2014-11-24 23:05 ` [PATCH V2 2/6] ARM: sa1100: add a clock alias for sa1111 pcmcia device Dmitry Eremin-Solenikov
2014-11-24 23:05 ` [PATCH V2 3/6] fbdev: sa1100fb: make use of device clock Dmitry Eremin-Solenikov
2014-11-24 23:05 ` Dmitry Eremin-Solenikov [this message]
2014-11-24 23:05 ` [PATCH V2 5/6] pcmcia: sa1111: provide " Dmitry Eremin-Solenikov
2014-11-24 23:05 ` [PATCH V2 6/6] pcmcia: sa1100: make use of " Dmitry Eremin-Solenikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416870336-30114-5-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).