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
     

03 Jul, 2019

1 commit


27 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.

    Cc: Manivannan Sadhasivam
    Reviewed-by: Sudeep Holla
    Tested-by: Sudeep Holla
    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
     

05 Nov, 2018

1 commit

  • Keeping the irq_chip definition static will make it shared with multiple
    giochips in the system. This practice is considered to be bad and now we
    will get the below warning from gpiolib core:

    "detected irqchip that is shared with multiple gpiochips: please fix the
    driver."

    Hence, move the irq_chip definition from static to `struct pl061` for
    using a unique irq_chip for each gpiochip.

    Signed-off-by: Manivannan Sadhasivam
    Signed-off-by: Linus Walleij

    Manivannan Sadhasivam
     

24 May, 2018

1 commit


08 Nov, 2017

1 commit


31 Aug, 2017

1 commit


17 Mar, 2017

1 commit

  • The pl061 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
    Signed-off-by: Linus Walleij

    Julia Cartwright
     

07 Dec, 2016

5 commits


28 Apr, 2016

2 commits


31 Mar, 2016

1 commit

  • The Kconfig for this driver is currently:

    config GPIO_PL061
    bool "PrimeCell PL061 GPIO support"

    ...meaning that it currently is not being built as a module by anyone.
    Lets remove the couple traces of modularity, so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering remains unchanged with this commit.

    We also delete the MODULE_LICENSE tag etc. since all that information
    was (or is now) contained at the top of the file in the comments.

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

    Paul Gortmaker
     

05 Jan, 2016

1 commit


14 Dec, 2015

1 commit

  • The PL061 supports interrupts and those can be wakeup interrupts. We
    need to provide support for configuring those interrupts as wakeup
    sources.

    This patch adds irq_set_wake callback for PL061 so that GPIO interrupts
    can be configured as wakeup.

    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Signed-off-by: Sudeep Holla
    Signed-off-by: Linus Walleij

    Sudeep Holla
     

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
     

17 Oct, 2015

1 commit

  • Instead of storing in the chip data whether the chip uses pinctrl and
    conditionally call pinctrl_{request,free}_gpio, just don't populate
    request/free in that case.

    This makes the implementations trivial and the same as the generic
    implementations, thus we can just use them.

    Signed-off-by: Jonas Gorski
    Signed-off-by: Linus Walleij

    Jonas Gorski
     

16 Oct, 2015

1 commit

  • The PL061 can handle level IRQs and edge IRQs, however it is
    just utilizing handle_simple_irq() for all IRQs. Inspired by
    Stefan Agners patch to vf610, this assigns the right handler
    depending on what type is set up, and after this
    handle_bad_irq() is only used as default and if the type is
    not specified, as is done in the OMAP driver: defining the
    IRQ type is really not optional for this driver.

    The interrupt handler was just writing the interrupt clearing
    register for all lines that were high when entering the handling
    loop, this is wrong: that register is only supposed to be
    written (on a per-line basis) for edge IRQs, so this ACK
    was moved to the .irq_ack() callback as is proper.

    Tested with PL061 on the ARM RealView PB11MPCore and the
    MMC/SC card detect GPIO.

    Cc: Jonas Gorski
    Cc: Stefan Agner
    Signed-off-by: Linus Walleij

    Linus Walleij
     

15 Oct, 2015

1 commit


02 Oct, 2015

1 commit


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
     

03 Dec, 2014

1 commit

  • Gpio-ranges property is useful to represent which GPIOs correspond
    to which pins on which pin controllers. But there may be some gpios
    without pinctrl operation. So check whether gpio-ranges property
    exists in device node first.

    Signed-off-by: Yunlei He
    Signed-off-by: Xinwei Kong
    Signed-off-by: Haojian Zhuang
    Signed-off-by: Linus Walleij

    Yunlei He
     

04 May, 2014

1 commit


29 Apr, 2014

1 commit


26 Mar, 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
     

07 Mar, 2014

1 commit

  • The following build warning is generated when building multi_v7_defconfig with
    LPAE option selected:

    drivers/gpio/gpio-pl061.c:358:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' [-Wformat=]

    Fix it by using %pa to print 'resource_size_t'.

    Reported-by: Olof's autobuilder
    Signed-off-by: Fabio Estevam
    Signed-off-by: Linus Walleij

    Fabio Estevam
     

24 Feb, 2014

1 commit


03 Feb, 2014

4 commits

  • Drop the " gpio" suffix after the pl061 irq_chip name:
    this is only confusing: an irqchip name should be a single,
    short, simple string that looks nice in /proc/interrupts.

    Drop the nameing of each individual IRQ to "pl061" - I
    think this naming function is for naming the IRQ line,
    not for boilerplating them all with the name of the
    parent controller, which is already known from the
    .name field of the irq_chip.

    Cc: Haojian Zhuang
    Cc: Deepak Sikri
    Acked-by: Baruch Siach
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Refactor this function so that I can understand it, do one
    big read/modify/write operation and have the bitmask in a
    variable instead of recalculating it every time it's needed.

    Cc: Haojian Zhuang
    Cc: Deepak Sikri
    Acked-by: Baruch Siach
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This uses the new API for tagging GPIO lines as in use by
    IRQs. This enforces a few semantic checks on how the underlying
    GPIO line is used.

    Cc: Haojian Zhuang
    Cc: Deepak Sikri
    Acked-by: Baruch Siach
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This makes the PL061 driver print proper error messages
    when probe fails, and also tell us when the chip is finally
    registered.

    Signed-off-by: Linus Walleij

    Linus Walleij
     

27 Nov, 2013

1 commit

  • The PL061 driver had the irqdomain initialization in an unfortunate
    place: when used with device tree (and thus passing the base IRQ
    0) the driver would work, as this registers an irqdomain and waits
    for mappings to be done dynamically as the devices request their
    IRQs, whereas when booting using platform data the irqdomain core
    would attempt to allocate IRQ descriptors dynamically (which works
    fine) but also to associate the irq_domain_associate_many() on all
    IRQs, which in turn will call the mapping function which at this
    point will try to set the type of the IRQ and then tries to acquire
    a non-initialized spinlock yielding a backtrace like this:

    CPU: 0 PID: 1 Comm: swapper Not tainted 3.13.0-rc1+ #652
    Backtrace:
    [] (dump_backtrace) from [] (show_stack+0x18/0x1c)
    r6:c798ace0 r5:00000000 r4:c78257e0 r3:00200140
    [] (show_stack) from [] (dump_stack+0x20/0x28)
    [] (dump_stack) from [] (__lock_acquire+0x1c0/0x1b80)
    [] (__lock_acquire) from [] (lock_acquire+0x6c/0x80)
    r10:00000000 r9:c0455234 r8:00000060 r7:c047d798 r6:600000d3 r5:00000000
    r4:c782c000
    [] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x60/0x74)
    r6:c01a1100 r5:800000d3 r4:c798acd0
    [] (_raw_spin_lock_irqsave) from [] (pl061_irq_type+0x28/0x)
    r6:00000000 r5:00000000 r4:c798acd0
    [] (pl061_irq_type) from [] (__irq_set_trigger+0x70/0x104)
    r6:00000000 r5:c01a10d8 r4:c046da1c r3:c01a10d8
    [] (__irq_set_trigger) from [] (irq_set_irq_type+0x40/0x60)
    r10:c043240c r8:00000060 r7:00000000 r6:c046da1c r5:00000060 r4:00000000
    [] (irq_set_irq_type) from [] (pl061_irq_map+0x40/0x54)
    r6:c79693c0 r5:c798acd0 r4:00000060
    [] (pl061_irq_map) from [] (irq_domain_associate+0xc0/0x190)
    r5:00000060 r4:c046da1c
    [] (irq_domain_associate) from [] (irq_domain_associate_man)
    r8:00000008 r7:00000000 r6:c79693c0 r5:00000060 r4:00000000
    [] (irq_domain_associate_many) from [] (irq_domain_add_simp)
    r8:c046578c r7:c035b72c r6:c79693c0 r5:00000060 r4:00000008 r3:00000008
    [] (irq_domain_add_simple) from [] (pl061_probe+0xc4/0x22c)
    r6:00000060 r5:c0464380 r4:c798acd0
    [] (pl061_probe) from [] (amba_probe+0x74/0xe0)
    r10:c043240c r9:c0455234 r8:00000000 r7:c047d7f8 r6:c047d744 r5:00000000
    r4:c0464380

    This moves the irqdomain initialization to a point where the spinlock
    and GPIO chip are both fully propulated, so the callbacks can be used
    without crashes.

    I had some problem reproducing the crash, as the devm_kzalloc():ed
    zeroed memory would seemingly mask the spinlock as something OK,
    but by poisoning the lock like this:

    u32 *dum;
    dum = (u32 *) &chip->lock;
    *dum = 0xaaaaaaaaU;

    I could reproduce, fix and test the patch.

    Reported-by: Russell King
    Cc: Rob Herring
    Cc: Haojian Zhuang
    Cc: Baruch Siach
    Signed-off-by: Linus Walleij

    Linus Walleij
     

16 Oct, 2013

1 commit


16 Aug, 2013

1 commit


03 May, 2013

1 commit

  • Pull ARM SoC cleanup from Olof Johansson:
    "Here is a collection of cleanup patches. Among the pieces that stand
    out are:

    - The deletion of h720x platforms
    - Split of at91 non-dt platforms to their own Kconfig file to keep
    them separate
    - General cleanups and refactoring of i.MX and MXS platforms
    - Some restructuring of clock tables for OMAP
    - Convertion of PMC driver for Tegra to dt-only
    - Some renames of sunxi -> sun4i (Allwinner A10)
    - ... plus a bunch of other stuff that I haven't mentioned"

    * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (119 commits)
    ARM: i.MX: remove unused ARCH_* configs
    ARM i.MX53: remove platform ahci support
    ARM: sunxi: Rework the restart code
    irqchip: sunxi: Rename sunxi to sun4i
    irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
    clocksource: sunxi: Rename sunxi to sun4i
    clocksource: sunxi: make use of CLKSRC_OF
    clocksource: sunxi: Cleanup the timer code
    ARM: at91: remove trailing semicolon from macros
    ARM: at91/setup: fix trivial typos
    ARM: EXYNOS: remove "config EXYNOS_DEV_DRM"
    ARM: EXYNOS: change the name of USB ohci header
    ARM: SAMSUNG: Remove unnecessary code for dma
    ARM: S3C24XX: Remove unused GPIO drive strength register definitions
    ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method
    ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2412
    ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2410
    ARM: S3C24XX: Removed unneeded dependency on ARCH_S3C24XX for boards
    ARM: SAMSUNG: Fix typo "CONFIG_SAMSUNG_DEV_RTC"
    ARM: S5P64X0: Fix typo "CONFIG_S5P64X0_SETUP_SDHCI"
    ...

    Linus Torvalds