]>
Commit | Line | Data |
---|---|---|
d006af40 AF |
1 | From 2e908aeebd6804296e7d14a96de6be1e2de38e93 Mon Sep 17 00:00:00 2001 |
2 | From: Matthias Brugger <matthias.bgg@gmail.com> | |
3 | Date: Wed, 23 Jan 2013 19:50:38 +0100 | |
4 | Subject: [PATCH 2/2] omap2: twl-common: Add default power configuration | |
5 | ||
6 | This patch adds a generic power script configuration. | |
7 | When rebooting an OMAP3530 at 125 MHz, the reboot hangs. | |
8 | With the generic power script, TWL4030 will be reset | |
9 | when a warm reset occures. This way the OMAP3530 does not | |
10 | hang on reboot. | |
11 | ||
12 | Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> | |
13 | --- | |
14 | arch/arm/mach-omap2/twl-common.c | 38 ++++++++++++++++++++++++++++++++++++++ | |
15 | arch/arm/mach-omap2/twl-common.h | 1 + | |
16 | 2 files changed, 39 insertions(+) | |
17 | ||
18 | diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c | |
19 | index e49b40b..f096beb 100644 | |
20 | --- a/arch/arm/mach-omap2/twl-common.c | |
21 | +++ b/arch/arm/mach-omap2/twl-common.c | |
22 | @@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = { | |
23 | .codec = &omap3_codec, | |
24 | }; | |
25 | ||
26 | +static struct twl4030_ins wrst_seq[] __initdata = { | |
27 | + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2}, | |
28 | + {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15}, | |
29 | + {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15}, | |
30 | + {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60}, | |
31 | + {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2}, | |
32 | + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2}, | |
33 | +}; | |
34 | + | |
35 | +static struct twl4030_script wrst_script __initdata = { | |
36 | + .script = wrst_seq, | |
37 | + .size = ARRAY_SIZE(wrst_seq), | |
38 | + .flags = TWL4030_WRST_SCRIPT, | |
39 | +}; | |
40 | + | |
41 | +static struct twl4030_script *omap3_power_scripts[] __initdata = { | |
42 | + &wrst_script, | |
43 | +}; | |
44 | + | |
45 | +static struct twl4030_resconfig omap3_rconfig[] = { | |
46 | + { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1, | |
47 | + .type2 = -1 }, | |
48 | + { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1, | |
49 | + .type2 = -1 }, | |
50 | + { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1, | |
51 | + .type2 = -1 }, | |
52 | + { 0, 0}, | |
53 | +}; | |
54 | + | |
55 | +static struct twl4030_power_data omap3_power_pdata = { | |
56 | + .scripts = omap3_power_scripts, | |
57 | + .num = ARRAY_SIZE(omap3_power_scripts), | |
58 | + .resource_config = omap3_rconfig, | |
59 | +}; | |
60 | + | |
61 | static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = { | |
62 | REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), | |
63 | }; | |
64 | @@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, | |
65 | if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) | |
66 | pmic_data->audio = &omap3_audio_pdata; | |
67 | ||
68 | + if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power) | |
69 | + pmic_data->power = &omap3_power_pdata; | |
70 | + | |
71 | /* Common regulator configurations */ | |
72 | if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) | |
73 | pmic_data->vdac = &omap3_vdac_idata; | |
74 | diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h | |
75 | index dcfbad5..dbeb905 100644 | |
76 | --- a/arch/arm/mach-omap2/twl-common.h | |
77 | +++ b/arch/arm/mach-omap2/twl-common.h | |
78 | @@ -7,6 +7,7 @@ | |
79 | #define TWL_COMMON_PDATA_BCI (1 << 1) | |
80 | #define TWL_COMMON_PDATA_MADC (1 << 2) | |
81 | #define TWL_COMMON_PDATA_AUDIO (1 << 3) | |
82 | +#define TWL_COMMON_PDATA_POWER (1 << 4) | |
83 | ||
84 | /* Common LDO regulators for TWL4030/TWL6030 */ | |
85 | #define TWL_COMMON_REGULATOR_VDAC (1 << 0) | |
86 | -- | |
87 | 1.7.10.4 | |
88 |