20 Oct, 2016

1 commit


23 Sep, 2016

2 commits

  • Linus Walleij
     
  • When using GPIO irqchip helpers to setup irqchip for a gpiolib based
    driver, it is not possible to select which GPIOs to add to the IRQ domain.
    Instead it just adds all GPIOs which is not always desired. For example
    there might be GPIOs that for some reason cannot generated normal
    interrupts at all.

    To support this we add a flag irq_need_valid_mask to struct gpio_chip. When
    this flag is set the core allocates irq_valid_mask that holds one bit for
    each GPIO the chip has. By default all bits are set but drivers can
    manipulate this using set_bit() and clear_bit() accordingly.

    Then when gpiochip_irqchip_add() is called, this mask is checked and all
    GPIOs with bit is set are added to the IRQ domain created for the GPIO
    chip.

    Suggested-by: Linus Walleij
    Signed-off-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Mika Westerberg
     

08 Aug, 2016

1 commit


13 Jun, 2016

1 commit


27 Apr, 2016

1 commit


10 Apr, 2016

1 commit

  • This has been a totally undocumented feature for years so add some
    generic concepts and documentation about open drain/source, include
    some facts on how we now support for hardware.

    Cc: Michael Hennerich
    Cc: Nicolas Saenz Julienne
    Cc: H. Nikolaus Schaller
    Signed-off-by: Linus Walleij

    Linus Walleij
     

25 Feb, 2016

1 commit


21 Nov, 2015

1 commit


06 Nov, 2015

1 commit

  • Pull documentation update from Jon Corbet:
    "There is a nice new document from Neil on how pathname lookups work
    and some new CAN driver documentation. Beyond that, we have
    kernel-doc fixes, a bit more work to support reproducible builds, and
    the usual collection of small fixes"

    * tag 'docs-for-linus' of git://git.lwn.net/linux: (34 commits)
    Documentation: add new description of path-name lookup.
    Documentation/vm/slub.txt: document slabinfo-gnuplot.sh
    Doc: ABI/stable: Fix typo in ABI/stable
    doc: Clarify that nmi_watchdog param is for hardlockups
    Typo correction for description in gpio document.
    DocBook: Fix kernel-doc to be case-insensitive for private:
    kernel-docs.txt: update kernelnewbies reference
    Doc:kvm: Fix typo in Doc/virtual/kvm
    Documentation/Changes: Add bc in "Current Minimal Requirements" section
    Documentation/email-clients.txt: remove trailing whitespace
    DocBook: Use a fixed encoding for output
    MAINTAINERS: The docs tree has moved
    Docs/kernel-parameters: Add earlycon devicetree usage
    SubmittingPatches: make Subject examples match the de facto standard
    Documentation: gpio: mention that -gpio has been deprecated
    Documentation: cgroups: just fix a few typos
    Documentation: Update kselftest.txt
    Documentation: DMA API: Be more explicit that nents is always the same
    Documentation: Update the default value of crashkernel low
    zram: update documentation
    ...

    Linus Torvalds
     

27 Oct, 2015

2 commits


20 Oct, 2015

1 commit


12 Oct, 2015

1 commit


25 Sep, 2015

1 commit

  • The gpiolib supports parsing DT properties of the form -gpio
    but it was only added for compatibility with older DT bindings that got
    it wrong and should not be used in newer bindings.

    The commit that added support for this was:

    dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names")

    but didn't update the documentation to explain this so it's been a source
    of confusion. So let's make clear this in the GPIO documentation.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Jonathan Corbet

    Javier Martinez Canillas
     

14 Sep, 2015

3 commits


17 Aug, 2015

1 commit


21 Jul, 2015

1 commit


25 Jun, 2015

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "The main thing here is Ingo's big subdirectory documenting feature
    support for each architecture. Beyond that, it's the usual pile of
    fixes, tweaks, and small additions"

    * tag 'docs-for-linus' of git://git.lwn.net/linux-2.6: (79 commits)
    doc:md: fix typo in md.txt.
    Documentation/mic/mpssd: don't build x86 userspace when cross compiling
    Documentation/prctl: don't build tsc tests when cross compiling
    Documentation/vDSO: don't build tests when cross compiling
    Doc:ABI/testing: Fix typo in sysfs-bus-fcoe
    Doc: Docbook: Change wikipedia's URL from http to https in scsi.tmpl
    Doc: Change wikipedia's URL from http to https
    Documentation/kernel-parameters: add missing pciserial to the earlyprintk
    Doc:pps: Fix typo in pps.txt
    kbuild : Fix documentation of INSTALL_HDR_PATH
    Documentation: filesystems: updated struct file_operations documentation in vfs.txt
    kbuild: edit explanation of clean-files variable
    Doc: ja_JP: Fix typo in HOWTO
    Move freefall program from Documentation/ to tools/
    Documentation: ARM: EXYNOS: Describe boot loaders interface
    Doc:nfc: Fix typo in nfc-hci.txt
    vfs: Minor documentation fix
    Doc: networking: txtimestamp: fix printf format warning
    Documentation, intel_pstate: Improve legacy mode internal governors description
    Documentation: extend use case for EXPORT_SYMBOL_GPL()
    ...

    Linus Torvalds
     

