aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-01-11 07:52:34 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-06-10 12:41:40 -0400
commit4a31bd28e86ac50eb620f6b5b36464c45b5fa38f (patch)
treedffb284d13110554c77403b306979a50187c9905 /arch/arm/mach-nomadik
parentb5111d9ed4cba9a29ee454db162c4a88c6b944bf (diff)
ARM: nomadik: convert to generic clock
Remove more custom stuff by simply converting the Nomadik machine to use generic clocks and move the driver to drivers/clk. Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Mike Turquette <mturquette@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-nomadik')
-rw-r--r--arch/arm/mach-nomadik/Makefile2
-rw-r--r--arch/arm/mach-nomadik/clock.c75
-rw-r--r--arch/arm/mach-nomadik/clock.h15
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c4
4 files changed, 2 insertions, 94 deletions
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
index a6bbd1a7b4e..a42c9a33d3b 100644
--- a/arch/arm/mach-nomadik/Makefile
+++ b/arch/arm/mach-nomadik/Makefile
@@ -7,8 +7,6 @@
7 7
8# Object file lists. 8# Object file lists.
9 9
10obj-y += clock.o
11
12# Cpu revision 10# Cpu revision
13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o 11obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
14 12
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c
deleted file mode 100644
index 48a59f24e10..00000000000
--- a/arch/arm/mach-nomadik/clock.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * linux/arch/arm/mach-nomadik/clock.c
3 *
4 * Copyright (C) 2009 Alessandro Rubini
5 */
6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/errno.h>
9#include <linux/clk.h>
10#include <linux/clkdev.h>
11#include "clock.h"
12
13/*
14 * The nomadik board uses generic clocks, but the serial pl011 file
15 * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them
16 */
17unsigned long clk_get_rate(struct clk *clk)
18{
19 return clk->rate;
20}
21EXPORT_SYMBOL(clk_get_rate);
22
23/* enable and disable do nothing */
24int clk_enable(struct clk *clk)
25{
26 return 0;
27}
28EXPORT_SYMBOL(clk_enable);
29
30void clk_disable(struct clk *clk)
31{
32}
33EXPORT_SYMBOL(clk_disable);
34
35static struct clk clk_24 = {
36 .rate = 2400000,
37};
38
39static struct clk clk_48 = {
40 .rate = 48 * 1000 * 1000,
41};
42
43/*
44 * Catch-all default clock to satisfy drivers using the clk API. We don't
45 * model the actual hardware clocks yet.
46 */
47static struct clk clk_default;
48
49#define CLK(_clk, dev) \
50 { \
51 .clk = _clk, \
52 .dev_id = dev, \
53 }
54
55static struct clk_lookup lookups[] = {
56 {
57 .con_id = "apb_pclk",
58 .clk = &clk_default,
59 },
60 CLK(&clk_24, "mtu0"),
61 CLK(&clk_24, "mtu1"),
62 CLK(&clk_48, "uart0"),
63 CLK(&clk_48, "uart1"),
64 CLK(&clk_default, "gpio.0"),
65 CLK(&clk_default, "gpio.1"),
66 CLK(&clk_default, "gpio.2"),
67 CLK(&clk_default, "gpio.3"),
68 CLK(&clk_default, "rng"),
69};
70
71int __init clk_init(void)
72{
73 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
74 return 0;
75}
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h
deleted file mode 100644
index 78da2e7c398..00000000000
--- a/arch/arm/mach-nomadik/clock.h
+++ /dev/null
@@ -1,15 +0,0 @@
1
2/*
3 * linux/arch/arm/mach-nomadik/clock.h
4 *
5 * Copyright (C) 2009 Alessandro Rubini
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct clk {
12 unsigned long rate;
13};
14
15int __init clk_init(void);
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 88511fef798..6fd8e46567a 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -25,6 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/platform_data/clk-nomadik.h>
28 29
29#include <plat/gpio-nomadik.h> 30#include <plat/gpio-nomadik.h>
30#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -35,7 +36,6 @@
35#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
36#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
37 38
38#include "clock.h"
39#include "cpu-8815.h" 39#include "cpu-8815.h"
40 40
41/* The 8815 has 4 GPIO blocks, let's register them immediately */ 41/* The 8815 has 4 GPIO blocks, let's register them immediately */
@@ -123,7 +123,7 @@ void __init cpu8815_init_irq(void)
123 * Init clocks here so that they are available for system timer 123 * Init clocks here so that they are available for system timer
124 * initialization. 124 * initialization.
125 */ 125 */
126 clk_init(); 126 nomadik_clk_init();
127} 127}
128 128
129/* 129/*