linux-mips
[Top] [All Lists]

Re: [PATCH 2/4] rbtx4938: Convert SPI codes to use generic SPI drivers

To: ralf@linux-mips.org
Subject: Re: [PATCH 2/4] rbtx4938: Convert SPI codes to use generic SPI drivers
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 27 Jun 2007 22:32:11 +0900 (JST)
Cc: linux-mips@linux-mips.org, sshtylyov@ru.mvista.com, mlachwani@mvista.com, vagabon.xyz@gmail.com
In-reply-to: <20070624205444.GC5814@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070622.232206.88704003.anemo@mba.ocn.ne.jp> <20070624205444.GC5814@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Sun, 24 Jun 2007 22:54:44 +0200, Ralf Baechle <ralf@linux-mips.org> wrote:
> > Use rtc-rs5c348 and at25 spi protocol driver and spi_txx9 spi
> > controller driver instead of platform dependent codes.
> > 
> > This patch also removes dependencies to old RTC interfaces such as
> > rtc_mips_get_time, etc.
> 
> Queued also,

Please queue this (or fold this into the patch) too.


Subject: [PATCH] rbtx4938: Provide minimum CLK API implementation

Do not abuse resource framework to pass "baseclk" to txx9spi driver.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 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);

<Prev in Thread] Current Thread [Next in Thread>