summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* pinctrl: ocelot: fix system hang on level based interruptsSergey Matsievskiy2024-10-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation only calls chained_irq_enter() and chained_irq_exit() if it detects pending interrupts. ``` for (i = 0; i < info->stride; i++) { uregmap_read(info->map, id_reg + 4 * i, &reg); if (!reg) continue; chained_irq_enter(parent_chip, desc); ``` However, in case of GPIO pin configured in level mode and the parent controller configured in edge mode, GPIO interrupt might be lowered by the hardware. In the result, if the interrupt is short enough, the parent interrupt is still pending while the GPIO interrupt is cleared; chained_irq_enter() never gets called and the system hangs trying to service the parent interrupt. Moving chained_irq_enter() and chained_irq_exit() outside the for loop ensures that they are called even when GPIO interrupt is lowered by the hardware. The similar code with chained_irq_enter() / chained_irq_exit() functions wrapping interrupt checking loop may be found in many other drivers: ``` grep -r -A 10 chained_irq_enter drivers/pinctrl ``` Cc: stable@vger.kernel.org Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/20241012105743.12450-2-matsievskiysv@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: nuvoton: fix a double free in ma35_pinctrl_dt_node_to_map_func()Harshit Mogalapalli2024-10-111-1/+1
| | | | | | | | | | | | | | | | | | | 'new_map' is allocated using devm_* which takes care of freeing the allocated data on device removal, call to .dt_free_map = pinconf_generic_dt_free_map double frees the map as pinconf_generic_dt_free_map() calls pinctrl_utils_free_map(). Fix this by using kcalloc() instead of auto-managed devm_kcalloc(). Cc: stable@vger.kernel.org Fixes: f805e356313b ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver") Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/20241010205237.1245318-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pinctrl: sophgo: fix double free in cv1800_pctrl_dt_node_to_map()Harshit Mogalapalli2024-10-101-1/+1
| | | | | | | | | | | | | 'map' is allocated using devm_* which takes care of freeing the allocated data, but in error paths there is a call to pinctrl_utils_free_map() which also does kfree(map) which leads to a double free. Use kcalloc() instead of devm_kcalloc() as freeing is manually handled. Fixes: a29d8e93e710 ("pinctrl: sophgo: add support for CV1800B SoC") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Link: https://lore.kernel.org/20241010111830.3474719-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* Merge tag 'intel-pinctrl-v6.12-2' of ↵Linus Walleij2024-10-032-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v6.12-2 Fixes a few issues with Intel pin control platform driver: * fix missing reference counter drop of fwnode on error path * replace comma by semicolon to follow the kernel style * add Panther Lake to the list of supported devices The following is an automated git shortlog grouped by driver: intel: - platform: Add Panther Lake to the list of supported - platform: use semicolon instead of comma in ncommunities assignment - platform: fix error path in device_for_each_child_node() Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * pinctrl: intel: platform: Add Panther Lake to the list of supportedAndy Shevchenko2024-10-031-0/+1
| | | | | | | | | | | | | | | | Intel Panther Lake is supported by the generic platform driver, so add it to the list of supported in Kconfig. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * pinctrl: intel: platform: use semicolon instead of comma in ncommunities ↵Javier Carrasco2024-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | assignment Substitute the comma with a semicolon in the `ncommunities` assignment for better readability and consistency with common C coding style. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * pinctrl: intel: platform: fix error path in device_for_each_child_node()Javier Carrasco2024-09-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device_for_each_child_node() loop requires calls to fwnode_handle_put() upon early returns to decrement the refcount of the child node and avoid leaking memory if that error path is triggered. There is one early returns within that loop in intel_platform_pinctrl_prepare_community(), but fwnode_handle_put() is missing. Instead of adding the missing call, the scoped version of the loop can be used to simplify the code and avoid mistakes in the future if new early returns are added, as the child node is only used for parsing, and it is never assigned. Cc: stable@vger.kernel.org Fixes: c5860e4a2737 ("pinctrl: intel: Add a generic Intel pin control platform driver") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
* | pinctrl: aw9523: add missing mutex_destroyRosen Penev2024-10-021-2/+4
| | | | | | | | | | | | | | | | Otherwise the mutex remains after a failed kzalloc. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/20241001212724.309320-1-rosenp@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | pinctrl: stm32: check devm_kasprintf() returned valueMa Ke2024-10-011-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked. Fix this lack and check the returned value. Found by code review. Cc: stable@vger.kernel.org Fixes: 32c170ff15b0 ("pinctrl: stm32: set default gpio line names using pin names") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Link: https://lore.kernel.org/20240906100326.624445-1-make24@iscas.ac.cn Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | pinctrl: apple: check devm_kasprintf() returned valueMa Ke2024-10-011-0/+3
|/ | | | | | | | | | | | | | devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked. Fix this lack and check the returned value. Found by code review. Cc: stable@vger.kernel.org Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/20240905020917.356534-1-make24@iscas.ac.cn Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* Merge tag 'soc-ep93xx-dt-6.12' of ↵Linus Torvalds2024-09-263-0/+1442
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull SoC update from Arnd Bergmann: "Convert ep93xx to devicetree This concludes a long journey towards replacing the old board files with devictree description on the Cirrus Logic EP93xx platform. Nikita Shubin has been working on this for a long time, for details see the last post on https://lore.kernel.org/lkml/20240909-ep93xx-v12-0-e86ab2423d4b@maquefel.me/" * tag 'soc-ep93xx-dt-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (47 commits) dt-bindings: gpio: ep9301: Add missing "#interrupt-cells" to examples MAINTAINERS: Update EP93XX ARM ARCHITECTURE maintainer soc: ep93xx: drop reference to removed EP93XX_SOC_COMMON config net: cirrus: use u8 for addr to calm down sparse dmaengine: cirrus: use snprintf() to calm down gcc 13.3.0 dmaengine: ep93xx: Fix a NULL vs IS_ERR() check in probe() pinctrl: ep93xx: Fix raster pins typo spi: ep93xx: update kerneldoc comments for ep93xx_spi clk: ep93xx: Fix off by one in ep93xx_div_recalc_rate() clk: ep93xx: add module license dmaengine: cirrus: remove platform code ASoC: cirrus: edb93xx: Delete driver ARM: ep93xx: soc: drop defines ARM: ep93xx: delete all boardfiles ata: pata_ep93xx: remove legacy pinctrl use pwm: ep93xx: drop legacy pinctrl ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms ARM: dts: ep93xx: Add EDB9302 DT ARM: dts: ep93xx: add ts7250 board ARM: dts: add Cirrus EP93XX SoC .dtsi ...
| * pinctrl: ep93xx: Fix raster pins typoNikita Shubin2024-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix raster_on_sdram0_pins used in PMX_GROUP() instead of raster_on_sdram3_pins as it should be. Fixes: d1661439f5a3 ("pinctrl: add a Cirrus ep93xx SoC pin controller") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202409130426.1OzNAC9M-lkp@intel.com/ Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Link: https://lore.kernel.org/r/20240913045829.11904-1-nikita.shubin@maquefel.me Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * pinctrl: add a Cirrus ep93xx SoC pin controllerNikita Shubin2024-09-123-0/+1442
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a pin control (only multiplexing) driver for ep93xx SoC so we can fully convert ep93xx to device tree. This driver is capable of muxing ep9301/ep9302/ep9307/ep9312/ep9315 variants, this is chosen based on "compatible" in device tree. Co-developed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* | Merge tag 'pinctrl-v6.12-1' of ↵Linus Torvalds2024-09-2362-527/+4970
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "Core changes: - Add support for "input-schmitt-microvolt" property, as used in the Sophgo SoC New drivers: - Mobileye EyeQ5 pin controller, I think this is an automotive SoC - Rockchip rk3576 pin control support - Sophgo CV1800 series pin controllers: CV1800B, CV1812H and SG2000 Improvements: - Gradual improvements to Renesas, Samsung, Qualcomm, Nuvoton and a few other drivers" * tag 'pinctrl-v6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (67 commits) pinctrl: intel: Constify struct intel_pinctrl parameter pinctrl: Remove redundant null pointer checks in pinctrl_remove_device_debugfs() pinctrl: baytrail: Drop duplicate return statement pinctrl: intel: Inline intel_gpio_community_irq_handler() dt-bindings: pinctrl: qcom: add missing type to GPIO hogs pinctrl: madera: Simplify with dev_err_probe() pinctrl: k210: Use devm_clk_get_enabled() helpers pinctrl: Join split messages and remove double whitespace pinctrl: renesas: rzg2l: Move pinconf_to_config_argument() call outside of switch cases pinctrl: renesas: rzg2l: Introduce single macro for digital noise filter configuration pinctrl: renesas: rzg2l: Replace of_node_to_fwnode() with more suitable API pinctrl: mvebu: Fix devinit_dove_pinctrl_probe function pinctrl: sunxi: Use devm_clk_get_enabled() helpers pinctrl: sophgo: cv18xx: fix missed __iomem type identifier pinctrl: stmfx: Use string_choices API instead of ternary operator pinctrl: nomadik: Use kmemdup_array instead of kmemdup for multiple allocation pinctrl: intel: Introduce for_each_intel_gpio_group() helper et al. pinctrl: intel: Constify intel_get_community() returned object pinctrl: intel: Implement high impedance support pinctrl: intel: Add __intel_gpio_get_direction() helper ...
| * \ Merge tag 'intel-pinctrl-v6.12-1' of ↵Linus Walleij2024-09-114-147/+189
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v6.12-1 * Enable High Impedance pin configuration support for Intel pin control * Miscellaneous small improvements here and there The following is an automated git shortlog grouped by driver: baytrail: - Drop duplicate return statement intel: - Constify struct intel_pinctrl parameter - Inline intel_gpio_community_irq_handler() - Introduce for_each_intel_gpio_group() helper et al. - Constify intel_get_community() returned object - Implement high impedance support - Add __intel_gpio_get_direction() helper - Refactor __intel_gpio_set_direction() to be more useful - Move debounce validation out of the lock Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | pinctrl: intel: Constify struct intel_pinctrl parameterAndy Shevchenko2024-09-052-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few functions that do not and should not change the state of the pin control object. Constify the respective parameter. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
| | * | pinctrl: baytrail: Drop duplicate return statementAndy Shevchenko2024-09-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to repeat 'return ret;' inside and outside conditional. Just use one outside conditional for both cases. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Inline intel_gpio_community_irq_handler()Andy Shevchenko2024-09-031-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we have for_each_intel_pad_group() helper, there is no advantage of having intel_gpio_community_irq_handler(). Inline it into intel_gpio_irq(). Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Introduce for_each_intel_gpio_group() helper et al.Andy Shevchenko2024-08-301-79/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a helper macro for_each_intel_gpio_group() et al. With those in place, update the users. It reduces the C code base as well as shrinks the binary: add/remove: 0/0 grow/shrink: 4/21 up/down: 39/-621 (-582) Total: Before=15942, After=15360, chg -3.65% Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Constify intel_get_community() returned objectAndy Shevchenko2024-08-304-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing prevents us from constifying intel_get_community() returned object. Do it to make code more robust. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Implement high impedance supportAndy Shevchenko2024-08-301-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement high impedance support for Intel pin control hardware. It allows to set high impedance and check it. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Add __intel_gpio_get_direction() helperAndy Shevchenko2024-08-301-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add __intel_gpio_get_direction() helper which provides all possible physical states of the pad. With that done, update current users and make the respective checks consistent. While at it, make the style of anonymous enum kernel documentation consistent. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Refactor __intel_gpio_set_direction() to be more usefulAndy Shevchenko2024-08-301-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor __intel_gpio_set_direction() to be more useful, i.e. 1) use one parameter per each direction to support all combinatios; 2) move IO to the only user that needs it. With that done, update current users and deduplicate existing code. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * | pinctrl: intel: Move debounce validation out of the lockAndy Shevchenko2024-08-301-12/+15
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to validate debounce value under the lock. Move it outside. It also results in a smaller binary: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-11 (-11) Total: Before=15374, After=15363, chg -0.07% Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | pinctrl: Remove redundant null pointer checks in pinctrl_remove_device_debugfs()Li Zetao2024-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/20240903143812.2005071-1-lizetao1@huawei.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | Merge tag 'renesas-pinctrl-for-v6.12-tag2' of ↵Linus Walleij2024-09-053-50/+28
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.12 (take two) - Miscellaneous fixes and improvements. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | pinctrl: renesas: rzg2l: Move pinconf_to_config_argument() call outside of ↵Lad Prabhakar2024-09-021-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | switch cases Refactor the `rzg2l_pinctrl_pinconf_set()` function by moving the call to `arg = pinconf_to_config_argument(_configs[i])` to the beginning of the loop. Previously, this call was redundantly made in most cases within the switch statement. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20240829194841.84398-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| | * | pinctrl: renesas: rzg2l: Introduce single macro for digital noise filter ↵Lad Prabhakar2024-09-021-32/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configuration Support for enabling the digital noise filter, and support for configuring the noise filter stages (via the FILNUM register) and the sampling interval (via the FILCLKSEL register) are related: a pin supports either all or none of them. Hence simplify declaring digital noise filter support for a pin by using a single feature flag instead of three separate flags. This patch removes the PIN_CFG_FILNUM and PIN_CFG_FILCLKSEL configuration macros and renames PIN_CFG_FILONOFF to PIN_CFG_NF. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20240829194841.84398-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| | * | pinctrl: renesas: rzg2l: Replace of_node_to_fwnode() with more suitable APIAndy Shevchenko2024-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_node_to_fwnode() is a IRQ domain specific implementation of of_fwnode_handle(). Replace the former with more suitable API. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20240822230104.707812-1-andy.shevchenko@gmail.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| | * | pinctrl: renesas: Switch to use kmemdup_array()Shen Lichuan2024-08-233-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let kmemdup_array() take care of multiplication and possible overflow. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20240822061438.14617-1-shenlichuan@vivo.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| * | | pinctrl: madera: Simplify with dev_err_probe()Yan Zhen2024-09-021-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to use dev_err_probe() to simplify the error path and unify a message template. Using this helper is totally fine even if err is known to never be -EPROBE_DEFER. The benefit compared to a normal dev_err() is the standardized format of the error code, it being emitted symbolically and the fact that the error code is returned which allows more compact error paths. Signed-off-by: Yan Zhen <yanzhen@vivo.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/20240829044835.2047794-1-yanzhen@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: k210: Use devm_clk_get_enabled() helpersWang Jianzheng2024-09-021-27/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the calls to clk_disable_unprepare(). Signed-off-by: Wang Jianzheng <wangjianzheng@vivo.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/20240829064938.20114-1-wangjianzheng@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: Join split messages and remove double whitespaceGeert Uytterhoeven2024-09-021-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Splitting error messages across multiple lines makes it harder to find them in the kernel sources. Fix this by joining the messages. Remove double whitespace (end of first line + begin of second line). Fixes: 1c8e794432c2ee75 ("pinctrl: improve warning messages") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/c8e3feeedbf42a130936a5afaea0f129bcda51f6.1724938156.git.geert+renesas@glider.be Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: mvebu: Fix devinit_dove_pinctrl_probe functionWang Jianzheng2024-09-021-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an error occurs during the execution of the function __devinit_dove_pinctrl_probe, the clk is not properly disabled. Fix this by calling clk_disable_unprepare before return. Fixes: ba607b6238a1 ("pinctrl: mvebu: make pdma clock on dove mandatory") Signed-off-by: Wang Jianzheng <wangjianzheng@vivo.com> Link: https://lore.kernel.org/20240829064823.19808-1-wangjianzheng@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: sunxi: Use devm_clk_get_enabled() helpersWang Jianzheng2024-09-021-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sunxi sunxi_pinctrl_init_with_variant get, enable clk and deinit_device disable and unprepare it. This simplifes the code and avoids the calls to clk_disable_unprepare(). Signed-off-by: Wang Jianzheng <wangjianzheng@vivo.com> Link: https://lore.kernel.org/20240829064737.16169-1-wangjianzheng@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: sophgo: cv18xx: fix missed __iomem type identifierInochi Amaoto2024-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the variable reg in "cv1800_pctrl_dbg_show" misses a "__iomem" type identifier, a warning will be issued by the compiler. Add this identifier to avoid this warning. Fixes: a29d8e93e710 ("pinctrl: sophgo: add support for CV1800B SoC") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202408271555.kpOmi9I8-lkp@intel.com/ Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Link: https://lore.kernel.org/IA1PR20MB495329EBE498DFFDAA1EC457BB972@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: stmfx: Use string_choices API instead of ternary operatorAndy Shevchenko2024-08-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use modern string_choices API instead of manually determining the output using ternary operator. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/20240826095306.1420628-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: nomadik: Use kmemdup_array instead of kmemdup for multiple allocationYu Jiaoliang2024-08-302-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the kememdup_array() take care about multiplication and possible overflows. Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com> Link: https://lore.kernel.org/20240826074037.2313468-1-yujiaoliang@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | Merge tag 'samsung-pinctrl-6.12' of ↵Linus Walleij2024-08-305-32/+141
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v6.12 1. Few cleanups: use more appropriate of_property_present(), use scoped OF nodes handling and switch to kmemdup_array(). 2. Implement configuring pull-up and pull-down via GPIOLIB. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | | pinctrl: samsung: Use kmemdup_array instead of kmemdup for multiple allocationShen Lichuan2024-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the kmemdup_array() take care about multiplication and possible overflows. Using kmemdup_array() is more appropriate and makes the code easier to audit. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Link: https://lore.kernel.org/r/20240823114441.50648-1-shenlichuan@vivo.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
| | * | | pinctrl: samsung: Add support for pull-up and pull-downVishnu Reddy2024-08-084-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gpiolib framework has the implementation of setting up the PUD configuration for GPIO pins but there is no driver support. Add support to handle the PUD configuration request from the userspace in samsung pinctrl driver. Signed-off-by: Vishnu Reddy <vishnu.reddy@samsung.com> Link: https://lore.kernel.org/r/20240729153631.24536-1-vishnu.reddy@samsung.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
| | * | | pinctrl: samsung: Use scope based of_node_put() cleanupsPeng Fan2024-08-052-26/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use scope based of_node_put() cleanup to simplify code. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20240504-pinctrl-cleanup-v2-20-26c5f2dc1181@nxp.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
| | * | | pinctrl: samsung: Use of_property_present()Rob Herring (Arm)2024-08-041-4/+4
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use of_property_present() to test for property presence rather than of_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240731191312.1710417-16-robh@kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
| * | | Merge branch 'ib-sophgo-pintrl' into develLinus Walleij2024-08-2610-0/+3529
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Immutable branch for the SoC tree, merge to pinctrl devel proper. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | | pinctrl: sophgo: add support for SG2002 SoCInochi Amaoto2024-08-263-0/+554
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pin definition driver of SG2002. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Link: https://lore.kernel.org/IA1PR20MB4953110EF4EAFA65EA2272E3BBB32@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | | pinctrl: sophgo: add support for SG2000 SoCInochi Amaoto2024-08-263-0/+783
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pin definition driver of SG2000. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Link: https://lore.kernel.org/IA1PR20MB495339CB8E9CB4FCAAE4886BBBB32@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | | pinctrl: sophgo: add support for CV1812H SoCInochi Amaoto2024-08-263-0/+783
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pin definition driver of CV1812H. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Link: https://lore.kernel.org/IA1PR20MB495355EDA2E04FA3E2794978BBB32@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | | pinctrl: sophgo: add support for CV1800B SoCInochi Amaoto2024-08-267-0/+1409
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sophgo CV1800 series SoCs share common control logic but have different register mapping. For maintenance, split the driver and pin definition of the SoC. Add base driver for CV1800 series SoC and pin definition of CV1800B. Signed-off-by: Inochi Amaoto <inochiama@outlook.com> Link: https://lore.kernel.org/IA1PR20MB4953B260E04EC53F6A01EB30BBB32@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | pinctrl: freescale: imx-scmi: Use kmemdup_array instead of kmemdup for ↵Shen Lichuan2024-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple allocation Let the kmemdup_array() take care about multiplication and possible overflows. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/20240823105421.50017-1-shenlichuan@vivo.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | Merge tag 'renesas-pinctrl-for-v6.12-tag1' of ↵Linus Walleij2024-08-261-26/+19
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.12 - Document support for the Renesas RZ/G2M v3.0 (r8a774a3) SoC, - Miscellaneous fixes and improvements. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>