]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
3 months agopinctrl: mediatek: Add EINT support for multiple addresses
Hao Chang [Sat, 22 Mar 2025 03:52:28 +0000 (11:52 +0800)] 
pinctrl: mediatek: Add EINT support for multiple addresses

For flexible routing, eint will be divided into 5 bases,
and it will obtain the operation address through the pins array.

Signed-off-by: Hao Chang <ot_chhao.chang@mediatek.com>
Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Link: https://lore.kernel.org/20250322035307.4811-2-ot_chhao.chang@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: amlogic-a4: Drop surplus semicolon
Linus Walleij [Sat, 22 Mar 2025 20:33:43 +0000 (21:33 +0100)] 
pinctrl: amlogic-a4: Drop surplus semicolon

The kernel bots complain about untidy code found using
coccinelle, fix it up.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503212354.Hx2qaDRe-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: nuvoton: Reduce use of OF-specific APIs
Andy Shevchenko [Tue, 18 Mar 2025 10:57:18 +0000 (12:57 +0200)] 
pinctrl: nuvoton: Reduce use of OF-specific APIs

Some drivers are using device property APIs along with OF-specific ones.
At the same time few of the latter can be converted to device property
calls. Reduce use of OF-specific APIs in order to bring a bit more consistency
into the drivers.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250318105932.2090926-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: nuvoton: Convert to use struct group_desc
Andy Shevchenko [Tue, 18 Mar 2025 10:57:17 +0000 (12:57 +0200)] 
pinctrl: nuvoton: Convert to use struct group_desc

The pin control core header provides struct group_desc.
Utilize it instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250318105932.2090926-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: nuvoton: Make use of struct pinfunction and PINCTRL_PINFUNCTION()
Andy Shevchenko [Tue, 18 Mar 2025 10:57:16 +0000 (12:57 +0200)] 
pinctrl: nuvoton: Make use of struct pinfunction and PINCTRL_PINFUNCTION()

Since pin control provides a generic data type and a macro for
the pin function definition, use them in the driver.

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250318105932.2090926-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
Andy Shevchenko [Tue, 18 Mar 2025 10:57:15 +0000 (12:57 +0200)] 
pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250318105932.2090926-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: npcm8xx: Fix incorrect struct npcm8xx_pincfg assignment
Andy Shevchenko [Tue, 18 Mar 2025 10:57:14 +0000 (12:57 +0200)] 
pinctrl: npcm8xx: Fix incorrect struct npcm8xx_pincfg assignment

Sparse is not happy about implementation of the NPCM8XX_PINCFG()

 pinctrl-npcm8xx.c:1314:9: warning: obsolete array initializer, use C99 syntax
 pinctrl-npcm8xx.c:1315:9: warning: obsolete array initializer, use C99 syntax
 ...
 pinctrl-npcm8xx.c:1412:9: warning: obsolete array initializer, use C99 syntax
 pinctrl-npcm8xx.c:1413:9: warning: too many warnings

which uses index-based assignment in a wrong way, i.e. it missed
the equal sign and hence the index is simply ignored, while the
entries are indexed naturally. This is not a problem as the pin
numbering repeats the natural order, but it might be in case of
shuffling the entries. Fix this by adding missed equal sign and
reformat a bit for better readability.

Fixes: acf4884a5717 ("pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250318105932.2090926-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()
Dan Carpenter [Wed, 19 Mar 2025 07:05:47 +0000 (10:05 +0300)] 
pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()

This should be >= pmx->soc->ngroups instead of > to avoid an out of
bounds access.  The pmx->soc->groups[] array is allocated in
tegra_pinctrl_probe().

Fixes: c12bfa0fee65 ("pinctrl-tegra: Restore SFSEL bit when freeing pins")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Kunwu Chan <kunwu.chan@linux.dev>
Link: https://lore.kernel.org/82b40d9d-b437-42a9-9eb3-2328aa6877ac@stanley.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: PINCTRL_AMDISP should depend on DRM_AMD_ISP
Geert Uytterhoeven [Tue, 18 Mar 2025 13:58:40 +0000 (14:58 +0100)] 
pinctrl: PINCTRL_AMDISP should depend on DRM_AMD_ISP

The AMD Image Signal Processor GPIO pin control functionality is only
present on AMD platforms with ISP support, and its platform device is
instantiated by the AMD ISP driver.  Hence add a dependency on
DRM_AMD_ISP, to prevent asking the user about this driver when
configuring a kernel that does not support the AMD ISP.

Fixes: e97435ab09f3ad7b ("pinctrl: amd: isp411: Add amdisp GPIO pinctrl")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/3685561e8e3cd1d94bce220eeb6001d659da615c.1742306024.git.geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agoMerge tag 'samsung-pinctrl-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git...
Linus Walleij [Tue, 18 Mar 2025 10:09:15 +0000 (11:09 +0100)] 
Merge tag 'samsung-pinctrl-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel

Samsung pinctrl drivers changes for v6.15

1. Add pin controller drivers for newly usptreamed Samsung Exynos2200
   and Exynos7870.
2. Correct filter configuration offset of some of Google GS101 SoC pin
   banks, which later is supposed to be used during system
   suspend/resume.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: qcom: sa8775p: Enable egpio function
Wasim Nazir [Wed, 12 Mar 2025 07:25:09 +0000 (12:55 +0530)] 
pinctrl: qcom: sa8775p: Enable egpio function

Egpio feature allows IsLand Domain IOs to be reused as TLMM GPIOs.
sa8775p supports egpio feature for GPIOs ranging from 126 to 148.

Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
Reviewed-by: Dmitry Baryshkov <lumag@kernel.org>
Link: https://lore.kernel.org/20250312072509.3247885-3-quic_wasimn@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: qcom: Add egpio function for sa8775p
Wasim Nazir [Wed, 12 Mar 2025 07:25:08 +0000 (12:55 +0530)] 
dt-bindings: pinctrl: qcom: Add egpio function for sa8775p

Add egpio function for TLMM pinctrl on sa8775p platform.

Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20250312072509.3247885-2-quic_wasimn@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: qcom: tlmm-test: Validate irq_enable delivers edge irqs
Bjorn Andersson [Thu, 13 Mar 2025 21:27:27 +0000 (14:27 -0700)] 
pinctrl: qcom: tlmm-test: Validate irq_enable delivers edge irqs

In commit 'cf9d052aa600 ("pinctrl: qcom: Don't clear pending interrupts
when enabling")' Doug establishes an expectation that edge interrupts
occurring while an interrupt is disabled should be delivered once the
interrupt is enabled again.

Implement a test to validate that this is the case.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://lore.kernel.org/20250313-tlmm-test-disabled-irq-delivered-v1-1-f0be903732ac@oss.qualcomm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: qcom: Clear latched interrupt status when changing IRQ type
Stephan Gerhold [Wed, 12 Mar 2025 13:19:27 +0000 (14:19 +0100)] 
pinctrl: qcom: Clear latched interrupt status when changing IRQ type

When submitting the TLMM test driver, Bjorn reported that some of the test
cases are failing for GPIOs that not are backed by PDC (i.e. "non-wakeup"
GPIOs that are handled directly in pinctrl-msm). Basically, lingering
latched interrupt state is still being delivered at IRQ request time, e.g.:

  ok 1 tlmm_test_silent_rising
  tlmm_test_silent_falling: ASSERTION FAILED at drivers/pinctrl/qcom/tlmm-test.c:178
  Expected atomic_read(&priv->intr_count) == 0, but
      atomic_read(&priv->intr_count) == 1 (0x1)
  not ok 2 tlmm_test_silent_falling
  tlmm_test_silent_low: ASSERTION FAILED at drivers/pinctrl/qcom/tlmm-test.c:178
  Expected atomic_read(&priv->intr_count) == 0, but
      atomic_read(&priv->intr_count) == 1 (0x1)
  not ok 3 tlmm_test_silent_low
  ok 4 tlmm_test_silent_high

Whether to report interrupts that came in while the IRQ was unclaimed
doesn't seem to be well-defined in the Linux IRQ API. However, looking
closer at these specific cases, we're actually reporting events that do not
match the interrupt type requested by the driver:

 1. After "ok 1 tlmm_test_silent_rising", the GPIO is in low state and
    configured for IRQF_TRIGGER_RISING.

 2. (a) In preparation for "tlmm_test_silent_falling", the GPIO is switched
        to high state. The rising interrupt gets latched.
    (b) The GPIO is re-configured for IRQF_TRIGGER_FALLING, but the latched
        interrupt isn't cleared.
    (c) The IRQ handler is called for the latched interrupt, but there
        wasn't any falling edge.

 3. (a) For "tlmm_test_silent_low", the GPIO remains in high state.
    (b) The GPIO is re-configured for IRQF_TRIGGER_LOW. This seems to
        result in a phantom interrupt that gets latched.
    (c) The IRQ handler is called for the latched interrupt, but the GPIO
        isn't in low state.

 4. (a) For "tlmm_test_silent_high", the GPIO is switched to low state.
    (b) This doesn't result in a latched interrupt, because RAW_STATUS_EN
        was cleared when masking the level-triggered interrupt.

Fix this by clearing the interrupt state whenever making any changes to the
interrupt configuration. This includes previously disabled interrupts, but
also any changes to interrupt polarity or detection type.

With this change, all 16 test cases are now passing for the non-wakeup
GPIOs in the TLMM.

Cc: stable@vger.kernel.org
Fixes: cf9d052aa600 ("pinctrl: qcom: Don't clear pending interrupts when enabling")
Reported-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Closes: https://lore.kernel.org/r/20250227-tlmm-test-v1-1-d18877b4a5db@oss.qualcomm.com/
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/20250312-pinctrl-msm-type-latch-v1-1-ce87c561d3d7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: airoha: Add missing gpio-ranges property
Lorenzo Bianconi [Fri, 7 Mar 2025 17:08:19 +0000 (18:08 +0100)] 
dt-bindings: pinctrl: airoha: Add missing gpio-ranges property

Introduce leftover gpio-ranges property for Airoha EN7581 pinctrl binding

Fixes: d0c15cb96b74 ("dt-bindings: pinctrl: airoha: Add EN7581 pinctrl")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20250307-en7581-gpio-range-v1-1-de1262105428@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: bcm281xx: Add missing assignment in bcm21664_pinctrl_lock_all()
Dan Carpenter [Mon, 10 Mar 2025 10:48:34 +0000 (13:48 +0300)] 
pinctrl: bcm281xx: Add missing assignment in bcm21664_pinctrl_lock_all()

The next line checks if this regmap_write() failed, but it doesn't
work because the assignment was accidentally left out.  Add the
assignment.

Fixes: 60d69769c851 ("pinctrl: bcm281xx: Add support for BCM21664 pinmux")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Artur Weber <aweber.kernel@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/dfc15d59-7fa9-4f96-aacb-37c3df6d420d@stanley.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()
Dan Carpenter [Mon, 10 Mar 2025 10:52:05 +0000 (13:52 +0300)] 
pinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()

The platform_get_resource() returns NULL on error.  It doesn't
return error pointers.  Fix the error checking to match.

Fixes: e97435ab09f3 ("pinctrl: amd: isp411: Add amdisp GPIO pinctrl")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Link: https://lore.kernel.org/617f4c77-7837-4e24-9f4d-620ecfedf924@stanley.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: at91-pio4: add microchip,sama7d65-pinctrl
Dharma Balasubiramani [Thu, 6 Mar 2025 16:03:19 +0000 (09:03 -0700)] 
dt-bindings: pinctrl: at91-pio4: add microchip,sama7d65-pinctrl

Add pinctrl bindings for microchip sama7d65 SoC.

Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/821255840c09d8d9cebbb1f2daaedd8a7c138875.1736522006.git.Ryan.Wanner@microchip.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: tegra: Set SFIO mode to Mux Register
Prathamesh Shete [Thu, 6 Mar 2025 05:05:42 +0000 (10:35 +0530)] 
pinctrl: tegra: Set SFIO mode to Mux Register

Tegra devices have an 'sfsel' bit field that determines whether a pin
operates in SFIO (Special Function I/O) or GPIO mode. Currently,
tegra_pinctrl_gpio_disable_free() sets this bit when releasing a GPIO.

However, tegra_pinctrl_set_mux() can be called independently in certain
code paths where gpio_disable_free() is not invoked. In such cases, failing
to set the SFIO mode could lead to incorrect pin configurations, resulting
in functional issues for peripherals relying on SFIO.

This patch ensures that whenever set_mux() is called, the SFIO mode is
correctly set in the Mux Register if the 'sfsel' bit is present. This
prevents situations where the pin remains in GPIO mode despite being
configured for SFIO use.

Fixes: 971dac7123c7 ("pinctrl: add a driver for NVIDIA Tegra")
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Link: https://lore.kernel.org/20250306050542.16335-1-pshete@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl-tegra: Restore SFSEL bit when freeing pins
Prathamesh Shete [Wed, 5 Mar 2025 10:49:39 +0000 (16:19 +0530)] 
pinctrl-tegra: Restore SFSEL bit when freeing pins

Each pin can be configured as a Special Function IO (SFIO) or GPIO,
where the SFIO enables the pin to operate in alternative modes such as
I2C, SPI, etc.

The current implementation sets all the pins back to SFIO mode
even if they were initially in GPIO mode. This can cause glitches
on the pins when pinctrl_gpio_free() is called.

Avoid these undesired glitches by storing the pin's SFIO/GPIO
state on GPIO request and restoring it on GPIO free.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Link: https://lore.kernel.org/20250305104939.15168-2-pshete@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: tegra: Add descriptions for SoC data fields
Prathamesh Shete [Wed, 5 Mar 2025 10:49:38 +0000 (16:19 +0530)] 
pinctrl: tegra: Add descriptions for SoC data fields

Add detailed descriptions for the remaining fields in the
tegra_pinctrl_soc_data structure. This improves code documentation
and clarifies the purpose of each field, particularly for the
pin-specific configuration options.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Link: https://lore.kernel.org/20250305104939.15168-1-pshete@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: spacemit: destroy mutex at driver detach
Bartosz Golaszewski [Wed, 5 Mar 2025 10:27:10 +0000 (11:27 +0100)] 
pinctrl: spacemit: destroy mutex at driver detach

The mutex initialized in probe() is never cleaned up. Use
devm_mutex_init() to destroy it automatically.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
Link: https://lore.kernel.org/20250305102710.52762-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: ingenic: jz4730: add pinmux for I2S interface
H. Nikolaus Schaller [Sat, 1 Mar 2025 10:00:41 +0000 (11:00 +0100)] 
pinctrl: ingenic: jz4730: add pinmux for I2S interface

I2S is used for the sound codec of the Alpha400.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/7e79b16be569fb0f501032b2b6ec726e4a09411f.1740823241.git.hns@goldelico.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: ingenic: jz4730: add pinmux for MII
H. Nikolaus Schaller [Sat, 1 Mar 2025 10:00:40 +0000 (11:00 +0100)] 
pinctrl: ingenic: jz4730: add pinmux for MII

The MII interface is used for the Ethernet connection of the Alpha400.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/972b31e1fce03808745e53df17315b29e2bcf696.1740823241.git.hns@goldelico.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: ingenic: add x1600 support
Paul Boddie [Sat, 1 Mar 2025 10:00:39 +0000 (11:00 +0100)] 
pinctrl: ingenic: add x1600 support

Add support for the Lumissil/Ingenic X1600 SoC.

It uses shadow registers to commit changes to multiple pinctrl
registers in parallel.

Define specific Chip ID, register offsets, pin tables etc.

Handling the unique X1600_GPIO_PU only for the x1600 but
not for x1830 and above must be carefully taken into account.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Co-authored-by: Andreas Kemnade <andreas@kemnade.info>
Co-authored-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Paul Boddie <paul@boddie.org.uk>
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/84477ec9cb9ed13bf4f6f87d5fb3b55542d31097.1740823241.git.hns@goldelico.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agobindings: pinctrl: ingenic: add x1600
H. Nikolaus Schaller [Sat, 1 Mar 2025 10:00:38 +0000 (11:00 +0100)] 
bindings: pinctrl: ingenic: add x1600

Add bindings for the Lumissil/Ingenic X1600 SoC.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/a9865c817d5aa9046dcbb251d834c1dbcc4e9219.1740823241.git.hns@goldelico.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: Add support for the secondary A523 GPIO ports
Andre Przywara [Thu, 6 Mar 2025 23:58:27 +0000 (23:58 +0000)] 
pinctrl: sunxi: Add support for the secondary A523 GPIO ports

As most other Allwinner SoCs before, the A523 chip contains a second
GPIO controller, managing banks PL and PM.
Use the newly introduced DT based pinctrl driver to describe just the
generic pinctrl properties, so advertise the number of pins per bank
and the interrupt capabilities. The actual function/mux assignment is
taken from the devicetree.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-9-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: Add support for the Allwinner A523
Andre Przywara [Thu, 6 Mar 2025 23:58:26 +0000 (23:58 +0000)] 
pinctrl: sunxi: Add support for the Allwinner A523

The Allwinner A523 contains pins in 10 out of the 11 possible pin banks;
it just skips port A.
Use the newly introduced DT based pinctrl driver to describe just the
generic pinctrl properties, so advertise the number of pins per bank
and the interrupt capabilities. The actual function/mux assignment is
taken from the devicetree.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-8-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: add compatible for Allwinner A523/T527
Andre Przywara [Thu, 6 Mar 2025 23:58:25 +0000 (23:58 +0000)] 
dt-bindings: pinctrl: add compatible for Allwinner A523/T527

The A523 contains a pin controller similar to previous SoCs, although
using 10 GPIO banks (PortB-PortK), all of them being IRQ capable.
With this SoC we introduce a new style of binding, where the pinmux values
for each pin group are stored in the new "allwinner,pinmux" property in
the DT node, instead of requiring every driver to store a mapping between
the function names and the required pinmux.

Add a new binding file, since all the different variants of the old
binding are making the file a bit unwieldy to handle already, and the new
property would make the situation worse.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20250306235827.4895-7-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: allow reading mux values from DT
Andre Przywara [Thu, 6 Mar 2025 23:58:24 +0000 (23:58 +0000)] 
pinctrl: sunxi: allow reading mux values from DT

So far every Allwinner SoC needs a large table in the kernel code, to
describe the mapping between the pinctrl function names ("uart") and
the actual pincontroller mux value to be written into the registers.
This adds a lot of data into a single image kernel, and also looks
somewhat weird, as the DT can easily store the mux value.

Add some code that allows to avoid that table: the struct that describes
the existing pins will be build at *runtime*, based on very basic
information provided by the respective SoC's pinctrl driver. This
consists of the number of pins per bank, plus information which bank
provides IRQ support, along with the mux value to use for that.
The code will then iterate over all children of the pincontroller DT
node (which describe each pin group), and populate that struct with the
mapping between function names and mux values. The only thing that needs
adding in the DT is a property with that value, per pin group.

When this table is built, it will be handed over to the existing sunxi
pinctrl driver, which cannot tell a difference between a hardcoded
struct and this new one built at runtime. It will take care of
registering the pinctrl device with the pinctrl subsystem.

All a new SoC driver would need to do is to provide two arrays, and then
call the sunxi_pinctrl_dt_table_init() function.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-6-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: support moved power configuration registers
Andre Przywara [Thu, 6 Mar 2025 23:58:23 +0000 (23:58 +0000)] 
pinctrl: sunxi: support moved power configuration registers

The Allwinner pincontroller IP features some registers to control the
withstand voltage of each pin group. So far those registers were always
located at the same offset, but the A523 SoC has moved them (probably to
accommodate all eleven pin banks).

Add a flag to note this feature, and use that to program the registers
either at offset 0x340 or 0x380. So far no pincontroller driver uses
this flag, but we need it for the upcoming A523 support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-5-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: move bank K register offset
Andre Przywara [Thu, 6 Mar 2025 23:58:22 +0000 (23:58 +0000)] 
pinctrl: sunxi: move bank K register offset

The Allwinner pincontroller register layout used to allow for at least
11 banks per controller, any more banks would reside at a second
controller instance.
When the per-bank register map size was increased with the D1, it turned
out that the last bank (port K) of those maximum 11 banks actually would
not fit anymore in the 512 bytes reserved for the pincontroller registers.
On new SoCs Allwinner thus moved the last bank beyond the existing
registers, at offset 0x500.

So far SoCs never used more than 9 banks per controller, but the new
Allwinner A523 actually uses all 11 banks. Since that SoC also uses the
extended layout, its PortK needs to be programmed at offset 0x500.

Factor out the bank offset calculation into a new function, and handle
the case for the last bank separately. Since none of the older SoCs ever
used PortK, we can ignore this case, and just always use offset 0x500
for the last bank.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/20250306235827.4895-4-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: increase number of GPIO bank regulators
Andre Przywara [Thu, 6 Mar 2025 23:58:21 +0000 (23:58 +0000)] 
pinctrl: sunxi: increase number of GPIO bank regulators

By design, the Allwinner pinctrl IP always supported up to 11 GPIO banks,
though no SoC ever used more than 9 banks so far.
The Allwinner A523 has pins in all 11 banks, which exceeds the number of
per-bank regulators that we currently support, as this was set to 9.

Increase the size of the array to hold up to 11 regulator structs, to
support pins in bank J and K as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/20250306235827.4895-3-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: sunxi: refactor pinctrl variants into flags
Andre Przywara [Thu, 6 Mar 2025 23:58:20 +0000 (23:58 +0000)] 
pinctrl: sunxi: refactor pinctrl variants into flags

For some Allwinner SoCs we have one pinctrl driver caring for multiple
very similar chips, and are tagging certain pins with a variant bitmask.
The Allwinner D1 introduced a slightly extended register layout, and we
were abusing this variant mask to convey this bit of information into
the common code part.
Now there will be more pinctrl device properties to consider (has PortF
voltage switch, for instance), so shoehorning this into the variant
bitmask will not fly anymore.

Refactor the "variant" field into a more generic "flags" field. It turns
out that we don't need the variant bits to be unique across all SoCs,
but only among those SoCs that share one driver (table), of which there
are at most three variants at the moment. So the actual variant field can
be limited to say 8 bits, and the other bits in the flag register can be
re-purposed to hold other information, like this extended register
layout.
As a side effect we can move the variant definition into the per-SoC
pinctrl driver file, which makes it more obvious that this is just a
private definition, only relevant for this particular table.
This also changes the artificial sun20i-d1 "variant" into the actual
flag bit that we are after.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-2-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agoMerge tag 'intel-pinctrl-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Walleij [Thu, 13 Mar 2025 08:57:46 +0000 (09:57 +0100)] 
Merge tag 'intel-pinctrl-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel

intel-pinctrl for v6.15-1

* Introduce devm_kmemdup_array() and convert Intel pin control drivers
* Update PWM handling for the cases when it's provided by Intel pin control
* Miscellaneous fixes, updates, and cleanups

The following is an automated git shortlog grouped by driver:

baytrail:
 -  copy communities using devm_kmemdup_array()
 -  Use dedicated helpers for chained IRQ handlers

cherryview:
 -  use devm_kmemdup_array()

devres:
 -  Introduce devm_kmemdup_array()

driver core:
 -  Split devres APIs to device/devres.h

err.h:
 -  move IOMEM_ERR_PTR() to err.h

iio:
 -  adc: xilinx-xadc-core: use devm_kmemdup_array()
 -  imu: st_lsm9ds0: Replace device.h with what is needed

input:
 -  ipaq-micro-keys: use devm_kmemdup_array()
 -  sparse-keymap: use devm_kmemdup_array()

intel:
 -  drop repeated config dependency
 -  copy communities using devm_kmemdup_array()
 -  Fix wrong bypass assignment in intel_pinctrl_probe_pwm()
 -  Import PWM_LPSS namespace for devm_pwm_lpss_probe()

lynxpoint:
 -  Use dedicated helpers for chained IRQ handlers

MAINTAINERS:
 -  Add pin control and GPIO to the Intel MID record

pwm:
 -  lpss: Clarify the bypass member semantics in struct pwm_lpss_boardinfo
 -  lpss: Actually use a module namespace by defining the namespace earlier

pxa2xx:
 -  use devm_kmemdup_array()

tangier:
 -  use devm_kmemdup_array()

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agoMerge tag 'renesas-pinctrl-for-v6.15-tag2' of git://git.kernel.org/pub/scm/linux...
Linus Walleij [Thu, 13 Mar 2025 08:56:13 +0000 (09:56 +0100)] 
Merge tag 'renesas-pinctrl-for-v6.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel

pinctrl: renesas: Updates for v6.15 (take two)

  - Add missing of_node_put() calls.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: samsung: add support for eint_fltcon_offset
Peter Griffin [Fri, 7 Mar 2025 10:29:05 +0000 (10:29 +0000)] 
pinctrl: samsung: add support for eint_fltcon_offset

On gs101 SoC the fltcon0 (filter configuration 0) offset isn't at a
fixed offset like previous SoCs as the fltcon1 register only exists when
there are more than 4 pins in the bank.

Add a eint_fltcon_offset and new GS101_PIN_BANK_EINT* macros that take
an additional fltcon_offs variable.

This can then be used in suspend/resume callbacks to save and restore
the fltcon0 and fltcon1 registers.

Fixes: 4a8be01a1a7a ("pinctrl: samsung: Add gs101 SoC pinctrl configuration")
Cc: stable@vger.kernel.org
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20250307-pinctrl-fltcon-suspend-v4-1-2d775e486036@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agopinctrl: renesas: rza2: Fix missing of_node_put() call
Fabrizio Castro [Wed, 5 Mar 2025 16:37:53 +0000 (16:37 +0000)] 
pinctrl: renesas: rza2: Fix missing of_node_put() call

of_parse_phandle_with_fixed_args() requires its caller to
call into of_node_put() on the node pointer from the output
structure, but such a call is currently missing.

Call into of_node_put() to rectify that.

Fixes: b59d0e782706 ("pinctrl: Add RZ/A2 pin and gpio controller")
Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250305163753.34913-5-fabrizio.castro.jz@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
3 months agopinctrl: renesas: rzv2m: Fix missing of_node_put() call
Fabrizio Castro [Wed, 5 Mar 2025 16:37:52 +0000 (16:37 +0000)] 
pinctrl: renesas: rzv2m: Fix missing of_node_put() call

of_parse_phandle_with_fixed_args() requires its caller to
call into of_node_put() on the node pointer from the output
structure, but such a call is currently missing.

Call into of_node_put() to rectify that.

Fixes: 92a9b8252576 ("pinctrl: renesas: Add RZ/V2M pin and gpio controller driver")
Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250305163753.34913-4-fabrizio.castro.jz@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
3 months agopinctrl: renesas: rzg2l: Fix missing of_node_put() call
Fabrizio Castro [Wed, 5 Mar 2025 16:37:51 +0000 (16:37 +0000)] 
pinctrl: renesas: rzg2l: Fix missing of_node_put() call

of_parse_phandle_with_fixed_args() requires its caller to
call into of_node_put() on the node pointer from the output
structure, but such a call is currently missing.

Call into of_node_put() to rectify that.

Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250305163753.34913-3-fabrizio.castro.jz@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
3 months agopinctrl: bcm281xx: Add support for BCM21664 pinmux
Artur Weber [Mon, 3 Mar 2025 20:54:49 +0000 (21:54 +0100)] 
pinctrl: bcm281xx: Add support for BCM21664 pinmux

BCM21664 is another chip from the Kona line of Broadcom SoCs, and
its pinmux shares a lot of similarities with the BCM281xx pinmux.

Add support for the BCM21664 pinmux controller to the BCM281xx driver.

This also enables pinmux support for the BCM23550, which has an
identical pinmux config to the BCM21664 (hence they can share a
single compatible, brcm,bcm21664-pinctrl).

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Link: https://lore.kernel.org/20250303-bcm21664-pinctrl-v3-4-5f8b80e4ab51@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: bcm281xx: Provide pinctrl device info as OF platform data
Artur Weber [Mon, 3 Mar 2025 20:54:48 +0000 (21:54 +0100)] 
pinctrl: bcm281xx: Provide pinctrl device info as OF platform data

Introduce a new struct type, "bcm281xx_pinctrl_info", that holds
information about the pins, pin functions and regmap config for a pin
control chip. Create such a struct for the BCM218xx and pass it as
device data for the OF compatible match.

This is done in preparation for introducing additional chip types
to the driver.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Link: https://lore.kernel.org/20250303-bcm21664-pinctrl-v3-3-5f8b80e4ab51@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: bcm281xx: Use "unsigned int" instead of bare "unsigned"
Artur Weber [Mon, 3 Mar 2025 20:54:47 +0000 (21:54 +0100)] 
pinctrl: bcm281xx: Use "unsigned int" instead of bare "unsigned"

Replace uses of bare "unsigned" with "unsigned int" to fix checkpatch
warnings. No functional change.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Link: https://lore.kernel.org/20250303-bcm21664-pinctrl-v3-2-5f8b80e4ab51@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: Add bindings for BCM21664 pin controller
Artur Weber [Mon, 3 Mar 2025 20:54:46 +0000 (21:54 +0100)] 
dt-bindings: pinctrl: Add bindings for BCM21664 pin controller

Add device tree bindings for the pin controller included in the
BCM21664 chip. The bindings are based off brcm,bcm11351-pinctrl.yaml;
both chips use the same driver, but have different pins, and the
BCM21664 has 6 alt modes instead of 4.

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20250303-bcm21664-pinctrl-v3-1-5f8b80e4ab51@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: amd: isp411: Add amdisp GPIO pinctrl
Pratap Nirujogi [Tue, 4 Mar 2025 23:20:31 +0000 (18:20 -0500)] 
pinctrl: amd: isp411: Add amdisp GPIO pinctrl

Add pinctrl driver support for AMD SoC with isp41 hw ip block.

Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
Link: https://lore.kernel.org/20250304232051.2936557-1-pratap.nirujogi@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: pinconf-generic: Fix spelling mistake "paramers" -> "parameters"
Colin Ian King [Mon, 3 Mar 2025 09:28:26 +0000 (09:28 +0000)] 
pinctrl: pinconf-generic: Fix spelling mistake "paramers" -> "parameters"

There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/20250303092826.318638-1-colin.i.king@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: meson: fix pin input property for a4
Xianwei Zhao [Mon, 3 Mar 2025 07:53:20 +0000 (15:53 +0800)] 
pinctrl: meson: fix pin input property for a4

The register of pin input attribute means the opposite.
value of reigster meaning is 1 for input and 0 for output.
So fix it.

Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250303-fix-a4-pinctl-v1-1-6579888b4272@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: bcm2835: don't -EINVAL on alternate funcs from get_direction()
Bartosz Golaszewski [Wed, 19 Feb 2025 10:27:50 +0000 (11:27 +0100)] 
pinctrl: bcm2835: don't -EINVAL on alternate funcs from get_direction()

Since commit 9d846b1aebbe ("gpiolib: check the return value of
gpio_chip::get_direction()") we check the return value of the
get_direction() callback as per its API contract. This driver returns
-EINVAL if the pin in question is set to one of the alternative
(non-GPIO) functions. This isn't really an error that should be
communicated to GPIOLIB so default to returning the "safe" value of
INPUT in this case. The GPIO subsystem does not have the notion of
"unknown" direction.

Fixes: 9d846b1aebbe ("gpiolib: check the return value of gpio_chip::get_direction()")
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/all/Z7VFB1nST6lbmBIo@finisterre.sirena.org.uk/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/20250219102750.38519-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: rockchip: Add support for RK3528
Steven Liu [Fri, 28 Feb 2025 06:40:09 +0000 (06:40 +0000)] 
pinctrl: rockchip: Add support for RK3528

Add gpio and pinctrl support for the 5 GPIO banks on RK3528.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/20250228064024.3200000-4-jonas@kwiboo.se
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agodt-bindings: pinctrl: Add pinctrl support for RK3528
Jonas Karlman [Fri, 28 Feb 2025 06:40:08 +0000 (06:40 +0000)] 
dt-bindings: pinctrl: Add pinctrl support for RK3528

Add compatible string for RK3528 pin controller.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/20250228064024.3200000-3-jonas@kwiboo.se
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
3 months agopinctrl: intel: drop repeated config dependency
Raag Jadav [Mon, 3 Mar 2025 13:55:06 +0000 (19:25 +0530)] 
pinctrl: intel: drop repeated config dependency

We already have ACPI dependency for Intel pinctrl menu. No need to
repeat it.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 months agopinctrl: samsung: add support for exynos7870 pinctrl
Kaustabh Chakraborty [Fri, 28 Feb 2025 19:35:19 +0000 (01:05 +0530)] 
pinctrl: samsung: add support for exynos7870 pinctrl

Add support for the Exynos7870 SoC pin-controller in the pinctrl driver.
It has 8 GPIO banks, and 3-bit PINCFG_TYPE_DRV width.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://lore.kernel.org/r/20250301-exynos7870-pinctrl-v3-3-ba1da9d3cd2f@disroot.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: pinctrl: samsung: add exynos7870-wakeup-eint compatible
Kaustabh Chakraborty [Fri, 28 Feb 2025 19:35:18 +0000 (01:05 +0530)] 
dt-bindings: pinctrl: samsung: add exynos7870-wakeup-eint compatible

Exynos7870's wakeup pin controller is entirely register-compatible with
Exynos7, thus document the node for Exynos7870 appropriately.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://lore.kernel.org/r/20250301-exynos7870-pinctrl-v3-2-ba1da9d3cd2f@disroot.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
3 months agodt-bindings: pinctrl: samsung: add exynos7870-pinctrl compatible
Kaustabh Chakraborty [Fri, 28 Feb 2025 19:35:17 +0000 (01:05 +0530)] 
dt-bindings: pinctrl: samsung: add exynos7870-pinctrl compatible

Document a dedicated compatible string for Exynos7870's pin controllers,
having 8 GPIO pin banks.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://lore.kernel.org/r/20250301-exynos7870-pinctrl-v3-1-ba1da9d3cd2f@disroot.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
4 months agopinctrl: qcom: Add test case for TLMM interrupt handling
Bjorn Andersson [Thu, 27 Feb 2025 20:39:30 +0000 (12:39 -0800)] 
pinctrl: qcom: Add test case for TLMM interrupt handling

While looking at the X1E PDC GPIO interrupts it became clear that we're
lacking a convenient and accessible way to validate if the TLMM
interrupt code performing as expected.

This introduces a kunit-based "hack" that relies on pin bias/pull
configuration to tickle the interrupt logic in non-connected pins to
allow us to evaluate that an expected number of interrupts are
delivered.

The bias/pull configuration is done with mmio accesses directly from the
test code, to avoid having to programmatically acquire and drive the
pinconf interface for the test pin. This limits the scalability of the
code to targets with a particular register layout, but serves our needs
for now.

The pin to be used for testing is specified by the tester using the
"tlmm-test.gpio" module parameter.

Worth mentioning is that some of the test cases currently fails for
GPIOs that is not backed by PDC (i.e. "non-wakeup" GPIOs), as lingering
latched interrupt state is being delivered at IRQ request time.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://lore.kernel.org/20250227-tlmm-test-v1-1-d18877b4a5db@oss.qualcomm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl-tegra: Add config property GPIO mode
Prathamesh Shete [Tue, 17 Dec 2024 15:32:49 +0000 (21:02 +0530)] 
pinctrl-tegra: Add config property GPIO mode

The SFIO/GPIO select bit is a crucial part of Tegra's pin multiplexing
system:
- When set to 1, the pin operates in SFIO mode, controlled by the
  pin's assigned special function.
- When set to 0, the pin operates as a general-purpose GPIO.

This SFIO/GPIO select bit that is set for a given pin is not displayed,
adding the support to retrieve this information from the
pinmux set for each pin.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Link: https://lore.kernel.org/20241217153249.5712-1-pshete@nvidia.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper
Andy Shevchenko [Thu, 20 Feb 2025 15:50:11 +0000 (17:50 +0200)] 
pinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper

Switch the code to use for_each_gpiochip_node() helper.

While at it, correct header inclusion as device property APIs
are provided in property.h.

Reviewed-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250220155036.2734838-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agoMerge tag 'renesas-pinctrl-for-v6.15-tag1' of git://git.kernel.org/pub/scm/linux...
Linus Walleij [Thu, 27 Feb 2025 23:13:55 +0000 (00:13 +0100)] 
Merge tag 'renesas-pinctrl-for-v6.15-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel

pinctrl: renesas: Updates for v6.15

  - Add suspend/resume support for pull up/down on RZ/G3S,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agoMerge branch 'ib-amlogic-a4' into devel
Linus Walleij [Thu, 27 Feb 2025 23:03:55 +0000 (00:03 +0100)] 
Merge branch 'ib-amlogic-a4' into devel

Merge immutable branch into devel for next.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agoMAINTAINERS: Add an entry for Amlogic pinctrl driver
Xianwei Zhao [Wed, 12 Feb 2025 05:20:54 +0000 (13:20 +0800)] 
MAINTAINERS: Add an entry for Amlogic pinctrl driver

Add Amlogic pinctrl entry to MAINTAINERS to clarify the maintainers.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250212-amlogic-pinctrl-v5-5-282bc2516804@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: Add driver support for Amlogic SoCs
Xianwei Zhao [Wed, 12 Feb 2025 05:20:52 +0000 (13:20 +0800)] 
pinctrl: Add driver support for Amlogic SoCs

Add a new pinctrl driver for Amlogic SoCs. All future Amlogic
SoCs pinctrl drives use this, such A4, A5, S6, S7 etc. To support
new Amlogic SoCs, only need to add the corresponding dts file.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250212-amlogic-pinctrl-v5-3-282bc2516804@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: pinconf-generic: Add API for pinmux propertity in DTS file
Xianwei Zhao [Wed, 12 Feb 2025 05:20:51 +0000 (13:20 +0800)] 
pinctrl: pinconf-generic: Add API for pinmux propertity in DTS file

When describing pin mux func through pinmux propertity,
a standard API is added for support. The pinmux contains pin
identification and mux values, which can include multiple
pins. And groups configuration use other word. DTS such as:

func-name {
group_alias: group-name{
pinmux= <pin_id << 8 | mux_value)>,
<pin_id << 8 | mux_value)>;
bias-pull-up;
drive-strength-microamp = <4000>;
};
};

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250212-amlogic-pinctrl-v5-2-282bc2516804@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agodt-bindings: pinctrl: Add support for Amlogic A4 SoC
Xianwei Zhao [Wed, 12 Feb 2025 05:20:50 +0000 (13:20 +0800)] 
dt-bindings: pinctrl: Add support for Amlogic A4 SoC

Add the dt-bindings for Amlogic pin controller, and add a new
dt-binding header file which document the GPIO bank names of
Amlogic A4 SoC.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20250212-amlogic-pinctrl-v5-1-282bc2516804@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agoMerge branch 'ib-sophgo' into devel
Linus Walleij [Thu, 27 Feb 2025 22:57:00 +0000 (23:57 +0100)] 
Merge branch 'ib-sophgo' into devel

Pull the immutable branch into devel for next.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: add support for SG2044 SoC
Inochi Amaoto [Tue, 11 Feb 2025 05:17:55 +0000 (13:17 +0800)] 
pinctrl: sophgo: add support for SG2044 SoC

SG2044 share the share common control logic with SG2042. So
only pin definition is needed.

Add pin definition driver for SG2044 SoC.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-8-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: add support for SG2042 SoC
Inochi Amaoto [Tue, 11 Feb 2025 05:17:54 +0000 (13:17 +0800)] 
pinctrl: sophgo: add support for SG2042 SoC

Add base driver for SG2042 SoC and pin definition.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-7-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agodt-bindings: pinctrl: Add pinctrl for Sophgo SG2042 series SoC
Inochi Amaoto [Tue, 11 Feb 2025 05:17:53 +0000 (13:17 +0800)] 
dt-bindings: pinctrl: Add pinctrl for Sophgo SG2042 series SoC

SG2042 introduces a simple pinctrl device for all configurable pins.
For the SG2042 pinctl register file, each register (32 bits) is
responsible for two pins, each occupying the upper 16 bits and lower
16 bits of the register. It supports setting pull up/down, drive
strength and input schmitt trigger.

Add support for SG2042 pinctrl device.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20250211051801.470800-6-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: introduce generic probe function
Inochi Amaoto [Tue, 11 Feb 2025 05:17:52 +0000 (13:17 +0800)] 
pinctrl: sophgo: introduce generic probe function

Since different series of the Sophgo chip share a common pinctrl data
structure. It is necessary to add a common probe function to alloc
the this data structure. Add pctrl_init callback to allow soc to perform
its own initialization.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-5-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: generalize shareable code of cv18xx pinctrl driver
Inochi Amaoto [Tue, 11 Feb 2025 05:17:51 +0000 (13:17 +0800)] 
pinctrl: sophgo: generalize shareable code of cv18xx pinctrl driver

With generic data structure, it is possible to generalize vddio
operators and DT parsing code of cv18xx pinctrl driver. Introduce
sophgo_cfg_ops callback to allow the driver to adjust the soc
logic and share common code.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-4-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: introduce generic data structure for cv18xx pinctrl driver
Inochi Amaoto [Tue, 11 Feb 2025 05:17:50 +0000 (13:17 +0800)] 
pinctrl: sophgo: introduce generic data structure for cv18xx pinctrl driver

To share DT parsing and vddio code, it is necessary to introduce
some generic data structure to abstract the different cv18xx series
and the incoming sg2042 series.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-3-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: sophgo: avoid to modify untouched bit when setting cv1800 pinconf
Inochi Amaoto [Tue, 11 Feb 2025 05:17:49 +0000 (13:17 +0800)] 
pinctrl: sophgo: avoid to modify untouched bit when setting cv1800 pinconf

When setting pinconf configuration for cv1800 SoC, the driver just writes
the value. It may zero some bits of the pinconf register and cause some
unexpected error. Add a mask to avoid this.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Link: https://lore.kernel.org/20250211051801.470800-2-inochiama@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: qcom: msm8917: Add MSM8937 wsa_reset pin
Dang Huynh [Tue, 11 Feb 2025 22:37:48 +0000 (23:37 +0100)] 
pinctrl: qcom: msm8917: Add MSM8937 wsa_reset pin

It looks like both 8917 and 8937 are the same except for one pin
"wsa_reset".

Signed-off-by: Dang Huynh <danct12@riseup.net>
Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
Link: https://lore.kernel.org/20250211-msm8937-v1-4-7d27ed67f708@mainlining.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agoMerge tag 'ib-devres-iio-input-pinctrl-v6.15' into intel/pinctrl
Andy Shevchenko [Tue, 25 Feb 2025 11:16:46 +0000 (13:16 +0200)] 
Merge tag 'ib-devres-iio-input-pinctrl-v6.15' into intel/pinctrl

There are a few Intel pin control drivers that are affected
by the devm_kmemdup_array() conversion, merge the ib-devres-iio-input-pinctrl
for making development going smoothly.

* Split devres APIs to a separate header (linux/device/devres.h)
* Move IOMEM_ERR_PTR() to err.h to avoid unneeded loops
* Introduce devm_kmemdup_array()
* Use devm_kmemdup_array() in input, IIO, and pinctrl subsystems

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoMerge patch series "Split devres APIs to device/devres.h and introduce devm_kmemdup_a...
Andy Shevchenko [Mon, 24 Feb 2025 10:08:12 +0000 (12:08 +0200)] 
Merge patch series "Split devres APIs to device/devres.h and introduce devm_kmemdup_array()"

Raag Jadav <raag.jadav@intel.com> says:

This series

1. Splits device/devres.h for the users that are only interested in devres APIs.
   Original work by Andy Shevchenko:
   https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com

2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
   across drivers.

The idea behind embedding both work into a single series is to make the review
process easier and reduce conflicts while merging.

Link: https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoinput: ipaq-micro-keys: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:13 +0000 (11:55 +0530)] 
input: ipaq-micro-keys: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoinput: sparse-keymap: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:12 +0000 (11:55 +0530)] 
input: sparse-keymap: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoiio: adc: xilinx-xadc-core: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:11 +0000 (11:55 +0530)] 
iio: adc: xilinx-xadc-core: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: pxa2xx: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:10 +0000 (11:55 +0530)] 
pinctrl: pxa2xx: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: tangier: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:09 +0000 (11:55 +0530)] 
pinctrl: tangier: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: cherryview: use devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:08 +0000 (11:55 +0530)] 
pinctrl: cherryview: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, use source size
instead of destination.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: baytrail: copy communities using devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:07 +0000 (11:55 +0530)] 
pinctrl: baytrail: copy communities using devm_kmemdup_array()

Copy communities using devm_kmemdup_array() instead of doing it manually.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: intel: copy communities using devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:06 +0000 (11:55 +0530)] 
pinctrl: intel: copy communities using devm_kmemdup_array()

Copy communities using devm_kmemdup_array() instead of doing it manually.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agodevres: Introduce devm_kmemdup_array()
Raag Jadav [Wed, 12 Feb 2025 06:25:05 +0000 (11:55 +0530)] 
devres: Introduce devm_kmemdup_array()

Introduce '_array' variant of devm_kmemdup() which is more robust and
consistent with alloc family of helpers.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoiio: imu: st_lsm9ds0: Replace device.h with what is needed
Andy Shevchenko [Wed, 12 Feb 2025 06:25:04 +0000 (11:55 +0530)] 
iio: imu: st_lsm9ds0: Replace device.h with what is needed

Instead of including a huge device.h with tons of dependencies
include only what driver actually uses.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agodriver core: Split devres APIs to device/devres.h
Andy Shevchenko [Wed, 12 Feb 2025 06:25:03 +0000 (11:55 +0530)] 
driver core: Split devres APIs to device/devres.h

device.h is a huge header which is hard to follow and easy to miss
something. Improve that by splitting devres APIs to device/devres.h.

In particular this helps to speedup the build of the code that includes
device.h solely for a devres APIs.

