- 08 3月, 2021 7 次提交
-
-
由 Andy Shevchenko 提交于
On STM32MP1, the GPIO banks are subnodes of pin-controller@50002000, see arch/arm/boot/dts/stm32mp151.dtsi. The driver for pin-controller@50002000 is in drivers/pinctrl/stm32/pinctrl-stm32.c and iterates over all of its DT subnodes when registering each GPIO bank gpiochip. Each gpiochip has: - gpio_chip.parent = dev, where dev is the device node of the pin controller - gpio_chip.of_node = np, which is the OF node of the GPIO bank Therefore, dev_fwnode(chip->parent) != of_fwnode_handle(chip.of_node), i.e. pin-controller@50002000 != pin-controller@50002000/gpio@5000*000. The original code behaved correctly, as it extracted the "gpio-line-names" from of_fwnode_handle(chip.of_node) = pin-controller@50002000/gpio@5000*000. To achieve the same behaviour, read property from the firmware node. Fixes: 7cba1a4d ("gpiolib: generalize devprop_gpiochip_set_names() for device properties") Reported-by: NMarek Vasut <marex@denx.de> Reported-by: NRoman Guskov <rguskov@dh-electronics.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: NMarek Vasut <marex@denx.de> Reviewed-by: NMarek Vasut <marex@denx.de> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Andy Shevchenko 提交于
The commit 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") indeliberately made a regression on how IRQ line from GPIO I²C expander is handled. I.e. it reveals that the quirk for Intel Galileo Gen 2 misses the part of setting IRQ type which previously was predefined by gpio-dwapb driver. Now, we have to reorganize the approach to call necessary parts, which can be done via ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk. Without this fix and with above mentioned change the kernel hangs on the first IRQ event with: gpio gpiochip3: Persistence not supported for GPIO 1 irq 32, desc: 62f8fb50, depth: 0, count: 0, unhandled: 0 ->handle_irq(): 41c7b0ab, handle_bad_irq+0x0/0x40 ->irq_data.chip(): e03f1e72, 0xc2539218 ->action(): 0ecc7e6f ->action->handler(): 8a3db21e, irq_default_primary_handler+0x0/0x10 IRQ_NOPROBE set unexpected IRQ trap at vector 20 Fixes: ba8c90c6 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") Depends-on: 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
Currently only search by index is supported. However, in some cases we might need to pass the quirks to the acpi_dev_gpio_irq_get(). For this, split out acpi_dev_gpio_irq_get_by() and replace acpi_dev_gpio_irq_get() by calling above with NULL for name parameter. Fixes: ba8c90c6 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") Depends-on: 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
On some systems the ACPI tables has wrong pin number and instead of having a relative one it provides an absolute one in the global GPIO number space. Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk to cope with such cases. Fixes: ba8c90c6 ("gpio: pca953x: Override IRQ for one of the expanders on Galileo Gen 2") Depends-on: 0ea68393 ("gpio: dwapb: Convert driver to using the GPIO-lib-based IRQ-chip") Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Yang Li 提交于
fixed the following coccicheck: ./drivers/gpio/gpiolib-acpi.c:176:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT Make sure threaded IRQs without a primary handler are always request with IRQF_ONESHOT Reported-by: NAbaci Robot <abaci@linux.alibaba.com> Signed-off-by: NYang Li <yang.lee@linux.alibaba.com> Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Johan Hovold 提交于
Make sure to hold the gpio_lock when removing the gpio device from the gpio_devices list (when dropping the last reference) to avoid corrupting the list when there are concurrent accesses. Fixes: ff2b1359 ("gpio: make the gpiochip a real device") Cc: stable@vger.kernel.org # 4.6 Reviewed-by: NSaravana Kannan <saravanak@google.com> Signed-off-by: NJohan Hovold <johan@kernel.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Johan Hovold 提交于
Fix a NULL-pointer deference when deregistering the gpio character device that was introduced by the recent stub-driver hack. When the new "driver" is unbound as part of deregistration, driver core clears the driver-data pointer which is used to retrieve the struct gpio_device in its release callback. Fix this by using container_of() in the release callback as should have been done all along. Fixes: 4731210c ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default") Cc: Saravana Kannan <saravanak@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reported-by: syzbot+d27b4c8adbbff70fbfde@syzkaller.appspotmail.com Signed-off-by: NJohan Hovold <johan@kernel.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 18 2月, 2021 1 次提交
-
-
由 Maxim Kiselev 提交于
If no n_latch value will be provided at driver probe then all pins will be used as an input: gpio->out = ~n_latch; In that case initial state for all pins is "one": gpio->status = gpio->out; So if pcf857x IRQ happens with change pin value from "zero" to "one" then we miss it, because of "one" from IRQ and "one" from initial state leaves corresponding pin unchanged: change = (gpio->status ^ status) & gpio->irq_enabled; The right solution will be to read actual state at driver probe. Cc: stable@vger.kernel.org Fixes: 6e20a0a4 ("gpio: pcf857x: enable gpio_to_irq() support") Signed-off-by: NMaxim Kiselev <bigunclemax@gmail.com> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
- 15 2月, 2021 32 次提交
-
-
由 Nikita Shubin 提交于
- use predefined constants instead of plain numbers - use provided bank IRQ number instead of defined constant for port F Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NNikita Shubin <nikita.shubin@maquefel.me> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Nikita Shubin 提交于
- replace plain numbers with girq->num_parents in devm_kcalloc - replace plain numbers with girq->num_parents for port F - refactor i - 1 to i + 1 to make loop more readable - combine getting IRQ's loop and setting handler's into single loop Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NNikita Shubin <nikita.shubin@maquefel.me> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Nikita Shubin 提交于
Fix typo in comment. Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NNikita Shubin <nikita.shubin@maquefel.me> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Nikita Shubin 提交于
As ->to_irq is redefined in gpiochip_add_irqchip, having it defined in driver is useless, so let's drop it. Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NNikita Shubin <nikita.shubin@maquefel.me> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Nikita Shubin 提交于
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: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NAlexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: NNikita Shubin <nikita.shubin@maquefel.me> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Srinivas Neeli 提交于
Add check to see if gpio-width property does not exceed 32. If it exceeds then return -EINVAL. Signed-off-by: NSrinivas Neeli <srinivas.neeli@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NWilliam Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Srinivas Neeli 提交于
Add support for suspend and resume, pm runtime suspend and resume. Added free and request calls. Signed-off-by: NSrinivas Neeli <srinivas.neeli@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Srinivas Neeli 提交于
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: NRobert Hancock <hancock@sedsystems.ca> Signed-off-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: NSrinivas Neeli <srinivas.neeli@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Srinivas Neeli 提交于
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: NSrinivas Neeli <srinivas.neeli@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Srinivas Neeli 提交于
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: NSrinivas Neeli <srinivas.neeli@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Andy Shevchenko 提交于
Driver is gone, no need to keep a Makefile entry for it. Remove. Reported-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
the regmap_set_bits(), regmap_clear_bits() API makes code better to understand. Switch the driver to use them, Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Andy Shevchenko 提交于
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 05f4434b ("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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
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 05f4434b ("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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Andy Shevchenko 提交于
Remove trailing comma in terminator entries to avoid potential expanding an array behind it. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
-
由 Andy Shevchenko 提交于
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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
-
由 Andy Shevchenko 提交于
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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
-
由 Andy Shevchenko 提交于
If we get bias set request, for example, from GpioIo() resource, we silently ignore it. Make bias configuration available for GPIOs. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Baruch Siach 提交于
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: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Dmitry Osipenko 提交于
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 <pgwipeout@gmail.com> # Ouya T30 Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 Tested-by: Dmitry Osipenko <digetx@gmail.com> # A500 T20 and Nexus7 T30 Fixes: efcdca286eef ("gpio: tegra: Convert to gpio_irq_chip") Reported-by: NMatt Merhar <mattmerhar@protonmail.com> Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Dmitry Osipenko 提交于
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: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Dmitry Osipenko 提交于
Clean up inconsistent whitespaces and tabs in the definition of tegra_gpio_driver to make code look better a tad. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Dmitry Osipenko 提交于
Use resource-managed variant of debugfs_create_file(0444) to prepare code for the modularization of the driver. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Dmitry Osipenko 提交于
Don't cross 80 chars of line length in order to keep formatting of the code consistent. Signed-off-by: NDmitry Osipenko <digetx@gmail.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Baruch Siach 提交于
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: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Analyzed-by: NRussell King <linux@armlinux.org.uk> Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Baruch Siach 提交于
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: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Baruch Siach 提交于
Round up the divisions in .get_state() to make applying the read out configuration idempotent in most cases as .apply rounds down. Reported-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Baruch Siach 提交于
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: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-
由 Bartosz Golaszewski 提交于
gpio-mockup doesn't require SYSFS to be selected so drop that bit from the Kconfig text. Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Zheng Yongjun 提交于
Replace a comma between expression statements by a semicolon. Signed-off-by: NZheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
-