aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm2xxx_3xxx.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-03-11 12:20:03 -0500
committerTony Lindgren <tony@atomide.com>2011-03-11 12:20:03 -0500
commita2358a7bc35e388978fc2f7f6b071a0fd27d78c1 (patch)
treefbdc2ddb066243a11aebc490c4d54e6a42be51e2 /arch/arm/mach-omap2/prm2xxx_3xxx.c
parent94a06b74e724caabcf0464c81527cfbcae0c8aff (diff)
parenta08572ae529b1e8de12393eeced661feae8fd44c (diff)
Merge branch 'integration-2.6.39-for-tony' of git://git.pwsan.com/linux-integration into omap-for-linus
Conflicts: arch/arm/mach-omap2/pm34xx.c
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index ec0362574b5..051213fbc34 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -118,7 +118,8 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
118/** 118/**
119 * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait 119 * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait
120 * @prm_mod: PRM submodule base (e.g. CORE_MOD) 120 * @prm_mod: PRM submodule base (e.g. CORE_MOD)
121 * @shift: register bit shift corresponding to the reset line to deassert 121 * @rst_shift: register bit shift corresponding to the reset line to deassert
122 * @st_shift: register bit shift for the status of the deasserted submodule
122 * 123 *
123 * Some IPs like dsp or iva contain processors that require an HW 124 * Some IPs like dsp or iva contain processors that require an HW
124 * reset line to be asserted / deasserted in order to fully enable the 125 * reset line to be asserted / deasserted in order to fully enable the
@@ -129,27 +130,28 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
129 * -EINVAL upon an argument error, -EEXIST if the submodule was already out 130 * -EINVAL upon an argument error, -EEXIST if the submodule was already out
130 * of reset, or -EBUSY if the submodule did not exit reset promptly. 131 * of reset, or -EBUSY if the submodule did not exit reset promptly.
131 */ 132 */
132int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) 133int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
133{ 134{
134 u32 mask; 135 u32 rst, st;
135 int c; 136 int c;
136 137
137 if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) 138 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
138 return -EINVAL; 139 return -EINVAL;
139 140
140 mask = 1 << shift; 141 rst = 1 << rst_shift;
142 st = 1 << st_shift;
141 143
142 /* Check the current status to avoid de-asserting the line twice */ 144 /* Check the current status to avoid de-asserting the line twice */
143 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) 145 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, rst) == 0)
144 return -EEXIST; 146 return -EEXIST;
145 147
146 /* Clear the reset status by writing 1 to the status bit */ 148 /* Clear the reset status by writing 1 to the status bit */
147 omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); 149 omap2_prm_rmw_mod_reg_bits(0xffffffff, st, prm_mod, OMAP2_RM_RSTST);
148 /* de-assert the reset control line */ 150 /* de-assert the reset control line */
149 omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); 151 omap2_prm_rmw_mod_reg_bits(rst, 0, prm_mod, OMAP2_RM_RSTCTRL);
150 /* wait the status to be set */ 152 /* wait the status to be set */
151 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, 153 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST,
152 mask), 154 st),
153 MAX_MODULE_HARDRESET_WAIT, c); 155 MAX_MODULE_HARDRESET_WAIT, c);
154 156
155 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 157 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;