1. 16 10月, 2013 1 次提交
  2. 12 2月, 2013 1 次提交
  3. 09 2月, 2013 1 次提交
  4. 05 2月, 2013 1 次提交
  5. 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
  6. 21 11月, 2012 2 次提交
  7. 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
  8. 26 10月, 2012 1 次提交
  9. 30 9月, 2012 1 次提交
  10. 19 5月, 2012 3 次提交
  11. 03 3月, 2012 1 次提交
  12. 05 1月, 2012 1 次提交
  13. 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
  14. 27 10月, 2011 1 次提交
  15. 24 10月, 2011 1 次提交
  16. 16 6月, 2011 1 次提交
  17. 28 5月, 2011 1 次提交
  18. 27 5月, 2011 1 次提交
  19. 14 1月, 2011 2 次提交
  20. 28 10月, 2010 1 次提交
  21. 10 9月, 2010 1 次提交
  22. 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
  23. 28 5月, 2010 3 次提交
  24. 07 3月, 2010 1 次提交
  25. 16 12月, 2009 1 次提交
  26. 11 12月, 2009 1 次提交
    • M
      asm-generic/gpio.h: add some forward decls of the device struct · 1f018c8d
      Mike Frysinger 提交于
      After the recent commit a4177ee7, attempting to include asm-generic/gpio.h
      in otherwise "slim" code results in ugly warnings like so:
      
        CC      arch/blackfin/kernel/bfin_gpio.o
      In file included from arch/blackfin/include/asm/gpio.h:278,
                       from arch/blackfin/kernel/bfin_gpio.c:15:
      include/asm-generic/gpio.h:193: warning:
      ‘struct device’ declared inside parameter list
      its scope is only this definition or declaration, which is probably not what you want
      
      So add simple C forward decls of the struct device to avoid these.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      1f018c8d
  27. 02 10月, 2009 1 次提交
  28. 23 9月, 2009 1 次提交