- 17 12月, 2021 7 次提交
-
-
由 Hsu Yuchang 提交于
Add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match. Signed-off-by: NYuchang Hsu <Richard_Hsu@asmedia.com.tw> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Prathamesh Shete 提交于
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra234. While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: NPrathamesh Shete <pshete@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Jason Wang 提交于
The double `all' in the comment in line 327 is repeated. Remove one of them from the comment. Signed-off-by: NJason Wang <wangborong@cdjrlc.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Bartosz Golaszewski 提交于
Implement a new, modern GPIO testing module controlled by configfs attributes instead of module parameters. The goal of this driver is to provide a replacement for gpio-mockup that will be easily extensible with new features and doesn't require reloading the module to change the setup. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
If the driver sets the fwnode in struct gpio_chip, let it take precedence over the of_node. This only affects OF-based systems, ACPI needs to be converted separately. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
Software nodes allow us to represent hierarchies for device components that don't have their struct device representation yet - for instance: banks of GPIOs under a common GPIO expander. The core gpiolib core however doesn't offer any way of passing this information from the drivers. This extends struct gpio_chip with a pointer to fwnode that can be set by the driver and used to pass device properties for child nodes. This is similar to how we handle device-tree sub-nodes with CONFIG_OF_GPIO enabled. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
由 Bartosz Golaszewski 提交于
Currently all users of gpiod_add_hogs() call it only once at system init so there never was any need for a mechanism allowing to remove them. Now the upcoming gpio-sim will need to tear down chips with hogged lines so provide a function that allows to remove hogs. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 10 12月, 2021 2 次提交
-
-
由 Iwona Winiarska 提交于
The gpio-aspeed-sgpio driver implements an irq_chip which need to be invoked from hardirq context. Since spin_lock() can sleep with PREEMPT_RT, it is no longer legal to invoke it while interrupts are disabled. This also causes lockdep to complain about: [ 25.919465] [ BUG: Invalid wait context ] because aspeed_sgpio.lock (spin_lock_t) is taken under irq_desc.lock (raw_spinlock_t). Let's use of raw_spinlock_t instead of spinlock_t. Signed-off-by: NIwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Iwona Winiarska 提交于
The gpio-aspeed driver implements an irq_chip which need to be invoked from hardirq context. Since spin_lock() can sleep with PREEMPT_RT, it is no longer legal to invoke it while interrupts are disabled. This also causes lockdep to complain about: [ 0.649797] [ BUG: Invalid wait context ] because aspeed_gpio.lock (spin_lock_t) is taken under irq_desc.lock (raw_spinlock_t). Let's use of raw_spinlock_t instead of spinlock_t. Signed-off-by: NIwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 06 12月, 2021 2 次提交
-
-
由 Bartosz Golaszewski 提交于
Several drivers read the 'ngpios' device property on their own, but since it's defined as a standard GPIO property in the device tree bindings anyway, it's a good candidate for generalization. If the driver didn't set its gc->ngpio, try to read the 'ngpios' property from the GPIO device's firmware node before bailing out. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Suggested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
由 Bartosz Golaszewski 提交于
Drop unneeded whitespaces and put the variables of the same type together for consistency with the rest of the code. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 03 12月, 2021 4 次提交
-
-
由 Rob Herring 提交于
Commit ea708ac5 ("gpio: xlp: Remove Netlogic XLP variants") has build errors with CONFIG_ACPI: drivers/gpio/gpio-xlp.c:300:23: error: 'GPIO_VARIANT_VULCAN' undeclared here (not in a function) and !CONFIG_OF: drivers/gpio/gpio-xlp.c:267:11: error: 'struct gpio_chip' has no member named 'of_node' Fix these errors. Fixes: ea708ac5 ("gpio: xlp: Remove Netlogic XLP variants") Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Reported-by: Nkernel test robot <lkp@intel.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: linux-gpio@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 John Keeping 提交于
Use the standard gpiochip request/release resource functions so that any GPIOs used as interrupts are properly locked. This allows libgpiod to correctly show these GPIOs as in-use. Signed-off-by: NJohn Keeping <john@metanate.com> Tested-by: NNicolas Frattaroli <frattaroli.nicolas@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Geert Uytterhoeven 提交于
Currently the GPIO Aggregator does not support interrupts. This means that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), and userspace applications using line events do not work. Add interrupt support by providing a gpio_chip.to_irq() callback, which just calls into the parent GPIO controller. Note that this does not implement full interrupt controller (irq_chip) support, so using e.g. gpio-keys with "interrupts" instead of "gpios" still does not work. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Geert Uytterhoeven 提交于
This saves 20 bytes on arm32, and 44 bytes on arm64. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 15 11月, 2021 1 次提交
-
-
由 Rob Herring 提交于
Netlogic XLP was removed in commit 95b8a5e0 ("MIPS: Remove NETLOGIC support"). With those gone, the single platform left to support is Cavium ThunderX2. Remove all the Netlogic variants and DT support. For simplicity, the existing kconfig name is retained. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: linux-gpio@vger.kernel.org Signed-off-by: NRob Herring <robh@kernel.org> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 04 11月, 2021 1 次提交
-
-
由 Viresh Kumar 提交于
This patch adds IRQ support for the virtio GPIO driver. Note that this uses the irq_bus_lock/unlock() callbacks, since those operations over virtio may sleep. Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> Acked-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 30 10月, 2021 3 次提交
-
-
由 Sander Vanheule 提交于
The irqchip uses one domain for all GPIO lines, so the line offset should be determined w.r.t. the first line of the first port, not the first line of the triggered port. Fixes: 0d82fb11 ("gpio: Add Realtek Otto GPIO support") Signed-off-by: NSander Vanheule <sander@svanheule.net> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Randy Dunlap 提交于
Fix multiple problems in punctuation, capitalization, grammar, wording, and typos in the GPIO Kconfig file. Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: linux-gpio@vger.kernel.org Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Sean Young <sean@mess.org> Cc: Bamvor Jian Zhang <bamv2005@gmail.com> Cc: Michael Walle <michael@walle.cc> Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Asmaa Mnebhi 提交于
Introduce standard IRQ handling in the gpio-mlxbf2.c driver. Signed-off-by: NAsmaa Mnebhi <asmaa@nvidia.com> Acked-by: NDavid S. Miller <davem@davemloft.net> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 27 10月, 2021 1 次提交
-
-
由 Marc Zyngier 提交于
The core gpiolib code is able to deal with multiple interrupt parents for a single gpio irqchip. It however only allows a single piece of data to be conveyed to all flow handlers (either the gpio_chip or some other, driver-specific data). This means that drivers have to go through some interesting dance to find the correct context, something that isn't great in interrupt context (see aebdc8ab for a prime example). Instead, offer an optional way for a pinctrl/gpio driver to provide an array of pointers which gets used to provide the correct context to the flow handler. Signed-off-by: NMarc Zyngier <maz@kernel.org> Signed-off-by: NJoey Gouly <joey.gouly@arm.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20211026175815.52703-2-joey.gouly@arm.comSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 26 10月, 2021 1 次提交
-
-
由 Rafael J. Wysocki 提交于
The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() macro and the ACPI handle produced by the former comes from the ACPI device object produced by the latter, so it is way more straightforward to evaluate the latter directly instead of passing the handle produced by the former to acpi_bus_get_device(). Modify pt_gpio_probe() accordingly (no intentional functional impact). Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 25 10月, 2021 2 次提交
-
-
由 Asmaa Mnebhi 提交于
Add a check if bgpio_init fails. Signed-off-by: NAsmaa Mnebhi <asmaa@nvidia.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Jonas Gorski 提交于
of_property_read_u32 returns 0 on success, not true, so we need to invert the check to actually take over the provided ngpio value. Fixes: 6a41b6c5 ("gpio: Add xgs-iproc driver") Signed-off-by: NJonas Gorski <jonas.gorski@gmail.com> Reviewed-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 21 10月, 2021 1 次提交
-
-
由 Andy Shevchenko 提交于
Since driver core provides a generic device_match_acpi_handle() we may replace the custom code with it. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20211014134756.39092-3-andriy.shevchenko@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 14 10月, 2021 2 次提交
-
-
由 Uwe Kleine-König 提交于
An spi remove callback is only called for devices that probed successfully. In this case this implies that mc33880_probe() set a non-NULL driver data. So the check for mc being NULL is never true and the check can be dropped. Also the return value ofspi remove callbacks is ignored anyway. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Uwe Kleine-König 提交于
An spi or i2c remove callback is only called for devices that probed successfully. In this case this implies that __max730x_probe() set a non-NULL driver data. So the check ts == NULL is never true. With this check dropped, __max730x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 13 10月, 2021 1 次提交
-
-
由 Geert Uytterhoeven 提交于
The tmp[] member of the gpiochip_fwd structure is used to store both the temporary values bitmap and the desc pointers for operations on multiple GPIOs. As both are arrays with sizes unknown at compile-time, accessing them requires offset calculations, which are currently duplicated in gpio_fwd_get_multiple() and gpio_fwd_set_multiple(). Introduce (a) accessors for both arrays and (b) a macro to calculate the needed storage size. This confines the layout of the tmp[] member into a single spot, to ease maintenance. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 06 10月, 2021 3 次提交
-
-
由 Andy Shevchenko 提交于
The gpio-mockup driver creates the properties that are shared between platform and GPIO devices. Because of that, the properties may not be removed at the proper point of time without provoking a use-after-free as shown in the following backtrace: refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 103 at lib/refcount.c:28 refcount_warn_saturate+0xd1/0x120 ... Call Trace: kobject_put+0xdc/0xf0 software_node_notify_remove+0xa8/0xc0 device_del+0x15a/0x3e0 That's why the driver has to manage the lifetime of the software nodes by itself. The problem originates from the old device_add_properties() API, but has been only revealed after the commit bd1e336a ("driver core: platform: Remove platform_device_add_properties()"). Hence, it's used as a landmark for backporting. Fixes: bd1e336a ("driver core: platform: Remove platform_device_add_properties()") Reported-by: NKent Gibson <warthog618@gmail.com> Tested-by: NKent Gibson <warthog618@gmail.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> [Bartosz: tweaked local variable placement] Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
The commit 15add068 ("gpio: pca953x: add ->set_config implementation") introduced support for bias setting. However this, due to being half-baked, brought potential issues: - the turning bias via disabling makes the pin floating for a while; - once enabled, bias can't be disabled. Fix all these by adding support for bias disabling and move the disabling part under the corresponding conditional. While at it, add support for default setting, since it's cheap to add. Fixes: 15add068 ("gpio: pca953x: add ->set_config implementation") Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Mark Brown 提交于
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI device ID table. Fixes: 96c8395e ("spi: Revert modalias changes") Signed-off-by: NMark Brown <broonie@kernel.org> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 30 9月, 2021 1 次提交
-
-
由 Andrey Gusakov 提交于
Per gpio_chip interface, error shall be proparated to the caller. Attempt to silent diagnostics by returning zero (as written in the comment) is plain wrong, because the zero return can be interpreted by the caller as the gpio value. Cc: stable@vger.kernel.org Signed-off-by: NAndrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: NNikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 23 9月, 2021 1 次提交
-
-
由 Piyush Mehta 提交于
This patch adds driver support for the zynqmp modepin GPIO controller. GPIO modepin driver set and get the value and status of the PS_MODE pin, based on device-tree pin configuration. These four mode pins are configurable as input/output. The mode pin has a control register, which have lower four-bits [0:3] are configurable as input/output, next four-bits can be used for reading the data as input[4:7], and next setting the output pin state output[8:11]. By default value of mode pin register is 0. Signed-off-by: NPiyush Mehta <piyush.mehta@xilinx.com> Acked-by: NMichal Simek <michal.simek@xilinx.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 22 9月, 2021 7 次提交
-
-
由 Krzysztof Kozlowski 提交于
The MODULE_DEVICE_TABLE already creates proper alias for platform driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Krzysztof Kozlowski 提交于
The MODULE_DEVICE_TABLE already creates proper alias for platform driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Wolfram Sang 提交于
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiko Stuebner 提交于
The function uses the newly introduced rockchip_gpio_readl_bit() which directly returns the actual value of the requeste bit. So using the existing bit-wise check for the bit inside the value will always return 0. Fix this by dropping the bit manipulation on the result. Fixes: 3bcbd1a8 ("gpio/rockchip: support next version gpio controller") Signed-off-by: NHeiko Stuebner <heiko@sntech.de> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiko Stuebner 提交于
The gpio driver runs into issues on v1 gpio blocks, as the db_clk and the whole extended debounce support is only ever defined on v2. So checking for the IS_ERR on the db_clk is not enough, as it will be NULL on v1. Fix this by adding the needed condition for v2 first before checking the existence of the db_clk. This caused my rk3288-veyron-pinky to enter a reboot loop when it tried to enable the power-key as adc-key device. Fixes: 3bcbd1a8 ("gpio/rockchip: support next version gpio controller") Signed-off-by: NHeiko Stuebner <heiko@sntech.de> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Thierry Reding 提交于
Tegra194 and later support more than a single interrupt per bank. This is primarily useful for virtualization but can also be helpful for more fine-grained CPU affinity control. To keep things simple for now, route all pins to the first interrupt. For backwards-compatibility, support old device trees that specify only one interrupt per bank by counting the interrupts at probe time. Signed-off-by: NThierry Reding <treding@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Thierry Reding 提交于
Newer chips support up to 8 interrupts per bank, which can be useful to balance the load and decrease latency. However, it also required a very complicated interrupt routing to be set up. To keep things simple for now, ensure that a single interrupt per bank is enforced, even if all possible interrupts are described in device tree. Signed-off-by: NThierry Reding <treding@nvidia.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-