1. 25 9月, 2014 2 次提交
  2. 24 9月, 2014 9 次提交
  3. 23 9月, 2014 10 次提交
  4. 19 9月, 2014 1 次提交
  5. 17 9月, 2014 3 次提交
    • G
      gpio: syscon: reuse for keystone 2 socs · 2134cb99
      Grygorii Strashko 提交于
      On Keystone SOCs, ARM host can send interrupts to DSP cores using the
      DSP GPIO controller IP. Each DSP GPIO controller provides 28 IRQ signals for
      each DSP core. This is one of the component used by the IPC mechanism used
      on Keystone SOCs.
      
      Keystone 2 DSP GPIO controller has specific features:
      - each GPIO can be configured only as output pin;
      - setting GPIO value to 1 causes IRQ generation on target DSP core;
      - reading pin value returns 0 - if IRQ was handled or 1 - IRQ is still
        pending.
      
      This patch updates gpio-syscon driver to be reused by Keystone 2 SoCs,
      because the Keystone 2 DSP GPIO controller is controlled through Syscon
      devices and, as requested by Linus Walleij, such kind of GPIO controllers
      should be integrated with drivers/gpio/gpio-syscon.c driver.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2134cb99
    • G
      gpio: syscon: retrive syscon node and regs offsets from dt · 5a3e3f88
      Grygorii Strashko 提交于
      This patch adds handling of new "gpio,syscon-dev" DT property,
      which allows to specify syscon node and data/direction registers
      offsets in DT.
      
      "gpio,syscon-dev" has following format:
      	gpio,syscon-dev = <&syscon_dev data_reg_offset [direction_reg_offset]>;
      
      where
       - syscon_dev - phandle on syscon node
       - data_reg_offset - offset of data register (in bytes)
       - direction_reg_offset - offset of dirrection register (optional, in bytes)
      
      for example:
      	gpio,syscon-dev = <&devctrl 0x254>;
      
      In such way, the support of multiple Syscon GPIO devices is added.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5a3e3f88
    • G
      gpio: syscon: add soc specific callback to assign output value · 2c341d62
      Grygorii Strashko 提交于
      Some SoCs (like Keystone) may require to perform special
      sequence of operations to assign output GPIO value, so default
      implementation of .set() callback from gpio-syscon driver
      can't be used.
      
      Hence, add optional, SoC specific callback to assign output
      gpio value.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2c341d62
  6. 05 9月, 2014 3 次提交
  7. 03 9月, 2014 1 次提交
  8. 02 9月, 2014 1 次提交
  9. 29 8月, 2014 4 次提交
  10. 28 8月, 2014 2 次提交
  11. 21 8月, 2014 1 次提交
  12. 17 8月, 2014 3 次提交
    • J
      gpio: delete unneeded test before of_node_put · 8a691550
      Julia Lawall 提交于
      Of_node_put supports NULL as its argument, so the initial test is not
      necessary.
      
      Suggested by Uwe Kleine-König.
      
      The semantic patch that fixes this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression e;
      @@
      
      -if (e)
         of_node_put(e);
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      8a691550
    • L
      gpio: zynq: Fix IRQ handlers · 6dd85950
      Lars-Peter Clausen 提交于
      The Zynq GPIO interrupt handling code as two main issues:
      1) It does not support IRQF_ONESHOT interrupt since it uses handle_simple_irq()
      for the interrupt handler. handle_simple_irq() does not do masking and unmasking
      of the IRQ that is required for this chip to be able to support IRQF_ONESHOT
      IRQs, causing the CPU to lock up in a interrupt storm if such a interrupt is
      requested.
      2) Interrupts are acked after the primary interrupt handlers for all asserted
      interrupts in a bank have been called. For edge triggered interrupt this is to
      late and may cause a interrupt to be missed. For level triggered oneshot
      interrupts this is to early and causes the interrupt handler to run twice per
      interrupt.
      
      This patch addresses the issue by updating the driver to use the correct IRQ
      chip handler functions that are appropriate for this kind of IRQ controller.
      
      The following diagram gives an overview of how the interrupt detection circuit
      works, it is not necessarily a accurate depiction of the real hardware though.
      
           INT_POL/INT_ON_ANY
                 |
                 | +---+                       INT_STATUS
                 `-|   |                            |
                   | E |-.                          |
               ,---|   |  \     |\          +----+  |  +---+
               |   +---+   `----| | ,-------|S   | ,*--|   |
      GPIO_IN -*                | |-        |   Q|-    | & |-- IRQ_OUT
               |   +---+  ,-----| |       ,-|R   |   ,o|   |
               `---|   | /      |/       |  +----+  |  +---+
                   | = |-        |       |          |
                 ,-|   |    INT_TYPE    ACK     INT_MASK
                 | +---+
                 |
              INT_POL
      
      GPIO_IN is the raw signal level connected to the hardware pin. This signal is
      routed to a edge detector and to a level detector. The edge detector can be
      configured to either detect a rising or falling edge or both edges. The level
      detector can detect either a level high or level low event. Depending on the
      setting of the INT_TYPE register either the edge or level event will be
      propagated to the INT_STATUS register. As long as a interrupt condition is
      detected the INT_STATUS register will be set to 1. It can be cleared to 0 if
      (and only if) the interrupt condition is no longer detected and software
      acknowledges the interrupt by writing a 1 to the address of the INT_STATUS
      register. There is also the INT_MASK register which can be used to disable the
      propagation of the INT_STATUS signal to the upstream IRQ controller. What is
      important to note is that the interrupt detection logic itself can not be
      disabled, only the propagation of the INT_STATUS register can be delayed. This
      means that for level type interrupts the interrupt must only be acknowledged
      after the interrupt source has been cleared otherwise it will stay asserted and
      the interrupt handler will be run a second time. For IRQF_ONESHOT interrupts
      this means that the IRQ must only be acknowledged after the threaded interrupt
      has finished running. If a second interrupt comes in between handling the first
      interrupt and acknowledging it the external interrupt will be asserted, which
      means trying to acknowledge the first interrupt will not clear the INT_STATUS
      register and the interrupt handler will be run a second time when the IRQ is
      unmasked, so no interrupts will be lost. The handle_fasteoi_irq() handler in
      combination with the IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED flags will
      have the desired behavior. For edge triggered interrupts a slightly different
      strategy is necessary. For edge triggered interrupts the interrupt condition is
      only true when the edge itself is detected, this means this is the only time the
      INT_STATUS register is set, acknowledging the interrupt any time after that will
      clear the INT_STATUS register until the next interrupt happens. This means in
      order to not loose any interrupts the interrupt needs to be acknowledged before
      running the interrupt handler. If a second interrupt occurs after the first
      interrupt handler has finished but before the interrupt is unmasked the
      INT_STATUS register will be re-asserted and the interrupt handler runs a second
      time once the interrupt is unmasked. This means with this flow handling strategy
      no interrupts are lost for edge triggered interrupts. The handle_level_irq()
      handler will have the desired behavior. (Note: The handle_edge_irq() only needs
      to be used for edge triggered interrupts where the controller stops detecting
      the interrupt event when the interrupt is masked, for this controller the
      detection logic still works, while only the propagation is delayed when the
      interrupt is masked.)
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NSoren Brinkmann <soren.brinkmann@xilinx.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6dd85950
    • J
      gpiolib: devres: use correct structure type name in sizeof · 0f05a3ae
      Julia Lawall 提交于
      Correct typo in the name of the type given to sizeof.  Because it is the
      size of a pointer that is wanted, the typo has no impact on compilation or
      execution.
      
      This problem was found using Coccinelle (http://coccinelle.lip6.fr/).  The
      semantic patch used can be found in message 0 of this patch series.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0f05a3ae