1. 06 7月, 2015 1 次提交
  2. 01 6月, 2015 1 次提交
  3. 26 5月, 2015 1 次提交
  4. 12 5月, 2015 1 次提交
    • J
      gpio: remove gpiod_sysfs_set_active_low · 166a85e4
      Johan Hovold 提交于
      Remove gpiod_sysfs_set_active_low (and gpio_sysfs_set_active_low) which
      allowed code to change the polarity of a gpio line even after it had
      been exported through sysfs.
      
      Drivers should not care, and generally does not know, about gpio-line
      polarity which is a hardware feature that needs to be described by
      firmware.
      
      It is currently possible to define gpio-line polarity in device-tree and
      acpi firmware or using platform data. Userspace can also change the
      polarity through sysfs.
      
      Note that drivers using the legacy gpio interface could still use
      GPIOF_ACTIVE_LOW to change the polarity before exporting the gpio.
      
      There are no in-kernel users of this interface.
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Harry Wei <harryxiyou@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: linux-doc@vger.kernel.org
      Cc: linux-kernel@zh-kernel.org
      Cc: linux-arch@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      166a85e4
  5. 05 3月, 2015 2 次提交
  6. 04 3月, 2015 1 次提交
  7. 16 1月, 2015 1 次提交
  8. 28 11月, 2014 1 次提交
  9. 27 11月, 2014 1 次提交
    • R
      gpiolib: allow simultaneous setting of multiple GPIO outputs · 5f424243
      Rojhalat Ibrahim 提交于
      Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer
      interface which allow setting multiple outputs with just one function call.
      Also add an optional set_multiple function to the driver interface. Without an
      implementation of that function in the chip driver outputs are set
      sequentially.
      
      Implementing the set_multiple function in a chip driver allows for:
      - Improved performance for certain use cases. The original motivation for this
        was the task of configuring an FPGA. In that specific case, where 9 GPIO
        lines have to be set many times, configuration time goes down from 48 s to
        20 s when using the new function.
      - Simultaneous glitch-free setting of multiple pins on any kind of parallel
        bus attached to GPIOs provided they all reside on the same chip and bank.
      
      Limitations:
        Performance is only improved for normal high-low outputs. Open drain and
        open source outputs are always set separately from each other. Those kinds
        of outputs could probably be accelerated in a similar way if we could
        forgo the error checking when setting GPIO directions.
      
      Change log:
        v6: - rebase on current linux-gpio devel branch
        v5: - check can_sleep property per chip
            - remove superfluous checks
            - supplement documentation
        v4: - add gpiod_set_array function for setting logical values
            - change interface of the set_multiple driver function to use
              unsigned long as type for the bit fields
            - use generic bitops (which also use unsigned long for bit fields)
            - do not use ARCH_NR_GPIOS any more
        v3: - add documentation
            - change commit message
        v2: - use descriptor interface
            - allow arbitrary groups of GPIOs spanning multiple chips
      Signed-off-by: NRojhalat Ibrahim <imr@rtschenk.de>
      Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
      Reviewed-by: NMark Brown <broonie@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5f424243
  10. 05 11月, 2014 1 次提交
  11. 02 9月, 2014 1 次提交
  12. 21 8月, 2014 1 次提交
  13. 28 7月, 2014 1 次提交
    • 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
  14. 16 5月, 2014 1 次提交
  15. 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
  16. 13 2月, 2014 1 次提交
  17. 07 2月, 2014 1 次提交
  18. 06 2月, 2014 1 次提交
  19. 20 10月, 2013 2 次提交