summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-siox.c
AgeCommit message (Collapse)AuthorFilesLines
2020-09-09gpio: siox: explicitly support only threaded irqsAhmad Fatoum1-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: u.kleine-koenig@pengutronix.de Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") Cc: stable@vger.kernel.org Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2020-02-21gpio: siox: use raw spinlock for irq related lockingUwe Kleine-König1-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 <uwe@kleine-koenig.org> Link: https://lore.kernel.org/r/20200211135121.15752-1-uwe@kleine-koenig.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-11-07gpio: Use new GPIO_LINE_DIRECTIONMatti Vaittinen1-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 <matti.vaittinen@fi.rohmeurope.com> Acked-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> Acked-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-07-03gpio: siox: Use devm_ managed gpiochipLinus Walleij1-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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-07-03gpio: siox: Add struct device *dev helper variableLinus Walleij1-5/+5
This makes the code easier to read. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-07-03gpio: siox: Pass irqchip when adding gpiochipLinus Walleij1-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 <u.kleine-koenig@pengutronix.de> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-06-27gpio: siox: Switch to IRQ_TYPE_NONELinus Walleij1-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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-06-27gpio: siox: Do not call gpiochip_remove() on errorpathLinus Walleij1-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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2019-06-27gpio: siox: Use module_siox_driver()Enrico Weigelt1-12/+1
Reduce driver init boilerplate by using the new module_siox_driver() macro. Signed-off-by: Enrico Weigelt <info@metux.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-09-28gpio: new driver to work with a 8x12 sioxUwe Kleine-König1-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 <g.schenk@eckelmann.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>