13 Sep, 2016

1 commit

  • These structures are only used to copy into other structures, so declare
    them as const.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct gpio_chip i@p = { ... };

    @ok@
    identifier r.i;
    expression e;
    position p;
    @@
    e = i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct gpio_chip e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct gpio_chip i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Joachim Eastwood
    Signed-off-by: Linus Walleij

    Julia Lawall
     

08 Jun, 2016

1 commit

  • The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
    with what looks like the wrong parameter. The write_lock_regs
    function takes a pointer to the registers, not the bcm_kona_gpio
    structure.

    Fix the warning, and probably bug by changing the function to
    pass reg_base instead of kona_gpio, fixing the following warning:

    drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1
    (different address spaces)
    expected void [noderef] *reg_base
    got struct bcm_kona_gpio *kona_gpio
    warning: incorrect type in argument 1 (different address spaces)
    expected void [noderef] *reg_base
    got struct bcm_kona_gpio *kona_gpio

    Cc: stable@vger.kernel.org
    Signed-off-by: Ben Dooks
    Acked-by: Ray Jui
    Reviewed-by: Markus Mayer
    Signed-off-by: Linus Walleij

    Ben Dooks
     

31 Mar, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    config GPIO_BCM_KONA
    bool "Broadcom Kona GPIO"

    ...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_platform_driver() uses the same init level priority as
    builtin_platform_driver() the init ordering remains unchanged with
    this commit.

    Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

    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: Ray Jui
    Cc: Alexandre Courbot
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: linux-gpio@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Walleij

    Paul Gortmaker
     

23 Feb, 2016

1 commit


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

1 commit


02 Jul, 2015

1 commit

  • Pull irq fixes from Thomas Gleixner:
    "This contains:

    - a series of fixes for interrupt drivers to prevent a potential race
    when installing a chained interrupt handler

    - a fix for cpumask pointer misuse

    - a fix for using the wrong interrupt number from struct irq_data

    - removal of unused code and outdated comments

    - a few new helper functions which allow us to cleanup the interrupt
    handling code further in 4.3

    I decided against doing the cleanup at the end of this merge window
    and rather do the preparatory steps for 4.3, so we can run the final
    ABI change at the end of the 4.3 merge window with less risk"

    * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    ARM/LPC32xx: Use irq not hwirq for __irq_set_handler_locked()
    genirq: Implement irq_set_handler_locked()/irq_set_chip_handler_name_locked()
    genirq: Introduce helper irq_desc_get_irq()
    genirq: Remove irq_node()
    genirq: Clean up outdated comments related to include/linux/irqdesc.h
    mn10300: Fix incorrect use of irq_data->affinity
    MIPS/ralink: Fix race in installing chained IRQ handler
    MIPS/pci: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    MIPS/ath25: Fix race in installing chained IRQ handler
    m68k/psc: Fix race in installing chained IRQ handler
    avr32/at32ap: Fix race in installing chained IRQ handler
    sh/intc: Fix race in installing chained IRQ handler
    sh/intc: Fix potential race in installing chained IRQ handler
    pinctrl/sun4i: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/samsung: Fix race in installing chained IRQ handler
    pinctrl/exynos: Fix race in installing chained IRQ handler
    pinctrl/st: Fix race in installing chained IRQ handler
    pinctrl/adi2: Fix race in installing chained IRQ handler
    ...

    Linus Torvalds
     

25 Jun, 2015

