- 08 2月, 2022 3 次提交
-
-
由 Andy Shevchenko 提交于
Simplify error path in the gpiod_get_index() when requesting a GPIO line by: - checking for error condition first - dropping redundant 'else' As a result, decrease the indentation level for better readability. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
Instead of repeating first argument for true branch, use short form of the ternary operator, i.e. ?:. While at it, fix a typo in the comment. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
In a few places we are using a loop against all GPIO descriptors with a given flag for a given device. Replace it with a consolidated for_each type of macro. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 02 2月, 2022 1 次提交
-
-
由 John Crispin 提交于
Airoha's GPIO controller on their ARM EN7523 SoCs consists of two banks of 32 GPIOs. Each instance in DT is for a single bank. Acked-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NJohn Crispin <john@phrozen.org> Signed-off-by: NFelix Fietkau <nbd@nbd.name> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 20 1月, 2022 2 次提交
-
-
由 Yang Li 提交于
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irqn', so making 'irqn' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression compared with zero: mpc8xxx_gc -> irqn < 0 Reported-by: NAbaci Robot <abaci@linux.alibaba.com> Fixes: 0b39536c ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe") Signed-off-by: NYang Li <yang.lee@linux.alibaba.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Yang Li 提交于
The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'parent_irq', so making 'parent_irq' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-idt3243x.c:167:6-16: WARNING: Unsigned expression compared with zero: parent_irq < 0 Reported-by: NAbaci Robot <abaci@linux.alibaba.com> Fixes: 30fee1d7 ("gpio: idt3243x: Fix IRQ check in idt_gpio_probe") Signed-off-by: NYang Li <yang.lee@linux.alibaba.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 17 1月, 2022 2 次提交
-
-
由 Miaoqian Lin 提交于
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 4195926a ("gpio: Add support for IDT 79RC3243x GPIO controller") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Miaoqian Lin 提交于
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 76c47d14 ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: NMiaoqian Lin <linmq006@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 15 1月, 2022 1 次提交
-
-
由 Michael S. Tsirkin 提交于
This will enable cleanups down the road. The idea is to disable cbs, then add "flush_queued_cbs" callback as a parameter, this way drivers can flush any work queued after callbacks have been disabled. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Link: https://lore.kernel.org/r/20211013105226.20225-1-mst@redhat.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
-
- 05 1月, 2022 3 次提交
-
-
由 Lad Prabhakar 提交于
The driver overrides the error code returned by devm_request_irq() to -ENOENT. Switch to propagating the error code upstream. Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: NSergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Lad Prabhakar 提交于
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Lad Prabhakar 提交于
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: NLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 03 1月, 2022 4 次提交
-
-
由 Andy Shevchenko 提交于
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes. Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NSerge Semin <fancer.lancer@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
If the driver sets the fwnode in struct gpio_chip, let it take precedence over the parent's fwnode. This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make fwnode take precedence in struct gpio_chip"). Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Steven Lee 提交于
Each aspeed sgpio bank has 64 gpio pins(32 input pins and 32 output pins). The hwirq base for each sgpio bank should be multiples of 64 rather than multiples of 32. Signed-off-by: NSteven Lee <steven_lee@aspeedtech.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Christophe JAILLET 提交于
kfree() and bitmap_free() are the same. But using the later is more consistent when freeing memory allocated with bitmap_alloc(). Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 24 12月, 2021 3 次提交
-
-
由 Andy Shevchenko 提交于
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NMichael Walle <michael@walle.cc> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Akhil R 提交于
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra241 (Grace). While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: NAkhil R <akhilrajeev@nvidia.com> Signed-off-by: NThierry Reding <treding@nvidia.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
We already have a local variable that contains a copy of OF node pointer. Use it instead of dereferencing it again from struct device. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 22 12月, 2021 1 次提交
-
-
由 Andy Shevchenko 提交于
After the commit 448cf905 ("gpio: Get rid of duplicate of_node assignment in the drivers") the OF node local pointers become unused. Remove them for good and make compiler happy about. Fixes: 448cf905 ("gpio: Get rid of duplicate of_node assignment in the drivers") Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> [Bart: removed unrelated change in gpio-brcmstb] Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 21 12月, 2021 2 次提交
-
-
由 Vincent Whitchurch 提交于
The driver imposes an arbitrary one second timeout on virtio requests, but the specification doesn't prevent the virtio device from taking longer to process requests, so remove this timeout to support all systems and device implementations. Fixes: 3a29355a ("gpio: Add virtio-gpio driver") Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com> Acked-by: NMichael S. Tsirkin <mst@redhat.com> Acked-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Yang Yingliang 提交于
Calling fwnode_handle_put() when break out of device_for_each_child_node(), or the device node reference will be leakd. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 20 12月, 2021 2 次提交
-
-
由 Daniel Palmer 提交于
This adds GPIO support for the SSD201 and SSD202D chips. Signed-off-by: NDaniel Palmer <daniel@0x0f.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Daniel Palmer 提交于
- Remove the unneeded assignment of ret before returning it. - Remove an unneeded blank line Signed-off-by: NDaniel Palmer <daniel@0x0f.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 19 12月, 2021 2 次提交
-
-
由 Noralf Trønnes 提交于
When replugging the device the following message shows up: gpio gpiochip2: (dln2): detected irqchip that is shared with multiple gpiochips: please fix the driver. This also has the effect that interrupts won't work. The same problem would also show up if multiple devices where plugged in. Fix this by allocating the irq_chip data structure per instance like other drivers do. I don't know when this problem appeared, but it is present in 5.10. Cc: <stable@vger.kernel.org> # 5.10+ Cc: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: NNoralf Trønnes <noralf@tronnes.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Tom Rix 提交于
Building with clang returns this error: gpio-sim.c:889:7: error: variable 'ret' is uninitialized when used here ret should be the status of the call to gpio_sim_make_bank_swnode stored in bank->swnode. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Signed-off-by: NTom Rix <trix@redhat.com> Reviewed-by: NNathan Chancellor <nathan@kernel.org> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 18 12月, 2021 3 次提交
-
-
由 Andy Shevchenko 提交于
When creating MFD platform devices the firmware node is left unset. This, in particular, prevents GPIO library to use it for different purposes. Propagate firmware node from the parent device and let GPIO library do the right thing. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Andy Shevchenko 提交于
GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove these assignment all at once. For the details one may look into the of_gpio_dev_init() implementation. While at it, remove duplicate parent device assignment where it is the case. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-By: NMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 17 12月, 2021 8 次提交
-
-
由 Peter Rosin 提交于
Some GPIO providers set names for GPIO lines that match the names of the pins on the SoC, or variations on that theme. These names are generic more often that not, such as pioC12 in the at91 case. These generic names block the possibility to set more useful GPIO line names with device properties (i.e. gpio-line-names). Allow overriding a generic name given by the GPIO driver if there is a name given to the GPIO line using device properties, but leave the generic name alone if no better name is available. However, there is a risk. If user space is depending on the above mentioned fixed GPIO names, AND there are device properties that previously did not reach the surface, the name change might cause regressions. But hopefully this stays below the radar... Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Tested-by: NAlexander Dahl <ada@thorsis.com> Signed-off-by: NPeter Rosin <peda@axentia.se> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 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>
-
- 13 12月, 2021 1 次提交
-
-
由 Jason Wang 提交于
The double `the' in the comment in line 142 is repeated. Remove one of them from the comment. Signed-off-by: NJason Wang <wangborong@cdjrlc.com> Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- 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>
-