1. 25 7月, 2014 1 次提交
  2. 23 7月, 2014 3 次提交
    • A
      gpio: move gpio_ensure_requested() into legacy C file · d82da797
      Alexandre Courbot 提交于
      gpio_ensure_requested() only makes sense when using the integer-based
      GPIO API, so make sure it is called from there instead of the gpiod
      API which we know cannot be called with a non-requested GPIO anyway.
      
      The uses of gpio_ensure_requested() in the gpiod API were kind of
      out-of-place anyway, so putting them in gpio-legacy.c helps clearing the
      code.
      
      Actually, considering the time this ensure_requested mechanism has been
      around, maybe we should just turn this patch into "remove
      gpio_ensure_requested()" if we know for sure that no user depend on it
      anymore?
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d82da797
    • A
      gpio: remove gpiod_lock/unlock_as_irq() · d74be6df
      Alexandre Courbot 提交于
      gpio_lock/unlock_as_irq() are working with (chip, offset) arguments and
      are thus not using the old integer namespace. Therefore, there is no
      reason to have gpiod variants of these functions working with
      descriptors, especially since the (chip, offset) tuple is more suitable
      to the users of these functions (GPIO drivers, whereas GPIO descriptors
      are targeted at GPIO consumers).
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d74be6df
    • G
      gpio: Add support for GPIOF_ACTIVE_LOW to gpio_request_one functions · 2be00173
      Guenter Roeck 提交于
      The gpio include file and the gpio documentation declare and document
      GPIOF_ACTIVE_LOW as one of the flags to be passed to gpio_request_one
      and related functions. However, the flag is not evaluated or used.
      
      This can cause problems in at least two areas: First, the same API can
      be used to auto-export pins to user space. The missing support for
      GPIOF_ACTIVE_LOW results in unexpected behavior for such auto-exported
      pins. Second, the requested gpio pin can be convered for use by
      gpiod functions with gpio_to_desc(). While gpio API functions do not
      support GPIOF_ACTIVE_LOW, gpiod functions do, which again results in
      unexpected behavior.
      
      Check the flag in gpio_request_one and set the gpio internal flag
      FLAG_ACTIVE_LOW if it is set to address those problems.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2be00173
  3. 09 7月, 2014 1 次提交