* [PATCH] rbtx4938: Provide minimum CLK API implementation
@ 2007-07-07 14:57 Atsushi Nemoto
2007-07-09 14:11 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2007-07-07 14:57 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Implement a minimum CLK API to pass a base clock to spi_txx9 driver.
This patch also remove old hack (abusing resource framework) which was
only for preliminary version of the spi_txx9 driver.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
This patch can be folded into a patch in linux-queue tree titled:
"[MIPS] rbtx4938: Convert SPI codes to use generic SPI drivers"
arch/mips/tx4938/toshiba_rbtx4938/setup.c | 37 +++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 330ee43..361d89a 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -20,6 +20,7 @@
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
+#include <linux/clk.h>
#include <asm/wbflush.h>
#include <asm/reboot.h>
@@ -1121,10 +1122,6 @@ static void __init txx9_spi_init(unsigned long base, int irq)
}, {
.start = irq,
.flags = IORESOURCE_IRQ,
- }, {
- .name = "baseclk",
- .start = txx9_gbus_clock / 2 / 4,
- .flags = IORESOURCE_IRQ,
},
};
platform_device_register_simple("txx9spi", 0,
@@ -1149,3 +1146,35 @@ static int __init rbtx4938_spi_init(void)
return 0;
}
arch_initcall(rbtx4938_spi_init);
+
+/* Minimum CLK support */
+
+struct clk *clk_get(struct device *dev, const char *id)
+{
+ if (!strcmp(id, "spi-baseclk"))
+ return (struct clk *)(txx9_gbus_clock / 2 / 4);
+ return ERR_PTR(-ENOENT);
+}
+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 (unsigned long)clk;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+void clk_put(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_put);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] rbtx4938: Provide minimum CLK API implementation
2007-07-07 14:57 [PATCH] rbtx4938: Provide minimum CLK API implementation Atsushi Nemoto
@ 2007-07-09 14:11 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-07-09 14:11 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
On Sat, Jul 07, 2007 at 11:57:20PM +0900, Atsushi Nemoto wrote:
>
> Implement a minimum CLK API to pass a base clock to spi_txx9 driver.
> This patch also remove old hack (abusing resource framework) which was
> only for preliminary version of the spi_txx9 driver.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> This patch can be folded into a patch in linux-queue tree titled:
> "[MIPS] rbtx4938: Convert SPI codes to use generic SPI drivers"
Commited separately for lmo, folded into the other patch for Linus.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-09 14:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-07 14:57 [PATCH] rbtx4938: Provide minimum CLK API implementation Atsushi Nemoto
2007-07-09 14:11 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox