27 Jul, 2015

1 commit


16 Jul, 2015

1 commit

  • Currently gpio modules are runtime-resumed at probe time. This means the
    gpio module will be active all the time (except during system suspend,
    if not configured as a wake-up source).

    While an R-Car Gen2 gpio module retains pins configured for output at
    the requested level while put in standby mode, gpio registercannot be
    accessed while suspended. Unfortunately pm_runtime_get_sync() cannot be
    called from all contexts where gpio register access is needed. Hence
    move the Runtime PM handling from probe/remove time to gpio request/free
    time, which is probably the best we can do.

    On r8a7791/koelsch, gpio modules 0, 1, 3, and 4 are now suspended during
    normal use (gpio2 is used for LEDs and regulators, gpio5 for keys, gpio6
    for SD-Card CD & WP, gpio7 for keys and regulators).

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij

    Geert Uytterhoeven
     

01 Jun, 2015

1 commit

  • If an interrupt controller doesn't support wake-up configuration,
    irq_set_irq_wake() returns an error code. Then any subsequent call
    trying to deconfigure wake-up will cause an imbalance, and a warning
    will be printed:

    WARNING: CPU: 1 PID: 1341 at kernel/irq/manage.c:540 irq_set_irq_wake+0x9c/0xf8()
    Unbalanced IRQ 26 wake disable

    To fix this, refrain from any further parent interrupt controller
    (de)configuration if irq_set_irq_wake() failed.

    Alternative fixes would be:
    - calling "gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE)" from the
    platform code,
    - setting "gic_chip.flags = IRQCHIP_SKIP_SET_WAKE" in the GIC driver
    code,
    but these were withheld as the GIC hardware doesn't really support
    wake-up interrupts.

    Fixes: ab82fa7da4dce5c7 ("gpio: rcar: Prevent module clock disable when wake-up is enabled")
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij

    Geert Uytterhoeven
     

26 Mar, 2015

3 commits


16 Jan, 2015

2 commits


27 Nov, 2014

1 commit


09 Aug, 2014

1 commit

  • Pull GPIO update from Linus Walleij:
    "This is the bulk of GPIO changes for the v3.17 development cycle, and
    this time we got a lot of action going on and it will continue:

    - The core GPIO library implementation has been split up in three
    different files:
    - gpiolib.c for the latest and greatest and shiny GPIO library code
    using GPIO descriptors only
    - gpiolib-legacy.c for the old integer number space API that we are
    phasing out gradually
    - gpiolib-sysfs.c for the sysfs interface that we are not entirely
    happy with, but has to live on for ABI compatibility

    - Add a flags argument to *gpiod_get* functions, with some
    backward-compatibility macros to ease transitions. We should have
    had the flags there from the beginning it seems, now we need to
    clean up the mess. There is a plan on how to move forward here
    devised by Alexandre Courbot and Mark Brown

    - Split off a special header for the board
    gpio table registration, as per example from the regulator
    subsystem

    - Start to kill off the return value from gpiochip_remove() by
    removing the __must_check attribute and removing all checks inside
    the drivers/gpio directory. The rationale is: well what were we
    supposed to do if there is an error code? Not much: print an error
    message. And gpiolib already does that. So make this function
    return void eventually

    - Some cleanups of hairy gpiolib code, make some functions not to be
    used outside the library private and make sure they are not
    exported, remove gpiod_lock/unlock_as_irq() as the existing
    function is for driver-internal use and fine as it is, delete
    gpio_ensure_requested() as it is not meaningful anymore

    - Support the GPIOF_ACTIVE_LOW flag from gpio_request_one() function
    calls, which is logical since this is already supported when
    referencing GPIOs from e.g. device trees

    - Switch STMPE, intel-mid, lynxpoint and ACPI (!) to use the gpiolib
    irqchip helpers cutting down on GPIO irqchip boilerplate a bit more

    - New driver for the Zynq GPIO block

    - The usual incremental improvements around a bunch of drivers

    - Janitorial syntactic and semantic cleanups by Jingoo Han, and
    Rickard Strandqvist especially"

    * tag 'gpio-v3.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (37 commits)
    MAINTAINERS: update GPIO include files
    gpio: add missing includes in machine.h
    gpio: add flags argument to gpiod_get*() functions
    MAINTAINERS: Update Samsung pin control entry
    gpio / ACPI: Move event handling registration to gpiolib irqchip helpers
    gpio: lynxpoint: Convert to use gpiolib irqchip
    gpio: split gpiod board registration into machine header
    gpio: remove gpio_ensure_requested()
    gpio: remove useless check in gpiolib_sysfs_init()
    gpiolib: Export gpiochip_request_own_desc and gpiochip_free_own_desc
    gpio: move gpio_ensure_requested() into legacy C file
    gpio: remove gpiod_lock/unlock_as_irq()
    gpio: make gpiochip_get_desc() gpiolib-private
    gpio: simplify gpiochip_export()
    gpio: remove export of private of_get_named_gpio_flags()
    gpio: Add support for GPIOF_ACTIVE_LOW to gpio_request_one functions
    gpio: zynq: Clear pending interrupt when enabling a IRQ
    gpio: drop retval check enforcing from gpiochip_remove()
    gpio: remove all usage of gpio_remove retval in driver/gpio
    devicetree: Add Zynq GPIO devicetree bindings documentation
    ...

    Linus Torvalds
     

