aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-siox.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: rename GPIO set callbacks back to their original namesBartosz Golaszewski2025-08-071-1/+1
| | | | | | | | | | | The conversion of all GPIO drivers to using the .set_rv() and .set_multiple_rv() callbacks from struct gpio_chip (which - unlike their predecessors - return an integer and allow the controller drivers to indicate failures to users) is now complete and the legacy ones have been removed. Rename the new callbacks back to their original names in one sweeping change. Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: siox: use new GPIO line value setter callbacksBartosz Golaszewski2025-07-021-5/+6
| | | | | | | | | | struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Acked-by: Thorsten Scherer <[email protected]> Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-4-bc110a3b52ff@linaro.org Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: siox: Convert to immutable irq_chipLinus Walleij2023-03-231-36/+37
| | | | | | | | | | | | | | | | | Convert the driver to immutable irq-chip with a bit of intuition. In this case I had to figure out a way to get to the struct gpio_chip that would work even when the irq_chip is not part of the driver state container. I did this by just doing what most other GPIO drivers do and pass the state struct as data to devm_gpiochip_add_data() and rewrite accordingly. Cc: Marc Zyngier <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: siox: explicitly support only threaded irqsAhmad Fatoum2020-09-091-0/+1
| | | | | | | | | | | | | | | | | The gpio-siox driver uses handle_nested_irq() to implement its interrupt support. This is only capable of handling threaded irq actions. For a hardirq action it triggers a NULL pointer oops. (It calls action->thread_fn which is NULL then.) Prevent registration of a hardirq action by setting gpio_irq_chip::threaded to true. Cc: [email protected] Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") Cc: [email protected] Signed-off-by: Ahmad Fatoum <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: siox: use raw spinlock for irq related lockingUwe Kleine-König2020-02-211-14/+14
| | | | | | | | | | | | All the irq related callbacks are called with the (raw) spinlock desc->lock being held. So the lock here must be raw as well. Also irqs were already disabled by the caller for the irq chip callbacks, so the non-irq variants of spin_lock must be used there. Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
* gpio: Use new GPIO_LINE_DIRECTIONMatti Vaittinen2019-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | It's hard for occasional GPIO code reader/writer to know if values 0/1 equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT to help them out. NOTE - for gpio-amd-fch and gpio-bd9571mwv: This commit also changes the return value for direction get to equal 1 for direction INPUT. Prior this commit these drivers might have returned some other positive value but 1 for INPUT. Signed-off-by: Matti Vaittinen <[email protected]> Acked-by: Scott Branden <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Reviewed-by: Michal Simek <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Acked-by: Kuppuswamy Sathyanarayanan <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Use devm_ managed gpiochipLinus Walleij2019-07-031-10/+1
| | | | | | | | | By using devm_gpiochip_add_data() we can get rid of the remove() callback. As this driver doesn't use the gpiochip data pointer we simply pass in NULL. Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Add struct device *dev helper variableLinus Walleij2019-07-031-5/+5
| | | | | | | This makes the code easier to read. Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Pass irqchip when adding gpiochipLinus Walleij2019-07-031-9/+7
| | | | | | | | | | | | We need to convert all old gpio irqchips to pass the irqchip setup along when adding the gpio_chip. For chained irqchips this is a pretty straight-forward conversion. Cc: Uwe Kleine-König <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Switch to IRQ_TYPE_NONELinus Walleij2019-06-271-1/+1
| | | | | | | | | | | | The siox driver is hardcoding a default type of IRQ_TYPE_EDGE_RISING to the irq helper, but this should only be applicable to old boardfiles and odd device tree irqchips with just onecell irq (no flags). I doubt this is the case with the siox, I think all consumers specify the flags they use in the device tree. Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Do not call gpiochip_remove() on errorpathLinus Walleij2019-06-271-5/+2
| | | | | | | | | | gpiochip_remove() was called on the errorpath if gpiochip_add() failed: this is wrong, if the chip failed to add it is not there so it should not be removed. Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: siox: Use module_siox_driver()Enrico Weigelt2019-06-271-12/+1
| | | | | | | | Reduce driver init boilerplate by using the new module_siox_driver() macro. Signed-off-by: Enrico Weigelt <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: new driver to work with a 8x12 sioxUwe Kleine-König2018-09-281-0/+293
This driver controls a SIOX device that provides 20 I/O lines. The first twelve are fixed inputs, the remaining eight are outputs. Acked-by: Gavin Schenk <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>