aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-03-12 06:29:58 -0400
committerPaul Walmsley <paul@pwsan.com>2012-03-12 06:29:58 -0400
commit387ca5bf4fe2297c93869b6f639afa8d849fb877 (patch)
tree1db68a3fc7a4df95e1400850401c7ab853187d46 /arch/arm/mach-omap2/omap_hwmod.c
parentfde7d9049e55ab85a390be7f415d74c9f62dd0f9 (diff)
ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
This is useful when we have broken type2 compliant IPs' where the softreset shift is not the same as SYSC_TYPE2_SOFTRESET_SHIFT and hence is overridden using sysc_fields->srst_shift. We have at least one such instance now with onchip keypad on OMAP5 which has a different softreset shift as compared to other type2 IPs'. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Balaji TK <balajitk@ti.com> Tested-by: Sourav Poddar <sourav.poddar@ti.com> Acked-by: BenoƮt Cousson <b-cousson@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index eba6cd3816f5..f9b9bb9c3e32 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1395,7 +1395,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1395 */ 1395 */
1396static int _ocp_softreset(struct omap_hwmod *oh) 1396static int _ocp_softreset(struct omap_hwmod *oh)
1397{ 1397{
1398 u32 v; 1398 u32 v, softrst_mask;
1399 int c = 0; 1399 int c = 0;
1400 int ret = 0; 1400 int ret = 0;
1401 1401
@@ -1427,11 +1427,13 @@ static int _ocp_softreset(struct omap_hwmod *oh)
1427 oh->class->sysc->syss_offs) 1427 oh->class->sysc->syss_offs)
1428 & SYSS_RESETDONE_MASK), 1428 & SYSS_RESETDONE_MASK),
1429 MAX_MODULE_SOFTRESET_WAIT, c); 1429 MAX_MODULE_SOFTRESET_WAIT, c);
1430 else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) 1430 else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
1431 softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
1431 omap_test_timeout(!(omap_hwmod_read(oh, 1432 omap_test_timeout(!(omap_hwmod_read(oh,
1432 oh->class->sysc->sysc_offs) 1433 oh->class->sysc->sysc_offs)
1433 & SYSC_TYPE2_SOFTRESET_MASK), 1434 & softrst_mask),
1434 MAX_MODULE_SOFTRESET_WAIT, c); 1435 MAX_MODULE_SOFTRESET_WAIT, c);
1436 }
1435 1437
1436 if (c == MAX_MODULE_SOFTRESET_WAIT) 1438 if (c == MAX_MODULE_SOFTRESET_WAIT)
1437 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", 1439 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",