OMAP2+: voltage: start towards a new voltagedomain layer
[pandora-kernel.git] / arch / arm / mach-omap2 / voltagedomains44xx_data.c
1 /*
2  * OMAP3/OMAP4 Voltage Management Routines
3  *
4  * Author: Thara Gopinath       <thara@ti.com>
5  *
6  * Copyright (C) 2007 Texas Instruments, Inc.
7  * Rajendra Nayak <rnayak@ti.com>
8  * Lesly A M <x0080970@ti.com>
9  *
10  * Copyright (C) 2008 Nokia Corporation
11  * Kalle Jokiniemi
12  *
13  * Copyright (C) 2010 Texas Instruments, Inc.
14  * Thara Gopinath <thara@ti.com>
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License version 2 as
18  * published by the Free Software Foundation.
19  */
20 #include <linux/kernel.h>
21 #include <linux/err.h>
22 #include <linux/init.h>
23
24 #include <plat/common.h>
25
26 #include "prm-regbits-44xx.h"
27 #include "prm44xx.h"
28 #include "prcm44xx.h"
29 #include "prminst44xx.h"
30 #include "voltage.h"
31 #include "omap_opp_data.h"
32 #include "vc.h"
33 #include "vp.h"
34
35 static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
36         .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
37 };
38
39 static struct omap_vdd_info omap4_vdd_mpu_info = {
40         .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
41         .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
42         .vp_data = &omap4_vp_mpu_data,
43         .vc_data = &omap4_vc_mpu_data,
44         .vfsm = &omap4_vdd_mpu_vfsm_data,
45 };
46
47 static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
48         .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
49 };
50
51 static struct omap_vdd_info omap4_vdd_iva_info = {
52         .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
53         .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
54         .vp_data = &omap4_vp_iva_data,
55         .vc_data = &omap4_vc_iva_data,
56         .vfsm = &omap4_vdd_iva_vfsm_data,
57 };
58
59 static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
60         .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
61 };
62
63 static struct omap_vdd_info omap4_vdd_core_info = {
64         .prm_irqst_mod = OMAP4430_PRM_OCP_SOCKET_INST,
65         .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
66         .vp_data = &omap4_vp_core_data,
67         .vc_data = &omap4_vc_core_data,
68         .vfsm = &omap4_vdd_core_vfsm_data,
69 };
70
71 static struct voltagedomain omap4_voltdm_mpu = {
72         .name = "mpu",
73         .vdd = &omap4_vdd_mpu_info,
74 };
75
76 static struct voltagedomain omap4_voltdm_iva = {
77         .name = "iva",
78         .vdd = &omap4_vdd_iva_info,
79 };
80
81 static struct voltagedomain omap4_voltdm_core = {
82         .name = "core",
83         .vdd = &omap4_vdd_core_info,
84 };
85
86 static struct voltagedomain *voltagedomains_omap4[] __initdata = {
87         &omap4_voltdm_mpu,
88         &omap4_voltdm_iva,
89         &omap4_voltdm_core,
90         NULL,
91 };
92
93 void __init omap44xx_voltagedomains_init(void)
94 {
95         /*
96          * XXX Will depend on the process, validation, and binning
97          * for the currently-running IC
98          */
99         omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
100         omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
101         omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
102
103         voltdm_init(voltagedomains_omap4);
104 };