aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-raspberrypi-exp.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: raspberrypi-exp: use new GPIO line value setter callbacksStefan Wahren2025-06-161-3/+7
| | | | | | | | | | | struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: raspberrypi-exp: remove redundant of_match_ptr()Zhu Wang2023-08-031-2/+2
| | | | | | | | | | | | | | The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr() here, and __maybe_unused can also be removed. Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Signed-off-by: Zhu Wang <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: raspberrypi-exp: mark OF related data as maybe unusedKrzysztof Kozlowski2023-03-151-1/+1
| | | | | | | | | | | The driver can be compile tested with !CONFIG_OF making certain data unused: drivers/gpio/gpio-raspberrypi-exp.c:237:34: error: ‘rpi_exp_gpio_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: Get rid of duplicate of_node assignment in the driversAndy Shevchenko2021-12-171-1/+0
| | | | | | | | | | | | | | 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: Andy Shevchenko <[email protected]> Reviewed-By: Matti Vaittinen <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: raspberrypi-exp: Release firmware handle on unbindNicolas Saenz Julienne2021-03-221-1/+1
| | | | | | | | | Use devm_rpi_firmware_get() so as to make sure we release RPi's firmware interface when unbinding the device. Signed-off-by: Nicolas Saenz Julienne <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]>
* gpio: Use new GPIO_LINE_DIRECTIONMatti Vaittinen2019-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | | 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: raspberrypi-exp: decrease refcount on firmware dt nodeNicolas Saenz Julienne2018-12-171-0/+1
| | | | | | | | | | We're getting a reference RPi's firmware node in order to be able to communicate with it's driver. We should decrease the reference count on the dt node after being done with it. Fixes: a98d90e7d588 ("gpio: raspberrypi-exp: Driver for RPi3 GPIO expander via mailbox service") Signed-off-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: raspberrypi-exp: Driver for RPi3 GPIO expander via mailbox serviceDave Stevenson2018-02-221-0/+252
Pi3 and Compute Module 3 have a GPIO expander that the VPU communicates with. There is a mailbox service that now allows control of this expander, so add a kernel driver that can make use of it. Reviewed-by: Stefan Wahren <[email protected]> Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Linus Walleij <[email protected]>