Generic twl4030 power script for 3430 based boards.
[linux-ginger.git] / arch / arm / mach-omap2 / twl4030-generic-scripts.c
blobf41c9effaee9c98860a538dff9075e2ea60c2d35
1 /*
2 * arch/arm/mach-omap2/twl4030-generic-scripts.c
4 * Generic power control scripts for TWL4030
6 * Copyright (C) 2008 Nokia Corporation
7 * Copyright (C) 2006 Texas Instruments, Inc
9 * Written by Kalle Jokiniemi
10 * Peter De Schrijver <peter.de-schrijver@nokia.com>
12 * This file is subject to the terms and conditions of the GNU General
13 * Public License. See the file "COPYING" in the main directory of this
14 * archive for more details.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/kernel.h>
27 #include <linux/device.h>
28 #include <linux/init.h>
29 #include <linux/i2c/twl4030.h>
32 * This script instructs twl4030 to first put the Reset and Control (RC)
33 * resources to sleep and then all the other resources.
36 static struct twl4030_ins sleep_on_seq[] __initdata = {
37 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
38 RES_STATE_SLEEP), 4},
39 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
40 RES_STATE_SLEEP), 4},
43 static struct twl4030_script sleep_on_script __initdata = {
44 .script = sleep_on_seq,
45 .size = ARRAY_SIZE(sleep_on_seq),
46 .flags = TRITON_SLEEP_SCRIPT,
50 * This script instructs twl4030 to first enable CLKEN, then wakeup the
51 * regulators and then all other resources.
54 static struct twl4030_ins wakeup_seq[] __initdata = {
55 {MSG_SINGULAR(DEV_GRP_NULL, 0x17, RES_STATE_ACTIVE), 0x30},
56 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP_PR, RES_TYPE_ALL, RES_TYPE2_R0,
57 RES_STATE_ACTIVE), 0x37},
58 {MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
59 RES_STATE_ACTIVE), 0x2},
62 static struct twl4030_script wakeup_script __initdata = {
63 .script = wakeup_seq,
64 .size = ARRAY_SIZE(wakeup_seq),
65 .flags = TRITON_WAKEUP12_SCRIPT | TRITON_WAKEUP3_SCRIPT,
68 static struct twl4030_script *twl4030_scripts[] __initdata = {
69 &sleep_on_script,
70 &wakeup_script,
73 struct twl4030_power_data generic3430_t2scripts_data __initdata = {
74 .scripts = twl4030_scripts,
75 .size = ARRAY_SIZE(twl4030_scripts),