clock-sh7367.c 1.76 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Preliminary clock framework support for sh7367
 *
 * Copyright (C) 2010  Magnus Damm
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/clk.h>
24
#include <linux/sh_clk.h>
25 26 27 28 29 30 31 32 33 34 35 36 37 38
#include <asm/clkdev.h>

/* a static peripheral clock for now - enough to get sh-sci working */
static struct clk peripheral_clk = {
	.name	    = "peripheral_clk",
	.rate	    = 48000000,
};

/* a static rclk for now - enough to get sh_cmt working */
static struct clk r_clk = {
	.name	    = "r_clk",
	.rate	    = 32768,
};

39 40 41 42 43
/* a static usb0 for now - enough to get r8a66597 working */
static struct clk usb0_clk = {
	.name	    = "usb0",
};

44 45 46 47 48
/* a static keysc0 clk for now - enough to get sh_keysc working */
static struct clk keysc0_clk = {
	.name	    = "keysc0",
};

49 50 51 52 53
static struct clk_lookup lookups[] = {
	{
		.clk = &peripheral_clk,
	}, {
		.clk = &r_clk,
54 55
	}, {
		.clk = &usb0_clk,
56 57
	}, {
		.clk = &keysc0_clk,
58 59 60 61 62 63 64 65 66 67 68 69
	}
};

void __init sh7367_clock_init(void)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(lookups); i++) {
		lookups[i].con_id = lookups[i].clk->name;
		clkdev_add(&lookups[i]);
	}
}