blob: f3ede5284ce34cf83ea99383f8e6ad363da75186 [file] [log] [blame]
Magnus Dammc793c1b2010-02-05 11:14:49 +00001/*
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 Damme47bb512010-05-12 14:21:24 +000024#include <linux/sh_clk.h>
Magnus Dammc793c1b2010-02-05 11:14:49 +000025#include <asm/clkdev.h>
26
Magnus Dammc793c1b2010-02-05 11:14:49 +000027/* a static peripheral clock for now - enough to get sh-sci working */
28static 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 */
34static struct clk r_clk = {
35 .name = "r_clk",
36 .rate = 32768,
37};
38
Magnus Damm3a7b8022010-02-10 20:13:31 +090039/* a static usb0 for now - enough to get r8a66597 working */
40static struct clk usb0_clk = {
41 .name = "usb0",
42};
43
Magnus Damm03fb2562010-02-16 10:48:15 +000044/* a static keysc0 clk for now - enough to get sh_keysc working */
45static struct clk keysc0_clk = {
46 .name = "keysc0",
47};
48
Magnus Dammc793c1b2010-02-05 11:14:49 +000049static struct clk_lookup lookups[] = {
50 {
51 .clk = &peripheral_clk,
52 }, {
53 .clk = &r_clk,
Magnus Damm3a7b8022010-02-10 20:13:31 +090054 }, {
55 .clk = &usb0_clk,
Magnus Damm03fb2562010-02-16 10:48:15 +000056 }, {
57 .clk = &keysc0_clk,
Magnus Dammc793c1b2010-02-05 11:14:49 +000058 }
59};
60
61void __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}