aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-02-15gpio: ep93xx: Fix typo s/hierarchial/hierarchicalNikita Shubin1-1/+1
Fix typo in comment. Reviewed-by: Linus Walleij <[email protected]> Acked-by: Alexander Sverdlin <[email protected]> Signed-off-by: Nikita Shubin <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: ep93xx: drop to_irq bindingNikita Shubin1-6/+0
As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in driver is useless, so let's drop it. Reviewed-by: Linus Walleij <[email protected]> Acked-by: Alexander Sverdlin <[email protected]> Signed-off-by: Nikita Shubin <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: ep93xx: Fix wrong irq numbers in port FNikita Shubin1-0/+1
Port F IRQ's should be statically mapped to EP93XX_GPIO_F_IRQ_BASE. So we need to specify girq->first otherwise: "If device tree is used, then first_irq will be 0 and IRQ's get mapped dynamically on the fly" And that's not the thing we want. Reviewed-by: Linus Walleij <[email protected]> Acked-by: Alexander Sverdlin <[email protected]> Signed-off-by: Nikita Shubin <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: uapi: use the preferred SPDX license identifierBartosz Golaszewski1-1/+1
GPL-2.0 license identifier is deprecated. User-space projects that want to include the kernel header with their source-code will be unable to become fully REUSE compliant due to the reuse tool complaining about deprecated licenses. Change the SPDX identifier to GPL-2.0-only. Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: gpio-xilinx: Add check if width exceeds 32Srinivas Neeli1-0/+5
Add check to see if gpio-width property does not exceed 32. If it exceeds then return -EINVAL. Signed-off-by: Srinivas Neeli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: gpio-xilinx: Add support for suspend and resumeSrinivas Neeli1-3/+89
Add support for suspend and resume, pm runtime suspend and resume. Added free and request calls. Signed-off-by: Srinivas Neeli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: gpio-xilinx: Add interrupt supportSrinivas Neeli2-4/+244
Adds interrupt support to the Xilinx GPIO driver so that rising and falling edge line events can be supported. Since interrupt support is an optional feature in the Xilinx IP, the driver continues to support devices which have no interrupt provided. Depends on OF_GPIO framework for of_xlate function to translate gpiospec to the GPIO number and flags. Signed-off-by: Robert Hancock <[email protected]> Signed-off-by: Shubhrajyoti Datta <[email protected]> Signed-off-by: Srinivas Neeli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: gpio-xilinx: Reduce spinlock array to arraySrinivas Neeli1-13/+12
Changed spinlock array to single. It is preparation for irq support which is shared between two channels that's why spinlock should be only one. Signed-off-by: Srinivas Neeli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: gpio-xilinx: Simplify with dev_err_probe()Srinivas Neeli1-5/+2
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Srinivas Neeli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2021-02-15gpio: msic: Drop driver from MakefileAndy Shevchenko1-1/+0
Driver is gone, no need to keep a Makefile entry for it. Remove. Reported-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15gpio: wcove: Split out to_ireg() helper and deduplicate the codeAndy Shevchenko1-20/+24
There are a few places in the code where IRQ status and mask register values are being updated. Use a new exctracted helper to deduplicate the code. While at it, get rid of unnecessary divisions. Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15gpio: wcove: Switch to use regmap_set_bits(), regmap_clear_bits()Andy Shevchenko1-10/+7
the regmap_set_bits(), regmap_clear_bits() API makes code better to understand. Switch the driver to use them, Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15gpio: wcove: Get rid of error prone casting in IRQ handlerAndy Shevchenko1-3/+3
The casting from int to long on 64-bit platform is error prone. Replace it with proper type of the variable on stack. Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15gpio: intel-mid: Remove driver for deprecated platformAndy Shevchenko5-424/+1
Intel Moorestown and Medfield are quite old Intel Atom based 32-bit platforms, which were in limited use in some Android phones, tablets and consumer electronics more than eight years ago. There are no bugs or problems ever reported outside from Intel for breaking any of that platforms for years. It seems no real users exists who run more or less fresh kernel on it. The commit 05f4434bc130 ("ASoC: Intel: remove mfld_machine") also in align with this theory. Due to above and to reduce a burden of supporting outdated drivers we remove the support of outdated platforms completely. Moreover this code duplicates gpio-pxa since the IP has been derived from XScale implementation. If anybody wants to resurrect this it has to be part of gpio-pxa.c. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Linus Walleij <[email protected]>
2021-02-15gpio: msic: Remove driver for deprecated platformAndy Shevchenko3-322/+0
Intel Moorestown and Medfield are quite old Intel Atom based 32-bit platforms, which were in limited use in some Android phones, tablets and consumer electronics more than eight years ago. There are no bugs or problems ever reported outside from Intel for breaking any of that platforms for years. It seems no real users exists who run more or less fresh kernel on it. The commit 05f4434bc130 ("ASoC: Intel: remove mfld_machine") also in align with this theory. Due to above and to reduce a burden of supporting outdated drivers we remove the support of outdated platforms completely. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Linus Walleij <[email protected]>
2021-02-15gpio: aggregator: Remove trailing comma in terminator entriesAndy Shevchenko1-2/+2
Remove trailing comma in terminator entries to avoid potential expanding an array behind it. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15gpio: aggregator: Use compound literal from the headerAndy Shevchenko2-4/+3
Instead of doing it in place, convert GPIO_LOOKUP_IDX() and GPIO_HOG() to be compund literals that's allow to use them as rvalue in assignments. Due to above conversion, use compound literal from the header in the gpio-aggregator.c. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15gpio: aggregator: Replace isrange() by using get_options()Andy Shevchenko1-30/+3
We already have a nice helper called get_options() which can be used to validate the input format. Replace isrange() by using it. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15lib/cmdline: Allow get_options() to take 0 to validate the inputAndy Shevchenko2-4/+21
Allow get_options() to take 0 as a number of integers parameter to validate the input. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15lib/cmdline: Update documentation to reflect behaviourAndy Shevchenko1-1/+6
get_options() API has some tricks to optimize that may be not so obvious to the caller. Update documentation to reflect current behaviour. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15lib/cmdline_kunit: add a new test case for get_options()Andy Shevchenko1-0/+47
Add a test case for get_options() which is provided by cmdline.c. Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15gpio: merrifield: Make bias configuration available for GPIOsAndy Shevchenko1-0/+5
If we get bias set request, for example, from GpioIo() resource, we silently ignore it. Make bias configuration available for GPIOs. Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15dt-bindings: ap806: document gpio marvell,pwm-offset propertyBaruch Siach1-0/+8
Update the example as well. Add the '#pwm-cells' and 'clocks' properties for a complete working example. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
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]>