09 Jun, 2017

1 commit


08 Jun, 2017

3 commits


23 Feb, 2017

2 commits

  • For some platform such as imx7D SDB, one pin of 74x164 to
    control all peripheral power supply(PERI_3V_EN).
    The pin should keep in high voltage level when 74x164 loading,
    otherwise the module depend on PERI_3V3 will lose power.
    So add new property registers-default into 74x164 driver.

    Signed-off-by: Sandor Yu
    Signed-off-by: Fugang Duan
    (cherry picked from commit: 61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)

    Sandor Yu
     
  • The pca953x type of devices, e.g. max7310, may have a reset which needs
    to be handled to get the device start working. Add a device_reset()
    call for that, and defer the probe if the reset controller for that is
    not ready yet.

    Signed-off-by: Shawn Guo
    Signed-off-by: Fugang Duan
    (cherry picked from commit: d3264091b30b777d94a18efda9823a06668d5b10)

    Shawn Guo
     

20 Jan, 2017

1 commit

  • commit 5018ada69a04c8ac21d74bd682fceb8e42dc0f96 upstream.

    When removing a gpiochip that uses GPIO hogging (e.g. by unloading the
    chip's DT overlay), a warning is printed:

    gpio gpiochip8: REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED

    This happens because gpiochip_free_hogs() is called after the gdev->chip
    pointer is reset to NULL. Hence __gpiod_free() cannot determine the
    chip in use, and cannot clear flags nor call the optional chip-specific
    .free() callback.

    Move the call to gpiochip_free_hogs() up to fix this.

    Fixes: ff2b135922992756 ("gpio: make the gpiochip a real device")
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

09 Jan, 2017

2 commits

  • commit f4e81c529767b9a33d1b27695c54dc84a14af30d upstream.

    The GPIO chardev is used for management tasks (allocating line and event
    handles) and does neither support read() nor write() operations. Hence it
    does not make much sense to allow seek operations.

    Currently the chardev uses noop_llseek() for its seek implementation. This
    function does not move the pointer and simply returns the current position
    (always 0 for the GPIO chardev). noop_llseek() is primarily meant for
    devices that can not support seek, but where there might be a user that
    depends on the seek() operation succeeding. For newly added devices that
    can not support seek operations it is recommended to use no_llseek(), which
    will return an error. For more information see commit 6038f373a3dc
    ("llseek: automatically add .llseek fop").

    Unfortunately this was overlooked when the GPIO chardev ABI was introduced.
    But it is highly unlikely that since then userspace applications have
    appeared that rely on being able to perform non-failing seek operations on
    a GPIO chardev file descriptor. So it should be safe to change from
    noop_llseel() to no_seek(). Also use nonseekable_open() in the chardev
    open() callback to clear the FMODE_SEEK, FMODE_PREAD and FMODE_PWRITE flags
    from the file. Neither of these should be set on a file that does not
    support seek operations.

    Fixes: 3c702e9987e2 ("gpio: add a userspace chardev ABI for GPIOs")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • commit 1516c6350aa2770b8a5e36d40c3ec5078f92ba70 upstream.

    commit 43db289d00c6 ("gpio: stmpe: Rework registers access")
    reworked the STMPE register access so as to use
    [STMPE_IDX_*_LSB + i] to access the 8bit register for a
    certain bank, assuming the CSB and MSB will follow after
    the enumerator. For this to work the index needs to go from
    (size-1) to 0 not 0 to (size-1).

    However for the GPIO IRQ handler, the status registers we read
    register MSB + 3 bytes ahead for the 24 bit GPIOs and index
    registers from MSB upwards and run an index i over the
    registers UNLESS we are STMPE1600.

    This is not working when we get to clearing the interrupt
    EDGE status register STMPE_IDX_GPEDR_[LCM]SB: it is indexed
    like all other registers [STMPE_IDX_*_LSB + i] but in this
    loop we index from 0 to get the right bank index for the
    calculations, and we need to just add i to the MSB.

    Before this, interrupts on the STMPE2401 were broken, this
    patch fixes it so it works again.

    Cc: Patrice Chotard
    Fixes: 43db289d00c6 ("gpio: stmpe: Rework registers access")
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     

17 Nov, 2016

1 commit

  • This option was added in 6a89a314ab107a12af08c71420c19a37a30fc2d3 to
    allow use of the devm_gpio_* functions without CONFIG_GPIOLIB.

    However, only a few months later in
    b69ac52449c658b7ac40034dc3c5f5f4a71a723d, CONFIG_GPIOLIB was added
    as a dependency, defeating the original purpose of this option.
    Instead of that patch, the original commit could have just been
    reverted (and in fact was partially so in
    403c1d0be5ccbd750d25c59d8358843a81e52e3b). Further, since this
    option has a dependency on HAS_IOMEM, even though it does not
    require it, it causes build failures when !HAS_IOMEM (e.g. in a
    uml build).

    Fix that by completely removing the option, in essence completing
    the reversion of the original commit.

    Signed-off-by: Keno Fischer
    Signed-off-by: Linus Walleij

    Keno Fischer
     

15 Nov, 2016

2 commits

  • The bit in the TC3589x direction register is 0 for input
    and 1 for output, but the gpiolib expects the reverse.
    Fix up the logic.

    Cc: stable@vger.kernel.org
    Fixes: 14063d71e5e6 ("gpio: tc3589x: add .get_direction() and small cleanup")
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • When locking a GPIO line as IRQ, we go to lengths to
    double-check that the line is really set as input before
    marking it as used for IRQ. This is not good on GPIO chips
    that can sleep, because this function is called in IRQ-safe
    context. Just skip this if it can't be checked quickly.

    Currently this happens on sleeping expanders such as STMPE
    or TC3589x:

    BUG: scheduling while atomic: swapper/1/0x00000002
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.0-rc1+ #38
    Hardware name: Nomadik STn8815
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (__schedule_bug+0x54/0x80)
    [] (__schedule_bug) from [] (__schedule+0x3a0/0x460)
    [] (__schedule) from [] (schedule+0x54/0xb8)
    (...)

    This patch fixes that problem and relies on the direction
    read from the chip when it was added.

    Cc: stable@vger.kernel.org
    Fixes: 9c10280d85c1 ("gpio: flush direction status in gpiochip_lock_as_irq()")
    Cc: Patrice Chotard
    Signed-off-by: Linus Walleij

    Linus Walleij
     

08 Nov, 2016

2 commits

  • Need to ensure that reg_output is not updated while setting multiple
    bits. This makes the mutex locking behaviour for the set_multiple call
    consistent with that of the set_value call.

    Cc: stable@vger.kernel.org
    Fixes: b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple")
    Signed-off-by: Phil Reid
    Signed-off-by: Linus Walleij

    Phil Reid
     
  • gpiod_set_array_value_complex does not clear the bits field.
    Therefore when the drivers set_multiple funciton is called bits outside
    the mask are undefined and can be either set or not. So bank_val needs
    to be masked with bank_mask before or with the reg_val cache.

    Cc: stable@vger.kernel.org
    Fixes: b4818afeacbd ("gpio: pca953x: Add set_multiple to allow multiple")
    Signed-off-by: Phil Reid
    Signed-off-by: Linus Walleij

    Phil Reid
     

02 Nov, 2016

1 commit

  • This fixes the irq allocation in this driver to not print:
    irq: Cannot allocate irq_descs @ IRQ34, assuming pre-allocated
    irq: Cannot allocate irq_descs @ IRQ66, assuming pre-allocated

    Which happens because the driver already called irq_alloc_descs()
    and so the change to use irq_domain_add_simple resulted in calling
    irq_alloc_descs() twice.

    Modernize the irq allocation in this driver to use the
    irq_domain_add_linear flow directly and eliminate the use of
    irq_domain_add_simple/legacy

    Fixes: ce931f571b6d ("gpio/mvebu: convert to use irq_domain_add_simple()")
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Linus Walleij

    Jason Gunthorpe
     

01 Nov, 2016

2 commits

  • Sylvain Lemieux reports the LPC32xx GPIO driver is broken since
    commit 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and
    struct gg_data"). Probably, gpio-etraxfs.c and gpio-davinci.c are
    broken too.

    Those drivers register multiple gpio_chip that are associated to a
    single OF node, and their own .of_xlate() checks if the passed
    gpio_chip is valid.

    Now, the problem is of_find_gpiochip_by_node() returns the first
    gpio_chip found to match the given node. So, .of_xlate() fails,
    except for the first GPIO bank.

    Reverting the commit could be a solution, but I do not want to go
    back to the mess of struct gg_data. Another solution here is to
    take the match by a node pointer and the success of .of_xlate().
    It is a bit clumsy to call .of_xlate twice; for gpio_chip matching
    and for really getting the gpio_desc index. Perhaps, our long-term
    goal might be to convert the drivers to single chip registration,
    but this commit will solve the problem until then.

    Fixes: 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data")
    Signed-off-by: Masahiro Yamada
    Reported-by: Sylvain Lemieux
    Tested-by: David Lechner
    Signed-off-by: Linus Walleij

    Masahiro Yamada
     
  • When allocating a new line handle or event a file is allocated that it is
    associated to. The file is attached to a file descriptor of the current
    process and the file descriptor is returned to userspace using
    copy_to_user(). If this copy operation fails the line handle or event
    allocation is aborted, all acquired resources are freed and an error is
    returned.

    But the file struct is not freed and left attached to the userspace
    application and even though the file descriptor number was not copied it is
    trivial to guess. If a userspace application performs a IOCTL on such a
    left over file descriptor it will trigger a use-after-free and if the file
    descriptor is closed (latest when the application exits) a double-free is
    triggered.

    anon_inode_getfd() performs 3 tasks, allocate a file struct, allocate a
    file descriptor for the current process and install the file struct in the
    file descriptor. As soon as the file struct is installed in the file
    descriptor it is accessible by userspace (even if the IOCTL itself hasn't
    completed yet), this means uninstalling the fd on the error path is not an
    option, since userspace might already got a reference to the file.

    Instead anon_inode_getfd() needs to be broken into its individual steps.
    The allocation of the file struct and file descriptor is done first, then
    the copy_to_user() is executed and only if it succeeds the file is
    installed.

    Since the file struct is reference counted it can not be just freed, but
    its reference needs to be dropped, which will also call the release()
    callback, which will free the state attached to the file. So in this case
    the normal error cleanup path should not be taken.

    Cc: stable@vger.kernel.org
    Fixes: d932cd49182f ("gpio: free handles in fringe cases")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     

24 Oct, 2016

2 commits

  • From the beginning of the gpio-mpc8xxx.c, the "handle_level_irq"
    has being used to handle GPIO interrupts in the PowerPC/Layerscape
    platforms. But actually, almost all PowerPC/Layerscape platforms
    assert an interrupt request upon either a high-to-low change or
    any change on the state of the signal.

    So the "handle_level_irq" is not reasonable for PowerPC/Layerscape
    GPIO interrupt, it should be "handle_edge_irq". Otherwise the system
    may lost some interrupts from the PIN's state changes.

    Signed-off-by: Liu Gang
    Signed-off-by: Linus Walleij

    Liu Gang
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/gpio/gpio-ath79.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/gpio/gpio-ath79.ko | grep alias
    alias: of:N*T*Cqca,ar9340-gpioC*
    alias: of:N*T*Cqca,ar9340-gpio
    alias: of:N*T*Cqca,ar7100-gpioC*
    alias: of:N*T*Cqca,ar7100-gpio

    Signed-off-by: Javier Martinez Canillas
    Acked-by: Aban Bedel
    Signed-off-by: Linus Walleij

    Javier Martinez Canillas
     

21 Oct, 2016

9 commits

  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/gpio/gpio-ts4800.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/gpio/gpio-ts4800.ko | grep alias
    alias: of:N*T*Ctechnologic,ts4800-gpioC*
    alias: of:N*T*Ctechnologic,ts4800-gpio

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Linus Walleij

    Javier Martinez Canillas
     
  • The GPIO_GET_LINEEVENT_IOCTL currently ignores unknown or undefined
    linehandle and lineevent flags. From a backwards and forwards compatibility
    viewpoint it is highly desirable to reject unknown flags though.

    On one hand an application that is using newer flags and is running on
    an older kernel has no way to detect if the new flags were handled
    correctly if they are silently discarded.

    On the other hand an application that (accidentally) passes undefined flags
    will run fine on an older kernel, but may break on a newer kernel when
    these flags get defined.

    Ensure that requests that have undefined flags set are rejected with an
    error, rather than silently discarding the undefined flags.

    Cc: stable@vger.kernel.org
    Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The GPIO_GET_LINEHANDLE_IOCTL currently ignores unknown or undefined
    linehandle flags. From a backwards and forwards compatibility viewpoint it
    is highly desirable to reject unknown flags though.

    On one hand an application that is using newer flags and is running on
    an older kernel has no way to detect if the new flags were handled
    correctly if they are silently discarded.

    On the other hand an application that (accidentally) passes undefined flags
    will run fine on an older kernel, but may break on a newer kernel when
    these flags get defined.

    Ensure that requests that have undefined flags set are rejected with an
    error, rather than silently discarding the undefined flags.

    Cc: stable@vger.kernel.org
    Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The GPIOHANDLE_GET_LINE_VALUES_IOCTL handler allocates a gpiohandle_data
    struct on the stack and then passes it to copy_to_user(). But depending on
    the number of requested line handles the struct is only partially
    initialized.

    This exposes the previous, potentially sensitive, stack content to the
    issuing userspace application. To avoid this make sure that the struct is
    fully initialized.

    Cc: stable@vger.kernel.org
    Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The line offset that is used as an index into the descs array is provided
    by userspace and might go beyond the bounds of the array. If that happens
    undefined behavior will occur.

    Make sure that the offset is within the bounds of the desc array and reject
    any requests that specify a value outside of it.

    Cc: stable@vger.kernel.org
    Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The GPIOHANDLE_GET_LINE_VALUES_IOCTL handler allocates a gpiohandle_data
    struct on the stack and then passes it to copy_to_user(). But only the
    first element of the values array in the struct is set, which leaves the
    struct partially initialized.

    This exposes the previous, potentially sensitive, stack content to the
    issuing userspace application. To avoid this make sure that the struct is
    fully initialized.

    Cc: stable@vger.kernel.org
    Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The line offset that is used as an index into the descs array is provided
    by userspace and might go beyond the bounds of the array. If that happens
    undefined behavior will occur.

    Make sure that the offset is within the bounds of the desc array and reject
    any requests that specify a value outside of it.

    Cc: stable@vger.kernel.org
    Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The GPIO_GET_CHIPINFO_IOCTL handler allocates a gpiochip_info struct on the
    stack and then passes it to copy_to_user(). But depending on the length of
    the GPIO chip name and label the struct is only partially initialized.

    This exposes the previous, potentially sensitive, stack content to the
    issuing userspace application. To avoid this make sure that the struct is
    fully initialized.

    Cc: stable@vger.kernel.org
    Fixes: 521a2ad6f862 ("gpio: add userspace ABI for GPIO line information")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     
  • The current line offset validation is off by one. Depending on the data
    stored behind the descs array this can either cause undefined behavior or
    disclose arbitrary, potentially sensitive, memory to the issuing userspace
    application.

    Make sure that offset is within the bounds of the desc array.

    Cc: stable@vger.kernel.org
    Fixes: 521a2ad6f862 ("gpio: add userspace ABI for GPIO line information")
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Linus Walleij

    Lars-Peter Clausen
     

20 Oct, 2016

4 commits

  • acpi_dev_gpio_irq_get() currently ignores the error returned
    by acpi_get_gpiod_by_index() and overwrites it with -ENOENT.

    Problem is this error can be -EPROBE_DEFER, which just blows
    up some drivers when the module ordering is not correct.

    Cc: stable@vger.kernel.org
    Signed-off-by: David Arcari
    Signed-off-by: Benjamin Tissoires
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    David Arcari
     
  • Building the gpio-mockup driver without SYSFS results in a harmless Kconfig
    warning:

    warning: (GPIO_MOCKUP) selects GPIO_SYSFS which has unmet direct dependencies (GPIOLIB && SYSFS)

    We can easily avoid that warning by adding a dependency on SYSFS.

    Fixes: 0f98dd1b27d2 ("gpio/mockup: add virtual gpio device")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Walleij

    Arnd Bergmann
     
  • && was obviously intended here.

    Fixes: 6936e1f88d23 ('gpio: stmpe: Write int status register only when needed')
    Signed-off-by: Dan Carpenter
    Acked-by: Patrice Chotard
    Signed-off-by: Linus Walleij

    Dan Carpenter
     
  • Free memory mapping, if mxs_gpio_probe is not successful.

    Signed-off-by: Arvind Yadav
    Signed-off-by: Linus Walleij

    Arvind Yadav
     

12 Oct, 2016

1 commit


08 Oct, 2016

1 commit

  • Pull i2c updates from Wolfram Sang:
    "Here is the 4.9 pull request from I2C including:

    - centralized error messages when registering to the core
    - improved lockdep annotations to prevent false positives
    - DT support for muxes, gates, and arbitrators
    - bus speeds can now be obtained from ACPI
    - i2c-octeon got refactored and now supports ThunderX SoCs, too
    - i2c-tegra and i2c-designware got a bigger bunch of updates
    - a couple of standard driver fixes and improvements"

    * 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (71 commits)
    i2c: axxia: disable clks in case of failure in probe
    i2c: octeon: thunderx: Limit register access retries
    i2c: uniphier-f: fix misdetection of incomplete STOP condition
    gpio: pca953x: variable 'id' was used twice
    i2c: i801: Add support for Kaby Lake PCH-H
    gpio: pca953x: fix an incorrect lockdep warning
    i2c: add a warning to i2c_adapter_depth()
    lockdep: make MAX_LOCKDEP_SUBCLASSES unconditionally visible
    i2c: export i2c_adapter_depth()
    i2c: rk3x: Fix variable 'min_total_ns' unused warning
    i2c: rk3x: Fix sparse warning
    i2c / ACPI: Do not touch an I2C device if it belongs to another adapter
    i2c: octeon: Fix high-level controller status check
    i2c: octeon: Avoid sending STOP during recovery
    i2c: octeon: Fix set SCL recovery function
    i2c: rcar: add support for r8a7796 (R-Car M3-W)
    i2c: imx: make bus recovery through pinctrl optional
    i2c: meson: add gxbb compatible string
    i2c: uniphier-f: set the adapter to master mode when probing
    i2c: uniphier-f: avoid WARN_ON() of clk_disable() in failure path
    ...

    Linus Torvalds
     

06 Oct, 2016

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v4.9 series:

    Subsystem improvements:

    - do away with the last users of the obsolete Kconfig options
    ARCH_REQUIRE_GPIOLIB and ARCH_WANT_OPTIONAL_GPIOLIB (the latter
    always sounded like an item on a wishlist to Santa Claus to me). We
    can now select GPIOLIB and be done with it, for all archs. After
    some struggle it even work on UM. Not that it has GPIO, but if it
    wants to, it can select the library.

    - continued efforts to make drivers properly either tristate or bool.

    - introduce a warning for drivers assigning default triggers to their
    irqchip lines when probed from device tree, so we find and fix
    these ambigous drivers. It is agreed that in the OF config path,
    the device tree defines trigger characteristics.

    - the same warning, mutatis mutandis, for ACPI-probed GPIO irqchips.

    - we introduce the ability to mark certain IRQ lines as "unusable" as
    they can be taken by BIOS/firmware, unrouted in silicon and
    generally nasty if you use them, and such things. This is put to
    good use in the STMPE driver and also in the Cherryview pin control
    driver.

    - a new "mockup" virtual GPIO device that can be used for testing.
    The plan is to add unit tests under tools/* for exercising this
    device and verify that the kernel code paths are working as they
    should.

    - make memory-mapped I/O-drivers depend on HAS_IOMEM. This was
    implicit all the time, but when people started building UM with
    allyesconfig or allmodconfig it exploded in their face.

    - move some stray bits of device tree and ACPI HW description
    callbacks down into their respective implementation silo. These
    were causing issues when compiling on !HAS_IOMEM as well, so now
    eventually UM compiles the GPIOLIB library if it wants to.

    New drivers:

    - new driver for the Aspeed GPIO front-end companion to the pin
    controller merged through the pin control tree.

    - new driver for the LP873x PMIC GPIO portions.

    - new driver for Technologic Systems' I2C FPGA GPIO such as TS4900,
    TS-7970, TS-7990 and TS-4100.

    - new driver for the Broadcom BCM63xx series including BCM6338 and
    BCM6345.

    - new driver for the Intel WhiskeyCove PMIC GPIO.

    - new driver for the Allwinner AXP209 PMIC GPIO portions.

    - new driver for Diamond Systems 48 line GPIO-MM, another of these
    port-mapped I/O expansion cards.

    - support the STMicroelectronics STMPE1600 variant in the STMPE
    driver.

    Driver improvements:

    - the STMPE driver now supports rising/falling edge detection
    properly for IRQs.

    - the PCA954x will now fetch and enable its VCC regulator properly.

    - major rework of the PCA953x driver with the goal of eventually
    switching it over to use regmap and thus modernize it even more.

    - switch the IOP driver to use the generic MMIO GPIO library.

    - move the ages old HTC EGPIO (extended GPIO) GPIO expander driver
    over to this subsystem from MFD, achieveing some separation of
    concerns"

    * tag 'gpio-v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (81 commits)
    gpio: add missing static inline
    gpio: OF: localize some gpiochip init functions
    gpio: acpi: separation of concerns
    gpio: OF: separation of concerns
    gpio: make memory-mapped drivers depend on HAS_IOMEM
    gpio: stmpe: use BIT() macro
    gpio: stmpe: forbid unused lines to be mapped as IRQs
    mfd/gpio: Move HTC GPIO driver to GPIO subsystem
    gpio: MAINTAINERS: Add an entry for GPIO mockup driver
    gpio/mockup: add virtual gpio device
    gpio: Added zynq specific check for special pins on bank zero
    gpio: axp209: Implement get_direction
    gpio: aspeed: remove redundant return value check
    gpio: loongson1: remove redundant return value check
    ARM: omap2: fix missing include
    gpio: tc3589x: fix up complaints on unsigned
    gpio: tc3589x: add .get_direction() and small cleanup
    gpio: f7188x: use gpiochip_get_data instead of container_of
    gpio: tps65218: use devm_gpiochip_add_data() for gpio registration
    gpio: aspeed: fix return value check in aspeed_gpio_probe()
    ...

    Linus Torvalds
     

04 Oct, 2016

3 commits

  • of_get_named_gpiod_flags() was missing a static inline version
    when compiling without OF_GPIO. Add this.

    Reported-by: kbuild test robot
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • of_gpiochip_add() and of_gpiochip_remove() are only used locally
    in the gpio subsystem so move these functions to the local
    header.

    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • The generic GPIO library directly implement code for acpi_find_gpio()
    which is only used with CONFIG_ACPI. This was probably done because
    OF did the same thing, but I removed that so remove this too.

    Rename the internal acpi_find_gpio() in gpiolib-acpi.c to
    acpi_populate_gpio_lookup() which seems to be more appropriate anyway
    so as to avoid a namespace clash with the same function.

    Make the stub return -ENOENT rather than -ENOSYS (as that is for
    syscalls!).

    For some reason the sunxi pin control driver was including the private
    gpiolib header, it works just fine without it so remove that oneliner.

    Cc: Rafael J. Wysocki
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Linus Walleij
     

03 Oct, 2016

2 commits

  • The generic GPIO library directly implement code for of_find_gpio()
    which is only used with CONFIG_OF and causes compilation problems
    on archs that do not even have stubs for OF functions, especially
    on UM that does not implement any IO remap functions.

    Move the function to gpiolib-of.c, implement a static inline stub
    in gpiolib.h returning PTR_ERR(-ENOENT) if CONFIG_OF_GPIO is not
    set and be done with it.

    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This one is pretty obvious: on UM Linux compilation of things
    like allmodconfig and allyesconfig will fail due to the
    absence of IO memory. Simply make these drivers depend on
    HAS_IOMEM, it has been implicitly assumed all the time, so
    just make it explicit.

    The generic MMIO library also assumes that IOMEM is present
    so make also this depend on HAS_IOMEM.

    Reported-by: kbuild test robot
    Signed-off-by: Linus Walleij

    Linus Walleij