1. 14 8月, 2017 1 次提交
    • R
      gpio: Convert to using %pOF instead of full_name · 7eb6ce2f
      Rob Herring 提交于
      Now that we have a custom printf format specifier, convert users of
      full_name to use %pOF instead. This is preparation to remove storing
      of the full path string for each node.
      Signed-off-by: NRob Herring <robh@kernel.org>
      Cc: Tien Hock Loh <thloh@altera.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: NGregory Fong <gregory.0xf0@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7eb6ce2f
  2. 16 6月, 2017 1 次提交
  3. 29 5月, 2017 1 次提交
  4. 07 4月, 2017 1 次提交
    • L
      gpio: core: Decouple open drain/source flag with active low/high · 4c0facdd
      Laxman Dewangan 提交于
      Currently, the GPIO interface is said to Open Drain if it is Single
      Ended and active LOW. Similarly, it is said as Open Source if it is
      Single Ended and active HIGH.
      
      The active HIGH/LOW is used in the interface for setting the pin
      state to HIGH or LOW when enabling/disabling the interface.
      
      In Open Drain interface, pin is set to HIGH by putting pin in
      high impedance and LOW by driving to the LOW.
      
      In Open Source interface, pin is set to HIGH by driving pin to
      HIGH and set to LOW by putting pin in high impedance.
      
      With above, the Open Drain/Source is unrelated to the active LOW/HIGH
      in interface. There is interface where the enable/disable of interface
      is ether active LOW or HIGH but it is Open Drain type.
      
      Hence decouple the Open Drain with Single Ended + Active LOW and
      Open Source with Single Ended + Active HIGH.
      
      Adding different flag for the Open Drain/Open Source which is valid
      only when Single ended flag is enabled.
      Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4c0facdd
  5. 30 12月, 2016 1 次提交
  6. 01 11月, 2016 1 次提交
    • M
      gpio: of: fix GPIO drivers with multiple gpio_chip for a single node · c7e9d398
      Masahiro Yamada 提交于
      Sylvain Lemieux reports the LPC32xx GPIO driver is broken since
      commit 762c2e46 ("gpio: of: remove of_gpiochip_and_xlate() and
      struct gg_data").  Probably, gpio-etraxfs.c and gpio-davinci.c are
      broken too.
      
      Those drivers register multiple gpio_chip that are associated to a
      single OF node, and their own .of_xlate() checks if the passed
      gpio_chip is valid.
      
      Now, the problem is of_find_gpiochip_by_node() returns the first
      gpio_chip found to match the given node.  So, .of_xlate() fails,
      except for the first GPIO bank.
      
      Reverting the commit could be a solution, but I do not want to go
      back to the mess of struct gg_data.  Another solution here is to
      take the match by a node pointer and the success of .of_xlate().
      It is a bit clumsy to call .of_xlate twice; for gpio_chip matching
      and for really getting the gpio_desc index.  Perhaps, our long-term
      goal might be to convert the drivers to single chip registration,
      but this commit will solve the problem until then.
      
      Fixes: 762c2e46 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reported-by: NSylvain Lemieux <slemieux.tyco@gmail.com>
      Tested-by: NDavid Lechner <david@lechnology.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c7e9d398
  7. 31 10月, 2016 1 次提交
  8. 24 10月, 2016 1 次提交
  9. 03 10月, 2016 1 次提交
    • L
      gpio: OF: separation of concerns · ea713bc4
      Linus Walleij 提交于
      The generic GPIO library directly implement code for of_find_gpio()
      which is only used with CONFIG_OF and causes compilation problems
      on archs that do not even have stubs for OF functions, especially
      on UM that does not implement any IO remap functions.
      
      Move the function to gpiolib-of.c, implement a static inline stub
      in gpiolib.h returning PTR_ERR(-ENOENT) if CONFIG_OF_GPIO is not
      set and be done with it.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ea713bc4
  10. 08 9月, 2016 1 次提交
  11. 23 6月, 2016 5 次提交
  12. 08 6月, 2016 1 次提交
  13. 07 6月, 2016 1 次提交
  14. 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
  15. 14 4月, 2016 1 次提交
  16. 13 4月, 2016 1 次提交
  17. 05 1月, 2016 1 次提交
  18. 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
  19. 25 9月, 2015 1 次提交
  20. 28 7月, 2015 1 次提交
  21. 16 7月, 2015 2 次提交
  22. 19 5月, 2015 1 次提交
  23. 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
  24. 23 2月, 2015 1 次提交
  25. 16 1月, 2015 2 次提交
  26. 17 8月, 2014 1 次提交
  27. 23 7月, 2014 2 次提交
  28. 09 7月, 2014 1 次提交
  29. 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
  30. 29 4月, 2014 1 次提交
  31. 06 2月, 2014 1 次提交
  32. 20 10月, 2013 1 次提交
  33. 16 10月, 2013 1 次提交