22 Jul, 2014

1 commit


16 Jul, 2014

1 commit


09 Jul, 2014

1 commit


09 May, 2014

1 commit


29 Apr, 2014

1 commit


29 Mar, 2014

1 commit


22 Jan, 2014

1 commit

  • Pull GPIO tree bulk changes from Linus Walleij:
    "A big set this merge window, as we have much going on in this
    subsystem. The changes to other subsystems (notably a slew of ARM
    machines as I am doing away with their custom APIs) have all been
    ACKed to the extent possible.

    Major changes this time:

    - Some core improvements and cleanups to the new GPIO descriptor API.
    This seems to be working now so we can start the exodus to this
    API, moving gradually away from the global GPIO numberspace.

    - Incremental improvements to the ACPI GPIO core, and move the few
    GPIO ACPI clients we have to the GPIO descriptor API right *now*
    before we go any further. We actually managed to contain this
    *before* we started to litter the kernel with yet another hackish
    global numberspace for the ACPI GPIOs, which is a big win.

    - The RFkill GPIO driver and all platforms using it have been
    migrated to use the GPIO descriptors rather than fixed number
    assignments. Tegra machine has been migrated as part of this.

    - New drivers for MOXA ART, Xtensa GPIO32 and SMSC SCH311x. Those
    should be really good examples of how I expect a nice GPIO driver
    to look these days.

    - Do away with custom GPIO implementations on a major part of the ARM
    machines: ks8695, lpc32xx, mv78xx0. Make a first step towards the
    same in the horribly convoluted Samsung S3C include forest. We
    expect to continue to clean this up as we move forward.

    - Flag GPIO lines used for IRQ on adnp, bcm-kona, em, intel-mid and
    lynxpoint.

    This makes the GPIOlib core aware that a certain GPIO line is used
    for IRQs and can then enforce some semantics such as disallowing a
    GPIO line marked as in use for IRQ to be switched to output mode.

    - Drop all use of irq_set_chip_and_handler_name(). The name provided
    in these cases were just unhelpful tags like "mux" or "demux".

    - Extend the MCP23s08 driver to handle interrupts.

    - Minor incremental improvements for rcar, lynxpoint, em 74x164 and
    msm drivers.

    - Some non-urgent bug fixes here and there, duplicate #includes and
    that usual kind of cleanups"

    Fix up broken Kconfig file manually to make this all compile.

    * tag 'gpio-v3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (71 commits)
    gpio: mcp23s08: fix casting caused build warning
    gpio: mcp23s08: depend on OF_GPIO
    gpio: mcp23s08: Add irq functionality for i2c chips
    ARM: S5P[v210|c100|64x0]: Fix build error
    gpio: pxa: clamp gpio get value to [0,1]
    ARM: s3c24xx: explicit dependency on
    ARM: S3C[24|64]xx: move includes back under scope
    Documentation / ACPI: update to GPIO descriptor API
    gpio / ACPI: get rid of acpi_gpio.h
    gpio / ACPI: register to ACPI events automatically
    mmc: sdhci-acpi: convert to use GPIO descriptor API
    ARM: s3c24xx: fix build error
    gpio: f7188x: set can_sleep attribute
    gpio: samsung: Update documentation
    gpio: samsung: Remove hardware.h inclusion
    gpio: xtensa: depend on HAVE_XTENSA_GPIO32
    gpio: clps711x: Enable driver compilation with COMPILE_TEST
    gpio: clps711x: Use of_match_ptr()
    net: rfkill: gpio: convert to descriptor-based GPIO interface
    leds: s3c24xx: Fix build failure
    ...

    Linus Torvalds
     

