Add generic sys_old_mmap()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-ux500 / clock.c
blob8359a73d0041c0b988cd4ecea50a77ac92f71093
1 /*
2 * Copyright (C) 2009 ST-Ericsson
3 * heavily based on realview platform
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9 #include <linux/module.h>
10 #include <linux/kernel.h>
11 #include <linux/list.h>
12 #include <linux/errno.h>
13 #include <linux/err.h>
14 #include <linux/clk.h>
15 #include <linux/mutex.h>
17 #include <asm/clkdev.h>
19 /* currently the clk structure
20 * just supports rate. This would
21 * be extended as and when new devices are
22 * added - TODO
24 struct clk {
25 unsigned long rate;
28 int clk_enable(struct clk *clk)
30 return 0;
32 EXPORT_SYMBOL(clk_enable);
34 void clk_disable(struct clk *clk)
37 EXPORT_SYMBOL(clk_disable);
39 unsigned long clk_get_rate(struct clk *clk)
41 return clk->rate;
43 EXPORT_SYMBOL(clk_get_rate);
45 long clk_round_rate(struct clk *clk, unsigned long rate)
47 /*TODO*/
48 return rate;
50 EXPORT_SYMBOL(clk_round_rate);
52 int clk_set_rate(struct clk *clk, unsigned long rate)
54 clk->rate = rate;
55 return 0;
57 EXPORT_SYMBOL(clk_set_rate);
59 /* ssp clock */
60 static struct clk ssp_clk = {
61 .rate = 48000000,
64 /* fixed clock */
65 static struct clk f38_clk = {
66 .rate = 38400000,
69 static struct clk_lookup lookups[] = {
71 /* UART0 */
72 .dev_id = "uart0",
73 .clk = &f38_clk,
74 }, { /* UART1 */
75 .dev_id = "uart1",
76 .clk = &f38_clk,
77 }, { /* UART2 */
78 .dev_id = "uart2",
79 .clk = &f38_clk,
80 }, { /* SSP */
81 .dev_id = "pl022",
82 .clk = &ssp_clk,
86 static int __init clk_init(void)
88 /* register the clock lookups */
89 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
90 return 0;
92 arch_initcall(clk_init);