Rob Herring | 220e6cf | 2011-06-07 10:02:55 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Calxeda, Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify it |
| 5 | * under the terms and conditions of the GNU General Public License, |
| 6 | * version 2, as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 11 | * more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along with |
| 14 | * this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | #include <linux/module.h> |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/errno.h> |
| 19 | #include <linux/clk.h> |
| 20 | #include <linux/clkdev.h> |
| 21 | |
| 22 | struct clk { |
| 23 | unsigned long rate; |
| 24 | }; |
| 25 | |
| 26 | int clk_enable(struct clk *clk) |
| 27 | { |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | void clk_disable(struct clk *clk) |
| 32 | {} |
| 33 | |
| 34 | unsigned long clk_get_rate(struct clk *clk) |
| 35 | { |
| 36 | return clk->rate; |
| 37 | } |
| 38 | |
| 39 | long clk_round_rate(struct clk *clk, unsigned long rate) |
| 40 | { |
| 41 | return clk->rate; |
| 42 | } |
| 43 | |
| 44 | int clk_set_rate(struct clk *clk, unsigned long rate) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | static struct clk eclk = { .rate = 200000000 }; |
| 50 | static struct clk pclk = { .rate = 150000000 }; |
| 51 | |
| 52 | static struct clk_lookup lookups[] = { |
| 53 | { .clk = &pclk, .con_id = "apb_pclk", }, |
| 54 | { .clk = &pclk, .dev_id = "sp804", }, |
| 55 | { .clk = &eclk, .dev_id = "ffe0e000.sdhci", }, |
| 56 | { .clk = &pclk, .dev_id = "fff36000.serial", }, |
| 57 | }; |
| 58 | |
| 59 | void __init highbank_clocks_init(void) |
| 60 | { |
| 61 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
| 62 | } |