1. 08 Jan, 2010 2 commits
    • Cory Maccarrone's avatar
      omap: gpio: Simultaneously requested rising and falling edge · 4318f36b
      Cory Maccarrone authored
      Some chips, namely any OMAP1 chips using METHOD_MPUIO,
      OMAP15xx and OMAP7xx, cannot be setup to respond to on-chip GPIO
      interrupts in both rising and falling edge directions -- they can
      only respond to one direction or the other, depending on how the
      ICR is configured.
      
      Additionally, current code forces rising edge detection if both
      flags are specified:
      
              if (trigger & IRQ_TYPE_EDGE_RISING)
                      l |= 1 << gpio;
              else if (trigger & IRQ_TYPE_EDGE_FALLING)
                      l &= ~(1 << gpio);
              else
                      goto bad;
      
      This change implements a toggle function that will modify the ICR
      to flip the direction of interrupt for IRQs that are requested with
      both rising and falling flags.  The toggle function is not called
      for chips and GPIOs it does not apply to through the use of a flip_mask
      that's added on a per-bank basis.  The mask is only set for those
      GPIOs where a toggle is necessary.  Edge detection starts out the
      same as above with FALLING mode first.
      
      The toggle happens on EACH interrupt; without it, we have the
      following sequence of actions on GPIO transition:
      
        ICR    GPIO               Result
        0x1    0 -> 1 (rising)    Interrupt
        0x1    1 -> 0 (falling)   No interrupt
      
        (set ICR to 0x0 manually)
        0x0    0 -> 1 (rising)    No interrupt
        0x0    1 -> 0 (falling)   Interrupt
      
      That is, with the ICR set to 1 for a gpio, only rising edge interrupts
      are caught, and with it set to 0, only falling edge interrupts are
      caught.  If we add in the toggle, we get this:
      
        ICR    GPIO               Result
        0x1    0 -> 1 (rising)    Interrupt (ICR set to 0x0)
        0x0    1 -> 0 (falling)   Interrupt (ICR set to 0x1)
        0x1    0 -> 1 ...
      
      so, both rising and falling are caught, per the request for both
      (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING).
      Signed-off-by: default avatarCory Maccarrone <darkstar6262@gmail.com>
      Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      4318f36b
    • Janusz Krzysztofik's avatar
      omap: McBSP: Fix possible port lockout · 1866b545
      Janusz Krzysztofik authored
      In its current form, the omap_mcbsp_request() function can return after
      irq_request() failure without any cleanups, effectively locking out the port
      forever with clocks left running. Fix it.
      Signed-off-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
      Acked-by: default avatarJarkko Nikula <jhnikula@gmail.com>
      Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      1866b545
  2. 06 Jan, 2010 4 commits
  3. 05 Jan, 2010 2 commits
  4. 04 Jan, 2010 27 commits
  5. 02 Jan, 2010 5 commits