22 Jul, 2019

1 commit


15 Jul, 2019

1 commit

  • In commit 8764c4ca5049 ("gpio: em: use the managed version of
    gpiochip_add_data()") we implicitly altered the ordering of resource
    freeing: since gpiochip_remove() calls gpiochip_irqchip_remove()
    internally, we now can potentially use the irq_domain after it was
    destroyed in the remove() callback (as devm resources are freed after
    remove() has returned).

    Use devm_add_action_or_reset() to keep the ordering right and entirely
    kill the remove() callback in the driver.

    Reported-by: Geert Uytterhoeven
    Fixes: 8764c4ca5049 ("gpio: em: use the managed version of gpiochip_add_data()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Bartosz Golaszewski
    Reviewed-by: Geert Uytterhoeven

    Bartosz Golaszewski
     

10 Jul, 2019

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the big slew of GPIO changes for the v5.3 kernel cycle. This
    is mostly incremental work this time.

    Three important things:

    - The FMC subsystem is deleted through my tree. This happens through
    GPIO as its demise was discussed in relation to a patch decoupling
    its GPIO implementation from the standard way of handling GPIO. As
    it turns out, that is not the only subsystem it reimplements and
    the authors think it is better do scratch it and start over using
    the proper kernel subsystems than try to polish the rust shiny. See
    the commit (ACKed by the maintainers) for details.

    - Arnd made a small devres patch that was ACKed by Greg and goes into
    the device core.

    - SPDX header change colissions may happen, because at times I've
    seen that quite a lot changed during the -rc:s in regards to SPDX.
    (It is good stuff, tglx has me convinced, and it is worth the
    occasional pain.)

    Apart from this is is nothing controversial or problematic.

    Summary:

    Core:

    - When a gpio_chip request GPIOs from itself, it can now fully
    control the line characteristics, both machine and consumer flags.
    This makes a lot of sense, but took some time before I figured out
    that this is how it has to work.

    - Several smallish documentation fixes.

    New drivers:

    - The PCA953x driver now supports the TI TCA9539.

    - The DaVinci driver now supports the K3 AM654 SoCs.

    Driver improvements:

    - Major overhaul and hardening of the OMAP driver by Russell King.

    - Starting to move some drivers to the new API passing irq_chip along
    with the gpio_chip when adding the gpio_chip instead of adding it
    separately.

    Unrelated:

    - Delete the FMC subsystem"

    * tag 'gpio-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (87 commits)
    Revert "gpio: tegra: Clean-up debugfs initialisation"
    gpiolib: Use spinlock_t instead of struct spinlock
    gpio: stp-xway: allow compile-testing
    gpio: stp-xway: get rid of the #include dependency
    gpio: stp-xway: improve module clock error handling
    gpio: stp-xway: simplify error handling in xway_stp_probe()
    gpiolib: Clarify use of non-sleeping functions
    gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants
    gpiolib: Document new gpio_chip.init_valid_mask field
    Documentation: gpio: Fix reference to gpiod_get_array()
    gpio: pl061: drop duplicate printing of device name
    gpio: altera: Pass irqchip when adding gpiochip
    gpio: siox: Use devm_ managed gpiochip
    gpio: siox: Add struct device *dev helper variable
    gpio: siox: Pass irqchip when adding gpiochip
    drivers: gpio: amd-fch: make resource struct const
    devres: allow const resource arguments
    gpio: ath79: Pass irqchip when adding gpiochip
    gpio: tegra: Clean-up debugfs initialisation
    gpio: siox: Switch to IRQ_TYPE_NONE
    ...

    Linus Torvalds
     

31 May, 2019

2 commits

  • Use the managed variant of gpiochip_add_data() and remove the call to
    gpiochip_remove().

    Cc: Geert Uytterhoeven
    Signed-off-by: Bartosz Golaszewski
    Reviewed-by: Geert Uytterhoeven

    Bartosz Golaszewski
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details you should have received a
    copy of the gnu general public license along with this program if
    not write to the free software foundation inc 59 temple place suite
    330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 3 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Steve Winslow
    Reviewed-by: Alexios Zavras
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190528170026.251475812@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

28 May, 2019

2 commits


07 Aug, 2018

1 commit


19 Mar, 2018

1 commit


22 Sep, 2017

1 commit


05 Jan, 2016

1 commit


27 Dec, 2015

1 commit

  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Cc: Magnus Damm
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij

    Linus Walleij
     

19 Nov, 2015

1 commit

  • The name .dev in a struct is normally reserved for a struct device
    that is let us say a superclass to the thing described by the struct.
    struct gpio_chip stands out by confusingly using a struct device *dev
    to point to the parent device (such as a platform_device) that
    represents the hardware. As we want to give gpio_chip:s real devices,
    this is not working. We need to rename this member to parent.

    This was done by two coccinelle scripts, I guess it is possible to
    combine them into one, but I don't know such stuff. They look like
    this:

    @@
    struct gpio_chip *var;
    @@
    -var->dev
    +var->parent

    and:

    @@
    struct gpio_chip var;
    @@
    -var.dev
    +var.parent

    and:

    @@
    struct bgpio_chip *var;
    @@
    -var->gc.dev
    +var->gc.parent

    Plus a few instances of bgpio that I couldn't figure out how
    to teach Coccinelle to rewrite.

    This patch hits all over the place, but I *strongly* prefer this
    solution to any piecemal approaches that just exercise patch
    mechanics all over the place. It mainly hits drivers/gpio and
    drivers/pinctrl which is my own backyard anyway.

    Cc: Haavard Skinnemoen
    Cc: Rafał Miłecki
    Cc: Richard Purdie
    Cc: Mauro Carvalho Chehab
    Cc: Alek Du
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Dmitry Torokhov
    Acked-by: Greg Kroah-Hartman
    Acked-by: Lee Jones
    Acked-by: Jiri Kosina
    Acked-by: Hans-Christian Egtvedt
    Acked-by: Jacek Anaszewski
    Signed-off-by: Linus Walleij

    Linus Walleij
     

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
     

16 Jul, 2015

1 commit

  • Since commit 59032702ead90562 ("ARM: shmobile: Remove legacy platform
    devices from EMEV2 SoC code"), EMMA Mobile SoCs are only supported in
    generic DT-only ARM multi-platform builds. The driver doesn't need to
    use platform data anymore, hence remove platform data configuration.

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Simon Horman
    Tested-by: Niklas Söderlund
    Signed-off-by: Linus Walleij

    Geert Uytterhoeven
     

06 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
     

28 Nov, 2014

1 commit


29 Oct, 2014

1 commit


20 Oct, 2014

1 commit


22 Jul, 2014

1 commit


09 May, 2014

1 commit


04 May, 2014

1 commit


18 Mar, 2014

1 commit

  • This switches all GPIO and pin control drivers with irqchips
    that were using .startup() and .shutdown() callbacks to lock
    GPIO lines for IRQ usage over to using the .request_resources()
    and .release_resources() callbacks just introduced into the
    irqchip vtable.

    Cc: Thomas Gleixner
    Cc: Jean-Jacques Hiblot
    Signed-off-by: Linus Walleij

    Linus Walleij
     

04 Dec, 2013

2 commits


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 KZM9D board with GPIO-keys.

    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
     
  • Make sure gpio_chip->dev is setup so of_gpiochip_add()
    will work as expected.

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

    Magnus Damm
     

16 Oct, 2013

1 commit


19 Sep, 2013

1 commit

  • EMEV2 is now a DT platform, however the GPIO driver cannot be used
    from a DT file since it does not fill out the of_node field in its
    gpio_chip structure.

    Signed-off-by: Ian Molton
    Reviewed-by: Simon Horman
    Signed-off-by: Linus Walleij

    Ian Molton
     

16 Aug, 2013

1 commit


21 Jul, 2013

1 commit

  • Register the GPIO pin range, and request and free GPIO pins using the
    pinctrl API. The pctl_name platform data member should be used by
    platform devices to point out which pinctrl device to use.

    Follows same style as "dc3465a gpio-rcar: Add pinctrl support",
    by Laurent Pinchart, thanks to him.

    Signed-off-by: Magnus Damm
    Signed-off-by: Linus Walleij

    Magnus Damm
     

27 Mar, 2013

1 commit


06 Mar, 2013

1 commit

  • Update the Emma Mobile GPIO driver to add DT support.

    The patch simply adds a two-cell xlate function and
    updates the probe code to allow configuration via DT
    using the "ngpios" property plus OF id in the same
    style as gpio-mvebu.c. The code is also adjusted to
    use postcore_initcall() to force early setup.

    Signed-off-by: Magnus Damm
    Signed-off-by: Grant Likely

    Magnus Damm
     

15 Feb, 2013

1 commit

  • Adjust the gpio-em.c driver to reconsider the pdata->irq_base
    variable. Non-DT board code like for instance board-kzm9d.c
    needs to operate of a static IRQ range for platform devices.

    So this patch is updating the code to make use of the function
    irq_domain_add_simple() instead of irq_domain_add_linear().

    Fixes a EMEV2 / KZM9D runtime error caused by the following commit:
    7385500 gpio/em: convert to linear IRQ domain

    Cc: stable@kernel.org
    Signed-off-by: Magnus Damm
    Tested-by: Simon Horman
    Reported-by: Simon Horman
    Signed-off-by: Linus Walleij

    Magnus Damm
     

12 Dec, 2012

1 commit

  • Pull driver core updates from Greg Kroah-Hartman:
    "Here's the large driver core updates for 3.8-rc1.

    The biggest thing here is the various __dev* marking removals. This
    is going to be a pain for the merge with different subsystem trees, I
    know, but all of the patches included here have been ACKed by their
    various subsystem maintainers, as they wanted them to go through here.

    If this is too much of a pain, I can pull all of them out of this tree
    and just send you one with the other fixes/updates and then, after
    3.8-rc1 is out, do the rest of the removals to ensure we catch them
    all, it's up to you. The merges should all be trivial, and Stephen
    has been doing them all in linux-next for a few weeks now quite
    easily.

    Other than the __dev* marking removals, there's nothing major here,
    some firmware loading updates and other minor things in the driver
    core.

    All of these have (much to Stephen's annoyance), been in linux-next
    for a while.

    Signed-off-by: Greg Kroah-Hartman "

    Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio
    update.

    * tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits)
    modpost.c: Stop checking __dev* section mismatches
    init.h: Remove __dev* sections from the kernel
    acpi: remove use of __devinit
    PCI: Remove __dev* markings
    PCI: Always build setup-bus when PCI is enabled
    PCI: Move pci_uevent into pci-driver.c
    PCI: Remove CONFIG_HOTPLUG ifdefs
    unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs
    sh/PCI: Remove CONFIG_HOTPLUG ifdefs
    powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs
    mips/PCI: Remove CONFIG_HOTPLUG ifdefs
    microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs
    dma: remove use of __devinit
    dma: remove use of __devexit_p
    firewire: remove use of __devinitdata
    firewire: remove use of __devinit
    leds: remove use of __devexit
    leds: remove use of __devinit
    leds: remove use of __devexit_p
    mmc: remove use of __devexit
    ...

    Linus Torvalds
     

29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Acked-by: Linus Walleij
    Cc: Peter Tyser
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Cc: Peter Tyser
    Cc: Santosh Shilimkar
    Cc: Kevin Hilman
    Acked-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Cc: Peter Tyser
    Acked-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton