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
     

28 Jun, 2019

1 commit

  • We need to convert all old gpio irqchips to pass the irqchip
    setup along when adding the gpio_chip.

    For chained irqchips this is a pretty straight-forward
    conversion.

    Take this opportunity to add a local dev pointer and
    use devm_gpiochip_add() so we can get rid of the remove()
    callback altogether.

    Cc: linux-mips@linux-mips.org
    Acked-by: Alban Bedel
    Signed-off-by: Linus Walleij

    Linus Walleij
     

19 Jun, 2019

1 commit

  • Based on 2 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 version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

30 Jul, 2018

1 commit


27 Mar, 2018

1 commit

  • platform_get_resource() may return NULL, add proper
    check to avoid potential NULL dereferencing.

    This is detected by Coccinelle semantic patch.

    @@
    expression pdev, res, n, t, e, e1, e2;
    @@

    res = platform_get_resource(pdev, t, n);
    + if (!res)
    + return -EINVAL;
    ... when != res == NULL
    e = devm_ioremap(e1, res->start, e2);

    Signed-off-by: Wei Yongjun
    [albeu@free.fr: Fixed patch to apply on current tree]
    Signed-off-by: Alban Bedel
    Signed-off-by: Linus Walleij

    Wei Yongjun
     

03 Dec, 2017

1 commit

  • This change resolves a new compile-time warning
    when built as a loadable module:

    WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
    see include/linux/module.h for more information

    This adds the license as "GPL v2", which matches the header of the file.

    MODULE_DESCRIPTION is also added.

    Signed-off-by: Jesse Chan
    Acked-by: Alban Bedel
    Signed-off-by: Linus Walleij

    Jesse Chan
     

08 Nov, 2017

1 commit


20 Oct, 2017

1 commit


17 Mar, 2017

1 commit

  • The ath79 gpio driver currently implements an irq_chip for handling
    interrupts; due to how irq_chip handling is done, it's necessary for the
    irq_chip methods to be invoked from hardirq context, even on a a
    real-time kernel. Because the spinlock_t type becomes a "sleeping"
    spinlock w/ RT kernels, it is not suitable to be used with irq_chips.

    A quick audit of the operations under the lock reveal that they do only
    minimal, bounded work, and are therefore safe to do under a raw spinlock.

    Signed-off-by: Julia Cartwright
    Acked-by: Aban Bedel
    Signed-off-by: Linus Walleij

    Julia Cartwright
     

24 Oct, 2016

1 commit

  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/gpio/gpio-ath79.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/gpio/gpio-ath79.ko | grep alias
    alias: of:N*T*Cqca,ar9340-gpioC*
    alias: of:N*T*Cqca,ar9340-gpio
    alias: of:N*T*Cqca,ar7100-gpioC*
    alias: of:N*T*Cqca,ar7100-gpio

    Signed-off-by: Javier Martinez Canillas
    Acked-by: Aban Bedel
    Signed-off-by: Linus Walleij

    Javier Martinez Canillas
     

15 Sep, 2016

1 commit

  • The Kconfig for this file is:

    drivers/gpio/Kconfig:config GPIO_ATH79
    drivers/gpio/Kconfig: tristate "Atheros AR71XX/AR724X/AR913X GPIO support"

    ...but however it does not include module.h -- it in turn gets it from
    another header (gpio/driver.h) and we'd like to replace that with a
    forward delcaration of "struct module;" but if we do, this file will
    fail to compile.

    So we fix this first to avoid putting build failures into the bisect
    commit history.

    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Cc: linux-gpio@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Walleij

    Paul Gortmaker
     

25 Feb, 2016

1 commit


10 Feb, 2016

5 commits


05 Jan, 2016

1 commit


21 Dec, 2015

1 commit


12 Dec, 2015

1 commit


30 Nov, 2015

1 commit


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
     

02 Oct, 2015

1 commit


03 Sep, 2015

2 commits

  • Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
    machines, and each machine type provides its own gpio.h. However
    only a handful really implement the GPIO API, most just forward
    everythings to gpiolib.

    The Alchemy machine is notable as it provides a system to allow
    implementing the GPIO API at the board level. But it is not used by
    any board currently supported, so it can also be removed.

    For most machine types we can just remove the custom gpio.h, as well
    as the custom wrappers if some exists. Some of the code found in
    the wrappers must be moved to the respective GPIO driver.

    A few more fixes are need in some drivers as they rely on linux/gpio.h
    to provides some machine specific definitions, or used asm/gpio.h
    instead of linux/gpio.h for the gpio API.

    Signed-off-by: Alban Bedel
    Reviewed-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: Hauke Mehrtens
    Cc: Rafał Miłecki
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Tejun Heo
    Cc: Alexandre Courbot
    Cc: Dmitry Torokhov
    Cc: Florian Fainelli
    Cc: Manuel Lauss
    Cc: Joe Perches
    Cc: Daniel Walter
    Cc: Sergey Ryazanov
    Cc: Huacai Chen
    Cc: James Hartley
    Cc: Andrew Bresticker
    Cc: Paul Burton
    Cc: Jiri Kosina
    Cc: Bjorn Helgaas
    Cc: Wolfram Sang
    Cc: Randy Dunlap
    Cc: Varka Bhadram
    Cc: Masanari Iida
    Cc: Tomi Valkeinen
    Cc: Michael Buesch
    Cc: abdoulaye berthe
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-ide@vger.kernel.org
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-input@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/10828/
    Signed-off-by: Ralf Baechle

    Alban Bedel
     
  • GPIO drivers should be in drivers/gpio

    Signed-off-by: Alban Bedel
    Acked-by: Linus Walleij
    Cc: linux-gpio@vger.kernel.org
    Cc: Alexandre Courbot
    Cc: Gabor Juhos
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/10597/
    Signed-off-by: Ralf Baechle

    Alban Bedel