04 Jun, 2015

1 commit


22 May, 2015

1 commit


12 May, 2015

1 commit

  • Remove gpiod_sysfs_set_active_low (and gpio_sysfs_set_active_low) which
    allowed code to change the polarity of a gpio line even after it had
    been exported through sysfs.

    Drivers should not care, and generally does not know, about gpio-line
    polarity which is a hardware feature that needs to be described by
    firmware.

    It is currently possible to define gpio-line polarity in device-tree and
    acpi firmware or using platform data. Userspace can also change the
    polarity through sysfs.

    Note that drivers using the legacy gpio interface could still use
    GPIOF_ACTIVE_LOW to change the polarity before exporting the gpio.

    There are no in-kernel users of this interface.

    Cc: Jonathan Corbet
    Cc: Harry Wei
    Cc: Arnd Bergmann
    Cc: linux-doc@vger.kernel.org
    Cc: linux-kernel@zh-kernel.org
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Johan Hovold
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Johan Hovold
     

18 Apr, 2015

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "Numerous fixes, the overdue removal of the i2o docs, some new Chinese
    translations, and, hopefully, the README fix that will end the flow of
    identical patches to that file"

    * tag 'docs-for-linus' of git://git.lwn.net/linux-2.6: (34 commits)
    Documentation/memcg: update memcg/kmem status
    Documentation: blackfin: Makefile: Typo building issue
    Documentation/vm/pagemap.txt: correct location of page-types tool
    Documentation/memory-barriers.txt: typo fix
    doc: Add guest_nice column to example output of `cat /proc/stat'
    Documentation/kernel-parameters: Move "eagerfpu" to its right place
    Documentation: gpio: Update ACPI part of the document to mention _DSD
    docs/completion.txt: Various tweaks and corrections
    doc: completion: context, scope and language fixes
    Documentation:Update Documentation/zh_CN/arm64/memory.txt
    Documentation:Update Documentation/zh_CN/arm64/booting.txt
    Documentation: Chinese translation of arm64/legacy_instructions.txt
    DocBook media: fix broken EIA hyperlink
    Documentation: tweak the maintainers entry
    README: Change gzip/bzip2 to xz compression format
    README: Update version number reference
    doc:pci: Fix typo in Documentation/PCI
    Documentation: drm: Use '->' when describing access through pointers.
    Documentation: Remove mentioning of block barriers
    Documentation/email-clients.txt: Fix one grammar mistake, add extra info about TB
    ...

    Linus Torvalds
     

04 Apr, 2015

1 commit


10 Mar, 2015

1 commit


05 Mar, 2015

2 commits

  • Add device managed variants of gpiod_get_array() / gpiod_put_array()
    functions for conveniently obtaining and disposing of an entire array
    of GPIOs with one function call.

    Signed-off-by: Rojhalat Ibrahim
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Rojhalat Ibrahim
     
  • Introduce new functions for conveniently obtaining and disposing of
    an entire array of GPIOs with one function call.

    ACPI parts tested by Mika Westerberg, DT parts tested by Rojhalat
    Ibrahim.

    Change log:
    v5: move the ACPI functions to gpiolib-acpi.c
    v4: - use shorter names for members of struct gpio_descs
    - rename lut_gpio_count to platform_gpio_count for clarity
    - add check for successful memory allocation
    - use ERR_CAST()
    v3: - rebase on current linux-gpio devel branch
    - fix ACPI GPIO counting
    - allow for zero-sized arrays
    - make the flags argument mandatory for the new functions
    - clarify documentation
    v2: change interface

    Suggested-by: Alexandre Courbot
    Signed-off-by: Rojhalat Ibrahim
    Reviewed-by: Alexandre Courbot
    Reviewed-by: Mika Westerberg
    Tested-by: Mika Westerberg
    Tested-by: Rojhalat Ibrahim
    Signed-off-by: Linus Walleij

    Rojhalat Ibrahim
     

29 Jan, 2015

1 commit


15 Dec, 2014

1 commit

  • Pull take two of the GPIO updates:
    "Same stuff as last time, now with a fixup patch for the previous
    compile error plus I ran a few extra rounds of compile-testing.

    This is the bulk of GPIO changes for the v3.19 series:

    - A new API that allows setting more than one GPIO at the time. This
    is implemented for the new descriptor-based API only and makes it
    possible to e.g. toggle a clock and data line at the same time, if
    the hardware can do this with a single register write. Both
    consumers and drivers need new calls, and the core will fall back
    to driving individual lines where needed. Implemented for the
    MPC8xxx driver initially

    - Patched the mdio-mux-gpio and the serial mctrl driver that drives
    modems to use the new multiple-setting API to set several signals
    simultaneously

    - Get rid of the global GPIO descriptor array, and instead allocate
    descriptors dynamically for each GPIO on a certain GPIO chip. This
    moves us closer to getting rid of the limitation of using the
    global, static GPIO numberspace

    - New driver and device tree bindings for 74xx ICs

    - New driver and device tree bindings for the VF610 Vybrid

    - Support the RCAR r8a7793 and r8a7794

    - Guidelines for GPIO device tree bindings trying to get things a bit
    more strict with the advent of combined device properties

    - Suspend/resume support for the MVEBU driver

    - A slew of minor fixes and improvements"

    * tag 'gpio-v3.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (33 commits)
    gpio: mcp23s08: fix up compilation error
    gpio: pl061: document gpio-ranges property for bindings file
    gpio: pl061: hook request if gpio-ranges avaiable
    gpio: mcp23s08: Add option to configure IRQ output polarity as active high
    gpio: fix deferred probe detection for legacy API
    serial: mctrl_gpio: use gpiod_set_array function
    mdio-mux-gpio: Use GPIO descriptor interface and new gpiod_set_array function
    gpio: remove const modifier from gpiod_get_direction()
    gpio: remove gpio_descs global array
    gpio: mxs: implement get_direction callback
    gpio: em: Use dynamic allocation of GPIOs
    gpio: Check if base is positive before calling gpio_is_valid()
    gpio: mcp23s08: Add simple IRQ support for SPI devices
    gpio: mcp23s08: request a shared interrupt
    gpio: mcp23s08: Do not free unrequested interrupt
    gpio: rcar: Add r8a7793 and r8a7794 support
    gpio-mpc8xxx: add mpc8xxx_gpio_set_multiple function
    gpiolib: allow simultaneous setting of multiple GPIO outputs
    gpio: mvebu: add suspend/resume support
    gpio: gpio-davinci: remove duplicate check on resource
    ..

    Linus Torvalds
     

27 Nov, 2014

1 commit

  • Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer
    interface which allow setting multiple outputs with just one function call.
    Also add an optional set_multiple function to the driver interface. Without an
    implementation of that function in the chip driver outputs are set
    sequentially.

    Implementing the set_multiple function in a chip driver allows for:
    - Improved performance for certain use cases. The original motivation for this
    was the task of configuring an FPGA. In that specific case, where 9 GPIO
    lines have to be set many times, configuration time goes down from 48 s to
    20 s when using the new function.
    - Simultaneous glitch-free setting of multiple pins on any kind of parallel
    bus attached to GPIOs provided they all reside on the same chip and bank.

    Limitations:
    Performance is only improved for normal high-low outputs. Open drain and
    open source outputs are always set separately from each other. Those kinds
    of outputs could probably be accelerated in a similar way if we could
    forgo the error checking when setting GPIO directions.

    Change log:
    v6: - rebase on current linux-gpio devel branch
    v5: - check can_sleep property per chip
    - remove superfluous checks
    - supplement documentation
    v4: - add gpiod_set_array function for setting logical values
    - change interface of the set_multiple driver function to use
    unsigned long as type for the bit fields
    - use generic bitops (which also use unsigned long for bit fields)
    - do not use ARCH_NR_GPIOS any more
    v3: - add documentation
    - change commit message
    v2: - use descriptor interface
    - allow arbitrary groups of GPIOs spanning multiple chips

    Signed-off-by: Rojhalat Ibrahim
    Reviewed-by: Alexandre Courbot
    Reviewed-by: Mark Brown
    Signed-off-by: Linus Walleij

    Rojhalat Ibrahim
     

05 Nov, 2014

1 commit


29 Oct, 2014

1 commit


10 Oct, 2014

1 commit

  • Pull GPIO changes from Linus Walleij:
    "This is the bulk of GPIO changes for the v3.18 development cycle:

    - Increase the default ARCH_NR_GPIO from 256 to 512. This was done
    to avoid having a custom header for the x86
    architecture - GPIO is custom and complicated enough as it is
    already! We want to move to a radix to store the descriptors going
    forward, and finally get rid of this fixed array size altogether.

    - Endgame patching of the gpio_remove() semantics initiated by
    Abdoulaye Berthe. It is not accepted by the system that the
    removal of a GPIO chip fails during eg reboot or shutdown, and
    therefore the return value has now painfully been refactored away.
    For special cases like GPIO expanders on a hot-pluggable bus like
    USB, we may later add some gpiochip_try_remove() call, but for the
    cases we have now, return values are moot.

    - Some incremental refactoring of the gpiolib core and ACPI GPIO
    library for more descriptor usage.

    - Refactor the chained IRQ handler set-up method to handle also
    threaded, nested interrupts and set up the parent IRQ correctly.
    Switch STMPE and TC3589x drivers to use this registration method.

    - Add a .irq_not_threaded flag to the struct gpio_chip, so that also
    GPIO expanders that block but are still not using threaded IRQ
    handlers.

    - New drivers for the ARM64 X-Gene SoC GPIO controller.

    - The syscon GPIO driver has been improved to handle the "DSP GPIO"
    found on the TI Keystone 2 SoC:s.

    - ADNP driver switched to use gpiolib irqchip helpers.

    - Refactor the DWAPB driver to support being instantiated from and
    MFD cell (platform device).

    - Incremental feature improvement in the Zynq, MCP23S08, DWAPB, OMAP,
    Xilinx and Crystalcove drivers.

    - Various minor fixes"

    * tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (52 commits)
    gpio: pch: Build context save/restore only for PM
    pinctrl: abx500: get rid of unused variable
    gpio: ks8695: fix 'else should follow close brace '}''
    gpio: stmpe: add verbose debug code
    gpio: stmpe: fix up interrupt enable logic
    gpio: staticize xway_stp_init()
    gpio: handle also nested irqchips in the chained handler set-up
    gpio: set parent irq on chained handlers
    gpiolib: irqchip: use irq_find_mapping while removing irqchip
    gpio: crystalcove: support virtual GPIO
    pinctrl: bcm281xx: make Kconfig dependency more strict
    gpio: kona: enable only on BCM_MOBILE or for compile testing
    gpio, bcm-kona, LLVMLinux: Remove use of __initconst
    gpio: Fix ngpio in gpio-xilinx driver
    gpio: dwapb: fix pointer to integer cast
    gpio: xgene: Remove unneeded #ifdef CONFIG_OF guard
    gpio: xgene: Remove unneeded forward declation for struct xgene_gpio
    gpio: xgene: Fix missing spin_lock_init()
    gpio: ks8695: fix switch case indentation
    gpiolib: add irq_not_threaded flag to gpio_chip
    ...

    Linus Torvalds
     

26 Sep, 2014

1 commit

  • To unify how we connect cascaded IRQ chips to parent IRQs, if
    NULL us passed as handler to the gpiochip_set_chained_irqchip()
    function, assume the chips is nested rather than chained, and
    we still get the parent set up correctly by way of this function
    call.

    Alter the drivers for tc3589x and stmpe to use this to set up
    their chained handlers as a demonstration of the usage.

    Signed-off-by: Linus Walleij

    Linus Walleij
     

29 Aug, 2014

2 commits

  • The current prototype of gpiochip_request_own_desc() requires to obtain
    a pointer to a descriptor. This is in contradiction to all other GPIO
    request schemes, and imposes an extra step of obtaining a descriptor to
    drivers. Most drivers actually cannot even perform that step since the
    function that does it (gpichip_get_desc()) is gpiolib-private.

    Change gpiochip_request_own_desc() to return a descriptor from a
    (chip, hwnum) tuple and update users of this function (currently
    gpiolib-acpi only).

    Signed-off-by: Alexandre Courbot
    Tested-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Alexandre Courbot
     
  • Add a mention about the _optional variants of (devm_)gpiod_get*().

    Signed-off-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Alexandre Courbot
     

28 Jul, 2014

2 commits

  • The huge majority of GPIOs have their direction and initial value set
    right after being obtained by one of the gpiod_get() functions. The
    integer GPIO API had gpio_request_one() that took a convenience flags
    parameter allowing to specify an direction and value applied to the
    returned GPIO. This feature greatly simplifies client code and ensures
    errors are always handled properly.

    A similar feature has been requested for the gpiod API. Since setting
    the direction of a GPIO is so often the very next action done after
    obtaining its descriptor, we prefer to extend the existing functions
    instead of introducing new functions that would raise the
    number of gpiod getters to 16 (!).

    The drawback of this approach is that all gpiod clients need to be
    updated. To limit the pain, temporary macros are introduced that allow
    gpiod_get*() to be called with or without the extra flags argument. They
    will be removed once all consumer code has been updated.

    Signed-off-by: Alexandre Courbot
    Reviewed-by: Mark Brown
    Signed-off-by: Linus Walleij

    Alexandre Courbot
     
  • As per example from the regulator subsystem: put all defines and
    functions related to registering board info for GPIO descriptors
    into a separate header.

    Cc: Andrew Victor
    Cc: Nicolas Ferre
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Ralf Baechle
    Cc: Thierry Reding
    Acked-by: Stephen Warren
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Linus Walleij