26 Jan, 2017

1 commit

  • Currently we already have two pin configuration related callbacks
    available for GPIO chips .set_single_ended() and .set_debounce(). In
    future we expect to have even more, which does not scale well if we need
    to add yet another callback to the GPIO chip structure for each possible
    configuration parameter.

    Better solution is to reuse what we already have available in the
    generic pinconf.

    To support this, we introduce a new .set_config() callback for GPIO
    chips. The callback takes a single packed pin configuration value as
    parameter. This can then be extended easily beyond what is currently
    supported by just adding new types to the generic pinconf enum.

    If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
    just assign gpiochip_generic_config() (introduced in this patch) to
    .set_config and that will take care configuration requests are directed
    to the pinctrl driver.

    We then convert the existing drivers over .set_config() and finally
    remove the .set_single_ended() and .set_debounce() callbacks.

    Suggested-by: Linus Walleij
    Signed-off-by: Mika Westerberg
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Linus Walleij

    Mika Westerberg
     

23 Feb, 2016

1 commit


05 Jan, 2016

1 commit

  • The separate struct bgpio_chip has been a pain to handle, both
    by being confusingly similar in name to struct gpio_chip and
    for being contained inside a struct so that struct gpio_chip
    is contained in a struct contained in a struct, making several
    steps of dereferencing necessary.

    Make things simpler: include the fields directly into
    , #ifdef:ed for CONFIG_GENERIC_GPIO, and
    get rid of the altogether. Prefix
    some of the member variables with bgpio_* and add proper
    kerneldoc while we're at it.

    Modify all users to handle the change and use a struct
    gpio_chip directly. And while we're at it: replace all
    container_of() dereferencing by gpiochip_get_data() and
    registering the gpio_chip with gpiochip_add_data().

    Cc: arm@kernel.org
    Cc: Alexander Shiyan
    Cc: Shawn Guo
    Cc: Sascha Hauer
    Cc: Kukjin Kim
    Cc: Alexandre Courbot
    Cc: Brian Norris
    Cc: Florian Fainelli
    Cc: Sudeep Holla
    Cc: Lorenzo Pieralisi
    Cc: Nicolas Pitre
    Cc: Olof Johansson
    Cc: Vladimir Zapolskiy
    Cc: Rabin Vincent
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-omap@vger.kernel.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: bcm-kernel-feedback-list@broadcom.com
    Acked-by: Gregory Fong
    Acked-by: Liviu Dudau
    Acked-by: H Hartley Sweeten
    Acked-by: Tony Lindgren
    Acked-by: Krzysztof Kozlowski
    Acked-by: Lee Jones
    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

2 commits

  • The irq argument of most interrupt flow handlers is unused or merily
    used instead of a local variable. The handlers which need the irq
    argument can retrieve the irq number from the irq descriptor.

    Search and update was done with coccinelle and the invaluable help of
    Julia Lawall.

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu
    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Cc: linux-gpio@vger.kernel.org

    Thomas Gleixner
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor.

    Search and replacement was done with coccinelle:

    @@
    struct irq_data *d;
    expression E1;
    @@

    -__irq_set_handler_locked(d->irq, E1);
    +irq_set_handler_locked(d, E1);

    Signed-off-by: Thomas Gleixner
    Cc: Jiang Liu
    Cc: Julia Lawall
    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Cc: linux-gpio@vger.kernel.org

    Thomas Gleixner
     

20 Oct, 2014

1 commit


27 May, 2014

1 commit


16 May, 2014

1 commit


16 Oct, 2013

1 commit

  • I have no idea why this driver is using __raw* accessors for
    reading and writing registers, I suspect it is just force of
    habit or copy/paste. Change all to readb()/writeb() except
    one chain where I used writeb_relaxed() up until the last
    writeb().

    Cc: Ryan Mallon
    Cc: H Hartley Sweeten
    Signed-off-by: Linus Walleij

    Linus Walleij
     

29 Nov, 2012

1 commit

  • 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
     

20 May, 2012

1 commit

  • It fixes the issue in gpio-generic that commit fb14921 (gpio/mxc: add
    missing initialization of basic_mmio_gpio shadow variables) manged to
    fix in gpio-mxc driver, so that other platform specific drivers do not
    suffer from the same problem over and over again.

    Changes since v1:
    * Turn the last parameter of bgpio_init() "bool big_endian" into
    "unsigned long flags" and give those really quirky hardwares a
    chance to tell that reg_set and reg_dir are unreadable.

    Signed-off-by: Shawn Guo
    [grant.likely: Fix big-endian usage to explicitly set BBGPIOF_BIG_ENDIAN]
    Signed-off-by: Grant Likely

    Shawn Guo
     

29 Mar, 2012

1 commit

  • Pull GPIO changes for v3.4 from Grant Likely:
    "Primarily gpio device driver changes with some minor side effects
    under arch/arm and arch/x86. Also includes a few core changes such as
    explicitly supporting (electrical) open source and open drain outputs
    and some help for parsing gpio devicetree properties."

    Fix up context conflict due to Laxman Dewangan adding sleep control for
    the tps65910 driver separately for gpio's and regulators.

    * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6: (34 commits)
    gpio/ep93xx: Remove unused inline function and useless pr_err message
    gpio/sodaville: Mark broken due to core irqdomain migration
    gpio/omap: fix redundant decoding of gpio offset
    gpio/omap: fix incorrect update to context.irqenable1
    gpio/omap: fix incorrect context restore logic in omap_gpio_runtime_*
    gpio/omap: fix missing dataout context save in _set_gpio_dataout_reg
    gpio/omap: fix _set_gpio_irqenable implementation
    gpio/omap: fix trigger type to unsigned
    gpio/omap: fix wakeup_en register update in _set_gpio_wakeup()
    gpio: tegra: tegra_gpio_config shouldn't be __init
    gpio/davinci: fix enabling unbanked GPIO IRQs
    gpio/davinci: fix oops on unbanked gpio irq request
    gpio/omap: Fix section warning for omap_mpuio_alloc_gc()
    ARM: tegra: export tegra_gpio_{en,dis}able
    gpio/gpio-stmpe: Fix the value returned by _get_value routine
    Documentation/gpio.txt: Explain expected pinctrl interaction
    GPIO: LPC32xx: Add output reading to GPO P3
    GPIO: LPC32xx: Fix missing bit selection mask
    gpio/omap: fix wakeups on level-triggered GPIOs
    gpio/omap: Fix IRQ handling for SPARSE_IRQ
    ...

    Linus Torvalds
     

26 Mar, 2012

1 commit


14 Mar, 2012

1 commit

  • Move the pinmux setting of the EP93xx GPIOs to the core code. This
    removes the need for the GPIO driver to have access to the system
    controller registers.

    Signed-off-by: Ryan Mallon
    Cc: Grant Likely
    Reviewed-by: Mika Westerberg
    Acked-by: Hartley Sweeten

    Ryan Mallon
     

01 Nov, 2011

1 commit


02 Oct, 2011

1 commit


22 Aug, 2011

1 commit


26 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

10 Jun, 2011

1 commit


09 Jun, 2011

1 commit


08 Jun, 2011

1 commit

  • With this driver now being moved from arch/arm/mach-ep93xx/gpio.c to
    drivers/gpio/gpio-ep93xx.c the prefix "ep93xx" is now redundant in the
    pr_* output. Using KBUILD_MODNAME is sufficient.

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: Grant Likely

    H Hartley Sweeten
     

07 Jun, 2011

2 commits