1. 23 6月, 2016 3 次提交
  2. 07 6月, 2016 1 次提交
  3. 10 5月, 2016 1 次提交
    • L
      gpio: of: make it possible to name GPIO lines · fd9c5531
      Linus Walleij 提交于
      Make it possible to name the producer side of a GPIO line using
      a "gpio-line-names" property array, modeled on the
      "clock-output-names" property from the clock bindings.
      
      This naming is especially useful for:
      
      - Debugging: lines are named after function, not just opaque
        offset numbers.
      
      - Exploration: systems where some or all GPIO lines are available
        to end users, such as prototyping, one-off's "makerspace usecases"
        users are helped by the names of the GPIO lines when tinkering.
        This usecase has been surfacing recently.
      
      The gpio-line-names attribute is completely optional.
      
      Example output from lsgpio on a patched Snowball tree:
      
      GPIO chip: gpiochip6, "8000e180.gpio", 32 GPIO lines
              line  0: unnamed unused
              line  1: "AP_GPIO161" "extkb3" [kernel]
              line  2: "AP_GPIO162" "extkb4" [kernel]
              line  3: "ACCELEROMETER_INT1_RDY" unused [kernel]
              line  4: "ACCELEROMETER_INT2" unused
              line  5: "MAG_DRDY" unused [kernel]
              line  6: "GYRO_DRDY" unused [kernel]
              line  7: "RSTn_MLC" unused
              line  8: "RSTn_SLC" unused
              line  9: "GYRO_INT" unused
              line 10: "UART_WAKE" unused
              line 11: "GBF_RESET" unused
              line 12: unnamed unused
      
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Amit Kucheria <amit.kucheria@linaro.org>
      Cc: David Mandala <david.mandala@linaro.org>
      Cc: Lee Campbell <leecam@google.com>
      Cc: devicetree@vger.kernel.org
      Acked-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NMichael Welling <mwelling@ieee.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      fd9c5531
  4. 14 4月, 2016 1 次提交
  5. 13 4月, 2016 1 次提交
  6. 05 1月, 2016 1 次提交
  7. 19 11月, 2015 1 次提交
    • L
      gpio: change member .dev to .parent · 58383c78
      Linus Walleij 提交于
      The name .dev in a struct is normally reserved for a struct device
      that is let us say a superclass to the thing described by the struct.
      struct gpio_chip stands out by confusingly using a struct device *dev
      to point to the parent device (such as a platform_device) that
      represents the hardware. As we want to give gpio_chip:s real devices,
      this is not working. We need to rename this member to parent.
      
      This was done by two coccinelle scripts, I guess it is possible to
      combine them into one, but I don't know such stuff. They look like
      this:
      
      @@
      struct gpio_chip *var;
      @@
      -var->dev
      +var->parent
      
      and:
      
      @@
      struct gpio_chip var;
      @@
      -var.dev
      +var.parent
      
      and:
      
      @@
      struct bgpio_chip *var;
      @@
      -var->gc.dev
      +var->gc.parent
      
      Plus a few instances of bgpio that I couldn't figure out how
      to teach Coccinelle to rewrite.
      
      This patch hits all over the place, but I *strongly* prefer this
      solution to any piecemal approaches that just exercise patch
      mechanics all over the place. It mainly hits drivers/gpio and
      drivers/pinctrl which is my own backyard anyway.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Rafał Miłecki <zajec5@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Alek Du <alek.du@intel.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: NJacek Anaszewski <j.anaszewski@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      58383c78
  8. 25 9月, 2015 1 次提交
  9. 28 7月, 2015 1 次提交
  10. 16 7月, 2015 2 次提交
  11. 19 5月, 2015 1 次提交
  12. 04 3月, 2015 1 次提交
    • B
      gpio: add GPIO hogging mechanism · f625d460
      Benoit Parrot 提交于
      Based on Boris Brezillion's work this is a reworked patch
      of his initial GPIO hogging mechanism.
      This patch provides a way to initially configure specific GPIO
      when the GPIO controller is probed.
      
      The actual DT scanning to collect the GPIO specific data is performed
      as part of gpiochip_add().
      
      The purpose of this is to allow specific GPIOs to be configured
      without any driver specific code.
      This is particularly useful because board design are getting
      increasingly complex and given SoC pins can now have more
      than 10 mux values, a lot of connections are now dependent on
      external IO muxes to switch various modes.
      
      Specific drivers should not necessarily need to be aware of
      what accounts to a specific board implementation. This board level
      "description" should be best kept as part of the dts file.
      Signed-off-by: NBenoit Parrot <bparrot@ti.com>
      Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f625d460
  13. 23 2月, 2015 1 次提交
  14. 16 1月, 2015 2 次提交
  15. 17 8月, 2014 1 次提交
  16. 23 7月, 2014 2 次提交
  17. 09 7月, 2014 1 次提交
  18. 21 5月, 2014 1 次提交
    • A
      gpio: make of_get_named_gpiod_flags() private · f01d9075
      Alexandre Courbot 提交于
      of_get_named_gpiod_flags() is visible and directly usable by GPIO
      consumers, but it really should not as the gpiod interface relies
      on the simpler gpiod_get() to provide properly-configured GPIOs.
      
      of_get_named_gpiod_flags() is just used internally by gpiolib to
      implement gpiod_get(), and by the old of_get_named_gpio_flags()
      function, therefore it makes sense to make it gpiolib-private.
      
      As a side-effect, the unused (and unneeded) of_get_gpiod_flags()
      inline function is also removed, and of_get_named_gpio_flags() is moved
      from a static inline function to a regular one in gpiolib-of.c
      
      This results in all references to gpiod_* functions in of_gpio.h being
      gone, which is the way it should be since this file is part of the old
      integer GPIO interface.
      
      Changes since v1:
      - Fixed compilation error when CONFIG_OF_GPIO is not defined
      - Fixed warning due to of_gpio_flags enum not being declared
        in private gpiolib.h header
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f01d9075
  19. 29 4月, 2014 1 次提交
  20. 06 2月, 2014 1 次提交
  21. 20 10月, 2013 1 次提交
  22. 16 10月, 2013 1 次提交
  23. 30 8月, 2013 1 次提交
  24. 16 8月, 2013 1 次提交
  25. 27 3月, 2013 1 次提交
  26. 07 3月, 2013 2 次提交
  27. 13 2月, 2013 1 次提交
  28. 21 1月, 2013 1 次提交
  29. 21 11月, 2012 1 次提交
  30. 12 11月, 2012 4 次提交
    • L
      gpiolib: separation of pin concerns · 1e63d7b9
      Linus Walleij 提交于
      The fact that of_gpiochip_add_pin_range() and
      gpiochip_add_pin_range() share too much code is fragile and
      will invariably mean that bugs need to be fixed in two places
      instead of one.
      
      So separate the concerns of gpiolib.c and gpiolib-of.c and
      have the latter call the former as back-end. This is necessary
      also when going forward with other device descriptions such
      as ACPI.
      
      This is done by:
      
      - Adding a return code to gpiochip_add_pin_range() so we can
        reliably check whether this succeeds.
      
      - Get rid of the custom of_pinctrl_add_gpio_range() from
        pinctrl. Instead create of_pinctrl_get() to just retrive the
        pin controller per se from an OF node. This composite
        function was just begging to be deleted, it was way to
        purpose-specific.
      
      - Use pinctrl_dev_get_name() to get the name of the retrieved
        pin controller and use that to call back into the generic
        gpiochip_add_pin_range().
      
      Now the pin range is only allocated and tied to a pin
      controller from the core implementation in gpiolib.c.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1e63d7b9
    • L
      gpiolib: remove duplicate pin range code · e93fa3f2
      Linus Walleij 提交于
      Commit 69e1601bca88809dc118abd1becb02c15a02ec71
      "gpiolib: provide provision to register pin ranges"
      
      Introduced both of_gpiochip_remove_pin_range() and
      gpiochip_remove_pin_ranges(). But the contents are exactly
      the same so remove the OF one and rely on the range deletion
      in the core.
      Reviewed-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e93fa3f2
    • L
      gpiolib-of: staticize the pin range calls · 167c1af9
      Linus Walleij 提交于
      Commit 69e1601bca88809dc118abd1becb02c15a02ec71
      "gpiolib: provide provision to register pin ranges"
      
      Declared the of_gpiochip_[add|remove]_pin_range() global
      while they should be static as they are only ever used in
      this file. Let's convert them to static.
      Reviewed-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      167c1af9
    • 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
  31. 17 8月, 2012 1 次提交