15 Mar, 2017

1 commit

  • Given the intent behind gpiod_get_optional() and friends it does not make
    sense to return -ENOSYS when GPIOLIB is disabled: the driver is expected to
    work just fine without gpio so let's behave as if gpio was not found.
    Otherwise we have to special-case -ENOSYS in drivers.

    Note that there was objection that someone might forget to enable GPIOLIB
    when dealing with a platform that has device that actually specifies
    optional gpio and we'll break it. I find this unconvincing as that would
    have to be the *only GPIO* in the system, which is extremely unlikely.

    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Linus Walleij

    Dmitry Torokhov
     

21 Nov, 2015

1 commit


14 Sep, 2015

1 commit

  • The con_id parameter has to match the GPIO description and is automatically
    extended by the GPIO suffix if not NULL. I had to look into the code to
    understand this and properly find the GPIO I've been looking for, so document
    this.

    Signed-off-by: Dirk Behme
    Acked-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Dirk Behme
     

17 Aug, 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


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
     

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 Aug, 2014

1 commit


28 Jul, 2014

1 commit

  • 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
     

04 Jun, 2014

1 commit

  • Pull trivial tree changes from Jiri Kosina:
    "Usual pile of patches from trivial tree that make the world go round"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
    staging: go7007: remove reference to CONFIG_KMOD
    aic7xxx: Remove obsolete preprocessor define
    of: dma: doc fixes
    doc: fix incorrect formula to calculate CommitLimit value
    doc: Note need of bc in the kernel build from 3.10 onwards
    mm: Fix printk typo in dmapool.c
    modpost: Fix comment typo "Modules.symvers"
    Kconfig.debug: Grammar s/addition/additional/
    wimax: Spelling s/than/that/, wording s/destinatary/recipient/
    aic7xxx: Spelling s/termnation/termination/
    arm64: mm: Remove superfluous "the" in comment
    of: Spelling s/anonymouns/anonymous/
    dma: imx-sdma: Spelling s/determnine/determine/
    ath10k: Improve grammar in comments
    ath6kl: Spelling s/determnine/determine/
    of: Improve grammar for of_alias_get_id() documentation
    drm/exynos: Spelling s/contro/control/
    radio-bcm2048.c: fix wrong overflow check
    doc: printk-formats: do not mention casts for u64/s64
    doc: spelling error changes
    ...

    Linus Torvalds
     

05 May, 2014

1 commit


07 Feb, 2014

1 commit

  • The documentation was not clear about whether
    gpio_direction_output should take a logical value or the physical
    level on the output line, i.e. whether the ACTIVE_LOW status
    would be taken into account.

    This converts gpiod_direction_output to use the logical level
    and adds a new gpiod_direction_output_raw for the raw value.

    Signed-off-by: Philipp Zabel
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Philipp Zabel
     

13 Dec, 2013

1 commit

  • Some devices drivers make use of optional GPIO parameters. For such
    drivers, it is important to discriminate between the case where no
    GPIO mapping has been defined for the function they are requesting, and
    the case where a mapping exists but an error occured while resolving it
    or when acquiring the GPIO.

    This patch changes the family of gpiod_get() functions such that they
    will return -ENOENT if and only if no GPIO mapping is defined for the
    requested function. Other error codes are used when an actual error
    occured during the GPIO resolution.

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

    Alexandre Courbot
     

25 Nov, 2013

1 commit

  • gpiolib now exports a new descriptor-based interface which deprecates
    the older integer-based one. This patch documents this new interface and
    also takes the opportunity to brush-up the GPIO documentation a little
    bit.

    The new descriptor-based interface follows the same consumer/driver
    model as many other kernel subsystems (e.g. clock, regulator), so its
    documentation has similarly been splitted into different files.

    The content of the former documentation has been reused whenever it
    made sense; however, some of its content did not apply to the new
    interface anymore and have this been removed. Likewise, new sections
    like the mapping of GPIOs to devices have been written from scratch.

    The deprecated legacy-based documentation is still available, untouched,
    under Documentation/gpio/gpio-legacy.txt.

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

    Alexandre Courbot