aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-15gpio: mvebu: add pwm support for Armada 8K/7KBaruch Siach1-33/+68
Use the marvell,pwm-offset DT property to store the location of PWM signal duration registers. Since we have more than two GPIO chips per system, we can't use the alias id to differentiate between them. Use the offset value for that. Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Fix irq_set_affinityDmitry Osipenko1-1/+2
The irq_set_affinity callback should not be set if parent IRQ domain doesn't present because gpio-tegra driver callback fails in this case, causing a noisy error messages on system suspend: Disabling non-boot CPUs ... IRQ 26: no longer affine to CPU1 IRQ128: set affinity failed(-22). IRQ130: set affinity failed(-22). IRQ131: set affinity failed(-22). IRQ 27: no longer affine to CPU2 IRQ128: set affinity failed(-22). IRQ130: set affinity failed(-22). IRQ131: set affinity failed(-22). IRQ 28: no longer affine to CPU3 IRQ128: set affinity failed(-22). IRQ130: set affinity failed(-22). IRQ131: set affinity failed(-22). Entering suspend state LP1 Hence just don't specify the irq_set_affinity callback if parent PMC IRQ domain is missing. Tegra isn't capable of setting affinity per GPIO, affinity could be set only per GPIO bank, thus there is nothing to do for gpio-tegra in regards to CPU affinity without the parent IRQ domain. Tested-by: Peter Geis <[email protected]> # Ouya T30 Tested-by: Matt Merhar <[email protected]> # Ouya T30 Tested-by: Dmitry Osipenko <[email protected]> # A500 T20 and Nexus7 T30 Fixes: efcdca286eef ("gpio: tegra: Convert to gpio_irq_chip") Reported-by: Matt Merhar <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Support building driver as a loadable moduleDmitry Osipenko2-7/+10
Support building driver as a loadable kernel module. This allows to reduce size of a kernel zImage, which is important for some devices since size of kernel partition may be limited and since some bootloader variants have known problems in regards to the initrd placement if kernel image is too big. $ lsmod Module Size Used by gpio_tegra 16384 27 Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Clean up whitespaces in tegra_gpio_driverDmitry Osipenko1-4/+4
Clean up inconsistent whitespaces and tabs in the definition of tegra_gpio_driver to make code look better a tad. Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Use debugfs_create_devm_seqfile()Dmitry Osipenko1-5/+3
Use resource-managed variant of debugfs_create_file(0444) to prepare code for the modularization of the driver. Signed-off-by: Dmitry Osipenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Improve formatting of the codeDmitry Osipenko1-5/+10
Don't cross 80 chars of line length in order to keep formatting of the code consistent. Signed-off-by: Dmitry Osipenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: mvebu: improve handling of pwm zero on/off valuesBaruch Siach1-16/+23
Hardware appears to treat zero value as 2^32. Take advantage of this fact to support on/off values of up to UINT_MAX+1 == 2^32. Adjust both .apply and .get_state to handle zero as a special case. Rounded up division result in .get_state can't be zero, since the dividend is now larger than 0. Remove check for this case. Reported-by: Uwe Kleine-König <[email protected]> Analyzed-by: Russell King <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: mvebu: don't limit pwm period/duty_cycle to UINT_MAXBaruch Siach1-6/+2
PWM on/off registers are limited to UINT_MAX. However the state period and duty_cycle fields are ns values of type u64. There is no reason to limit them to UINT_MAX. Reported-by: Uwe Kleine-König <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: mvebu: make pwm .get_state closer to idempotentBaruch Siach1-2/+2
Round up the divisions in .get_state() to make applying the read out configuration idempotent in most cases as .apply rounds down. Reported-by: Uwe Kleine-König <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: mvebu: improve pwm period calculation accuracyBaruch Siach1-2/+2
Change 'off' register value calculation from $off = (period - duty_cycle) * clkrate / NSEC_PER_SEC to $off = (period * clkrate / NSEC_PER_SEC) - $on That is, divide the full period value to reduce rounding error. Reported-by: Uwe Kleine-König <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: mockup: tweak the Kconfig help textBartosz Golaszewski1-2/+1
gpio-mockup doesn't require SYSFS to be selected so drop that bit from the Kconfig text. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Linus Walleij <[email protected]>
2021-02-15gpio: wcove: convert comma to semicolonZheng Yongjun1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: vx855: convert comma to semicolonZheng Yongjun1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra186: convert comma to semicolonZheng Yongjun1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: max77620: convert comma to semicolonZheng Yongjun1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: remove zte zx driverArnd Bergmann4-321/+0
The zte zx platform is getting removed, so this driver is no longer needed. Cc: Jun Nie <[email protected]> Cc: Shawn Guo <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: uapi: fix line info flags descriptionKent Gibson1-1/+1
The description of the flags field of the struct gpio_v2_line_info mentions "the GPIO lines" while the info only applies to an individual GPIO line. This was accidentally changed from "the GPIO line" during formatting improvements. Reword to "this GPIO line" to clarify and to be consistent with other struct gpio_v2_line_info fields. Fixes: 2cc522d3931b ("gpio: uapi: kernel-doc formatting improvements") Signed-off-by: Kent Gibson <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: gpio: add CONFIG_GPIO_CDEV to configKent Gibson1-0/+1
GPIO CDEV is now optional and required for the selftests so add it to the config. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: gpio: port to GPIO uAPI v2Kent Gibson2-10/+76
Add a port to the GPIO uAPI v2 interface and make it the default. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15tools: gpio: remove uAPI v1 code no longer used by selftestsKent Gibson2-95/+0
gpio-mockup-chardev helper has been obsoleted and removed, so also remove the tools/gpio code that it, and nothing else, was using. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: remove obsolete gpio references from kselftest_deps.shKent Gibson1-3/+1
GPIO Makefile has been greatly simplified so remove references to lines which no longer exist. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: remove obsolete build restriction for gpioKent Gibson1-9/+0
Build restrictions related to the gpio-mockup-chardev helper are no longer relevant so remove them. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: gpio: remove obsolete gpio-mockup-chardev.cKent Gibson1-323/+0
GPIO selftests have changed to new gpio-mockup-cdev helper, so remove old gpio-mockup-chardev helper. Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15selftests: gpio: rework and simplify test implementationKent Gibson4-288/+535
The GPIO mockup selftests are overly complicated with separate implementations of the tests for sysfs and cdev uAPI, and with the cdev implementation being dependent on tools/gpio and libmount. Rework the test implementation to provide a common test suite with a simplified pluggable uAPI interface. The cdev implementation utilises the GPIO uAPI directly to remove the dependence on tools/gpio. The simplified uAPI interface removes the need for any file system mount checks in C, and so removes the dependence on libmount. The rework also fixes the sysfs test implementation which has been broken since the device created in the multiple gpiochip case was split into separate devices. Fixes: 8a39f597bcfd ("gpio: mockup: rework device probing") Signed-off-by: Kent Gibson <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: tegra: Fix wake interruptDmitry Osipenko1-3/+13
The GPIO bank wake interrupt setting was erroneously removed after conversion to gpio_irq_chip, thus the wake interrupt programming is broken now. Secondly, the wake_enb of the GPIO driver should be changed only after the successful toggling of the IRQ wake-state. Restore the wake interrupt setting and the programming order. Fixes: efcdca286eef ("gpio: tegra: Convert to gpio_irq_chip") Signed-off-by: Dmitry Osipenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15dt-bindings: gpio: pca953x: Increase allowed length for gpio-line-namesUwe Kleine-König1-1/+1
Some supported chips (e.g. pca9505) support 40 lines. To be able to give each line a name the length of the gpio-line-names property must be allowed to contain up to 40 entries. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15dt-bindings: gpio: pca953x: Document new supported chip pca9506Uwe Kleine-König1-0/+1
The previous patch added support for this chip. Add its name to the list of allowed compatibles. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: pca953x: Add support for pca9506Uwe Kleine-König1-0/+2
According to the reference manual "The PCA9505 is identical to the PCA9506 except that it includes 100 kΩ internal pull-up resistors on all the I/Os." So the pca9506 device can be considered identical to the pca9505 for the gpio driver. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: rcar: Add R-Car V3U (R8A779A0) supportGeert Uytterhoeven1-0/+35
Add support for the GPIO controller block in the R-Car V3U (R8A779A0) SoC, which is very similar to the block found on other R-Car Gen3 SoCs. However, this block has a new General Input Enable Register (INEN), whose reset state is to have all inputs disabled. Enable input for all available pins in probe and resume, to support the use of the General Input Register (INDT) for reading pin state at all times. This preserves backwards compatibility with other R-Car Gen3 SoCs, as recommended by the Hardware Manual. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Wolfram Sang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: rcar: Optimize GPIO pin state read on R-Car Gen3Geert Uytterhoeven1-5/+20
Currently, the R-Car GPIO driver treats R-Car Gen2 and R-Car Gen3 GPIO controllers the same. However, there exist small differences, like the behavior of the General Input Register (INDT): - On R-Car Gen1, R-Car Gen2, and RZ/G1, INDT only reflects the state of an input pin if the GPIO is configured for input, - On R-Car Gen3 and RZ/G2, INDT always reflects the state of the input pins. Hence to accommodate all variants, the driver does not use the INDT register to read the status of a GPIO line when configured for output, at the expense of doing 2 or 3 register reads instead of 1. Given register accesses are slow, change the .get() and .get_multiple() callbacks to always use INDT to read pin state on SoCs where this is supported. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Wolfram Sang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15dt-bindings: gpio: rcar: Add r8a779a0 supportGeert Uytterhoeven1-0/+3
Document the compatible value for the GPIO block in the Renesas R-Car V3U (R8A779A0) SoC. While this GPIO block is mostly compatible with GPIO blocks on R-Car Gen3 SoCs, there are small differences, and one of the new registers needs to be configured differently from its initial reset state. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: bd7xxxx: use helper variable for pdev->devBartosz Golaszewski2-17/+15
Using a helper local variable to store the address of &pdev->dev adds to readability and allows us to avoid unnecessary line breaks. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Matti Vaittinen <[email protected]>
2021-02-15gpio: tegra: Convert to gpio_irq_chipThierry Reding1-72/+146
Convert the Tegra GPIO driver to use the gpio_irq_chip infrastructure. This allows a bit of boiler plate to be removed and while at it enables support for hierarchical domains, which is useful to support PMC wake events on Tegra210 and earlier. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15arm: dts: visconti: Add DT support for Toshiba Visconti5 GPIO driverNobuhiro Iwamatsu2-0/+15
Add the GPIO node in Toshiba Visconti5 SoC-specific DT file. And enable the GPIO node in TMPV7708 RM main board's board-specific DT file. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Punit Agrawal <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15MAINTAINERS: Add entries for Toshiba Visconti GPIO controllerNobuhiro Iwamatsu1-0/+2
Add entries for Toshiba Visconti GPIO Controller binding and driver. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: visconti: Add Toshiba Visconti GPIO supportNobuhiro Iwamatsu4-0/+252
Add the GPIO driver for Toshiba Visconti ARM SoCs. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Punit Agrawal <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15dt-bindings: gpio: Add bindings for Toshiba Visconti GPIO ControllerNobuhiro Iwamatsu1-0/+70
Add bindings for the Toshiba Visconti GPIO Controller. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Punit Agrawal <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15dt-bindings: gpio: Add compatible string for AM64 SoCAswath Govindraju1-0/+1
Add compatible string for AM64 SoC in device tree binding of davinci GPIO modules as the same IP is used. Signed-off-by: Aswath Govindraju <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: bd7xxxx: Do not depend on parent driver dataMatti Vaittinen2-41/+33
The ROHM BD70528 and BD71828 GPIO drivers only need the regmap pointer from parent. Regmap can be obtained via dev_get_regmap() so do not require parent to populate driver data for that. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: Kconfig: Update help description for GPIO_RCAR configLad Prabhakar1-2/+2
The gpio-rcar driver also supports RZ/G SoC's, update the description to reflect this. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: sl28cpld: convert comma to semicolonZheng Yongjun1-2/+2
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: rcar: Remove redundant compatible valuesLad Prabhakar1-27/+0
The mandatory compatible values 'renesas,rcar-gen{1,2,3}-gpio' have been already added to all the respective R-Car Gen{1,2,3} SoC DTSI files, remove the redundant device specific values from the driver. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15docs: gpio: intro: Improve HTML formattingJonathan Neuschäfer1-4/+4
Currently the HTML output for Documentation/driver-api/gpio/intro.rst doesn't look right. The lines that start with LOW or HIGH are formatted in bold, while the next line after each is not bold. With this patch, the HTML looks better. Signed-off-by: Jonathan Neuschäfer <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15docs: gpio: Fix formatting in description of gpiod_*_array_* functionsJonathan Neuschäfer1-2/+3
The gpiod_*_array_* functions take four arguments, not three. Additionally, the formatting of the "value_bitmap" line results in misformatted HTML, so fix that. Signed-off-by: Jonathan Neuschäfer <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: fix spelling mistake in Kconfig "supprot" -> "support"Colin Ian King1-1/+1
There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-14Linux 5.11Linus Torvalds1-2/+2
2021-02-14Merge branch 'for-rc8-5.11' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED fix from Pavel Machek: "One-liner fixing a build problem" * 'for-rc8-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: rt8515: add V4L2_FLASH_LED_CLASS dependency
2021-02-14Merge tag 'kbuild-fixes-v5.11-3' of ↵Linus Torvalds3-2/+4
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64 - Use pkg-config for scripts/sign-file.c CFLAGS * tag 'kbuild-fixes-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: scripts: set proper OpenSSL include dir also for sign-file sparc: remove wrong comment from arch/sparc/include/asm/Kbuild kbuild: fix CONFIG_TRIM_UNUSED_KSYMS build for ppc64
2021-02-14Merge tag 'x86_urgent_for_v5.11' of ↵Linus Torvalds4-7/+22
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "I kinda knew while typing 'I hope this is the last batch of x86/urgent updates' last week, Murphy was reading too and uttered 'Hold my beer!'. So here's more fixes... Thanks Murphy. Anyway, three more x86/urgent fixes for 5.11 final. We should be finally ready (famous last words). :-) - An SGX use after free fix - A fix for the fix to disable CET instrumentation generation for kernel code. We forgot 32-bit, which we seem to do very often nowadays - A Xen PV fix to irqdomain init ordering" * tag 'x86_urgent_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init() x86/build: Disable CET instrumentation in the kernel for 32-bit too x86/sgx: Maintain encl->refcount for each encl->mm_list entry
2021-02-14leds: rt8515: add V4L2_FLASH_LED_CLASS dependencyArnd Bergmann1-0/+1
The leds-rt8515 driver can optionall use the v4l2 flash led class, but it causes a link error when that class is in a loadable module and the rt8515 driver itself is built-in: ld.lld: error: undefined symbol: v4l2_flash_init >>> referenced by leds-rt8515.c >>> leds/flash/leds-rt8515.o:(rt8515_probe) in archive drivers/built-in.a Adding 'depends on V4L2_FLASH_LED_CLASS' in Kconfig would avoid that, but it would make it impossible to use the driver without the v4l2 support. Add the same dependency that the other users of this class have instead, which just prevents the broken configuration. Fixes: e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Pavel Machek <[email protected]>