While at it, cast the error pointers to __iomem using IOMEM_ERR_PTR()
and fix sparse warnings.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agoerr.h: move IOMEM_ERR_PTR() to err.h
Raag Jadav [Wed, 12 Feb 2025 06:25:02 +0000 (11:55 +0530)] 
err.h: move IOMEM_ERR_PTR() to err.h

Since IOMEM_ERR_PTR() macro deals with an error pointer, a better place
for it is err.h. This helps avoid dependency on io.h for the users that
don't need it.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
4 months agopinctrl: renesas: rzg2l: Suppress binding attributes
Claudiu Beznea [Sat, 15 Feb 2025 13:12:35 +0000 (15:12 +0200)] 
pinctrl: renesas: rzg2l: Suppress binding attributes

Suppress binding attributes for the rzg2l pinctrl driver, as it is an
essential block for Renesas SoCs.  Unbinding the driver leads to
warnings from __device_links_no_driver() and can eventually render the
system inaccessible.

Fixes: c4c4637eb57f ("pinctrl: renesas: Add RZ/G2L pin and gpio controller driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250215131235.228274-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 months agopinctrl: samsung: add exynos2200 SoC pinctrl configuration
Ivaylo Ivanov [Sat, 15 Feb 2025 11:32:48 +0000 (13:32 +0200)] 
pinctrl: samsung: add exynos2200 SoC pinctrl configuration

Add support for the pin-controller found on the Exynos2200 SoC
used in Samsung Galaxy S22, S22 Plus and S22 Ultra phones.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Link: https://lore.kernel.org/r/20250215113248.159386-4-ivo.ivanov.ivanov1@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
4 months agodt-bindings: pinctrl: samsung: add exynos2200 compatible
Ivaylo Ivanov [Sat, 15 Feb 2025 11:32:47 +0000 (13:32 +0200)] 
dt-bindings: pinctrl: samsung: add exynos2200 compatible

Document the compatible for Exynos2200 SoC.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250215113248.159386-3-ivo.ivanov.ivanov1@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
4 months agodt-bindings: pinctrl: samsung: add exynos2200-wakeup-eint compatible
Ivaylo Ivanov [Sat, 15 Feb 2025 11:32:46 +0000 (13:32 +0200)] 
dt-bindings: pinctrl: samsung: add exynos2200-wakeup-eint compatible

Add a dedicated compatible for exynos2200.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250215113248.159386-2-ivo.ivanov.ivanov1@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
4 months agopinctrl: cy8c95x0: Fix comment style
Andy Shevchenko [Wed, 5 Feb 2025 09:51:20 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Fix comment style

One comment style is not aligned with the rest. Fix that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Separate EEPROM related register definitios
Andy Shevchenko [Wed, 5 Feb 2025 09:51:19 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Separate EEPROM related register definitios

Currently it's not easy to see at a glance the group of the registers
that are per port. Add a blank line and a comment to make it better.

Also add a missing definition for one of the EEPROM related registers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Drop unneeded casting
Andy Shevchenko [Wed, 5 Feb 2025 09:51:18 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Drop unneeded casting

The 'arg' variable in cy8c95x0_gpio_get_pincfg() is already type of u16.
No need to cast it, so drop unneeded casting.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Get rid of cy8c95x0_pinmux_direction() forward declaration
Andy Shevchenko [Wed, 5 Feb 2025 09:51:17 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Get rid of cy8c95x0_pinmux_direction() forward declaration

The function is used before being defined. Just move it up enough to
get rid of forward declaration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Initialise boolean variable with boolean values
Andy Shevchenko [Wed, 5 Feb 2025 09:51:16 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Initialise boolean variable with boolean values

The 'ret' variable in cy8c95x0_irq_handler() is defined as bool,
but is intialised with integers. Avoid implicit castings and
initialise boolean variable with boolean values.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Replace 'return ret' by 'return 0' in some cases
Andy Shevchenko [Wed, 5 Feb 2025 09:51:15 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Replace 'return ret' by 'return 0' in some cases

When it's known that the returned value can't be non-zero,
use 'return 0' explicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Remove redundant check in cy8c95x0_regmap_update_bits_base()
Andy Shevchenko [Wed, 5 Feb 2025 09:51:14 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Remove redundant check in cy8c95x0_regmap_update_bits_base()

The function is never called with the PORTSEL register in the argument.
Drop unneeded check, but rescue a comment. While at it, drop inline
and allow any compiler to choose better stragy (note, that inline in
C code is only a recomendation to most of the modern compilers anyway).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Transform to cy8c95x0_regmap_read_bits()
Andy Shevchenko [Wed, 5 Feb 2025 09:51:13 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Transform to cy8c95x0_regmap_read_bits()

The returned value of cy8c95x0_regmap_read() is used always with
a bitmask being applied. Move that bitmasking code into the function.
At the same time transform it to cy8c95x0_regmap_read_bits() which
will be in align with the write and update counterparts.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0; Switch to use for_each_set_clump8()
Andy Shevchenko [Wed, 5 Feb 2025 09:51:12 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0; Switch to use for_each_set_clump8()

for_each_set_clump8() has embedded check for unset clump to skip.
Switch driver to use for_each_set_clump8().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 months agopinctrl: cy8c95x0: Use better bitmap APIs where appropriate
Andy Shevchenko [Wed, 5 Feb 2025 09:51:11 +0000 (11:51 +0200)] 
pinctrl: cy8c95x0: Use better bitmap APIs where appropriate

There are bitmap_gather() and bitmap_scatter() that are factually
reimplemented in the driver. Use better bitmap APIs where appropriate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>