30 Sep, 2020

7 commits


12 Jul, 2020

3 commits


06 May, 2020

1 commit


05 Apr, 2020

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO development for the v5.7 kernel cycle.

    Core and userspace API:

    - The userspace API KFIFOs have been imoproved with locks that do not
    block interrupts. This makes us better at getting events to
    userspace without blocking or disturbing new events arriving in the
    same time. This was reviewed by the KFIFO maintainer Stefani. This
    is a generic improvement which paves the road for similar
    improvements in other subsystems.

    - We provide a new ioctl() for monitoring changes in the line
    information, such as when multiple clients are taking lines and
    giving them back, possibly reconfiguring them in the process: we
    can now monitor that and not get stuck with stale static
    information.

    - An example tool 'gpio-watch' is provided to showcase this
    functionality.

    - Timestamps for events are switched to ktime_get_ns() which is
    monotonic. We previously had a 'realtime' stamp which could move
    forward and *backward* in time, which probably would just cause
    silent bugs and weird behaviour. In the long run we see two
    relevant timestamps: ktime_get_ns() or the timestamp sometimes
    provided by the GPIO hardware itself, if that exists.

    - Device Tree overlay support for GPIO hogs. On systems that load
    overlays, these overlays can now contain hogs, and will then be
    respected.

    - Handle pin control interaction with nonexisting pin ranges in the
    GPIO library core instead of in the individual drivers.

    New drivers:

    - New driver for the Mellanox BlueField 2 GPIO controller.

    Driver improvements:

    - Introduce the BGPIOF_NO_SET_ON_INPUT flag to the generic MMIO GPIO
    library and use this flag in the MT7621 driver.

    - Texas Instruments OMAP CPU power management improvements, such as
    blocking of idle on pending GPIO interrupts"

    * tag 'gpio-v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (59 commits)
    Revert "gpio: eic-sprd: Use devm_platform_ioremap_resource()"
    pinctrl: Unconditionally assign .request()/.free()
    gpio: Unconditionally assign .request()/.free()
    gpio: export of_pinctrl_get to modules
    pinctrl: Define of_pinctrl_get() dummy for !PINCTRL
    gpio: Rename variable in core APIs
    gpio: Avoid using pin ranges with !PINCTRL
    gpiolib: Remove unused gpio_chip parameter from gpio_set_bias()
    gpiolib: Pass gpio_desc to gpio_set_config()
    gpiolib: Introduce gpiod_set_config()
    tools: gpio: Fix out-of-tree build regression
    gpio: gpiolib: fix a doc warning
    gpio: tegra186: Add Tegra194 pin ranges for GG.0 and GG.1
    gpio: tegra186: Add support for pin ranges
    gpio: Support GPIO controllers without pin-ranges
    ARM: integrator: impd1: Use GPIO_LOOKUP() helper macro
    gpio: brcmstb: support gpio-line-names property
    tools: gpio: Fix typo in gpio-utils
    tools: gpio-hammer: Apply scripts/Lindent and retain good changes
    gpiolib: gpio_name_to_desc: factor out !name check
    ...

    Linus Torvalds
     

28 Mar, 2020

