Commit 82e9bd58 authored by Paul Walmsley's avatar Paul Walmsley Committed by paul

OMAP3 clock: convert clock34xx.h to clock34xx_data.c

The OMAP3 clock code currently #includes a large .h file full of static
data structures.  Instead, define the data in a .c file.

Russell King <linux@arm.linux.org.uk> proposed this new arrangement:

    http://marc.info/?l=linux-omap&m=125967425908895&w=2Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Cc: Russell King <linux@arm.linux.org.uk>
parent 75d43340
...@@ -42,7 +42,7 @@ obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o ...@@ -42,7 +42,7 @@ obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o
# Clock framework # Clock framework
obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o
obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clock34xx_data.o
# EMU peripherals # EMU peripherals
obj-$(CONFIG_OMAP3_EMU) += emu.o obj-$(CONFIG_OMAP3_EMU) += emu.o
......
...@@ -77,6 +77,8 @@ extern const struct clkops clkops_omap2_dflt; ...@@ -77,6 +77,8 @@ extern const struct clkops clkops_omap2_dflt;
extern u8 cpu_mask; extern u8 cpu_mask;
extern struct clk_functions omap2_clk_functions;
/* clksel_rate data common to 24xx/343x */ /* clksel_rate data common to 24xx/343x */
static const struct clksel_rate gpt_32k_rates[] = { static const struct clksel_rate gpt_32k_rates[] = {
{ .div = 1, .val = 0, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE }, { .div = 1, .val = 0, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <plat/clock.h> #include <plat/clock.h>
#include <plat/sram.h> #include <plat/sram.h>
#include <plat/prcm.h> #include <plat/prcm.h>
#include <plat/clkdev_omap.h>
#include <asm/div64.h> #include <asm/div64.h>
#include <asm/clkdev.h> #include <asm/clkdev.h>
...@@ -59,24 +60,6 @@ static const struct clkops clkops_omap2430_i2chs_wait = { ...@@ -59,24 +60,6 @@ static const struct clkops clkops_omap2430_i2chs_wait = {
#include "clock24xx.h" #include "clock24xx.h"
struct omap_clk {
u32 cpu;
struct clk_lookup lk;
};
#define CLK(dev, con, ck, cp) \
{ \
.cpu = cp, \
.lk = { \
.dev_id = dev, \
.con_id = con, \
.clk = ck, \
}, \
}
#define CK_243X RATE_IN_243X
#define CK_242X RATE_IN_242X
static struct omap_clk omap24xx_clks[] = { static struct omap_clk omap24xx_clks[] = {
/* external root sources */ /* external root sources */
CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X), CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X),
...@@ -658,7 +641,7 @@ void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) ...@@ -658,7 +641,7 @@ void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
} }
#endif #endif
static struct clk_functions omap2_clk_functions = { struct clk_functions omap2_clk_functions = {
.clk_enable = omap2_clk_enable, .clk_enable = omap2_clk_enable,
.clk_disable = omap2_clk_disable, .clk_disable = omap2_clk_disable,
.clk_round_rate = omap2_clk_round_rate, .clk_round_rate = omap2_clk_round_rate,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* linux/arch/arm/mach-omap2/clock_common_data.c
*
* Copyright (C) 2005-2009 Texas Instruments, Inc.
* Copyright (C) 2004-2009 Nokia Corporation
*
* Contacts:
* Richard Woodruff <r-woodruff2@ti.com>
* Paul Walmsley
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This file contains clock data that is common to both the OMAP2xxx and
* OMAP3xxx clock definition files.
*/
#include "clock.h"
/* clksel_rate data common to 24xx/343x */
const struct clksel_rate gpt_32k_rates[] = {
{ .div = 1, .val = 0, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
{ .div = 0 }
};
const struct clksel_rate gpt_sys_rates[] = {
{ .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
{ .div = 0 }
};
const struct clksel_rate gfx_l3_rates[] = {
{ .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_343X },
{ .div = 2, .val = 2, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
{ .div = 3, .val = 3, .flags = RATE_IN_243X | RATE_IN_343X },
{ .div = 4, .val = 4, .flags = RATE_IN_243X | RATE_IN_343X },
{ .div = 0 }
};
/*
* clkdev <-> OMAP integration
*
* Russell King <linux@arm.linux.org.uk>
*
*/
#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
#include <asm/clkdev.h>
struct omap_clk {
u32 cpu;
struct clk_lookup lk;
};
#define CLK(dev, con, ck, cp) \
{ \
.cpu = cp, \
.lk = { \
.dev_id = dev, \
.con_id = con, \
.clk = ck, \
}, \
}
#define CK_243X (1 << 0)
#define CK_242X (1 << 1)
#define CK_343X (1 << 2)
#define CK_3430ES1 (1 << 3)
#define CK_3430ES2 (1 << 4)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment