Commit 4410c423 authored by Arnd Bergmann's avatar Arnd Bergmann

mips: ar7: convert to clkdev_lookup

ar7 is one of only two platforms that provide the clock interface but
implement a custom version of the clkdev_lookup code.

Change this to use the generic version instead.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 6efb943b
...@@ -215,6 +215,7 @@ config AR7 ...@@ -215,6 +215,7 @@ config AR7
select SYS_SUPPORTS_ZBOOT_UART16550 select SYS_SUPPORTS_ZBOOT_UART16550
select GPIOLIB select GPIOLIB
select VLYNQ select VLYNQ
select CLKDEV_LOOKUP
select HAVE_LEGACY_CLK select HAVE_LEGACY_CLK
help help
Support for the Texas Instruments AR7 System-on-a-Chip Support for the Texas Instruments AR7 System-on-a-Chip
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/gcd.h> #include <linux/gcd.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clkdev.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
...@@ -424,27 +425,15 @@ unsigned long clk_get_rate(struct clk *clk) ...@@ -424,27 +425,15 @@ unsigned long clk_get_rate(struct clk *clk)
} }
EXPORT_SYMBOL(clk_get_rate); EXPORT_SYMBOL(clk_get_rate);
struct clk *clk_get(struct device *dev, const char *id) static struct clk_lookup ar7_clkdev_table[] = {
{ CLKDEV_INIT(NULL, "bus", &bus_clk),
if (!strcmp(id, "bus"))
return &bus_clk;
/* cpmac and vbus share the same rate */ /* cpmac and vbus share the same rate */
if (!strcmp(id, "cpmac")) CLKDEV_INIT("cpmac.0", "cpmac", &vbus_clk),
return &vbus_clk; CLKDEV_INIT("cpmac.1", "cpmac", &vbus_clk),
if (!strcmp(id, "cpu")) CLKDEV_INIT(NULL, "cpu", &cpu_clk),
return &cpu_clk; CLKDEV_INIT(NULL, "dsp", &dsp_clk),
if (!strcmp(id, "dsp")) CLKDEV_INIT(NULL, "vbus", &vbus_clk),
return &dsp_clk; };
if (!strcmp(id, "vbus"))
return &vbus_clk;
return ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL(clk_get);
void clk_put(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_put);
void __init ar7_init_clocks(void) void __init ar7_init_clocks(void)
{ {
...@@ -462,6 +451,8 @@ void __init ar7_init_clocks(void) ...@@ -462,6 +451,8 @@ void __init ar7_init_clocks(void)
} }
/* adjust vbus clock rate */ /* adjust vbus clock rate */
vbus_clk.rate = bus_clk.rate / 2; vbus_clk.rate = bus_clk.rate / 2;
clkdev_add_table(ar7_clkdev_table, ARRAY_SIZE(ar7_clkdev_table));
} }
/* dummy functions, should not be called */ /* dummy functions, should not be called */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment