1. 12 11月, 2012 2 次提交
    • L
      gpiolib: fix up function prototypes etc · 165adc9c
      Linus Walleij 提交于
      Commit 69e1601bca88809dc118abd1becb02c15a02ec71
      "gpiolib: provide provision to register pin ranges"
      
      Got most of it's function prototypes wrong, so fix this up by:
      
      - Moving the void declarations into static inlines in
        <linux/gpio.h> (previously the actual prototypes were declared
        here...)
      
      - Declare the gpiochip_add_pin_range() and
        gpiochip_remove_pin_ranges() functions in <asm-generic/gpio.h>
        together with the pin range struct declaration itself.
      
      - Actually only implement these very functions in gpiolib.c
        if CONFIG_PINCTRL is set.
      
      - Additionally export the symbols since modules will need to
        be able to do this.
      Reviewed-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      165adc9c
    • S
      gpiolib: provide provision to register pin ranges · f23f1516
      Shiraz Hashim 提交于
      pinctrl subsystem needs gpio chip base to prepare set of gpio
      pin ranges, which a given pinctrl driver can handle. This is
      important to handle pinctrl gpio request calls in order to
      program a given pin properly for gpio operation.
      
      As gpio base is allocated dynamically during gpiochip
      registration, presently there exists no clean way to pass this
      information to the pinctrl subsystem.
      
      After few discussions from [1], it was concluded that may be
      gpio controller reporting the pin range it supports, is a
      better way than pinctrl subsystem directly registering it.
      
      [1] http://comments.gmane.org/gmane.linux.ports.arm.kernel/184816
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NShiraz Hashim <shiraz.hashim@st.com>
      [Edited documentation a bit]
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f23f1516
  2. 05 7月, 2012 1 次提交
  3. 19 5月, 2012 1 次提交
  4. 12 5月, 2012 1 次提交
  5. 06 4月, 2012 2 次提交
  6. 05 3月, 2012 3 次提交
  7. 24 10月, 2011 1 次提交
  8. 16 6月, 2011 1 次提交
  9. 28 5月, 2011 1 次提交
  10. 27 5月, 2011 1 次提交
  11. 15 1月, 2011 1 次提交
  12. 14 1月, 2011 3 次提交
  13. 01 9月, 2010 1 次提交
    • A
      gpiolib: Add 'struct gpio_chip' forward declaration for !GPIOLIB case · 4e4438b8
      Anton Vorontsov 提交于
      With CONFIG_GPIOLIB=n, the 'struct gpio_chip' is not declared,
      so the following pops up on PowerPC:
      
        cc1: warnings being treated as errors
        In file included from arch/powerpc/platforms/52xx/mpc52xx_common.c:19:
        include/linux/of_gpio.h:74: warning: 'struct gpio_chip' declared
                                    inside parameter list
        include/linux/of_gpio.h:74: warning: its scope is only this definition
                                    or declaration, which is probably not what
      			      you want
        include/linux/of_gpio.h:75: warning: 'struct gpio_chip' declared
                                    inside parameter list
        make[2]: *** [arch/powerpc/platforms/52xx/mpc52xx_common.o] Error 1
      
      This patch fixes the issue by providing the proper forward declaration.
      Signed-off-by: NAnton Vorontsov <cbouatmailru@gmail.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      4e4438b8
  14. 28 5月, 2010 1 次提交
    • F
      gpiolib: introduce set_debounce method · c4b5be98
      Felipe Balbi 提交于
      A few architectures, like OMAP, allow you to set a debouncing time for the
      gpio before generating the IRQ.  Teach gpiolib about that.
      
      Mark said:
      : This would be generally useful for embedded systems, especially where
      : the interrupt concerned is a wake source.  It allows drivers to avoid
      : spurious interrupts from noisy sources so if the hardware supports it
      : the driver can avoid having to explicitly wait for the signal to become
      : stable and software has to cope with fewer events.  We've lived without
      : it for quite some time, though.
      
      David said:
      : I looked at adding debounce support to the generic GPIO calls (and thus
      : gpiolib) some time back, but decided against it.  I forget why at this
      : time (check list archives) but it wasn't because of lack of utility in
      : certain contexts.
      :
      : One thing to watch out for is just how variable the hardware capabilities
      : are.  Atmel GPIOs have something like a fixed number of 32K clock cycles
      : for debounce, twl4030 had something odd, OMAPs were more like the Atmel
      : chips but with a different clock.  In some cases debouncing had to be
      : ganged, not per-GPIO.  And so forth.
      Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: David Brownell <david-b@pacbell.net>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4b5be98
  15. 16 12月, 2009 1 次提交
  16. 23 9月, 2009 1 次提交
  17. 17 10月, 2008 1 次提交
  18. 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
  19. 25 5月, 2008 1 次提交
  20. 05 3月, 2008 1 次提交