2 commits

  • 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().

    Search and conversion was done with coccinelle:

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    |
    -irq_set_chained_handler(E1, E3);
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    @@
    expression E1, E2, E3;
    @@
    (
    -if (irq_set_chained_handler(E1, E3) != 0)
    - BUG();
    ...
    |
    -irq_set_chained_handler(E1, E3);
    ...
    )
    -irq_set_handler_data(E1, E2);
    +irq_set_chained_handler_and_data(E1, E3, E2);

    Reported-by: Russell King
    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Ray Jui
    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: linux-gpio@vger.kernel.org

    Thomas Gleixner
     
  • Pull pin control updates from Linus Walleij:
    "Here is the bulk of pin control changes for the v4.2 series: Quite a
    lot of new SoC subdrivers and two new main drivers this time, apart
    from that business as usual.

    Details:

    Core functionality:
    - Enable exclusive pin ownership: it is possible to flag a pin
    controller so that GPIO and other functions cannot use a single pin
    simultaneously.

    New drivers:
    - NXP LPC18xx System Control Unit pin controller
    - Imagination Pistachio SoC pin controller

    New subdrivers:
    - Freescale i.MX7d SoC
    - Intel Sunrisepoint-H PCH
    - Renesas PFC R8A7793
    - Renesas PFC R8A7794
    - Mediatek MT6397, MT8127
    - SiRF Atlas 7
    - Allwinner A33
    - Qualcomm MSM8660
    - Marvell Armada 395
    - Rockchip RK3368

    Cleanups:
    - A big cleanup of the Marvell MVEBU driver rectifying it to
    correspond to reality
    - Drop platform device probing from the SH PFC driver, we are now a
    DT only shop for SuperH
    - Drop obsolte multi-platform check for SH PFC
    - Various janitorial: constification, grammar etc

    Improvements:
    - The AT91 GPIO portions now supports the set_multiple() feature
    - Split out SPI pins on the Xilinx Zynq
    - Support DTs without specific function nodes in the i.MX driver"

    * tag 'pinctrl-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (99 commits)
    pinctrl: rockchip: add support for the rk3368
    pinctrl: rockchip: generalize perpin driver-strength setting
    pinctrl: sh-pfc: r8a7794: add SDHI pin groups
    pinctrl: sh-pfc: r8a7794: add MMCIF pin groups
    pinctrl: sh-pfc: add R8A7794 PFC support
    pinctrl: make pinctrl_register() return proper error code
    pinctrl: mvebu: armada-39x: add support for Armada 395 variant
    pinctrl: mvebu: armada-39x: add missing SATA functions
    pinctrl: mvebu: armada-39x: add missing PCIe functions
    pinctrl: mvebu: armada-38x: add ptp functions
    pinctrl: mvebu: armada-38x: add ua1 functions
    pinctrl: mvebu: armada-38x: add nand functions
    pinctrl: mvebu: armada-38x: add sata functions
    pinctrl: mvebu: armada-xp: add dram functions
    pinctrl: mvebu: armada-xp: add nand rb function
    pinctrl: mvebu: armada-xp: add spi1 function
    pinctrl: mvebu: armada-39x: normalize ref clock naming
    pinctrl: mvebu: armada-xp: rename spi to spi0
    pinctrl: mvebu: armada-370: align spi1 clock pin naming
    pinctrl: mvebu: armada-370: align VDD cpu-pd pin naming with datasheet
    ...

    Linus Torvalds
     

06 May, 2015

1 commit


27 Apr, 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


24 Sep, 2014

1 commit

  • The __initconst is in the wrong place, and when moved to the correct place
    it uncovers an error where the variable is used by non-init data structures.

    Instead merely make them const and put the const in the right spot.

    Signed-off-by: Behan Webster
    Reviewed-by: Mark Charlebois
    Acked-by: Arnd Bergmann
    Acked-by: Matt Porter
    Signed-off-by: Linus Walleij

    Behan Webster
     

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
     

14 Mar, 2014

1 commit


06 Feb, 2014

3 commits


05 Feb, 2014

1 commit


09 Dec, 2013

1 commit


04 Dec, 2013

1 commit

  • 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: Christian Daudt
    Cc: Grygorii Strashko
    Reviewed-by: Markus Mayer
    Tested-by: Markus Mayer
    Reviewed-by: Javier Martinez Canillas
    Signed-off-by: Linus Walleij

    Linus Walleij
     

27 Nov, 2013

1 commit


31 Oct, 2013

1 commit


19 Oct, 2013

1 commit


16 Oct, 2013

1 commit

  • Rename the argument "virq" to just "irq", this IRQ isn't any
    more "virtual" than any other Linux IRQ number, we use "hwirq"
    for the actual hw-numbers, "virq" is just bogus. Rename the
    "gpio" variable to "hwirq" to reflect what it is. Rename one
    instance of "virq" to "child_irq" that better describes what
    it is.

    Cc: Markus Mayer
    Signed-off-by: Linus Walleij

    Linus Walleij
     

11 Oct, 2013

1 commit


21 Sep, 2013

2 commits

  • As per the pattern from other GPIO drivers, use set_irq_flags()
    on ARM only, use irq_set_noprobe() on other archs.

    Also rename the argument "virq" to just "irq", this IRQ isn't
    any more "virtual" than any other Linux IRQ number, we use
    "hwirq" for the actual hw-numbers, "virq" is just bogus.

    Reviewed-by: Markus Mayer
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Add the GPIO driver for the Broadcom bcm281xx family of mobile SoCs.
    These GPIO controllers may contain up to 8 banks where each bank
    includes 32 pins that can be driven high or low and act as an edge
    sensitive interrupt.

    Signed-off-by: Markus Mayer
    Reviewed-by: Christian Daudt
    Reviewed-by: Tim Kryger
    Reviewed-by: Matt Porter
    Reviewed-by: Stephen Warren
    [Added depends on OF_GPIO]
    Signed-off-by: Linus Walleij

    Markus Mayer