15 Jul, 2019

1 commit


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
     

08 Jun, 2019

2 commits


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 as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

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

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

    Thomas Gleixner
     

21 Feb, 2019

1 commit


26 Nov, 2018

1 commit

  • Commit 587f7a694f01 ("gpio: davinci: Use dev name for label and
    automatic base selection") broke the network support in legacy boot
    mode for da850-evm since we can no longer request the MDIO clock GPIO.

    Other boards may be broken too, which I haven't tested.

    The problem is in the fact that most board files still use the legacy
    GPIO API where lines are requested by numbers rather than descriptors.

    While this should be fixed eventually, in order to unbreak the board
    for now - provide a way to manually specify the GPIO base in platform
    data.

    Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection")
    Cc: stable@vger.kernel.org
    Signed-off-by: Bartosz Golaszewski
    Acked-by: Linus Walleij
    Signed-off-by: Sekhar Nori

    Bartosz Golaszewski
     

20 Sep, 2018

3 commits

  • These defines, structs and inline functions are used only internally by
    the driver, they do not belong in platform_data. Move them.

    Signed-off-by: Andrew F. Davis
    Tested-by: Keerthy
    Acked-by: Keerthy
    Signed-off-by: Linus Walleij

    Andrew F. Davis
     
  • Previously we created a controller structure per bank of GPIO pins. This
    has since been changed to one per controller, but the allocation size
    was not changed. Fix this here.

    This also leaves the variable 'nbank' unused, instead of removing it,
    move it down and use it to clean up a loop. For loops with multiple
    initializers and/or iteration expressions, especially ones that don't
    use those loop counters are quite hard to follow, fix this.

    Signed-off-by: Andrew F. Davis
    Tested-by: Keerthy
    Acked-by: Keerthy
    Signed-off-by: Linus Walleij

    Andrew F. Davis
     
  • Use dev_name to get a unique label and use -1 for a base to get our
    selection automatically. We pull in all GPIOs per chip now so this
    does not have the effect of out of order labels like before.

    We do these both together so we can drop all the static data in one
    patch. This also lets us normalize the return paths as we don't need
    any cleanup after this change.

    Signed-off-by: Andrew F. Davis
    Tested-by: Keerthy
    Acked-by: Keerthy
    Signed-off-by: Linus Walleij

    Andrew F. Davis
     

18 Jun, 2018

2 commits


13 Jun, 2018

1 commit

  • The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
    This patch replaces cases of:

    devm_kzalloc(handle, a * b, gfp)

    with:
    devm_kcalloc(handle, a * b, gfp)

    as well as handling cases of:

    devm_kzalloc(handle, a * b * c, gfp)

    with:

    devm_kzalloc(handle, array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    devm_kcalloc(handle, array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    devm_kzalloc(handle, 4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    Some manual whitespace fixes were needed in this patch, as Coccinelle
    really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    expression HANDLE;
    type TYPE;
    expression THING, E;
    @@

    (
    devm_kzalloc(HANDLE,
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression HANDLE;
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    expression HANDLE;
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    expression HANDLE;
    identifier SIZE, COUNT;
    @@

    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression HANDLE;
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression HANDLE;
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    expression HANDLE;
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression HANDLE;
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression HANDLE;
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
    |
    devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2, ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

30 May, 2018

1 commit

  • This nukes the following warning that is seen when building without
    OF support:

    drivers/gpio/gpio-davinci.c:437:25: warning: ‘keystone_gpio_get_irq_chip’ defined but not used [-Wunused-function]
    static struct irq_chip *keystone_gpio_get_irq_chip(unsigned int irq)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
    Signed-off-by: Sekhar Nori
    Signed-off-by: Linus Walleij

    Sekhar Nori
     

12 Feb, 2018

1 commit


01 Feb, 2018

1 commit

  • Pull GPIO updates from Linus Walleij:
    "The is the bulk of GPIO changes for the v4.16 kernel cycle. It is
    pretty calm this time around I think. I even got time to get to things
    like starting to clean up header includes.

    Core changes:

    - Disallow open drain and open source flags to be set simultaneously.
    This doesn't make electrical sense, and would the hardware actually
    respond to this setting, the result would be short circuit.

    - ACPI GPIO has a new core infrastructure for handling quirks. The
    quirks are there to deal with broken ACPI tables centrally instead
    of pushing the work to individual drivers. In the world of BIOS
    writers, the ACPI tables are perfect. Until they find a mistake in
    it. When such a mistake is found, we can patch it with a quirk. It
    should never happen, the problem is that it happens. So we
    accomodate for it.

    - Several documentation updates.

    - Revert the patch setting up initial direction state from reading
    the device. This was causing bad things for drivers that can't read
    status on all its pins. It is only affecting debugfs information
    quality.

    - Label descriptors with the device name if no explicit label is
    passed in.

    - Pave the ground for transitioning SPI and regulators to use GPIO
    descriptors by implementing some quirks in the device tree GPIO
    parsing code.

    New drivers:

    - New driver for the Access PCIe IDIO 24 family.

    Other:

    - Major refactorings and improvements to the GPIO mockup driver used
    for test and verification.

    - Moved the AXP209 driver over to pin control since it gained a pin
    control back-end. These patches will appear (with the same hashes)
    in the pin control pull request as well.

    - Convert the onewire GPIO driver w1-gpio to use descriptors. This is
    merged here since the W1 maintainers send very few pull requests
    and he ACKed it.

    - Start to clean up driver headers using to just use
    as appropriate"

    * tag 'gpio-v4.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (103 commits)
    gpio: Timestamp events in hardirq handler
    gpio: Fix kernel stack leak to userspace
    gpio: Fix a documentation spelling mistake
    gpio: Documentation update
    gpiolib: remove redundant initialization of pointer desc
    gpio: of: Fix NPE from OF flags
    gpio: stmpe: Delete an unnecessary variable initialisation in stmpe_gpio_probe()
    gpio: stmpe: Move an assignment in stmpe_gpio_probe()
    gpio: stmpe: Improve a size determination in stmpe_gpio_probe()
    gpio: stmpe: Use seq_putc() in stmpe_dbg_show()
    gpio: No NULL owner
    gpio: stmpe: i2c transfer are forbiden in atomic context
    gpio: davinci: Include proper header
    gpio: da905x: Include proper header
    gpio: cs5535: Include proper header
    gpio: crystalcove: Include proper header
    gpio: bt8xx: Include proper header
    gpio: bcm-kona: Include proper header
    gpio: arizona: Include proper header
    gpio: amd8111: Include proper header
    ...

    Linus Torvalds
     

14 Jan, 2018

1 commit


30 Nov, 2017

1 commit


14 Aug, 2017

3 commits


29 May, 2017

1 commit


15 Mar, 2017

1 commit


26 Jan, 2017

4 commits

  • With the current redesign of driver it's not necessary to have
    custom .xlate() as the gpiolib will assign default of_gpio_simple_xlate().

    Suggested-by: Grygorii Strashko
    Signed-off-by: Keerthy
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Keerthy
     
  • Update GPIO driver to support Multiple GPIO controllers by updating
    the base of subsequent GPIO chips with total of previous chips
    gpio count so that gpio_add_chip gets unique numbers.

    Signed-off-by: Keerthy
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Keerthy
     
  • The Davinci GPIO driver is implemented to work with one monolithic
    Davinci GPIO platform device which may have up to Y(144) gpios.
    The Davinci GPIO driver instantiates number of GPIO chips with
    max 32 gpio pins per each during initialization and one IRQ domain.
    So, the current GPIO's opjects structure is:

    Davinci GPIO controller
    |- ------|
    ... |--- irq_domain (hwirq [0..143])
    |- ------|

    Current driver creates one chip for every 32 GPIOs in a controller.
    This was a limitation earlier now there is no need for that. Hence
    redesigning the driver to create one gpio chip for all the ngpio
    in the controller.

    |- ------|--- irq_domain (hwirq [0..143]).

    The previous discussion on this can be found here:
    https://www.spinics.net/lists/linux-omap/msg132869.html

    Signed-off-by: Keerthy
    Signed-off-by: Linus Walleij

    Keerthy
     
  • gpio2regs is written making an assumption that driver supports only
    one instance of gpio controller. Removing this and adding a generic
    array so as to support multiple instances of gpio controllers.

    Signed-off-by: Keerthy
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Keerthy
     

11 Jan, 2017

1 commit


09 Nov, 2016

1 commit

  • The gpiod framework uses the chip label to match a specific chip.
    The davinci gpio driver, creates several chips using always the same
    label, which is not compatible with gpiod.

    To allow platform data to declare gpio lookup tables, and for drivers
    to use the gpiod framework, allocate unique label per registered chip.

    Signed-off-by: Axel Haslam
    Reviewed-by: Sekhar Nori
    Acked-by: Kevin Hilman
    Signed-off-by: Linus Walleij

    Axel Haslam
     

22 Feb, 2016

1 commit


16 Feb, 2016

1 commit

  • This fixes a possible NULL pointer deference in the function,
    davinci_gpio_probe due to the function, gpio2regs being able
    to return a NULL pointer if it rans to get the registers for
    the gpio devices on a davinci board. Furthermore if this does
    arise return -ENXIO to signal callers that this case has arisen
    and avoiding setting the regs or other pointer values on the

    Signed-off-by: Nicholas Krause
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Nicholas Krause
     

10 Feb, 2016

2 commits

  • Driver only needs to allocate for [ngpio / 32] controllers,
    as each controller handles 32 gpios. But the current driver
    allocates for ngpio of which the extra allocated are unused.
    Fix it be registering only the required number of controllers.

    Signed-off-by: Lokesh Vutla
    Signed-off-by: Keerthy
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Lokesh Vutla
     
  • Currently the first parameter of irq_domain_add_legacy is NULL.
    irq_find_host function returns NULL when we do not populate the of_node
    and hence irq_of_parse_and_map call fails whenever we want to request a
    gpio irq. This fixes the request_irq failures for gpio interrupts.

    Signed-off-by: Keerthy
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Keerthy
     

28 Jan, 2016

1 commit


05 Jan, 2016

1 commit


27 Dec, 2015

1 commit

  • As we want gpio_chip .get() calls to be able to return negative
    error codes and propagate to drivers, we need to go over all
    drivers and make sure their return values are clamped to [0,1].
    We do this by using the ret = !!(val) design pattern.

    Cc: Sekhar Nori
    Cc: Santosh Shilimkar
    Reviewed-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Linus Walleij
     

04 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
     

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