1. 19 11月, 2015 5 次提交
  2. 17 10月, 2015 3 次提交
  3. 02 10月, 2015 1 次提交
  4. 25 9月, 2015 4 次提交
    • L
      gpio: keep the GPIO line names internal · f881bab0
      Linus Walleij 提交于
      This refactors the changes to the GPIO line naming mechanism to
      not have so widespread effects, instead we conclude the patch series
      by having created a name attribute in the GPIO descriptor, that need
      not be globally unique, and it will be initialized from the old
      .names array in struct gpio_chip if it exists, then used in the legacy
      sysfs code like the array was used previously.
      
      The associated changes to name lines from the device tree are
      controversial and need to stand alone from this. Resulting changes:
      
      1. Remove the export and the header for the gpio_name_to_desc() as so
      far the only use is inside gpiolib.c. Staticize gpio_name_to_desc()
      and move it above the only function using it.
      
      2. Only print a warning if there are two GPIO lines with the same name.
      The reason is to preserve current behaviour: before the previous
      changes to the naming mechanism this would not reject probing the
      driver, instead the error would occur when trying to export the line
      in sysfs, so restore this behaviour, but print a friendly warning
      if names collide.
      
      Cc: Johan Hovold <johan@kernel.org>
      Cc: Markus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f881bab0
    • M
      gpiolib: Add gpio name information to /sys/kernel/debug/gpio · ced433e2
      Markus Pargmann 提交于
      Add some information about gpio names to the debugfs gpio file. name and
      label of a GPIO are then displayed next to each other. This way it is
      easy to see what the real name of GPIO is and what the driver requested
      it for.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      [Dropped unsolicited sysfs ABI patch hunk]
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ced433e2
    • M
      gpiolib: Use GPIO name from names array for gpio descriptor · 5f3ca732
      Markus Pargmann 提交于
      This patch adds GPIO names to the GPIO descriptors when initializing the
      gpiochip. It also introduces a check whether any of the new names will
      conflict with an existing GPIO name.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5f3ca732
    • M
      gpio: Introduce gpio descriptor 'name' · c0017ed7
      Markus Pargmann 提交于
      The latest gpio hogging mechanism assigns each gpio a 'line-name' in the
      devicetree. The 'name' field is different from the 'label' field.
      'label' is only used for requested GPIOs to describe its current use by
      driver or userspace.
      
      The 'name' field describes the GPIO itself, not the use. This is most
      likely identical to the label in the schematic on the GPIO line and
      should help to find this particular GPIO.
      
      This is equivalent to the gpiochip->names array. However names should be
      stored in the GPIO descriptor. We will use gpiochip->names in the future
      only as initializer for the GPIO descriptors for drivers that assign
      GPIO names hardcoded. All other GPIO names will be parsed from DT and
      directly assigned to the GPIO descriptor.
      
      This patch adds a helper function to find gpio descriptors by name
      instead of gpio number.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c0017ed7
  5. 15 9月, 2015 2 次提交
    • R
      ACPI / property: Extend device_get_next_child_node() to data-only nodes · 504a3374
      Rafael J. Wysocki 提交于
      Make device_get_next_child_node() work with ACPI data-only subnodes
      introduced previously.
      
      Namely, replace acpi_get_next_child() with acpi_get_next_subnode()
      that can handle (and return) child device objects as well as child
      data-only subnodes of the given device and modify the ACPI part
      of the GPIO subsystem to handle data-only subnodes returned by it.
      
      To that end, introduce acpi_node_get_gpiod() taking a struct
      fwnode_handle pointer as the first argument.  That argument may
      point to an ACPI device object as well as to a data-only subnode
      and the function should do the right thing (ie. look for the matching
      GPIO descriptor correctly) in either case.
      
      Next, modify fwnode_get_named_gpiod() to use acpi_node_get_gpiod()
      instead of acpi_get_gpiod_by_index() which automatically causes
      devm_get_gpiod_from_child() to work with ACPI data-only subnodes
      that may be returned by device_get_next_child_node() which in turn
      is required by the users of that function (the gpio_keys_polled
      and gpio-leds drivers).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      504a3374
    • R
      ACPI / property: Extend fwnode_property_* to data-only subnodes · 3a7a2ab8
      Rafael J. Wysocki 提交于
      Modify is_acpi_node() to return "true" for ACPI data-only subnodes as
      well as for ACPI device objects and change the name of to_acpi_node()
      to to_acpi_device_node() so it is clear that it covers ACPI device
      objects only.  Accordingly, introduce to_acpi_data_node() to cover
      data-only subnodes in an analogous way.
      
      With that, make the fwnode_property_* family of functions work with
      ACPI data-only subnodes introduced previously.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      3a7a2ab8
  6. 14 9月, 2015 1 次提交
  7. 17 8月, 2015 1 次提交
    • G
      gpiolib: irqchip: use different lockdep class for each gpio irqchip · a0a8bcf4
      Grygorii Strashko 提交于
      Since IRQ chip helpers were introduced drivers lose ability to
      register separate lockdep classes for each registered GPIO IRQ
      chip and the gpiolib now is using shared lockdep class for
      all GPIO IRQ chips (gpiochip_irq_lock_class).
      As result, lockdep will produce warning when there are min two
      stacked GPIO chips and all of them are interrupt controllers.
      
      HW configuration which generates lockdep warning (TI dra7-evm):
      
      [SOC GPIO bankA.gpioX]
        <- irq - [pcf875x.gpioY]
                  <- irq - DevZ.enable_irq_wake(pcf_gpioY_irq);
      The issue was reported in [1] and discussed [2].
      
      =============================================
      [ INFO: possible recursive locking detected ]
      4.2.0-rc6-00013-g5d050ed-dirty #55 Not tainted
      ---------------------------------------------
      sh/63 is trying to acquire lock:
       (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      but task is already holding lock:
       (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(class);
        lock(class);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      7 locks held by sh/63:
       #0:  (sb_writers#4){.+.+.+}, at: [<c016bbb8>] vfs_write+0x13c/0x164
       #1:  (&of->mutex){+.+.+.}, at: [<c01debf4>] kernfs_fop_write+0x4c/0x1a0
       #2:  (s_active#36){.+.+.+}, at: [<c01debfc>] kernfs_fop_write+0x54/0x1a0
       #3:  (pm_mutex){+.+.+.}, at: [<c009758c>] pm_suspend+0xec/0x4c4
       #4:  (&dev->mutex){......}, at: [<c03f77f8>] __device_suspend+0xd4/0x398
       #5:  (&gpio->lock){+.+.+.}, at: [<c009b940>] __irq_get_desc_lock+0x74/0x94
       #6:  (class){......}, at: [<c009b91c>] __irq_get_desc_lock+0x50/0x94
      
      stack backtrace:
      CPU: 0 PID: 63 Comm: sh Not tainted 4.2.0-rc6-00013-g5d050ed-dirty #55
      Hardware name: Generic DRA74X (Flattened Device Tree)
      [<c0016e24>] (unwind_backtrace) from [<c0013338>] (show_stack+0x10/0x14)
      [<c0013338>] (show_stack) from [<c05f6b24>] (dump_stack+0x84/0x9c)
      [<c05f6b24>] (dump_stack) from [<c00903f4>] (__lock_acquire+0x19c0/0x1e20)
      [<c00903f4>] (__lock_acquire) from [<c0091098>] (lock_acquire+0xa8/0x128)
      [<c0091098>] (lock_acquire) from [<c05fd61c>] (_raw_spin_lock_irqsave+0x38/0x4c)
      [<c05fd61c>] (_raw_spin_lock_irqsave) from [<c009b91c>] (__irq_get_desc_lock+0x50/0x94)
      [<c009b91c>] (__irq_get_desc_lock) from [<c009c4f4>] (irq_set_irq_wake+0x20/0xfc)
      [<c009c4f4>] (irq_set_irq_wake) from [<c0393ac4>] (pcf857x_irq_set_wake+0x24/0x54)
      [<c0393ac4>] (pcf857x_irq_set_wake) from [<c009c560>] (irq_set_irq_wake+0x8c/0xfc)
      [<c009c560>] (irq_set_irq_wake) from [<c04a02ac>] (gpio_keys_suspend+0x70/0xd4)
      [<c04a02ac>] (gpio_keys_suspend) from [<c03f6a00>] (dpm_run_callback+0x50/0x124)
      [<c03f6a00>] (dpm_run_callback) from [<c03f7830>] (__device_suspend+0x10c/0x398)
      [<c03f7830>] (__device_suspend) from [<c03f90f0>] (dpm_suspend+0x134/0x2f4)
      [<c03f90f0>] (dpm_suspend) from [<c0096e20>] (suspend_devices_and_enter+0xa8/0x728)
      [<c0096e20>] (suspend_devices_and_enter) from [<c00977cc>] (pm_suspend+0x32c/0x4c4)
      [<c00977cc>] (pm_suspend) from [<c0096060>] (state_store+0x64/0xb8)
      [<c0096060>] (state_store) from [<c01dec64>] (kernfs_fop_write+0xbc/0x1a0)
      [<c01dec64>] (kernfs_fop_write) from [<c016b280>] (__vfs_write+0x20/0xd8)
      [<c016b280>] (__vfs_write) from [<c016bb0c>] (vfs_write+0x90/0x164)
      [<c016bb0c>] (vfs_write) from [<c016c330>] (SyS_write+0x44/0x9c)
      [<c016c330>] (SyS_write) from [<c000f500>] (ret_fast_syscall+0x0/0x54)
      
      Lets fix it by using separate lockdep class for each registered GPIO
      IRQ Chip. This is done by wrapping gpiochip_irqchip_add call into macros.
      
      The implementation of this patch inspired by solution done by Nicolas
      Boichat for regmap [3]
      
      [1] http://www.spinics.net/lists/linux-gpio/msg05844.html
      [2] http://www.spinics.net/lists/linux-gpio/msg06021.html
      [3] http://www.spinics.net/lists/arm-kernel/msg429834.html
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Roger Quadros <rogerq@ti.com>
      Reported-by: NRoger Quadros <rogerq@ti.com>
      Tested-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      a0a8bcf4
  8. 03 8月, 2015 1 次提交
  9. 28 7月, 2015 2 次提交
    • T
      gpio: defer probe if pinctrl cannot be found · 28355f81
      Tomeu Vizoso 提交于
      When an OF node has a pin range for its GPIOs, return -EPROBE_DEFER if
      the pin controller isn't available.
      
      Otherwise, the GPIO range wouldn't be set at all unless the pin
      controller probed always before the GPIO chip.
      
      With this change, the probe of the GPIO chip will be deferred and will
      be retried at a later point, hopefully once the pin controller has been
      registered and probed already.
      Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      28355f81
    • R
      gpio: kill off set_irq_flags usage · 23393d49
      Rob Herring 提交于
      set_irq_flags is ARM specific with custom flags which have genirq
      equivalents. Convert drivers to use the genirq interfaces directly, so we
      can kill off set_irq_flags. The translation of flags is as follows:
      
      IRQF_VALID -> !IRQ_NOREQUEST
      IRQF_PROBE -> !IRQ_NOPROBE
      IRQF_NOAUTOEN -> IRQ_NOAUTOEN
      
      For IRQs managed by an irqdomain, the irqdomain core code handles clearing
      and setting IRQ_NOREQUEST already, so there is no need to do this in
      .map() functions and we can simply remove the set_irq_flags calls. Some
      users also modify IRQ_NOPROBE and this has been maintained although it
      is not clear that is really needed as most platforms don't use probing.
      There appears to be a great deal of blind copy and paste of this code.
      Signed-off-by: NRob Herring <robh@kernel.org>
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      23393d49
  10. 27 7月, 2015 1 次提交
  11. 21 7月, 2015 1 次提交
  12. 16 7月, 2015 3 次提交
  13. 14 7月, 2015 1 次提交
  14. 06 7月, 2015 1 次提交
  15. 25 6月, 2015 1 次提交
  16. 16 6月, 2015 1 次提交
  17. 10 6月, 2015 2 次提交
  18. 01 6月, 2015 1 次提交
  19. 19 5月, 2015 1 次提交
  20. 13 5月, 2015 1 次提交
  21. 12 5月, 2015 3 次提交
  22. 19 3月, 2015 1 次提交
  23. 05 3月, 2015 2 次提交