1. 19 3月, 2015 1 次提交
  2. 23 9月, 2014 1 次提交
    • M
      gpio: Increase ARCH_NR_GPIOs to 512 · 7ca267fa
      Mika Westerberg 提交于
      Some newer Intel SoCs, like Braswell already have more than 256 GPIOs
      available so the default limit is exceeded. Instead of adding more
      architecture specific gpio.h files with custom ARCH_NR_GPIOs we increase
      the gpiolib default limit to be twice the current.
      
      Current generic ARCH_NR_GPIOS limit is 256 which starts to be too small
      for newer Intel SoCs like Braswell. In order to support GPIO controllers
      on these SoCs we increase ARCH_NR_GPIOS to be 512 which should be
      sufficient for now.
      
      The kernel size increases a bit with this change. Below is an example of
      x86_64 kernel image.
      
      ARCH_NR_GPIOS=256
       text     data    bss     dec      hex    filename
       11476173 1971328 1265664 14713165 e0814d vmlinux
      
      ARCH_NR_GPIOS=512
       text     data    bss     dec      hex    filename
       11476173 1971328 1269760 14717261 e0914d vmlinux
      
      So the BSS size and this the kernel image size increases by 4k.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7ca267fa
  3. 25 7月, 2014 1 次提交
  4. 23 7月, 2014 2 次提交
    • 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
  5. 07 2月, 2014 1 次提交
  6. 20 10月, 2013 1 次提交
    • A
      gpiolib: export descriptor-based GPIO interface · 79a9becd
      Alexandre Courbot 提交于
      This patch exports the gpiod_* family of API functions, a safer
      alternative to the legacy GPIO interface. Differences between the gpiod
      and legacy gpio APIs are:
      
      - gpio works with integers, whereas gpiod operates on opaque handlers
        which cannot be forged or used before proper acquisition
      - gpiod get/set functions are aware of the active low state of a GPIO
      - gpio consumers should now include <linux/gpio/consumer.h> to access
        the new interface, whereas chips drivers will use
        <linux/gpio/driver.h>
      
      The legacy gpio API is now built as inline functions on top of gpiod.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      79a9becd
  7. 16 10月, 2013 2 次提交
  8. 12 2月, 2013 1 次提交
  9. 09 2月, 2013 1 次提交
  10. 05 2月, 2013 1 次提交
  11. 22 1月, 2013 2 次提交
    • S
      gpio: devm_gpio_* support should not depend on GPIOLIB · 6a89a314
      Shawn Guo 提交于
      Some architectures (e.g. blackfin) provide gpio API without requiring
      GPIOLIB support (ARCH_WANT_OPTIONAL_GPIOLIB).  devm_gpio_* functions
      should also work for these architectures, since they do not really
      depend on GPIOLIB.
      
      Add a new option GPIO_DEVRES (enabled by default) to control the build
      of devres.c.  It also removes the empty version of devm_gpio_*
      functions for !GENERIC_GPIO build from linux/gpio.h, and moves the
      function declarations from asm-generic/gpio.h into linux/gpio.h.
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6a89a314
    • S
      gpio: fix warning of 'struct gpio_chip' declaration · d59b4eaa
      Shawn Guo 提交于
      The struct gpio_chip is only defined inside #ifdef CONFIG_GPIOLIB,
      but it's referenced by gpiochip_add_pin_range() and
      gpiochip_remove_pin_ranges() which are outside #ifdef CONFIG_GPIOLIB.
      Thus, we see the following warning when building blackfin image, where
      GPIOLIB is not required.
      
        CC      arch/blackfin/kernel/bfin_gpio.o
        CC      init/version.o
      In file included from arch/blackfin/include/asm/gpio.h:321,
                       from arch/blackfin/kernel/bfin_gpio.c:15:
      include/asm-generic/gpio.h:298: warning: 'struct gpio_chip' declared inside parameter list
      include/asm-generic/gpio.h:298: warning: its scope is only this definition or declaration, which is probably not what you want
      include/asm-generic/gpio.h:304: warning: 'struct gpio_chip' declared inside parameter list
      
      Move pinctrl trunk into #ifdef CONFIG_GPIOLIB to fix the warning,
      since it appears that pinctrl gpio range support depends on GPIOLIB.
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d59b4eaa
  12. 21 11月, 2012 2 次提交
  13. 12 11月, 2012 4 次提交
    • L
      gpiolib: iron out include ladder mistakes · 50309a9c
      Linus Walleij 提交于
      The <*/gpio.h> includes are updated again: now we need to account
      for the problem introduced by commit:
      595679a8038584df7b9398bf34f61db3c038bfea
      "gpiolib: fix up function prototypes etc"
      
      Actually we need static inlines in include/asm-generic/gpio.h
      as well since we may have GPIOLIB but not PINCTRL.
      Make sure to move all the CONFIG_PINCTRL business
      to the end of the file so we are sure we have
      declared struct gpio_chip.
      
      And we need to keep the static inlines in <linux/gpio.h>
      but here for the !CONFIG_GENERIC_GPIO case, and then we
      may as well throw in a few warnings like the other
      prototypes there, if someone would have the bad taste
      of compiling without GENERIC_GPIO even.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      50309a9c
    • 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: fix up function prototypes etc · 165adc9c
      Linus Walleij 提交于
      Commit 69e1601bca88809dc118abd1becb02c15a02ec71
      "gpiolib: provide provision to register pin ranges"
      
      Got most of it's function prototypes wrong, so fix this up by:
      
      - Moving the void declarations into static inlines in
        <linux/gpio.h> (previously the actual prototypes were declared
        here...)
      
      - Declare the gpiochip_add_pin_range() and
        gpiochip_remove_pin_ranges() functions in <asm-generic/gpio.h>
        together with the pin range struct declaration itself.
      
      - Actually only implement these very functions in gpiolib.c
        if CONFIG_PINCTRL is set.
      
      - Additionally export the symbols since modules will need to
        be able to do this.
      Reviewed-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      165adc9c
    • 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
  14. 26 10月, 2012 1 次提交
  15. 30 9月, 2012 1 次提交
  16. 19 5月, 2012 3 次提交
  17. 03 3月, 2012 1 次提交
  18. 05 1月, 2012 1 次提交
  19. 13 12月, 2011 2 次提交
    • G
      of: create of_phandle_args to simplify return of phandle parsing data · 15c9a0ac
      Grant Likely 提交于
      of_parse_phandle_with_args() needs to return quite a bit of data.  Rather
      than making each datum a separate **out_ argument, this patch creates
      struct of_phandle_args to contain all the returned data and reworks the
      user of the function.  This patch also enables of_parse_phandle_with_args()
      to return the device node pointer for the phandle node.
      
      This patch also ends up being fairly major surgery to
      of_parse_handle_with_args().  The existing structure didn't work well
      when extending to use of_phandle_args, and I discovered bugs during testing.
      I also took the opportunity to rename the function to be like the
      existing of_parse_phandle().
      
      v2: - moved declaration of of_phandle_args to fix compile on non-DT builds
          - fixed incorrect index in example usage
          - fixed incorrect return code handling for empty entries
      Reviewed-by: NShawn Guo <shawn.guo@freescale.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      15c9a0ac
    • G
      gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags() · 1a2d397a
      Grant Likely 提交于
      A large chunk of qe_pin_request() is unnecessarily cut-and-paste
      directly from of_get_named_gpio_flags().  This patch cuts out the
      duplicate code and replaces it with a call to of_get_gpio().
      
      v2: fixed compile error due to missing gpio_to_chip()
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      1a2d397a
  20. 27 10月, 2011 1 次提交
  21. 24 10月, 2011 1 次提交
  22. 16 6月, 2011 1 次提交
  23. 28 5月, 2011 1 次提交
  24. 27 5月, 2011 1 次提交
  25. 14 1月, 2011 2 次提交
  26. 28 10月, 2010 1 次提交
  27. 10 9月, 2010 1 次提交
  28. 06 7月, 2010 2 次提交
    • G
      of/gpio: stop using device_node data pointer to find gpio_chip · 594fa265
      Grant Likely 提交于
      Currently the kernel uses the struct device_node.data pointer to resolve
      a struct gpio_chip pointer from a device tree node.  However, the .data
      member doesn't provide any type checking and there aren't any rules
      enforced on what it should be used for.  There's no guarantee that the
      data stored in it actually points to an gpio_chip pointer.
      
      Instead of relying on the .data pointer, this patch modifies the code
      to add a lookup function which scans through the registered gpio_chips
      and returns the gpio_chip that has a pointer to the specified
      device_node.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Anton Vorontsov <avorontsov@ru.mvista.com>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: David Brownell <dbrownell@users.sourceforge.net>
      CC: Bill Gatliff <bgat@billgatliff.com>
      CC: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Jean Delvare <khali@linux-fr.org>
      CC: linux-kernel@vger.kernel.org
      CC: devicetree-discuss@lists.ozlabs.org
      594fa265
    • A
      of/gpio: Kill of_gpio_chip and add members directly to gpio_chip · a19e3da5
      Anton Vorontsov 提交于
      The OF gpio infrastructure is great for describing GPIO connections within
      the device tree.  However, using a GPIO binding still requires changes to
      the gpio controller just to add an of_gpio structure.  In most cases, the
      gpio controller doesn't actually need any special support and the simple
      OF gpio mapping function is more than sufficient.  Additional, the current
      scheme of using of_gpio_chip requires a convoluted scheme to maintain
      1:1 mappings between of_gpio_chip and gpio_chip instances.
      
      If the struct of_gpio_chip data members were moved into struct gpio_chip,
      then it would simplify the processing of OF gpio bindings, and it would
      make it trivial to use device tree OF connections on existing gpiolib
      controller drivers.
      
      This patch eliminates the of_gpio_chip structure and moves the relevant
      fields into struct gpio_chip (conditional on CONFIG_OF_GPIO).  This move
      simplifies the existing code and prepares for adding automatic device tree
      support to existing drivers.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Bill Gatliff <bgat@billgatliff.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      a19e3da5