1. 07 8月, 2014 1 次提交
  2. 28 7月, 2014 2 次提交
    • A
      gpio: add flags argument to gpiod_get*() functions · 39b2bbe3
      Alexandre Courbot 提交于
      The huge majority of GPIOs have their direction and initial value set
      right after being obtained by one of the gpiod_get() functions. The
      integer GPIO API had gpio_request_one() that took a convenience flags
      parameter allowing to specify an direction and value applied to the
      returned GPIO. This feature greatly simplifies client code and ensures
      errors are always handled properly.
      
      A similar feature has been requested for the gpiod API. Since setting
      the direction of a GPIO is so often the very next action done after
      obtaining its descriptor, we prefer to extend the existing functions
      instead of introducing new functions that would raise the
      number of gpiod getters to 16 (!).
      
      The drawback of this approach is that all gpiod clients need to be
      updated. To limit the pain, temporary macros are introduced that allow
      gpiod_get*() to be called with or without the extra flags argument. They
      will be removed once all consumer code has been updated.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Reviewed-by: NMark Brown <broonie@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      39b2bbe3
    • L
      gpio: split gpiod board registration into machine header · 0a6d3158
      Linus Walleij 提交于
      As per example from the regulator subsystem: put all defines and
      functions related to registering board info for GPIO descriptors
      into a separate <linux/gpio/machine.h> header.
      
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Acked-by: NStephen Warren <swarren@wwwdotorg.org>
      Reviewed-by: NAlexandre Courbot <gnurou@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0a6d3158
  3. 24 7月, 2014 1 次提交
  4. 23 7月, 2014 3 次提交
  5. 16 5月, 2014 1 次提交
  6. 09 5月, 2014 1 次提交
    • T
      gpio: Add helpers for optional GPIOs · 29a1f233
      Thierry Reding 提交于
      Introduce gpiod_get_optional() and gpiod_get_index_optional() helpers
      that make it easier for drivers to handle optional GPIOs.
      
      Currently in order to handle optional GPIOs, a driver needs to special
      case error handling for -ENOENT, such as this:
      
      	gpio = gpiod_get(dev, "foo");
      	if (IS_ERR(gpio)) {
      		if (PTR_ERR(gpio) != -ENOENT)
      			return PTR_ERR(gpio);
      
      		gpio = NULL;
      	}
      
      	if (gpio) {
      		/* set up GPIO */
      	}
      
      With these new helpers the above is reduced to:
      
      	gpio = gpiod_get_optional(dev, "foo");
      	if (IS_ERR(gpio))
      		return PTR_ERR(gpio);
      
      	if (gpio) {
      		/* set up GPIO */
      	}
      
      While at it, device-managed variants of these functions are also
      provided.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      29a1f233
  7. 29 4月, 2014 1 次提交
    • L
      gpio: support threaded interrupts in irqchip helpers · 1c8732bb
      Linus Walleij 提交于
      Some off-chip GPIO expanders need to be communicated by I2C or
      SPI traffic, but may still support IRQs. By the sleeping nature
      of such buses, such IRQ handlers need to be threaded. Support
      such handlers in the gpiochip irqchip helpers by flagging IRQs
      as threaded if the .can_sleep property of the gpiochip is
      true.
      
      Helpfully deny registration of chained IRQ handlers if the
      .can_sleep property is set, as such chips will invariably need
      a nested handler rather than a chained handler.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1c8732bb
  8. 29 3月, 2014 1 次提交
  9. 26 3月, 2014 1 次提交
  10. 13 2月, 2014 1 次提交
  11. 07 2月, 2014 1 次提交
  12. 06 2月, 2014 1 次提交
  13. 09 12月, 2013 2 次提交
  14. 04 12月, 2013 1 次提交
    • L
      gpio/pinctrl: make gpio_chip members typed boolean · 9fb1f39e
      Linus Walleij 提交于
      This switches the two members of struct gpio_chip that were
      defined as unsigned foo:1 to bool, because that is indeed what
      they are. Switch all users in the gpio and pinctrl subsystems
      to assign these values with true/false instead of 0/1. The
      users outside these subsystems will survive since true/false
      is 1/0, atleast we set some kind of more strict typing example.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9fb1f39e
  15. 03 12月, 2013 1 次提交
  16. 25 11月, 2013 1 次提交
    • A
      gpiolib: use dedicated flags for GPIO properties · 53e7cac3
      Alexandre Courbot 提交于
      GPIO mapping properties were defined using the GPIOF_* flags, which are
      declared in linux/gpio.h. This file is not included when using the
      GPIO descriptor interface.
      
      This patch declares the flags that can be used as GPIO mappings
      properties in linux/gpio/driver.h, and uses them in gpiolib, so that no
      deprecated declarations are used by the GPIO descriptor interface.
      
      This patch also allows GPIO_OPEN_DRAIN and GPIO_OPEN_SOURCE to be
      specified as GPIO mapping properties.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      53e7cac3
  17. 30 10月, 2013 1 次提交
  18. 20 10月, 2013 2 次提交