13 Dec, 2013

1 commit

  • According to the manual, if a port is set for level detection using
    the corresponding bit in the edge/level select register and an external
    level interrupt signal is asserted, the corresponding bit in INTDT
    does not use the FF to hold the input.
    Thus, writing 1 to the corresponding bits in INTCLR cannot clear the
    corresponding bits in the INTDT register. Instead, when an external
    input signal is stopped, the corresponding bit in INTDT is cleared
    automatically.

    Since the INTDT bit cannot be cleared for the level interrupts until
    the interrupt signal is stopped, we end up with the infinite loop
    when using deferred (threaded) IRQ handling.

    Since a deferred interrupt is disabled by the low-level handler and
    re-enabled only when the deferred handler is completed, Fix the issue
    by dropping disabled interrupts from the pending mask as suggested by
    Laurent Pinchart

    Changes in V2:
    * Drop disabled interrupts from pending mask altogether instead of
    dropping level interrupts one by one once they get handled.

    Signed-off-by: Valentine Barshak
    Acked-by: Laurent Pinchart
    Acked-by: Magnus Damm
    Signed-off-by: Linus Walleij

    Valentine Barshak
     

09 Dec, 2013

1 commit


03 Dec, 2013

1 commit

  • Some versions of the R-Car GPIO controller support triggering on both
    edges of the input signal. Whether this capability is supported is
    currently specified in platform data. R-Car GPIO devices instantiated
    from the device tree have the capability turned off even when the
    hardware supports it.

    To fix this, add DT match data support to the driver, initialize both
    edge trigger support from match data and enable both edge trigger in
    r8a7790 and r8a7791 match data.

    Signed-off-by: Laurent Pinchart
    Acked-by: Magnus Damm
    Signed-off-by: Linus Walleij

    Laurent Pinchart
     

25 Nov, 2013

3 commits

  • Now when lazy interrupt disable has been enabled in the driver
    then extend the code to set IRQCHIP_MASK_ON_SUSPEND which tells
    the core that only IRQs marked as wakeups need to stay enabled
    during Suspend-to-RAM.

    Tested on the Lager board with GPIO-keys and Suspend-to-RAM.

    Signed-off-by: Magnus Damm
    Acked-by: Laurent Pinchart
    Signed-off-by: Linus Walleij

    Magnus Damm
     
  • Set the ->irq_enable() and ->irq_disable() methods to NULL
    to enable lazy disable of interrupts. This by itself provides
    some level of optimization, but is mainly enabled as ground
    work for future Suspend-to-RAM wake up support.

    Signed-off-by: Magnus Damm
    Acked-by: Laurent Pinchart
    Signed-off-by: Linus Walleij

    Magnus Damm
     
  • It's not obvious from the label name but "err1" tries to release
    "p->irq_domain" which leads to a NULL dereference.

    Fixes: 119f5e448d32 ('gpio: Renesas R-Car GPIO driver V3')

    Cc: stable@vger.kernel.org
    Signed-off-by: Dan Carpenter
    Acked-by: Magnus Damm
    Signed-off-by: Linus Walleij

    Dan Carpenter
     

16 Oct, 2013

3 commits


22 Sep, 2013

1 commit


16 Aug, 2013

1 commit


04 Jul, 2013

