mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Weiner <jw@emlix.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Chris Zankel" <chris@zankel.net>,
	linux-kernel@vger.kernel.org, "Daniel Glöckner" <dg@emlix.com>
Subject: [patch 06/12] xtensa: implement CLK API
Date: Tue, 14 Apr 2009 11:41:14 +0200	[thread overview]
Message-ID: <1239702080-14355-7-git-send-email-jw@emlix.com> (raw)
In-Reply-To: <1239702080-14355-1-git-send-email-jw@emlix.com>

From: Daniel Glöckner <dg@emlix.com>

Implement access to the peripheral clock (half of cpu clock) by means
of the generic CLK API.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
---
 arch/xtensa/platforms/s6105/Makefile |    2 +-
 arch/xtensa/platforms/s6105/clocks.c |   49 ++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 1 deletions(-)
 create mode 100644 arch/xtensa/platforms/s6105/clocks.c

diff --git a/arch/xtensa/platforms/s6105/Makefile b/arch/xtensa/platforms/s6105/Makefile
index 0be6194..294427b 100644
--- a/arch/xtensa/platforms/s6105/Makefile
+++ b/arch/xtensa/platforms/s6105/Makefile
@@ -1,3 +1,3 @@
 # Makefile for the Stretch S6105 eval board
 
-obj-y		:= setup.o device.o
+obj-y		:= setup.o device.o clocks.o
diff --git a/arch/xtensa/platforms/s6105/clocks.c b/arch/xtensa/platforms/s6105/clocks.c
new file mode 100644
index 0000000..fcd3bad
--- /dev/null
+++ b/arch/xtensa/platforms/s6105/clocks.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009 emlix GmbH
+ * Author:	Daniel Gloeckner <dg@emlix.com>
+ */
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/string.h>
+#include <asm/param.h>
+#include <asm/timex.h>
+
+struct clk {
+	unsigned long rate;
+};
+
+static struct clk pclk;
+
+struct clk *clk_get(struct device *dev, const char *id)
+{
+	if (!strcmp(id, "PCLK")) {
+		pclk.rate = CCOUNT_PER_JIFFY * HZ / 2;
+		return &pclk;
+	}
+	return ERR_PTR(-ENODEV);
+}
+EXPORT_SYMBOL(clk_get);
+
+int clk_enable(struct clk *clk)
+{
+	return 0;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+	return clk->rate;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+void clk_put(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_put);
-- 
1.6.2.107.ge47ee


  parent reply	other threads:[~2009-04-14  9:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  9:41 Johannes Weiner
2009-04-14  9:41 ` [patch 01/12] xtensa: always use correct stack pointer for stack traces Johannes Weiner
2009-04-14  9:41 ` [patch 02/12] xtensa: register gpio chip before use Johannes Weiner
2009-04-14  9:41 ` [patch 03/12] xtensa: fix wrong extern declaration renamed in code using it Johannes Weiner
2009-04-14  9:41 ` [patch 04/12] xtensa: implement ccount calibration for s6000 Johannes Weiner
2009-04-14  9:41 ` [patch 05/12] xtensa: update s6105_defconfig for ccount calibration Johannes Weiner
2009-04-14  9:41 ` Johannes Weiner [this message]
2009-04-14  9:41 ` [patch 07/12] xtensa: implement PTRACE_PEEKUSER addresses for nommu Johannes Weiner
2009-04-14  9:41 ` [patch 08/12] xtensa: s6000 dma engine support Johannes Weiner
2009-04-14  9:41 ` [patch 09/12] xtensa: allow platform and variant to initialize own irq chips Johannes Weiner
2009-04-23  7:19   ` Chris Zankel
2009-04-23 16:16     ` Daniel Glöckner
2009-04-14  9:41 ` [patch 10/12] xtensa: support s6000 gpio irqs and alternate function selection Johannes Weiner
2009-04-14  9:41 ` [patch 11/12] xtensa: s6105 specific configuration for s6gmac Johannes Weiner
2009-04-14  9:41 ` [patch 12/12] xtensa: enable s6gmac in s6105_defconfig Johannes Weiner
2009-04-16  7:42 ` Xtensa patches Chris Zankel
2009-04-16  8:24   ` Andrew Morton
2009-04-16  8:30     ` Paul Mundt
2009-04-16  8:56       ` Andrew Morton
2009-04-16  9:06         ` Paul Mundt
2009-04-16  8:35     ` Stephen Rothwell
2009-04-16  9:15       ` Chris Zankel

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=1239702080-14355-7-git-send-email-jw@emlix.com \
    --to=jw@emlix.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@zankel.net \
    --cc=dg@emlix.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®