ARM: OMAP: Remove unused old gpio-switch.h
[deliverable/linux.git] / arch / arm / mach-omap2 / voltagedomains3xxx_data.c
CommitLineData
c0718df4
PW
1/*
2 * OMAP3 voltage domain data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#include <linux/kernel.h>
18#include <linux/err.h>
19#include <linux/init.h>
20
4e65331c 21#include "common.h"
c0718df4
PW
22#include <plat/cpu.h>
23
24#include "prm-regbits-34xx.h"
25#include "omap_opp_data.h"
26#include "voltage.h"
27#include "vc.h"
28#include "vp.h"
29
30/*
31 * VDD data
32 */
33
ddf536d0
PW
34/* OMAP3-common voltagedomain data */
35
36static struct voltagedomain omap3_voltdm_wkup = {
37 .name = "wakeup",
38};
39
40/* 34xx/36xx voltagedomain data */
41
5892bb1f 42static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
c0718df4 43 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
c0718df4
PW
44 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
45};
46
5892bb1f 47static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
c0718df4 48 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
c0718df4
PW
49 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
50};
51
81a60482 52static struct voltagedomain omap3_voltdm_mpu = {
280a7275 53 .name = "mpu_iva",
37efca7e 54 .scalable = true,
4bcc475e
KH
55 .read = omap3_prm_vcvp_read,
56 .write = omap3_prm_vcvp_write,
57 .rmw = omap3_prm_vcvp_rmw,
d84adcf4 58 .vc = &omap3_vc_mpu,
5892bb1f 59 .vfsm = &omap3_vdd1_vfsm,
b7ea803e 60 .vp = &omap3_vp_mpu,
c0718df4
PW
61};
62
81a60482
KH
63static struct voltagedomain omap3_voltdm_core = {
64 .name = "core",
37efca7e 65 .scalable = true,
4bcc475e
KH
66 .read = omap3_prm_vcvp_read,
67 .write = omap3_prm_vcvp_write,
68 .rmw = omap3_prm_vcvp_rmw,
d84adcf4 69 .vc = &omap3_vc_core,
5892bb1f 70 .vfsm = &omap3_vdd2_vfsm,
b7ea803e 71 .vp = &omap3_vp_core,
81a60482 72};
c0718df4 73
81a60482
KH
74static struct voltagedomain *voltagedomains_omap3[] __initdata = {
75 &omap3_voltdm_mpu,
76 &omap3_voltdm_core,
ace19ffa 77 &omap3_voltdm_wkup,
81a60482
KH
78 NULL,
79};
80
ddf536d0
PW
81/* AM35xx voltagedomain data */
82
83static struct voltagedomain am35xx_voltdm_mpu = {
84 .name = "mpu_iva",
85};
86
87static struct voltagedomain am35xx_voltdm_core = {
88 .name = "core",
89};
90
91static struct voltagedomain *voltagedomains_am35xx[] __initdata = {
92 &am35xx_voltdm_mpu,
93 &am35xx_voltdm_core,
94 &omap3_voltdm_wkup,
95 NULL,
96};
97
98
0e2f3d9c
KH
99static const char *sys_clk_name __initdata = "sys_ck";
100
81a60482
KH
101void __init omap3xxx_voltagedomains_init(void)
102{
0e2f3d9c 103 struct voltagedomain *voltdm;
ddf536d0 104 struct voltagedomain **voltdms;
0e2f3d9c
KH
105 int i;
106
c0718df4
PW
107 /*
108 * XXX Will depend on the process, validation, and binning
109 * for the currently-running IC
110 */
3ddd4d0c 111#ifdef CONFIG_PM_OPP
c0718df4 112 if (cpu_is_omap3630()) {
e3277880
KH
113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
c0718df4 115 } else {
e3277880
KH
116 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
117 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
c0718df4 118 }
3ddd4d0c 119#endif
c0718df4 120
68a88b98 121 if (soc_is_am35xx())
ddf536d0
PW
122 voltdms = voltagedomains_am35xx;
123 else
124 voltdms = voltagedomains_omap3;
125
126 for (i = 0; voltdm = voltdms[i], voltdm; i++)
0e2f3d9c
KH
127 voltdm->sys_clk.name = sys_clk_name;
128
ddf536d0 129 voltdm_init(voltdms);
c0718df4 130};
This page took 0.108671 seconds and 5 git commands to generate.