1. 10 9月, 2018 3 次提交
    • H
      gpiolib: add flag to indicate if the irq is disabled · 4e9439dd
      Hans Verkuil 提交于
      GPIO drivers call gpiochip_(un)lock_as_irq whenever they want to use a gpio
      as an interrupt. This is done when the irq is requested and it marks the
      gpio as in use by an interrupt.
      
      This is problematic for cases where a gpio pin is used as an interrupt
      pin, then, after the irq is disabled, is used as a regular gpio pin.
      Currently it is not possible to do this other than by first freeing
      the interrupt so gpiochip_unlock_as_irq is called, since an attempt to
      switch the gpio direction for output will fail since gpiolib believes
      that the gpio is in use for an interrupt and it does not know that it
      the irq is actually disabled.
      
      There are currently two drivers that would like to be able to do this:
      the tda998x_drv.c driver where a regular gpio pin needs to be temporarily
      reconfigured as an interrupt pin during CEC calibration, and the cec-gpio
      driver where you want to configure the gpio pin as an interrupt while
      waiting for traffic over the CEC bus, or as a regular pin when receiving or
      transmitting a CEC message.
      
      The solution is to add a new flag that is set when the irq is enabled,
      and have gpiod_direction_output check for that flag.
      
      We also add functions that drivers that do not use GPIOLIB_IRQCHIP
      can call when they enable/disable the irq.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4e9439dd
    • H
      gpiolib: export gpiochip_irq_reqres/relres() · 4e6b8238
      Hans Verkuil 提交于
      GPIO drivers that do not use GPIOLIB_IRQCHIP can hook these into
      the irq_request_resource and irq_release_resource callbacks of the
      irq_chip so they correctly 'get' the module and lock the gpio line
      for IRQ use.
      
      This will simplify driver code.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4e6b8238
    • R
      gpio: fix kernel-doc notation warning for 'request_key' · 02ad0437
      Randy Dunlap 提交于
      Fix kernel-doc warning for missing struct member 'request_key':
      
      ../include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip'
      
      Fixes: 39c3fd58 ("kernel/irq: Extend lockdep class for request mutex")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      02ad0437
  2. 04 9月, 2018 2 次提交
  3. 24 8月, 2018 6 次提交
  4. 23 8月, 2018 29 次提交