1. 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
  2. 04 4月, 2015 1 次提交
  3. 10 3月, 2015 1 次提交
  4. 05 3月, 2015 2 次提交
  5. 29 1月, 2015 1 次提交
  6. 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
  7. 05 11月, 2014 1 次提交
  8. 29 10月, 2014 1 次提交
  9. 26 9月, 2014 1 次提交
  10. 29 8月, 2014 2 次提交
  11. 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
  12. 24 7月, 2014 1 次提交
  13. 23 7月, 2014 1 次提交
  14. 05 5月, 2014 1 次提交
  15. 29 4月, 2014 1 次提交
  16. 07 2月, 2014 1 次提交
  17. 03 2月, 2014 1 次提交
  18. 13 12月, 2013 1 次提交
  19. 09 12月, 2013 1 次提交
  20. 03 12月, 2013 1 次提交
  21. 25 11月, 2013 1 次提交
    • A
      Documentation: gpiolib: document new interface · fd8e198c
      Alexandre Courbot 提交于
      gpiolib now exports a new descriptor-based interface which deprecates
      the older integer-based one. This patch documents this new interface and
      also takes the opportunity to brush-up the GPIO documentation a little
      bit.
      
      The new descriptor-based interface follows the same consumer/driver
      model as many other kernel subsystems (e.g. clock, regulator), so its
      documentation has similarly been splitted into different files.
      
      The content of the former documentation has been reused whenever it
      made sense; however, some of its content did not apply to the new
      interface anymore and have this been removed. Likewise, new sections
      like the mapping of GPIOs to devices have been written from scratch.
      
      The deprecated legacy-based documentation is still available, untouched,
      under Documentation/gpio/gpio-legacy.txt.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      fd8e198c