From: Saeed Bishara <saeed@marvell.com>
To: linux-raid@vger.kernel.org, dan.j.williams@intel.com
Cc: buytenh@marvell.com, nico@marvell.com, saeed.bishara@gmail.com,
Saeed Bishara <saeed@marvell.com>
Subject: [PATCH] mv_xor: add support for clkdev framework
Date: Tue, 23 Jun 2009 12:56:43 +0300 [thread overview]
Message-ID: <1245751004-3056-1-git-send-email-saeed@marvell.com> (raw)
Signed-off-by: Saeed Bishara <saeed@marvell.com>
---
drivers/dma/mv_xor.c | 16 ++++++++++++++++
drivers/dma/mv_xor.h | 4 ++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index ddab94f..db77903 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1325,6 +1325,14 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, msp);
+#if defined(CONFIG_HAVE_CLK)
+ msp->clk = clk_get(&pdev->dev, NULL);
+ if (IS_ERR(msp->clk))
+ dev_notice(&pdev->dev, "cannot get clkdev\n");
+ else
+ clk_enable(msp->clk);
+#endif
+
/*
* (Re-)program MBUS remapping windows if we are asked to.
*/
@@ -1336,6 +1344,14 @@ static int mv_xor_shared_probe(struct platform_device *pdev)
static int mv_xor_shared_remove(struct platform_device *pdev)
{
+#if defined(CONFIG_HAVE_CLK)
+ struct mv_xor_shared_private *msp = platform_get_drvdata(pdev);
+
+ if (!IS_ERR(msp->clk)) {
+ clk_disable(msp->clk);
+ clk_put(msp->clk);
+ }
+#endif
return 0;
}
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h
index 06cafe1..08c3815 100644
--- a/drivers/dma/mv_xor.h
+++ b/drivers/dma/mv_xor.h
@@ -22,6 +22,7 @@
#include <linux/io.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
+#include <linux/clk.h>
#define USE_TIMER
#define MV_XOR_SLOT_SIZE 64
@@ -55,6 +56,9 @@
struct mv_xor_shared_private {
void __iomem *xor_base;
void __iomem *xor_high_base;
+#if defined(CONFIG_HAVE_CLK)
+ struct clk *clk;
+#endif
};
--
1.6.0.4
next reply other threads:[~2009-06-23 9:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-23 9:56 Saeed Bishara [this message]
2009-06-23 9:56 ` [PATCH] mv_xor: add support for power management Saeed Bishara
2009-06-23 16:20 ` [PATCH] mv_xor: add support for clkdev framework Dan Williams
2009-06-23 16:42 ` saeed bishara
2009-06-23 16:44 ` Nicolas Pitre
2009-06-23 17:00 ` Saeed Bishara
2009-06-23 17:11 ` Dan Williams
2009-06-23 17:22 ` Nicolas Pitre
2009-06-24 7:29 ` Saeed Bishara
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=1245751004-3056-1-git-send-email-saeed@marvell.com \
--to=saeed@marvell.com \
--cc=buytenh@marvell.com \
--cc=dan.j.williams@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=nico@marvell.com \
--cc=saeed.bishara@gmail.com \
/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).