]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOF...
authorRajendra Nayak <rnayak@ti.com>
Mon, 12 Mar 2012 10:29:58 +0000 (04:29 -0600)
committerPaul Walmsley <paul@pwsan.com>
Mon, 12 Mar 2012 10:29:58 +0000 (04:29 -0600)
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>
arch/arm/mach-omap2/omap_hwmod.c

index eba6cd3816f5e917d09aa5d8367c84f27a6e51dc..f9b9bb9c3e32fcbd0265c0ccae2d67b260792fad 100644 (file)
@@ -1395,7 +1395,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
  */
 static int _ocp_softreset(struct omap_hwmod *oh)
 {
-       u32 v;
+       u32 v, softrst_mask;
        int c = 0;
        int ret = 0;
 
@@ -1427,11 +1427,13 @@ static int _ocp_softreset(struct omap_hwmod *oh)
                                                    oh->class->sysc->syss_offs)
                                   & SYSS_RESETDONE_MASK),
                                  MAX_MODULE_SOFTRESET_WAIT, c);
-       else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS)
+       else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
+               softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
                omap_test_timeout(!(omap_hwmod_read(oh,
                                                     oh->class->sysc->sysc_offs)
-                                  & SYSC_TYPE2_SOFTRESET_MASK),
+                                  & softrst_mask),
                                  MAX_MODULE_SOFTRESET_WAIT, c);
+       }
 
        if (c == MAX_MODULE_SOFTRESET_WAIT)
                pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",