1 commit

  • Commit 0161a94e2d1c7 ("tools: gpio: Correctly add make dependencies for
    gpio_utils") added a make rule for gpio-utils-in.o but used $(output)
    instead of the correct $(OUTPUT) for the output directory, breaking
    out-of-tree build (O=xx) with the following error:

    No rule to make target 'out/tools/gpio/gpio-utils-in.o', needed by 'out/tools/gpio/lsgpio-in.o'. Stop.

    Fix that.

    Fixes: 0161a94e2d1c ("tools: gpio: Correctly add make dependencies for gpio_utils")
    Cc:
    Cc: Laura Abbott
    Signed-off-by: Anssi Hannula
    Link: https://lore.kernel.org/r/20200325103154.32235-1-anssi.hannula@bitwise.fi
    Reviewed-by: Bartosz Golaszewski
    Signed-off-by: Linus Walleij

    Anssi Hannula
     

25 Mar, 2020

5 commits


12 Feb, 2020

1 commit


13 Nov, 2019

1 commit

  • gpio tools fail to build correctly with make parallelization:

    $ make -s -j24
    ld: gpio-utils.o: file not recognized: file truncated
    make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:145: lsgpio-in.o] Error 1
    make: *** [Makefile:43: lsgpio-in.o] Error 2
    make: *** Waiting for unfinished jobs....

    This is because gpio-utils.o is used across multiple targets.
    Fix this by making gpio-utios.o a proper dependency.

    Cc:
    Signed-off-by: Laura Abbott
    Signed-off-by: Bartosz Golaszewski

    Laura Abbott
     

22 Oct, 2019

1 commit

  • make TARGETS=gpio kselftest fails with:

    Makefile:23: tools/build/Makefile.include: No such file or directory

    When the gpio tool make is invoked from tools Makefile, srctree is
    cleared and the current logic check for srctree equals to empty
    string to determine srctree location from CURDIR.

    When the build in invoked from selftests/gpio Makefile, the srctree
    is set to "." and the same logic used for srctree equals to empty is
    needed to determine srctree.

    Check building_out_of_srctree undefined as the condition for both
    cases to fix "make TARGETS=gpio kselftest" build failure.

    Cc: stable@vger.kernel.org
    Signed-off-by: Shuah Khan
    Signed-off-by: Bartosz Golaszewski

    Shuah Khan
     

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
     

19 Jun, 2019

1 commit

  • Based on 2 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 version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

20 May, 2019

1 commit


29 Dec, 2018

1 commit

  • So that the user can specify outside CFLAGS values.

    Signed-off-by: Jiri Olsa
    Reviewed-by: Andy Shevchenko
    Cc: Hartmut Knaack
    Cc: Herton Krzesinski
    Cc: Jonathan Cameron
    Cc: Lars-Peter Clausen
    Link: http://lkml.kernel.org/r/20181212102537.25902-7-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

19 Mar, 2018

1 commit


01 Mar, 2018

1 commit

  • PRIu64 is defined in user space to match libc's uint64_t definition.
    However, gpioevent_data structure in the kernel is defined using the
    kernel's own __u64 type.

    gpio-event-mon.c: In function ‘monitor_device’:
    gpio-event-mon.c:102:19: warning: format ‘%lu’ expects argument of type
    ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long
    unsigned int}’ [-Wformat=]
    fprintf(stdout, "GPIO EVENT %" PRIu64 ": ", event.timestamp);
    ^~~~~~~~~~~~~~
    LD /tmp/kselftest/gpiogpio-event-mon-in.o
    LINK /tmp/kselftest/gpiogpio-event-mon

    Fix is to replace PRIu64 with llu, which we know is what the kernel uses
    for __u64.

    Signed-off-by: Anders Roxell
    Tested-by: Daniel Díaz
    Signed-off-by: Linus Walleij

    Anders Roxell
     

22 Feb, 2018

