aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2023-09-11gpio: dwapb: don't include gpiolib.hBartosz Golaszewski1-1/+0
The gpiolib.h is unnecessarily included in the driver. None of its symbols are used so drop it. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-09-11gpio: xgene-sb: don't include gpiolib.hBartosz Golaszewski1-1/+0
The gpiolib.h is unnecessarily included in the driver. None of its symbols are used so drop it. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-09-11gpio: of: correct notifier return codesBartosz Golaszewski1-8/+8
According to the comments in linux/notifier.h, the code to return when a notifications is "not for us" is NOTIFY_DONE, not NOTIFY_OK. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpiolib: unexport gpiod_set_transitory()Bartosz Golaszewski2-1/+2
There are no and never have been any users of gpiod_set_transitory() outside the core GPIOLIB code. Make it private. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio: mockup: don't access internal GPIOLIB structuresBartosz Golaszewski1-9/+30
Don't include gpiolib.h. Track the request status of lines locally instead. In order to retrieve the device name use the fact that gpio-mockup supports only a single GPIO device per platform device and call device_find_any_child(). Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio: mockup: simplify code by using cleanup helpersBartosz Golaszewski1-24/+21
Use lock from linux/cleanup.h and simplify locking paths. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio: mockup: deprecate the old testing moduleBartosz Golaszewski1-1/+3
We have a much better alternative to the clunky old gpio-mockup. Don't remove it just yet (there are tests depending on it out there) but make Kconfig say that it should no longer be used in new projects. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio: mockup: remove unused fieldBartosz Golaszewski1-2/+0
The desc assigned to debugfs private structure is unused so remove it. Fixes: 9202ba2397d1 ("gpio: mockup: implement event injecting over debugfs") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio: mockup: fix kerneldocBartosz Golaszewski1-0/+2
The pull field of the line state struct is undocumented. Fix it. Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-09-11gpio-f7188x: fix base values conflicts with other gpio pinsxingtong.wu1-69/+69
switch pin base from static to automatic allocation to avoid conflicts and align with other gpio chip drivers Signed-off-by: xingtong.wu <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Revisit header inclusionsAndy Shevchenko1-6/+14
Some of the headers are not use, some are missing. Fix that. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Get rid of useless goto labelAndy Shevchenko1-17/+7
In a few functions goto label is useless as there are no locking, no nothing that may justify its usage. Get rid of it. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Switch to DEFINE_SIMPLE_DEV_PM_OPS()Andy Shevchenko1-5/+3
SIMPLE_DEV_PM_OPS() is deprecated, replace it with pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() for setting the driver's PM routines. We can now remove the ifdeffery surrounding the suspend and resume functions. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Utilise temporary variable for struct gpio_chipAndy Shevchenko1-4/+3
We have a temporary variable to keep pointer to struct gpio_chip. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Utilise temporary variable for struct deviceAndy Shevchenko1-16/+14
We have a temporary variable to keep pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Simplify code with cleanup helpersAndy Shevchenko1-48/+29
Use macros defined in linux/cleanup.h to automate resource lifetime control in gpio-pca953x. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Split pca953x_restore_context() and pca953x_save_context()Andy Shevchenko1-15/+29
Split regcache handling to the respective helpers. It will allow to have further refactoring with ease. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Utilise dev_err_probe() where it makes senseAndy Shevchenko1-5/+3
At least in pca953x_irq_setup() we may use dev_err_probe(). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Fully convert to device managed resourcesAndy Shevchenko1-33/+35
Curtrently the error path is unsynchronised with removal due to regulator being disabled before other device managed resources are handled. Correct that by wrapping regulator enablement in the respective call. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-11gpio: pca953x: Drop unused fields in struct pca953x_platform_dataAndy Shevchenko1-29/+8
New code should solely use firmware nodes for the specifics and not any callbacks. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-09-06gpio: zynq: restore zynq_gpio_irq_reqres/zynq_gpio_irq_relres callbacksDaniel Mack1-2/+24
Commit f56914393537 ("gpio: zynq: fix zynqmp_gpio not an immutable chip warning") ditched the open-coded resource allocation handlers in favor of the generic ones. These generic handlers don't maintain the PM runtime anymore, which causes a regression in that level IRQs are no longer reported. Restore the original handlers to fix this. Signed-off-by: Daniel Mack <[email protected]> Fixes: f56914393537 ("gpio: zynq: fix zynqmp_gpio not an immutable chip warning") Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-29Merge tag 'gpio-updates-for-v6.6' of ↵Linus Torvalds80-2015/+1505
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have a lot of code refactoring using common helpers and ended up removing more lines then we're adding this release cycle. Nothing really stands out, just small updates all over the place. Core GPIOLIB updates: - wake-up poll() in user-space on device unbind - improve fwnode usage - interrupt domain handling improvements - correctly handle the ngpios property in gpio-mmio Driver cleanups: - remove unneeded calls to platform_set_drvdata() all around the place - remove unneeded of_match_ptr() expansions whenever a driver depends on CONFIG_OF - remove redundant calls to dev_err_probe() from gpio-omap and gpio-davinci Driver improvements: - use autopointers and guards from cleanup.h in gpio-sim - shrink code in gpio-sim using some common helpers - convert the idio family of drivers to using gpio-regmap - convert gpio-ws16c48 to using gpio-regmap - use devres to simplify code in gpio-pisosr and gpio-mxc - update gpio-sifive: support IRQ wake, improve interrupt handling, allow building as module - make gpio-ge and gpio-bcm-kona OF-independent (plus some minor tweaks) - add support for new models in gpio-pca953x and gpio-ds4520 - add runtime PM support to gpio-mxc - fix a build warning in gpio-mxs - add support for adding pin ranges to gpio-mlxbf3 - add counter/timer support to gpio-104-dio-48e - switch to dynamic GPIO base allocation in gpio-vf610 - minor oneliners here and there Device-tree bindings updates: - enable the gpio-line-names property in snps,dw-apb and STMPE GPIO - document new models in fsl-imx-gpio, ds4520 and pca95xx - convert the bindings for brcm,kona-gpio to YAML" * tag 'gpio-updates-for-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (94 commits) gpio: pca953x: add support for TCA9538 dt-bindings: gpio: pca95xx: document new tca9538 chip gpio: pca953x: Use i2c_get_match_data() gpio: mlxbf3: use capital "OR" for multiple licenses in SPDX gpio: pcf857x: Extend match data support for OF tables gpio: vf610: switch to dynamic allocat GPIO base gpiolib: provide and use gpiod_line_state_notify() gpio: cdev: wake up lineevent poll() on device unbind gpio: cdev: wake up linereq poll() on device unbind gpio: cdev: wake up chardev poll() on device unbind gpiolib: add a second blocking notifier to struct gpio_device gpio: cdev: open-code to_gpio_chardev_data() gpiolib: rename the gpio_device notifier gpio: mlxbf3: Support add_pin_ranges() gpio: mxc: Use helper function devm_clk_get_optional_enabled() gpio: pca9570: fix kerneldoc gpio: sim: simplify code with cleanup helpers gpio: sim: replace memmove() + strstrip() with skip_spaces() + strim() gpio: sim: simplify gpio_sim_device_config_live_store() gpio: mxc: release the parent IRQ in runtime suspend ...
2023-08-29Merge tag 'mmc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmcLinus Torvalds1-2/+18
Pull MMC updates from Ulf Hansson: "MMC core: - Convert drivers to use the ->remove_new() callback - Propagate the removable attribute for the card's device MMC host: - Convert drivers to use the ->remove_new() callback - atmel-mci: Convert to gpio descriptors and cleanup the code - davinci: Make SDIO irq truly optional - renesas_sdhi: Register irqs before registering controller - sdhci: Simplify the sdhci_pltfm_* interface a bit - sdhci-esdhc-imx: Improve support for the 1.8V errata - sdhci-of-at91: Add support for the microchip sam9x7 variant - sdhci-of-dwcmshc: Add support for runtime PM - sdhci-pci-o2micro: Add support for the new Bayhub GG8 variant - sdhci-sprd: Add support for SD high-speed mode tuning - uniphier-sd: Register irqs before registering controller" * tag 'mmc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (108 commits) mmc: atmel-mci: Move card detect gpio polarity quirk to gpiolib mmc: atmel-mci: move atmel MCI header file mmc: atmel-mci: Convert to gpio descriptors mmc: sdhci-sprd: Add SD HS mode online tuning mmc: core: Add host specific tuning support for SD HS mode mmc: sdhci-of-dwcmshc: Add runtime PM operations mmc: sdhci-of-dwcmshc: Add error handling in dwcmshc_resume mmc: sdhci-esdhc-imx: improve ESDHC_FLAG_ERR010450 mmc: sdhci-pltfm: Rename sdhci_pltfm_register() mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister() mmc: sdhci-st: Use sdhci_pltfm_remove() mmc: sdhci-pxav2: Use sdhci_pltfm_remove() mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove() mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove() mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove() mmc: sdhci-of-at91: Use sdhci_pltfm_remove() mmc: sdhci-of-arasan: Use sdhci_pltfm_remove() mmc: sdhci-iproc: Use sdhci_pltfm_remove() mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove() mmc: sdhci-dove: Use sdhci_pltfm_remove() ...
2023-08-25mmc: atmel-mci: Move card detect gpio polarity quirk to gpiolibBalamanikandan Gunasundar1-2/+18
The polarity of the card detection gpio is handled by the "cd-inverted" property in the device tree. Move this inversion logic to gpiolib to avoid reading the gpio raw value. Signed-off-by: Balamanikandan Gunasundar <[email protected]> Suggested-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
2023-08-25gpio: pca953x: add support for TCA9538Liam Beguin1-0/+2
The TCA9538 is an 8 bit version of the already supported TCA9539. This chip also has interrupt support. Signed-off-by: Liam Beguin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-25gpio: pca953x: Use i2c_get_match_data()Biju Das1-15/+3
Replace device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-24gpio: mlxbf3: use capital "OR" for multiple licenses in SPDXKrzysztof Kozlowski1-1/+1
Documentation/process/license-rules.rst and checkpatch expect the SPDX identifier syntax for multiple licenses to use capital "OR". Correct it to keep consistent format and avoid copy-paste issues. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-23gpio: sim: pass the GPIO device's software node to irq domainBartosz Golaszewski1-1/+1
Associate the swnode of the GPIO device's (which is the interrupt controller here) with the irq domain. Otherwise the interrupt-controller device attribute is a no-op. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-23gpio: sim: dispose of irq mappings before destroying the irq_sim domainBartosz Golaszewski1-0/+13
If a GPIO simulator device is unbound with interrupts still requested, we will hit a use-after-free issue in __irq_domain_deactivate_irq(). The owner of the irq domain must dispose of all mappings before destroying the domain object. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-22gpio: pcf857x: Extend match data support for OF tablesBiju Das1-15/+14
The driver has OF match table, but still it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. Extend match data support for OF tables by using i2c_get_match_data() instead of the ID lookup for both OF/ID matches by making similar OF/ID tables. Signed-off-by: Biju Das <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-22gpio: vf610: switch to dynamic allocat GPIO baseHaibo Chen1-2/+1
gpiolib want to get completely rid of static gpiobase allocation, so switch to dynamic allocat GPIO base, also can avoid warning message: [ 1.529974] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. Signed-off-by: Haibo Chen <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-22gpiolib: provide and use gpiod_line_state_notify()Bartosz Golaszewski3-16/+14
Wrap the calls to blocking_notifier_call_chain() for the line state notifier with a helper that allows us to use fewer lines of code and simpler syntax. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-21gpio: cdev: wake up lineevent poll() on device unbindBartosz Golaszewski1-0/+22
Add a notifier block to the lineevent_state structure and register it with the gpio_device's device notifier. Upon reception of an event, wake up the wait queue so that the user-space be forced out of poll() and need to go into a new system call which will then fail due to the chip being gone. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpio: cdev: wake up linereq poll() on device unbindBartosz Golaszewski1-0/+23
Add a notifier block to the linereq structure and register it with the gpio_device's device notifier. Upon reception of an event, wake up the wait queue so that the user-space be forced out of poll() and need to go into a new system call which will then fail due to the chip being gone. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpio: cdev: wake up chardev poll() on device unbindBartosz Golaszewski1-2/+27
Add a notifier block to the gpio_chardev_data structure and register it with the gpio_device's device notifier. Upon reception of an event, wake up the wait queue so that the user-space be forced out of poll() and need to go into a new system call which will then fail due to the chip being gone. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpiolib: add a second blocking notifier to struct gpio_deviceBartosz Golaszewski3-0/+5
Add a new blocking notifier to struct gpio_device and use it to notify subscribers about the GPIO device being unregistered from the device model. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpio: cdev: open-code to_gpio_chardev_data()Bartosz Golaszewski1-7/+2
This function is a wrapper around container_of(). It's used only once and we will have a second notifier soon, so instead of having two flavors of this helper, let's just open-code where needed. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpiolib: rename the gpio_device notifierBartosz Golaszewski3-14/+14
Change the generic "notifier" name to "line_state_notifier" in order to reflect its purpose in preparation for adding a second notifier which will be used to notify wait queues about device unregistering. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
2023-08-21gpio: mlxbf3: Support add_pin_ranges()Asmaa Mnebhi1-0/+24
Support add_pin_ranges() so that pinctrl_gpio_request() can be called. The GPIO value is not modified when the user runs the "gpioset" tool. This is because when gpiochip_generic_request is invoked by the gpio-mlxbf3 driver, "pin_ranges" is empty so it skips "pinctrl_gpio_request()". pinctrl_gpio_request() is essential in the code flow because it changes the mux value so that software has control over modifying the GPIO value. Adding add_pin_ranges() creates a dependency on the pinctrl-mlxbf3.c driver. Fixes: cd33f216d24 ("gpio: mlxbf3: Add gpio driver support") Signed-off-by: Asmaa Mnebhi <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-21gpio: mxc: Use helper function devm_clk_get_optional_enabled()Li Zetao1-8/+1
Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get_optional() and clk_prepare_enable() can now be replaced by devm_clk_get_optional_enabled() when the driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Signed-off-by: Li Zetao <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-21gpio: pca9570: fix kerneldocBartosz Golaszewski1-1/+1
While renaming one of the fields in the driver data struct, the kerneldoc was not updated which apparently angers the test robot now. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: a3f7c1d6ddcb ("gpio: pca9570: rename platform_data to chip_data") Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-18gpio: sim: simplify code with cleanup helpersBartosz Golaszewski1-169/+85
Use macros defined in linux/cleanup.h to automate resource lifetime control in gpio-sim. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Linus Walleij <[email protected]>
2023-08-16gpiolib: fix reference leaks when removing GPIO chips still in useBartosz Golaszewski1-5/+11
After we remove a GPIO chip that still has some requested descriptors, gpiod_free_commit() will fail and we will never put the references to the GPIO device and the owning module in gpiod_free(). Rework this function to: - not warn on desc == NULL as this is a use-case on which most free functions silently return - put the references to desc->gdev and desc->gdev->owner unconditionally so that the release callback actually gets called when the remaining references are dropped by external GPIO users Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
2023-08-16gpiolib: sysfs: Do unexport GPIO when user asks for itAndy Shevchenko1-2/+5
It seems that sysfs interface implicitly relied on the gpiod_free() to unexport the line. This is logically incorrect as core gpiolib should not deal with sysfs so instead of restoring it, let's call gpiod_unexport() from sysfs code. Fixes: b0ce9ce408b6 ("gpiolib: Do not unexport GPIO on freeing") Reported-by: Marek Behún <[email protected]> Closes: https://lore.kernel.org/r/20230808102828.4a9eac09@dellmb Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Marek Behún <[email protected]> [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-15gpio: sim: replace memmove() + strstrip() with skip_spaces() + strim()Bartosz Golaszewski1-7/+4
Turns out we can avoid the memmove() by using skip_spaces() and strim(). We did that in gpio-consumer, let's do it in gpio-sim. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-12gpio: sim: simplify gpio_sim_device_config_live_store()Bartosz Golaszewski1-2/+1
Simplify the logic when checking the current live value against the user input. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2023-08-11gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extentWilliam Breathitt Gray1-1/+1
The WinSystems WS16C48 I/O address region spans offsets 0x0 through 0xA, which is a total of 11 bytes. Fix the WS16C48_EXTENT define to the correct value of 11 so that access to necessary device registers is properly requested in the ws16c48_probe() callback by the devm_request_region() function call. Fixes: 2c05a0f29f41 ("gpio: ws16c48: Implement and utilize register structures") Cc: [email protected] Cc: Paul Demetrotion <[email protected]> Signed-off-by: William Breathitt Gray <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-11gpio: mxc: release the parent IRQ in runtime suspendShenwei Wang1-12/+29
Release the parent interrupt request during runtime suspend, allowing the parent interrupt controller to enter runtime suspend if there are no active users. This change may not have a visible impact if the parent controller is the GIC, but it can enable significant power savings for parent IRQ controllers like IRQSteer inside a subsystem on i.MX8 SoCs. Releasing the parent IRQ provides an opportunity for the subsystem to enter suspend states if there are no active users. Signed-off-by: Shenwei Wang <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-11gpio: mxs: fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'devid' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: gpio-mxs.c:274:16: error: cast to smaller integer type 'enum mxs_gpio_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2023-08-11gpio: imx-scu: Use ARRAY_SIZE for array lengthRajeshwar R Shinde1-1/+2
Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability. This fixes warnings reported by Coccinelle: drivers/gpio/gpio-imx-scu.c:106:32-33: WARNING: Use ARRAY_SIZE Signed-off-by: Rajeshwar R Shinde <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>