OMAP3+: VP: struct omap_vp_common: replace shift with __ffs(mask)
[deliverable/linux.git] / arch / arm / mach-omap2 / voltagedomains44xx_data.c
CommitLineData
c0718df4
PW
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
5892bb1f 35static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = {
c0718df4
PW
36 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
37};
38
b7ea803e 39static struct omap_vdd_info omap4_vdd_mpu_info;
c0718df4 40
5892bb1f 41static const struct omap_vfsm_instance omap4_vdd_iva_vfsm = {
c0718df4
PW
42 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
43};
44
b7ea803e 45static struct omap_vdd_info omap4_vdd_iva_info;
c0718df4 46
5892bb1f 47static const struct omap_vfsm_instance omap4_vdd_core_vfsm = {
c0718df4
PW
48 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
49};
50
b7ea803e 51static struct omap_vdd_info omap4_vdd_core_info;
c0718df4 52
81a60482
KH
53static struct voltagedomain omap4_voltdm_mpu = {
54 .name = "mpu",
37efca7e 55 .scalable = true,
4bcc475e
KH
56 .read = omap4_prm_vcvp_read,
57 .write = omap4_prm_vcvp_write,
58 .rmw = omap4_prm_vcvp_rmw,
d84adcf4 59 .vc = &omap4_vc_mpu,
5892bb1f 60 .vfsm = &omap4_vdd_mpu_vfsm,
b7ea803e 61 .vp = &omap4_vp_mpu,
81a60482 62 .vdd = &omap4_vdd_mpu_info,
c0718df4
PW
63};
64
81a60482
KH
65static struct voltagedomain omap4_voltdm_iva = {
66 .name = "iva",
37efca7e 67 .scalable = true,
4bcc475e
KH
68 .read = omap4_prm_vcvp_read,
69 .write = omap4_prm_vcvp_write,
70 .rmw = omap4_prm_vcvp_rmw,
d84adcf4 71 .vc = &omap4_vc_iva,
5892bb1f 72 .vfsm = &omap4_vdd_iva_vfsm,
b7ea803e 73 .vp = &omap4_vp_iva,
81a60482
KH
74 .vdd = &omap4_vdd_iva_info,
75};
76
77static struct voltagedomain omap4_voltdm_core = {
78 .name = "core",
37efca7e 79 .scalable = true,
4bcc475e
KH
80 .read = omap4_prm_vcvp_read,
81 .write = omap4_prm_vcvp_write,
82 .rmw = omap4_prm_vcvp_rmw,
d84adcf4 83 .vc = &omap4_vc_core,
5892bb1f 84 .vfsm = &omap4_vdd_core_vfsm,
b7ea803e 85 .vp = &omap4_vp_core,
81a60482
KH
86 .vdd = &omap4_vdd_core_info,
87};
c0718df4 88
7e1b9405
BC
89static struct voltagedomain omap4_voltdm_wkup = {
90 .name = "wakeup",
91};
92
81a60482
KH
93static struct voltagedomain *voltagedomains_omap4[] __initdata = {
94 &omap4_voltdm_mpu,
95 &omap4_voltdm_iva,
96 &omap4_voltdm_core,
7e1b9405 97 &omap4_voltdm_wkup,
81a60482
KH
98 NULL,
99};
100
101void __init omap44xx_voltagedomains_init(void)
102{
c0718df4
PW
103 /*
104 * XXX Will depend on the process, validation, and binning
105 * for the currently-running IC
106 */
107 omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
108 omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
109 omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
110
81a60482 111 voltdm_init(voltagedomains_omap4);
c0718df4 112};
This page took 0.066101 seconds and 5 git commands to generate.