16 Aug, 2018

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v4.19 kernel cycle.

    I don't know if anything in particular stands out. Maybe the Aspeed
    coprocessor thing from Benji: Aspeed is doing baseboard management
    chips (BMC's) for servers etc.

    These Aspeed's are ARM processors that exist inside (I guess) Intel
    servers, and they are moving forward to using mainline Linux in those.
    This is one of the pieces of the puzzle to achive that. They are doing
    OpenBMC, it's pretty cool: https://lwn.net/Articles/683320/

    Summary:

    Core changes:

    - Add a new API for explicitly naming GPIO consumers, when needed.

    - Don't let userspace set values on input lines. While we do not
    think anyone would do this crazy thing we better plug the hole
    before someone uses it and think it's a nifty feature.

    - Avoid calling chip->request() for unused GPIOs.

    New drivers/subdrivers:

    - The Mediatek MT7621 is supported which is a big win for OpenWRT and
    similar router distributions using this chip, as it seems every
    major router manufacturer on the planet has made products using
    this chip: https://wikidevi.com/wiki/MediaTek_MT7621

    - The Tegra 194 is now supported.

    - The IT87 driver now supports IT8786E and IT8718F super-IO chips.

    - Add support for Rockchip RK3328 in the syscon GPIO driver.

    Driver changes:

    - Handle the get/set_multiple() properly on MMIO chips with inverted
    direction registers. We didn't have this problem until a new chip
    appear that has get/set registers AND inverted direction bits, OK
    now we handle it.

    - A patch series making more error codes percolate upward properly
    for different errors on gpiochip_lock_as_irq().

    - Get/set multiple for the OMAP driver, accelerating these multiple
    line operations if possible.

    - A coprocessor interface for the Aspeed driver. Sometimes a few GPIO
    lines need to be grabbed by a co-processor for doing automated
    tasks, sometimes they are available as GPIO lines. By adding an
    explicit API in this driver we make it possible for the two line
    consumers to coexist. (This work was made available on the
    ib-aspeed branch, which may be appearing in other pull requests.)

    - Implemented .get_direction() and open drain in the SCH311x driver.

    - Continuing cleanup of included headers in GPIO drivers"

    * tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (80 commits)
    gpio: it87: Add support for IT8613
    gpio: it87: add support for IT8718F Super I/O.
    gpiolib: Avoid calling chip->request() for unused gpios
    gpio: tegra: Include the right header
    gpio: mmio: Fix up inverted direction registers
    gpio: xilinx: Use the right include
    gpio: timberdale: Include the right header
    gpio: tb10x: Use the right include
    gpiolib: Fix of_node inconsistency
    gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error
    gpio: uniphier: Bail out on gpiochip_lock_as_irq() error
    gpio: xgene-sb: Don't shadow error code of gpiochip_lock_as_irq()
    gpio: em: Don't shadow error code of gpiochip_lock_as_irq()
    gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq()
    gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq()
    gpiolib: Don't shadow error code of gpiochip_lock_as_irq()
    gpio: syscon: rockchip: add GRF GPIO support for rk3328
    gpio: omap: Add get/set_multiple() callbacks
    gpio: pxa: remove set but not used variable 'gpio_offset'
    gpio-it87: add support for IT8786E Super I/O
    ...

    Linus Torvalds
     

11 Aug, 2018

1 commit


04 Aug, 2018

1 commit

  • There is a bug in regards to deferred probing within the drivers core
    that causes GPIO-driver to suspend after its users. The bug appears if
    GPIO-driver probe is getting deferred, which happens after introducing
    dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges"
    property in device-tree. The bug in the drivers core is old (more than 4
    years now) and is well known, unfortunately there is no easy fix for it.
    The good news is that we can workaround the deferred probe issue by
    changing GPIO / PINCTRL drivers registration order and hence by moving
    PINCTRL driver registration to the arch_init level and GPIO to the
    subsys_init.

    Signed-off-by: Dmitry Osipenko
    Acked-by: Stefan Agner
    Signed-off-by: Linus Walleij

    Dmitry Osipenko
     

30 Jul, 2018

2 commits

  • Since commit e45d1c80c0ee ("gpio: put GPIO IRQs into their own lock
    class") and commit a0a8bcf4670c ("gpiolib: irqchip: use different
    lockdep class for each gpio irqchip") GPIO lib takes care of lockdep
    classes. In fact, gpiochip_irq_map() overwrites the class anyway, so
    the lockdep class set by the driver is useless. Remove it.

    Signed-off-by: Stefan Agner
    Signed-off-by: Linus Walleij

    Stefan Agner
     
  • Commit 36b312792b97 ("gpiolib: Respect error code of ->get_direction()")
    broke tegra_gpio_irq_set_type() because requesting of GPIO direction must
    be done after enabling GPIO function for a pin.

    This patch fixes drivers probe failure like this:

    gpio gpiochip0: (tegra-gpio): gpiochip_lock_as_irq: cannot get GPIO direction
    tegra-gpio 6000d000.gpio: unable to lock Tegra GPIO 144 as IRQ

    Fixes: 36b312792b97 ("gpiolib: Respect error code of ->get_direction()")
    Signed-off-by: Dmitry Osipenko
    Acked-by: Jon Hunter
    Tested-by: Jon Hunter
    Signed-off-by: Linus Walleij

    Dmitry Osipenko
     

22 Feb, 2018

1 commit


28 Dec, 2017

1 commit

  • The IRQ code already has support for lockdep class for the lock mutex
    in an interrupt descriptor. Extend this to add a second class for the
    request mutex in the descriptor. Not having a class is resulting in
    false positive splats in some code paths.

    Signed-off-by: Andrew Lunn
    Signed-off-by: Thomas Gleixner
    Acked-by: linus.walleij@linaro.org
    Cc: grygorii.strashko@ti.com
    Cc: f.fainelli@gmail.com
    Link: https://lkml.kernel.org/r/1512234664-21555-1-git-send-email-andrew@lunn.ch

    Andrew Lunn
     

22 Sep, 2017

1 commit


14 Aug, 2017

7 commits


02 Aug, 2017

1 commit


26 Jan, 2017

1 commit

  • Currently we already have two pin configuration related callbacks
    available for GPIO chips .set_single_ended() and .set_debounce(). In
    future we expect to have even more, which does not scale well if we need
    to add yet another callback to the GPIO chip structure for each possible
    configuration parameter.

    Better solution is to reuse what we already have available in the
    generic pinconf.

    To support this, we introduce a new .set_config() callback for GPIO
    chips. The callback takes a single packed pin configuration value as
    parameter. This can then be extended easily beyond what is currently
    supported by just adding new types to the generic pinconf enum.

    If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
    just assign gpiochip_generic_config() (introduced in this patch) to
    .set_config and that will take care configuration requests are directed
    to the pinctrl driver.

    We then convert the existing drivers over .set_config() and finally
    remove the .set_single_ended() and .set_debounce() callbacks.

    Suggested-by: Linus Walleij
    Signed-off-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Linus Walleij

    Mika Westerberg
     

22 Jun, 2016

1 commit

  • Commit b546be0db955 ("gpio: tegra: Get rid of all file scoped global
    variables") moved all file scoped variables into the driver-private
    structure to allow potentially multiple instances of the driver. The
    change also included turning the lockdep class into a driver-private
    field, which doesn't work and produces error messages such as this:

    [ 0.142310] BUG: key ffff8000fb3f7ab0 not in .data!

    Make the lockdep class file-scoped again to fix this issue.

    Signed-off-by: Thierry Reding
    Signed-off-by: Linus Walleij

    Thierry Reding
     

30 Apr, 2016

1 commit

  • Implement gpio_get_direction() callback for Tegra GPIO.
    The direction is only valid if the pin is configured as
    GPIO. If pin is not configured in GPIO mode then this
    function return error.

    Signed-off-by: Laxman Dewangan
    Reviewed-by: Stephen Warren
    Acked-by: Jon Hunter
    Signed-off-by: Linus Walleij

    Laxman Dewangan
     

29 Apr, 2016

4 commits


23 Feb, 2016

1 commit


05 Jan, 2016

1 commit


17 Nov, 2015

1 commit

  • The tegra gpio driver creates the debugfs entry irrespective of
    whether the device exists or not. This is enabled on an arm64_defconfig
    and leaves an entry in debugfs on all platforms where it is not
    useful. This patch fixes the issue by creating the entry only when
    a device exists.

    Signed-off-by: Suzuki K. Poulose
    Acked-by: Thierry Reding
    Signed-off-by: Linus Walleij

    Suzuki K. Poulose
     

16 Sep, 2015

1 commit

  • Most interrupt flow handlers do not use the irq argument. Those few
    which use it can retrieve the irq number from the irq descriptor.

    Remove the argument.

    Search and replace was done with coccinelle and some extra helper
    scripts around it. Thanks to Julia for her help!

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu

    Thomas Gleixner
     

28 Jul, 2015

1 commit

  • 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: Rob Herring
    Cc: Michael Hennerich
    Acked-by: Linus Walleij
    Cc: Alexandre Courbot
    Cc: Ray Jui
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: linux-gpio@vger.kernel.org
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: linux-tegra@vger.kernel.org
    Signed-off-by: Linus Walleij

    Rob Herring
     

14 Jul, 2015

2 commits


24 Jun, 2015

1 commit

  • Pull gpio updates from Linus Walleij:
    "This is the big bulk of GPIO changes queued for the v4.2 kernel
    series:

    - a big set of cleanups to the aged sysfs interface from Johan
    Hovold. To get these in, v4.1-rc3 was merged into the tree as the
    first patch in that series had to go into stable. This makes the
    locking much more fine-grained (get rid of the "big GPIO lock(s)"
    and store states in the GPIO descriptors.

    - rename gpiod_[g|s]et_array() to gpiod_[g|s]et_array_value() to
    avoid confusions.

    - New drivers for:
    * NXP LPC18xx (currently LPC1850)
    * NetLogic XLP
    * Broadcom STB SoC's
    * Axis ETRAXFS
    * Zynq Ultrascale+ (subdriver)

    - ACPI:
    * make it possible to retrieve GpioInt resources from a GPIO
    device using acpi_dev_gpio_irq_get()
    * merge some dependent I2C changes exploiting this.
    * support the ARM X-Gene GPIO standby driver.

    - make it possible for the generic GPIO driver to read back the value
    set registers to reflect current status.

    - loads of OMAP IRQ handling fixes.

    - incremental improvements to Kona, max732x, OMAP, MXC, RCAR,
    PCA953x, STP-XWAY, PCF857x, Crystalcove, TB10x.

    - janitorial (constification, checkpatch cleanups)"

    * tag 'gpio-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (71 commits)
    gpio: Fix checkpatch.pl issues
    gpio: pcf857x: handle only enabled irqs
    gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
    GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module use
    gpio: improve error reporting on own descriptors
    gpio: promote own request failure to pr_err()
    gpio: Added support to Zynq Ultrascale+ MPSoC
    gpio: add ETRAXFS GPIO driver
    fix documentation after renaming gpiod_set_array to gpiod_set_array_value
    gpio: Add GPIO support for Broadcom STB SoCs
    gpio: xgene: add ACPI support for APM X-Gene GPIO standby driver
    gpio: tb10x: Drop unneeded free_irq() call
    gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip
    gpio: stp-xway: Use the of_property_read_u32 helper
    gpio: pcf857x: Check for irq_set_irq_wake() failures
    gpio-stp-xway: Fix enabling the highest bit of the PHY LEDs
    gpio: Prevent an integer overflow in the pca953x driver
    gpio: omap: rework omap_gpio_irq_startup to handle current pin state properly
    gpio: omap: rework omap_gpio_request to touch only gpio specific registers
    gpio: omap: rework omap_x_irq_shutdown to touch only irqs specific registers
    ...

    Linus Torvalds
     

18 Jun, 2015

1 commit

  • Fix a race where a pending interrupt could be received and the handler
    called before the handler's data has been setup, by converting to
    irq_set_chained_handler_and_data().

    Signed-off-by: Russell King
    Cc: Alexandre Courbot
    Cc: Hans Ulli Kroll
    Cc: Jason Cooper
    Cc: Lee Jones
    Cc: Linus Walleij
    Cc: Thierry Reding
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/E1Z4z0M-0002Sl-Ti@rmk-PC.arm.linux.org.uk
    Signed-off-by: Thomas Gleixner

    Russell King
     

19 May, 2015

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

29 Oct, 2014

1 commit


20 Oct, 2014

1 commit


09 May, 2014

2 commits


11 Dec, 2013

1 commit


17 Oct, 2013

1 commit

  • Whenever an IRQ is claimed or freed, call gpio_lock_as_irq() or
    gpio_unlock_as_irq() on the associated GPIO, to prevent that GPIO from
    being configured in a manner incompatible with an interrupt.

    Signed-off-by: Stephen Warren
    Reviewed-by: Javier Martinez Canillas
    Signed-off-by: Linus Walleij

    Stephen Warren