1 commit

  • Currently a number of Makefiles break when used with toolchains that
    pass extra flags in CC and other cross-compile related variables (such
    as --sysroot).

    Thus we get this error when we use a toolchain that puts --sysroot in
    the CC var:

    ~/src/linux/tools$ make iio
    [snip]
    iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
    #include
    ^~~~~~~~~~

    This occurs because we clobber several env vars related to
    cross-compiling with lines like this:

    CC = $(CROSS_COMPILE)gcc

    Although this will point to a valid cross-compiler, we lose any extra
    flags that might exist in the CC variable, which can break toolchains
    that rely on them (for example, those that use --sysroot).

    This easily shows up using a Yocto SDK:

    $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi

    $ echo $CC
    arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
    -mcpu=cortex-a8
    --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi

    $ echo $CROSS_COMPILE
    arm-poky-linux-gnueabi-

    $ echo ${CROSS_COMPILE}gcc
    krm-poky-linux-gnueabi-gcc

    Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
    --sysroot and other flags that enable us to find the right libraries to
    link against, so we can't find unistd.h and other libraries and headers.
    Normally with the --sysroot flag we would find unistd.h in the sdk
    directory in the sysroot:

    $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
    [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h

    The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
    already set, and it compiles correctly with the above toolchain.

    So, generalize the logic that perf uses in the common Makefile and
    remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.

    Note that this patch does not fix cross-compile for all the tools (some
    have other bugs), but it does fix it for all except usb and acpi, which
    still have other unrelated issues.

    I tested both with and without the patch on native and cross-build and
    there appear to be no regressions.

    Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.com
    Signed-off-by: Martin Kelly
    Acked-by: Mark Brown
    Cc: Tejun Heo
    Cc: Li Zefan
    Cc: Johannes Weiner
    Cc: Linus Walleij
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Cc: Jonathan Cameron
    Cc: Pali Rohar
    Cc: Richard Purdie
    Cc: Jacek Anaszewski
    Cc: Pavel Machek
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Cc: Robert Moore
    Cc: Lv Zheng
    Cc: "Rafael J. Wysocki"
    Cc: Greg Kroah-Hartman
    Cc: Valentina Manea
    Cc: Shuah Khan
    Cc: Mario Limonciello
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Kelly
     

21 Dec, 2017

1 commit

  • The GPIO tools build fails when using a buildroot toolchain that uses musl
    as it's C library:

    arm-broomstick-linux-musleabi-gcc -Wp,-MD,./.gpio-event-mon.o.d \
    -Wp,-MT,gpio-event-mon.o -O2 -Wall -g -D_GNU_SOURCE \
    -Iinclude -D"BUILD_STR(s)=#s" -c -o gpio-event-mon.o gpio-event-mon.c
    gpio-event-mon.c:30:6: error: unknown type name ‘u_int32_t’; did you mean ‘uint32_t’?
    u_int32_t handleflags,
    ^~~~~~~~~
    uint32_t

    The glibc headers installed on my laptop include sys/types.h in
    unistd.h, but it appears that musl does not.

    Fixes: 97f69747d8b1 ("tools/gpio: add the gpio-event-mon tool")
    Cc: stable@vger.kernel.org
    Signed-off-by: Joel Stanley
    Signed-off-by: Linus Walleij

    Joel Stanley
     

20 Dec, 2017

1 commit


15 Nov, 2017

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v4.15 kernel cycle:

    Core:

    - Fix the semantics of raw GPIO to actually be raw. No inversion
    semantics as before, but also no open draining, and allow the raw
    operations to affect lines used for interrupts as the caller
    supposedly knows what they are doing if they are getting the big
    hammer.

    - Rewrote the __inner_function() notation calls to names that make
    more sense. I just find this kind of code disturbing.

    - Drop the .irq_base() field from the gpiochip since now all IRQs are
    mapped dynamically. This is nice.

    - Support for .get_multiple() in the core driver API. This allows us
    to read several GPIO lines with a single register read. This has
    high value for some usecases: it can be used to create
    oscilloscopes and signal analyzers and other things that rely on
    reading several lines at exactly the same instant. Also a generally
    nice optimization. This uses the new assign_bit() macro from the
    bitops lib that was ACKed by Andrew Morton and is implemented for
    two drivers, one of them being the generic MMIO driver so everyone
    using that will be able to benefit from this.

    - Do not allow requests of Open Drain and Open Source setting of a
    GPIO line simultaneously. If the hardware actually supports
    enabling both at the same time the electrical result would be
    disastrous.

    - A new interrupt chip core helper. This will be helpful to deal with
    "banked" GPIOs, which means GPIO controllers with several logical
    blocks of GPIO inside them. This is several gpiochips per device in
    the device model, in contrast to the case when there is a 1-to-1
    relationship between a device and a gpiochip.

    New drivers:

    - Maxim MAX3191x industrial serializer, a very interesting piece of
    professional I/O hardware.

    - Uniphier GPIO driver. This is the GPIO block from the recent
    Socionext (ex Fujitsu and Panasonic) platform.

    - Tegra 186 driver. This is based on the new banked GPIO
    infrastructure.

    Other improvements:

    - Some documentation improvements.

    - Wakeup support for the DesignWare DWAPB GPIO controller.

    - Reset line support on the DesignWare DWAPB GPIO controller.

    - Several non-critical bug fixes and improvements for the Broadcom
    BRCMSTB driver.

    - Misc non-critical bug fixes like exotic errorpaths, removal of dead
    code etc.

    - Explicit comments on fall-through switch() statements"

    * tag 'gpio-v4.15-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (65 commits)
    gpio: tegra186: Remove tegra186_gpio_lock_class
    gpio: rcar: Add r8a77995 (R-Car D3) support
    pinctrl: bcm2835: Fix some merge fallout
    gpio: Fix undefined lock_dep_class
    gpio: Automatically add lockdep keys
    gpio: Introduce struct gpio_irq_chip.first
    gpio: Disambiguate struct gpio_irq_chip.nested
    gpio: Add Tegra186 support
    gpio: Export gpiochip_irq_{map,unmap}()
    gpio: Implement tighter IRQ chip integration
    gpio: Move lock_key into struct gpio_irq_chip
    gpio: Move irq_valid_mask into struct gpio_irq_chip
    gpio: Move irq_nested into struct gpio_irq_chip
    gpio: Move irq_chained_parent to struct gpio_irq_chip
    gpio: Move irq_default_type to struct gpio_irq_chip
    gpio: Move irq_handler to struct gpio_irq_chip
    gpio: Move irqdomain into struct gpio_irq_chip
    gpio: Move irqchip into struct gpio_irq_chip
    gpio: Introduce struct gpio_irq_chip
    pinctrl: armada-37xx: remove unused variable
    ...

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

07 Oct, 2017

1 commit

  • Add to error messages the error description by concatenating
    output of strerror() function to error messages print out by
    gpio-utils.c on IOCTL failures.
    Rationalize error messages, while at there, making all of them
    look the same.

    Signed-off-by: Jacopo Mondi
    Signed-off-by: Linus Walleij

    Jacopo Mondi
     

26 Jan, 2017

1 commit


11 Jan, 2017

1 commit


18 Dec, 2016

1 commit

  • Pull kbuild updates from Michal Marek:

    - prototypes for x86 asm-exported symbols (Adam Borowski) and a warning
    about missing CRCs (Nick Piggin)

    - asm-exports fix for LTO (Nicolas Pitre)

    - thin archives improvements (Nick Piggin)

    - linker script fix for CONFIG_LD_DEAD_CODE_DATA_ELIMINATION (Nick
    Piggin)

    - genksyms support for __builtin_va_list keyword

    - misc minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    x86/kbuild: enable modversions for symbols exported from asm
    kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case
    scripts/kallsyms: remove last remnants of --page-offset option
    make use of make variable CURDIR instead of calling pwd
    kbuild: cmd_export_list: tighten the sed script
    kbuild: minor improvement for thin archives build
    kbuild: modpost warn if export version crc is missing
    kbuild: keep data tables through dead code elimination
    kbuild: improve linker compatibility with lib-ksyms.o build
    genksyms: Regenerate parser
    kbuild/genksyms: handle va_list type
    kbuild: thin archives for multi-y targets
    kbuild: kallsyms allow 3-pass generation if symbols size has changed

    Linus Torvalds
     

11 Dec, 2016

1 commit


24 Oct, 2016

2 commits


08 Aug, 2016

1 commit