1. 18 May, 2012 2 commits
    • Kevin Hilman's avatar
      gpio/omap: (re)fix wakeups on level-triggered GPIOs · b3c64bc3
      Kevin Hilman authored
      commit 1b128703 (gpio/omap: fix missing check in *_runtime_suspend())
      broke wakeups on level-triggered GPIOs by adding the enabled
      non-wakeup GPIO check before the workaround that enables wakeups
      on level-triggered IRQs, effectively disabling that workaround.
      
      To fix, move the enabled non-wakeup GPIO check after the
      level-triggered IRQ workaround.
      Reported-by: default avatarTony Lindgren <tony@atomide.com>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Acked-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
      Tested-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      b3c64bc3
    • Kevin Hilman's avatar
      gpio/omap: fix broken context restore for non-OFF mode transitions · 22770de1
      Kevin Hilman authored
      The fix in commit 1b128703 (gpio/omap: fix missing check in
      *_runtime_suspend()) exposed another bug in the context restore path.
      
      Currently, the per-bank context restore happens whenever the context
      loss count is different in runtime suspend and runtime resume *and*
      whenever the per-bank contex_loss_count == 0:
      
      	if (context_lost_cnt_after != bank->context_loss_count ||
      					!context_lost_cnt_after) {
      		omap_gpio_restore_context(bank);
      
      Restoring context when the context_lost_cnt_after == 0 is clearly
      wrong, since this will be true until the first off-mode transition
      (which could be never, if off-mode is never enabled.)  This check
      causes the context to be restored on *every* runtime PM transition.
      
      Before commit 1b128703 (gpio/omap: fix missing check in
      *_runtime_suspend()), this code was never executed in non-OFF mode, so
      there were never spurious context restores happening.  After that
      change though, spurious context restores could happen.
      
      To fix, simply remove the !context_lost_cnt_after check. It is not
      needed.
      
      This bug was found when noticing that the smc911x NIC on 3530/Overo
      was not working, and git bisect tracked it down to this patch.  It
      seems that the spurious context restore was causing the smsc911x to
      not be properly probed on this platform.
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Acked-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      22770de1
  2. 12 May, 2012 8 commits
  3. 10 May, 2012 1 commit
    • Tarun Kanti DebBarma's avatar
      gpio/omap: fix incorrect initialization of omap_gpio_mod_init · 6edd94db
      Tarun Kanti DebBarma authored
      Initialization of irqenable, irqstatus registers is the common
      operation done in this function for all OMAP platforms, viz. OMAP1,
      OMAP2+. The latter _gpio_rmw()'s which supposedly got introduced
      wrongly to take care of OMAP2+ platforms were overwriting initially
      programmed OMAP1 value breaking functionality on OMAP1.
      Somehow incorrect assumption was made that each _gpio_rmw()'s were
      mutually exclusive. On close observation it is found that the first
      _gpio_rmw() which is supposedly done to take care of OMAP1 platform
      is generic enough and takes care of OMAP2+ platform as well.
      Therefore remove the latter _gpio_rmw() to irqenable as they are
      redundant now.
      
      Writing to ctrl and debounce_en registers for OMAP2+ platforms are
      modified to match the original(pre-cleanup) code where the registers
      are initialized with 0. In the cleanup series since we are using
      _gpio_rmw(reg, 0, 1), instead of __raw_writel(), we are just reading
      and writing the same values to ctrl and debounce_en. This is not an
      issue for debounce_en register because it has 0x0 as the default value.
      But in the case of ctrl register the default value is 0x2 (GATINGRATIO
       = 0x1) so that we end up writing 0x2 instead of intended 0 value.
      Therefore changing back to __raw_writel() as this is sufficient for
      this case besides simpler to understand.
      
      Also, change irqstatus initalization logic that avoids comparison
      with bool, besides making it fit in a single line.
      
      Cc: stable@vger.kernel.org
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Reported-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
      Tested-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
      Signed-off-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      6edd94db
  4. 06 May, 2012 5 commits
  5. 05 May, 2012 10 commits
  6. 04 May, 2012 14 commits