1. 13 Mar, 2014 4 commits
    • Mika Westerberg's avatar
      gpio / ACPI: Rework ACPI GPIO event handling · 6072b9dc
      Mika Westerberg authored
      The current ACPI GPIO event handling code was never tested against real
      hardware with functioning GPIO triggered events (at the time such hardware
      wasn't available). Thus it misses certain things like requesting the GPIOs
      properly, passing correct flags to the interrupt handler and so on.
      
      This patch reworks ACPI GPIO event handling so that we:
      
       1) Use struct acpi_gpio_event for all GPIO signaled events.
       2) Switch to use GPIO descriptor API and request GPIOs by calling
          gpiochip_request_own_desc() that we added in a previous patch.
       3) Pass proper flags from ACPI GPIO resource to request_threaded_irq().
      
      Also instead of open-coding the _AEI iteration loop we can use
      acpi_walk_resources(). This simplifies the code a bit and fixes memory leak
      that was caused by missing kfree() for buffer returned by
      acpi_get_event_resources().
      
      Since the remove path now calls gpiochip_free_own_desc() which takes GPIO
      spinlock we need to call acpi_gpiochip_remove() outside of that lock
      (analogous to acpi_gpiochip_add() path where the lock is released before
      those funtions are called).
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      6072b9dc
    • Mika Westerberg's avatar
      gpio / ACPI: Rename acpi_gpio_evt_pin to acpi_gpio_event · 4b01a14b
      Mika Westerberg authored
      In order to consolidate _Exx, _Lxx and _EVT to use the same structure make
      the structure name to reflect that we are dealing with any event, not just
      _EVT.
      
      This is just rename, no functional changes.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      4b01a14b
    • Mika Westerberg's avatar
      gpio / ACPI: Allocate ACPI specific data directly in acpi_gpiochip_add() · aa92b6f6
      Mika Westerberg authored
      We are going to add more ACPI specific data to accompany GPIO chip so
      instead of allocating it per each use-case we allocate it once when
      acpi_gpiochip_add() is called and release it when acpi_gpiochip_remove() is
      called.
      
      Doing this allows us to add more ACPI specific data by merely adding new
      fields to struct acpi_gpio_chip.
      
      In addition we embed evt_pins member directly to the structure instead of
      having it as a pointer. This simplifies the code a bit since we don't need
      to check against NULL.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      aa92b6f6
    • Mika Westerberg's avatar
      gpiolib: Allow GPIO chips to request their own GPIOs · 77c2d792
      Mika Westerberg authored
      Sometimes it is useful to allow GPIO chips themselves to request GPIOs they
      own through gpiolib API. One use case is ACPI ASL code that should be able
      to toggle GPIOs through GPIO operation regions.
      
      We can't use gpio_request() because it will pin the module to the kernel
      forever (it calls try_module_get()). To solve this we move module refcount
      manipulation to gpiod_request() and let __gpiod_request() handle the actual
      request. This changes the sequence a bit as now try_module_get() is called
      outside of gpio_lock (I think this is safe, try_module_get() handles
      serialization it needs already).
      
      Then we provide gpiolib internal functions gpiochip_request/free_own_desc()
      that do the same as gpio_request() but don't manipulate module refrence
      count. This allows the GPIO chip driver to request and free descriptors it
      owns without being pinned to the kernel forever.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      77c2d792
  2. 12 Mar, 2014 6 commits
  3. 11 Mar, 2014 2 commits
  4. 07 Mar, 2014 4 commits
  5. 06 Mar, 2014 1 commit
  6. 05 Mar, 2014 2 commits
    • Arnd Bergmann's avatar
      gpio: remove obsolete tnetv107x driver · de15011a
      Arnd Bergmann authored
      The tnetv107x platform is getting removed, so this driver won't
      be needed any more.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Acked-by: default avatarSekhar Nori <nsekhar@ti.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      de15011a
    • Jamie Iles's avatar
      gpio: add a driver for the Synopsys DesignWare APB GPIO block · 7779b345
      Jamie Iles authored
      The Synopsys DesignWare block is used in some ARM devices (picoxcell)
      and can be configured to provide multiple banks of GPIO pins.
      
      v12: - Add irq_startup/shutdown
           - do irq_create_mapping() in probe, irq_find_mapping() in to_irq()
           - Adjust mappings to show support for 1 gpio per port.
           - gpio-cells = <1>
      v11: - Use NULL when checking existence of 'interrupts' property
           - Bindings descriptions cleanup
      v10: - in documentation nr-gpio -> nr-gpios
      v9:  - cleanup in dt bindings doc
           - use of_get_child_count()
      v8:  - remove socfpga.dtsi changes
           - minor cleanup in devicetree documentation
      v7:  - use irq_generic_chip
           - support one irq per gpio line or one irq for many
           - s/bank/port/ and other cleanup
      v6:  - (atull) squash the set of patches
           - use linear irq domain
           - build fixes. Original driver was reviewed on v3.2.
           - Fix setting irq edge type for 'rising' and 'both'.
           - Support as a loadable module.
           - Use bgpio_chip's spinlock during register access.
           - Clean up register names to match spec
           - s/bank/port/ because register names use the word 'port'
           - s/nr-gpio/nr-gpios/
           - don't get/put the of_node
           - remove signoffs/acked-by's because of changes
           - other cleanup
      v5:  - handle sparse bank population correctly
      v3:  - depend on rather than select IRQ_DOMAIN
           - split IRQ support into a separate patch
      v2:  - use Rob Herring's irqdomain in generic irq chip patches
           - use reg property to indicate bank index
           - support irqs on both edges based on LinusW's u300 driver
      Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
      Signed-off-by: default avatarAlan Tull <atull@altera.com>
      Reviewed-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7779b345
  7. 04 Mar, 2014 1 commit
  8. 27 Feb, 2014 3 commits
  9. 24 Feb, 2014 4 commits
  10. 13 Feb, 2014 7 commits
  11. 12 Feb, 2014 6 commits