10 Feb, 2020

1 commit

  • Care is taken with "index", however with the current version
    the actual xgpio_writereg is using index for data but
    xgpio_regoffset(chip, i) for the offset. And since i is already
    incremented it is incorrect. This patch fixes it so that index
    is used for the offset too.

    Cc: stable@vger.kernel.org
    Signed-off-by: Paul Thomas
    Link: https://lore.kernel.org/r/20200125221410.8022-1-pthomas8589@gmail.com
    Signed-off-by: Linus Walleij

    Paul Thomas
     

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
     

10 Jun, 2019

1 commit

  • This driver was using the OF GPIO helper API, but barely used any of its
    features and it cost more code than it saved. Also, the OF GPIO code is
    now deprecated. Convert it to use a more standard setup and use devm
    APIs for initialization to avoid the need for a remove function.

    Our rationale for this change is that we are using the Xilinx GPIO with
    resources injected using the MFD core rather than on the device tree
    itself. Using platform rather than OF-specific resources allows this to
    work for free.

    Signed-off-by: Robert Hancock
    Acked-by: Michal Simek
    Signed-off-by: Linus Walleij

    Robert Hancock
     

31 May, 2019

1 commit

  • 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 version 2 as
    published by the free software foundation 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 1 file(s).

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

    Thomas Gleixner
     

11 Aug, 2018

1 commit


14 Aug, 2017

1 commit

  • Now that we have a custom printf format specifier, convert users of
    full_name to use %pOF instead. This is preparation to remove storing
    of the full path string for each node.

    Signed-off-by: Rob Herring
    Cc: Tien Hock Loh
    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Cc: Brian Norris
    Cc: Florian Fainelli
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: Michal Simek
    Cc: "Sören Brinkmann"
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Acked-by: Gregory Fong
    Signed-off-by: Linus Walleij

    Rob Herring
     

08 Jun, 2016

1 commit


07 Jan, 2016

1 commit

  • Commit 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer") replaces
    the use of container_of() with gpiochip_get_data(). Unfortunately, the
    data pointer is not yet set by the time xgpio_save_regs() is called,
    causing a system hang.

    Fixes: 097d88e94c44 ("gpio: xilinx: use gpiochip data pointer")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Linus Walleij

    Guenter Roeck
     

05 Jan, 2016

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
     

16 Jul, 2015

1 commit

  • xgpio_save_regs() is used in this driver to setup the initial
    values of the registers in the hardware.

    The relevant registers at that time are:
    0x0 -> channel 0 data (32 bits, one for each GPIO on this channel).
    0x4 -> channel 0 tri, controls in/out status for each GPIO of this channel.
    0x8 -> channel 1 data
    0xC -> channel 1 tri

    gpio-xilinx.c defines these:
    XGPIO_DATA_OFFSET (0x0)
    XGPIO_TRI_OFFSET (0x4)
    XGPIO_CHANNEL_OFFSET 0x8

    Before this patch, the "data" register value of channel 1 was written
    at 0x4 intead of 0x8 (overwriting the channel 0 "tri" register),
    and the "tri" register value for channel 1 was written at 0x8 instead of 0xC.

    Signed-off-by: Raphaël Teysseyre
    Reviewed-by: Michal Simek
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Raphaël Teysseyre
     

12 May, 2015

1 commit


16 Jan, 2015

6 commits


24 Sep, 2014

1 commit

  • If one adds gpio-controller; to the chip in the devicetree, then
    initialization fails with 'gpiochip_find_base: cannot find free range',
    because ngpio is 0. This patch fixes the bug.

    This version includes the suggestions from Linus Walleij.

    Tested on ml507 board.

    Signed-off-by: Gernot Vormayr
    Signed-off-by: Linus Walleij

    Gernot Vormayr
     

09 May, 2014

1 commit


17 Jun, 2013

4 commits


29 Nov, 2012

2 commits

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

    Signed-off-by: Bill Pemberton
    Cc: Grant Likely
    Acked-by: Linus Walleij
    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
     

13 Dec, 2011

1 commit

  • This patch adds a kernel message, containing GPIO range and device
    name on successful device registration, and removes duplicate messages from the following drivers:
    * gpio-adp5588
    * gpio-bt8xx
    * gpio-cs5535
    * gpio-janz-ttl
    * gpio-nomadik
    * gpio-pcf857x
    * gpio-xilinx
    * drivers/of/gpio.c

    Signed-off-by: Hartmut Knaack
    [grant.likely@secretlab.ca: squashed 2 patches together]
    Signed-off-by: Grant Likely

    Grant Likely
     

01 Nov, 2011

1 commit


07 Jun, 2011

1 commit

  • Sort the gpio makefile and enforce the naming convention gpio-*.c for
    gpio drivers.

    v2: cleaned up filenames in Kconfig and comment blocks
    v3: fixup use of BASIC_MMIO to GENERIC_GPIO for mxc

    Signed-off-by: Grant Likely

    Grant Likely