1. 27 7月, 2008 1 次提交
  2. 26 7月, 2008 1 次提交
    • D
      gpio: sysfs interface · d8f388d8
      David Brownell 提交于
      This adds a simple sysfs interface for GPIOs.
      
          /sys/class/gpio
          	/export ... asks the kernel to export a GPIO to userspace
          	/unexport ... to return a GPIO to the kernel
              /gpioN ... for each exported GPIO #N
      	    /value ... always readable, writes fail for input GPIOs
      	    /direction ... r/w as: in, out (default low); write high, low
      	/gpiochipN ... for each gpiochip; #N is its first GPIO
      	    /base ... (r/o) same as N
      	    /label ... (r/o) descriptive, not necessarily unique
      	    /ngpio ... (r/o) number of GPIOs; numbered N .. N+(ngpio - 1)
      
      GPIOs claimed by kernel code may be exported by its owner using a new
      gpio_export() call, which should be most useful for driver debugging.
      Such exports may optionally be done without a "direction" attribute.
      
      Userspace may ask to take over a GPIO by writing to a sysfs control file,
      helping to cope with incomplete board support or other "one-off"
      requirements that don't merit full kernel support:
      
        echo 23 > /sys/class/gpio/export
      	... will gpio_request(23, "sysfs") and gpio_export(23);
      	use /sys/class/gpio/gpio-23/direction to (re)configure it,
      	when that GPIO can be used as both input and output.
        echo 23 > /sys/class/gpio/unexport
      	... will gpio_free(23), when it was exported as above
      
      The extra D-space footprint is a few hundred bytes, except for the sysfs
      resources associated with each exported GPIO.  The additional I-space
      footprint is about two thirds of the current size of gpiolib (!).  Since
      no /dev node creation is involved, no "udev" support is needed.
      
      Related changes:
      
        * This adds a device pointer to "struct gpio_chip".  When GPIO
          providers initialize that, sysfs gpio class devices become children of
          that device instead of being "virtual" devices.
      
        * The (few) gpio_chip providers which have such a device node have
          been updated.
      
        * Some gpio_chip drivers also needed to update their module "owner"
          field ...  for which missing kerneldoc was added.
      
        * Some gpio_chips don't support input GPIOs.  Those GPIOs are now
          flagged appropriately when the chip is registered.
      
      Based on previous patches, and discussion both on and off LKML.
      
      A Documentation/ABI/testing/sysfs-gpio update is ready to submit once this
      merges to mainline.
      
      [akpm@linux-foundation.org: a few maintenance build fixes]
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
      Cc: Greg KH <greg@kroah.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d8f388d8
  3. 15 4月, 2008 3 次提交
  4. 20 3月, 2008 1 次提交
  5. 05 3月, 2008 2 次提交
  6. 09 2月, 2008 3 次提交
  7. 25 1月, 2008 1 次提交
  8. 20 10月, 2007 1 次提交
  9. 09 5月, 2007 1 次提交
  10. 05 5月, 2007 8 次提交
  11. 22 4月, 2007 1 次提交
  12. 02 3月, 2007 1 次提交
  13. 30 11月, 2006 1 次提交
  14. 07 10月, 2006 1 次提交
  15. 25 9月, 2006 7 次提交
  16. 02 8月, 2006 1 次提交
  17. 03 7月, 2006 1 次提交
  18. 02 7月, 2006 1 次提交
  19. 01 7月, 2006 1 次提交
  20. 27 6月, 2006 2 次提交
    • I
      ARM: OMAP: Fix GPIO IRQ mask handling · 99c47707
      Imre Deak 提交于
      The GPIO IRQ mask was retrieved incorrectly in cases where we have a mask
      register instead of an enable register. Also we should only return the
      valid bits depending on the bank size.
      
      This fixes a bug on 1510/1610 based OMAPs where GPIO IRQs are not
      delivered.
      Signed-off-by: NImre Deak <imre.deak@nokia.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      99c47707
    • I
      ARM: OMAP: GPIO IRQ lazy IRQ disable fix · ea6dedd7
      Imre Deak 提交于
      - The current OMAP GPIO IRQ framework doesn't use the do_edge_IRQ,
        do_level_IRQ handlers, but instead calls do_simple_IRQ. This
        doesn't handle disabled interrupts properly, so drivers will
        still get interrupts after calling disable_irq. The patch solves
        this by respecting the irq_desc.disable_depth and irq_desc.running
        counters.  When one of these is non-zero the handler is not called,
        the interrupt is masked and marked as pending. The pending interrupt
        will be serviced when the running handler returns. This is according
        to the same semantics as the standard do_edge_IRQ and do_level_IRQ
        handlers have, so one day we should use them instead of do_simple_IRQ.
      
      - Process only interrupts that are not masked. The ISR may contain
        pending interrupts that are masked these shouldn't be processed.
      
      - Move the bank IRQ unmasking out of the IRQ dispatch loop. If there
        are further iterations we shouldn't unmask it if there are level
        triggered interrupts pending.
      Signed-off-by: NImre Deak <imre.deak@nokia.com>
      Signed-off-by: NJuha Yrjola <juha.yrjola@nokia.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      ea6dedd7
  21. 03 4月, 2006 1 次提交