1. 29 5月, 2017 1 次提交
  2. 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
  3. 04 10月, 2016 1 次提交
  4. 05 1月, 2016 1 次提交
  5. 04 1月, 2016 1 次提交
    • A
      gpiolib: always initialize *flags from of_get_named_gpio_flags · 427e0dc5
      Arnd Bergmann 提交于
      The of_get_named_gpio_flags() function does nothing other than returning
      an error when CONFIG_OF_GPIO is disabled, but that causes spurious
      warnings about possible use of uninitialized variables in any code that
      does not check the of_get_named_gpio_flags() return value before trying
      to use the flags:
      
      drivers/input/misc/rotary_encoder.c: In function 'rotary_encoder_probe':
      drivers/input/misc/rotary_encoder.c:223:28: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      drivers/power/bq24735-charger.c: In function 'bq24735_charger_probe':
      drivers/power/bq24735-charger.c:227:12: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      drivers/power/sbs-battery.c: In function 'sbs_probe':
      drivers/power/sbs-battery.c:782:17: warning: 'gpio_flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      This changes the behavior of the inline helper to set the flags to zero
      when OF_GPIO is disabled, to avoid the warnings. In all cases I've
      encountered, we don't actually get to the place that uses the flags
      if CONFIG_OF is disabled because we won't enter the DT parser code.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      427e0dc5
  6. 17 10月, 2015 1 次提交
  7. 28 7月, 2015 1 次提交
  8. 16 1月, 2015 1 次提交
  9. 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
  10. 30 10月, 2013 1 次提交
  11. 20 10月, 2013 1 次提交
  12. 13 2月, 2013 1 次提交
  13. 19 5月, 2012 1 次提交
  14. 06 2月, 2012 1 次提交
  15. 13 12月, 2011 1 次提交
    • 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
  16. 29 7月, 2011 1 次提交
  17. 29 6月, 2011 1 次提交
  18. 06 7月, 2010 3 次提交
    • A
      of/gpio: add default of_xlate function if device has a node pointer · 391c970c
      Anton Vorontsov 提交于
      Implement generic OF gpio hooks and thus make device-enabled GPIO chips
      (i.e.  the ones that have gpio_chip->dev specified) automatically attach
      to the OpenFirmware subsystem.  Which means that now we can handle I2C and
      SPI GPIO chips almost* transparently.
      
      * "Almost" because some chips still require platform data, and for these
        chips OF-glue is still needed, though with this change the glue will
        be much smaller.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NGrant 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: Andrew Morton <akpm@linux-foundation.org>
      CC: linux-kernel@vger.kernel.org
      CC: devicetree-discuss@lists.ozlabs.org
      391c970c
    • 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
  19. 21 12月, 2008 1 次提交
  20. 03 12月, 2008 1 次提交
  21. 22 7月, 2008 1 次提交
  22. 17 4月, 2008 1 次提交