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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 24 Jun 2007 22:54:44 +0200, Ralf Baechle <ralf@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
---
 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);


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux