Magnus Damm | c793c1b | 2010-02-05 11:14:49 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Preliminary clock framework support for sh7367 |
| 3 | * |
| 4 | * Copyright (C) 2010 Magnus Damm |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | #include <linux/init.h> |
| 20 | #include <linux/module.h> |
| 21 | #include <linux/kernel.h> |
| 22 | #include <linux/list.h> |
| 23 | #include <linux/clk.h> |
Magnus Damm | e47bb51 | 2010-05-12 14:21:24 +0000 | [diff] [blame^] | 24 | #include <linux/sh_clk.h> |
Magnus Damm | c793c1b | 2010-02-05 11:14:49 +0000 | [diff] [blame] | 25 | #include <asm/clkdev.h> |
| 26 | |
Magnus Damm | c793c1b | 2010-02-05 11:14:49 +0000 | [diff] [blame] | 27 | /* a static peripheral clock for now - enough to get sh-sci working */ |
| 28 | static struct clk peripheral_clk = { |
| 29 | .name = "peripheral_clk", |
| 30 | .rate = 48000000, |
| 31 | }; |
| 32 | |
| 33 | /* a static rclk for now - enough to get sh_cmt working */ |
| 34 | static struct clk r_clk = { |
| 35 | .name = "r_clk", |
| 36 | .rate = 32768, |
| 37 | }; |
| 38 | |
Magnus Damm | 3a7b802 | 2010-02-10 20:13:31 +0900 | [diff] [blame] | 39 | /* a static usb0 for now - enough to get r8a66597 working */ |
| 40 | static struct clk usb0_clk = { |
| 41 | .name = "usb0", |
| 42 | }; |
| 43 | |
Magnus Damm | 03fb256 | 2010-02-16 10:48:15 +0000 | [diff] [blame] | 44 | /* a static keysc0 clk for now - enough to get sh_keysc working */ |
| 45 | static struct clk keysc0_clk = { |
| 46 | .name = "keysc0", |
| 47 | }; |
| 48 | |
Magnus Damm | c793c1b | 2010-02-05 11:14:49 +0000 | [diff] [blame] | 49 | static struct clk_lookup lookups[] = { |
| 50 | { |
| 51 | .clk = &peripheral_clk, |
| 52 | }, { |
| 53 | .clk = &r_clk, |
Magnus Damm | 3a7b802 | 2010-02-10 20:13:31 +0900 | [diff] [blame] | 54 | }, { |
| 55 | .clk = &usb0_clk, |
Magnus Damm | 03fb256 | 2010-02-16 10:48:15 +0000 | [diff] [blame] | 56 | }, { |
| 57 | .clk = &keysc0_clk, |
Magnus Damm | c793c1b | 2010-02-05 11:14:49 +0000 | [diff] [blame] | 58 | } |
| 59 | }; |
| 60 | |
| 61 | void __init sh7367_clock_init(void) |
| 62 | { |
| 63 | int i; |
| 64 | |
| 65 | for (i = 0; i < ARRAY_SIZE(lookups); i++) { |
| 66 | lookups[i].con_id = lookups[i].clk->name; |
| 67 | clkdev_add(&lookups[i]); |
| 68 | } |
| 69 | } |