1 commit

  • Pull GPIO updates from Linus Walleij:
    "Here is a batch of GPIO changes for v3.11. I have agreed with Grant
    to take care of the pull requests for this development cycle.

    No special things are happening in the GPIO tree this time (nice with
    some calm) and I have been extra careful to do regression builds and
    it's well boiled in -next.

    GPIO changes for the v3.11 development cycle:
    - Incremental development for the Langwell (Atom SoC), Xilinx, ICH
    and RCAR drivers.
    - Cleanups from Jingoo Han, Axel Lin, Wei Jongjun, Wolfram Sang,
    Tushar Behera, Sachin Kamat and Yijing Wang"

    * tag 'gpio-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (35 commits)
    Gpio/trivial: replace numeric with standard PM state macros
    gpiolib: remove warnning of allocations with IRQs disabled
    gpio: grgpio: Staticize local symbols
    gpio-langwell: remove Withney point support
    gpio: ich: add GPO_BLINK support
    gpio-sta2x11: Convert to use devm_ioremap_resource
    gpio_msm: Convert to use devm_ioremap_resource
    gpio-rcar: Use OUTDT when reading GPIOs configured as output
    gpio-sta2x11: Fix potential NULL pointer dereference
    gpio/omap: omap_gpio_init_context stub must be inline
    gpio: msm-v1: Remove errant __devinit to fix compile
    gpio: devres: make comments proper
    GPIO: xilinx: Enable driver for Xilinx zynq
    DT: Add documentation for gpio-xilinx
    GPIO: xilinx: Use BIT macro
    GPIO: xilinx: Use __raw_readl/__raw_writel IO functions
    GPIO: xilinx: Add support for dual channel
    GPIO: xilinx: Simplify driver probe function
    gpio: sx150x: convert to use devm_* functions
    MAINTAINERS: add linux-gpio mailing list
    ...

    Linus Torvalds
     

21 Jun, 2013

1 commit

  • …ernel/git/horms/renesas into next/drivers

    From Simon Horman:

    Second Round of Renesas ARM based SoC GPIO R-Car updates for v3.11

    Documentation enhancement and code cleanup by Laurent Pinchart.

    * tag 'renesas-gpio-rcar2-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
    gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections
    gpio-rcar: Reference core gpio documentation in the DT bindings

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

    Arnd Bergmann
     

19 Jun, 2013

2 commits


17 Jun, 2013

1 commit


12 Jun, 2013

1 commit

  • Add DT bindings for the gpio-rcar driver and read the device
    configuration from the DT node at probe time if available.

    Cc: devicetree-discuss@lists.ozlabs.org
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Simon Horman

    Laurent Pinchart
     

04 Jun, 2013

2 commits

  • As hardware support for this feature is not universal for all SoCs a flag,
    has_both_edge_trigger, has been added to the platform data of the driver to
    allow this feature to be enabled.

    The motivation for this is to allow use of the gpio-keys driver on the
    lager board which is based on the r8a7790 SoC. The V2 of this patch has been
    fully exercised using that driver on that board.

    Signed-off-by: Magnus Damm
    Signed-off-by: Simon Horman

    Simon Horman
     
  • R-Car H1 or Gen2 GPIO interrupts are assigned per each GPIO domain,
    but, Gen1 E1/M1 GPIO interrupts are shared for all GPIO domain.
    gpio-rcar driver needs IRQF_SHARED flags for these.
    This patch was tested on Bock-W board

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Simon Horman

    Kuninori Morimoto
     

03 Apr, 2013

2 commits

  • Register the GPIO pin range, and request and free GPIO pins using the
    pinctrl API.

    Signed-off-by: Laurent Pinchart
    Acked-by: Linus Walleij
    Signed-off-by: Simon Horman

    Laurent Pinchart
     
  • This patch is V3 of a GPIO driver for the R-Car series of
    SoCs from Renesas. This driver is designed to be reusable
    between multiple SoCs that share the same basic building block,
    but so far it has only been used on R-Car H1 (r8a7779).

    Each driver instance handles 32 GPIOs with individually
    maskable IRQs. The driver operates on a single I/O memory
    range and the 32 GPIOs are hooked up a single interrupt.

    In the case of R-Car H1 either external IRQ pins or GPIOs
    with interrupts can be used for on-board interupts. For
    external IRQs 4 pins are supported, and in the case of GPIO
    there are 202 GPIOS as 202 interrupts hooked up via 6 driver
    instances and to the GIC and the Cortex-A9 Quad.

    At this point this driver is interfacing as a regular
    platform device driver. In the future DT support will be
    submitted as an incremental feature patch.

    Signed-off-by: Magnus Damm
    Reviewed-by: Linus Walleij
    Signed-off-by: Simon Horman

    Magnus Damm