Commit Graph

7404 Commits

Author SHA1 Message Date
Bartosz Golaszewski
2c75dc82ed pinctrl: renesas: gpio: Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250611-gpiochip-set-rv-pinctrl-renesas-v1-1-ad169a794ef0@linaro.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2025-06-13 11:25:29 +02:00
Andy Shevchenko
3b4408038d pinctrl: intel: fix build warnings about export.h
After commit a934a57a42 ("scripts/misc-check: check missing #include
<linux/export.h> when W=1") and 7d95680d64 ("scripts/misc-check:
check unnecessary #include <linux/export.h> when W=1"), we get some build
warnings with W=1:

pinctrl-intel.c: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing

So fix these build warnings for the driver code.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-06-12 15:19:08 +03:00
Bartosz Golaszewski
20e62271fb pinctrl: lynxpoint: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-06-11 11:27:30 +03:00
Bartosz Golaszewski
241d79f025 pinctrl: intel: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-06-11 11:27:30 +03:00
Bartosz Golaszewski
83ab731cb2 pinctrl: cherryview: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-06-11 11:27:30 +03:00
Bartosz Golaszewski
4863d750fd pinctrl: baytrail: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2025-06-11 11:27:30 +03:00
Thomas Richard
90256033c1 pinctrl: cirrus: madera-core: Use devm_pinctrl_register_mappings()
Use devm_pinctrl_register_mappings(), so the mappings are automatically
unregistered by the core. If pinctrl_enable() failed during the probe,
pinctrl_mappings were not freed. Now it is done by the core.

Fixes: 218d72a77b ("pinctrl: madera: Add driver for Cirrus Logic Madera codecs")
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/20250609-pinctrl-madera-devm-pinctrl-register-mappings-v1-1-ba2c2822cf6c@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-10 14:44:42 +02:00
Chen-Yu Tsai
5558f27a58 pinctrl: sunxi: dt: Consider pin base when calculating bank number from pin
In prepare_function_table() when the pinctrl function table IRQ entries
are generated, the pin bank is calculated from the absolute pin number;
however the IRQ bank mux array is indexed from the first pin bank of the
controller. For R_PIO controllers, this means the absolute pin bank is
way off from the relative pin bank used for array indexing.

Correct this by taking into account the pin base of the controller.

Fixes: f5e2cd34b1 ("pinctrl: sunxi: allow reading mux values from DT")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/20250607135203.2085226-1-wens@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-10 14:35:40 +02:00
Xianwei Zhao
1f8e5dfdda pinctrl: meson: support amlogic S6/S7/S7D SoC
In some Amlogic SoCs, to save register space or due to some
abnormal arrangements, two sets of pins share one mux register.

A group starting from pin0 is the main pin group, which acquires
the register address through DTS and has management permissions,
but the register bit offset is undetermined.

Another GPIO group as a subordinate group. Some pins mux use share
register and bit offset from bit0 . But this group do not have
register management permissions.

This submission implements this situation.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250527-s6-s7-pinctrl-v3-3-44f6a0451519@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-10 14:10:45 +02:00
Xianwei Zhao
cfdedf7392 pinctrl: meson: a4: remove special data processing
According to the data specifications of Amlogic's existing SoCs,
the function register offset and the bit offset are the same
value among various chips. Therefore, general processing can
be carried out without the need for private data modification.
Drop special data processing.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250527-s6-s7-pinctrl-v3-2-44f6a0451519@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-10 14:10:37 +02:00
Krzysztof Kozlowski
24b0277c1c pinctrl: tb10x: Drop of_match_ptr for ID table
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF warning:

  pinctrl-tb10x.c:815:34: warning: unused variable 'tb10x_pinctrl_dt_ids' [-Wunused-const-variable]

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505301317.EI1caRC0-lkp@intel.com/
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20250601105100.27927-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-09 10:16:46 +02:00
Krzysztof Kozlowski
fcd65d65fd pinctrl: st: Drop unused st_gpio_bank() function
Static inline st_gpio_bank() function is not referenced:

  pinctrl-st.c:377:19: error: unused function 'st_gpio_bank' [-Werror,-Wunused-function]

Fixes: 701016c0cb ("pinctrl: st: Add pinctrl and pinconf support.")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20250528092201.52132-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-09 10:16:45 +02:00
Wojciech Slenska
315345610f pinctrl: qcom: pinctrl-qcm2290: Add missing pins
Added the missing pins to the qcm2290_pins table.

Signed-off-by: Wojciech Slenska <wojciech.slenska@gmail.com>
Fixes: 48e049ef12 ("pinctrl: qcom: Add QCM2290 pinctrl driver")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250523101437.59092-1-wojciech.slenska@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-09 10:16:45 +02:00
Dmitry Baryshkov
56ec63a6e1 pinctrl: qcom: switch to devm_gpiochip_add_data()
In order to simplify cleanup actions, use devres-enabled version of
gpiochip_add_data().  As the msm_pinctrl_remove() function is now empty,
drop it and all its calls from the corresponding pinctrl drivers.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250513-pinctrl-msm-fix-v2-3-249999af0fc1@oss.qualcomm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-06-09 10:16:45 +02:00
Linus Torvalds
eafd95ea74 Pin control bulk changes for v6.16:
Core changes:
 
 - Add the devres devm_pinctrl_register_mappings() call that can
   register some pin control machine mappings and have them go away
   with the associated device.
 
 New drivers:
 
 - Support for the Mediatek MT6893 and MT8196 SoCs.
 
 - Support for the Renesas RZ/V2N SoC.
 
 - Support for the NXP Freescale i.MX943 SoC.
 
 Improvements:
 
 - Per-SoC suspend/resume callbacks in the Samsung drivers.
 
 - Set all pins as input (High-Z) at probe in the MCP23S08 driver.
 
 - Switch most GPIO chips to use the setters/getters with a return
   value.
 
 - EGPIO support in the Qualcomm QCM2290 driver.
 
 - Fix up the number of available GPIO lines in Qualcomm QCS8300
   and QCS615.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmg5xGcACgkQQRCzN7AZ
 XXNuLQ/+LBL4VQXKXZxLkKlhhXpfJRmZx4W1h2VQt4PXj3Evhmk7aHFcPNiswWl2
 rtXQEuEQcnReu8fO7wtA1d4a9QdA5ODniMmtwwNHJ0TTgcZsW1cj5ayZ5x1swRKN
 +dTq336T1EEJ4KSQH6f3UIQaFyDGfL81zMei2qi63prEN7QCJ1zlJtJ3NWdoMzsK
 INwzhHQPcSc0JskaMTYsYajkeaxXbA190hXAwI2msBuV/8YDjoGYWGvZIU7t3MbA
 m+eFsCQJAmIgf9hK0qRBZHAWvN8XbOofnDtOUULxSi00Mh92GGTYrFmkHMIE3dRX
 jtpD/kY4cWnlYYBzSo5/LmVvc2dAIvLHupqw+55fN4pG3i0fOHbjI1an160Oe61r
 t3K/2fHSPZvKu1vLGedLePOBNG9AZQUjHEjiBQZd81KGRX4t4HcdQZvzd7l/5htK
 J9HujqFcjT8xx/QarM2fxlFtOrAyHKljJgiBsmPtdL5zqJoQeUIXyofjGYUDgNfn
 mqoT6+IwiJBEjEg6FVa3YXBhf8n2dmfzoxbITfhTeY/gsSvO24Po+9lK7NkpStyC
 VHpoIxFtO9XsDrE9IC/8EpuVXB3rS5pWHBcYZeOcYCLkiSLqC7C4ZvJsZxPM8xMx
 PTFzrjL+s1MxLCalE9XNA9wuZHXP8yRew67UymSsBm0yb9FDR/w=
 =Qr9t
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "An especially linear and sparse improvement and new drivers release.
  Nothing exciting. The biggest change in Bartosz changes to make
  gpiochip set/get calls return error codes (something we should have
  fixed ages ago but is now finally getting fixed.)

  Core changes:

   - Add the devres devm_pinctrl_register_mappings() call that can
     register some pin control machine mappings and have them go away
     with the associated device

  New drivers:

   - Support for the Mediatek MT6893 and MT8196 SoCs

   - Support for the Renesas RZ/V2N SoC

   - Support for the NXP Freescale i.MX943 SoC

  Improvements:

   - Per-SoC suspend/resume callbacks in the Samsung drivers

   - Set all pins as input (High-Z) at probe in the MCP23S08 driver

   - Switch most GPIO chips to use the setters/getters with a return
     value

   - EGPIO support in the Qualcomm QCM2290 driver

   - Fix up the number of available GPIO lines in Qualcomm QCS8300 and
     QCS615"

* tag 'pinctrl-v6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (82 commits)
  pinctrl: freescale: Add support for imx943 pinctrl
  pinctrl: core: add devm_pinctrl_register_mappings()
  pinctrl: remove extern specifier for functions in machine.h
  pinctrl: mediatek: eint: Fix invalid pointer dereference for v1 platforms
  pinctrl: freescale: Enable driver if platform is enabled.
  pinctrl: freescale: Depend imx-scu driver on OF
  pinctrl: armada-37xx: propagate error from armada_37xx_pmx_set_by_name()
  pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get_direction()
  pinctrl: armada-37xx: propagate error from armada_37xx_pmx_gpio_set_direction()
  pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get()
  pinctrl: armada-37xx: propagate error from armada_37xx_gpio_direction_output()
  pinctrl: armada-37xx: set GPIO output value before setting direction
  pinctrl: armada-37xx: use correct OUTPUT_VAL register for GPIOs > 31
  pinctrl: meson: Drop unused aml_pctl_find_group_by_name()
  pinctrl: at91: Fix possible out-of-boundary access
  pinctrl: add stubs for OF-specific pinconf functions
  pinctrl: qcom: correct the ngpios entry for QCS8300
  pinctrl: qcom: correct the ngpios entry for QCS615
  dt-bindings: pinctrl: qcom: correct gpio-ranges in examples for qcs8300
  dt-bindings: pinctrl: qcom: correct gpio-ranges in examples for qcs615
  ...
2025-05-30 09:46:28 -07:00
Linus Torvalds
3702a515ed ACPI updates for 6.16-rc1
- Fix two ACPICA SLAB cache leaks (Seunghun Han).
 
  - Add EINJv2 get error type action and define Error Injection Actions
    in hex values to avoid inconsistencies between the specification and
    the code (Zaid Alali).
 
  - Fix typo in comments for SRAT structures (Adam Lackorzynski).
 
  - Prevent possible loss of data in ACPICA because of u32 to u8
    conversions (Saket Dumbre).
 
  - Fix reading FFixedHW operation regions in ACPICA (Daniil Tatianin).
 
  - Add support for printing AML arguments when the ACPICA debug level is
    ACPI_LV_TRACE_POINT (Mario Limonciello).
 
  - Drop a stale comment about the file content from actbl2.h (Sudeep
    Holla).
 
  - Apply pack(1) to union aml_resource (Tamir Duberstein).
 
  - Fix overflow check in the ACPICA version of vsnprintf() (gldrk).
 
  - Interpret SIDP structures in DMAR added revision 3.4 of the VT-d
    specification (Alexey Neyman).
 
  - Add typedef and other definitions related to MRRM to ACPICA (Tony
    Luck).
 
  - Add definitions for RIMT to ACPICA (Sunil V L).
 
  - Fix spelling mistake "Incremement" -> "Increment" in the ACPICA
    utilities code (Colin Ian King).
 
  - Add typedef and other definitions for ERDT to ACPICA (Tony Luck).
 
  - Introduce ACPI_NONSTRING and use it (Kees Cook, Ahmed Salem).
 
  - Rename structure and field names of the RAS2 table in actbl2.h (Shiju
    Jose).
 
  - Fix up whitespace in acpica/utcache.c (Zhe Qiao).
 
  - Avoid sequence overread in a call to strncmp() in ap_get_table_length()
    and replace strncpy() with memcpy() in ACPICA in some places (Ahmed
    Salem).
 
  - Update copyright year in all ACPICA files (Saket Dumbre).
 
  - Add __nonstring annotations for unterminated strings in the static
    ACPI tables parsing code (Kees Cook).
 
  - Add support for parsing the MRRM ACPI table and sysfs files to
    describe memory regions listed in it (Tony Luck, Anil Keshavamurthy).
 
  - Remove an (explicitly) unused header file include from the VIOT ACPI
    table parser file (Andy Shevchenko).
 
  - Improve logging around acpi_initialize_tables() (Bartosz Szczepanek).
 
  - Clean up the initialization of CPU data structures in the ACPI
    processor driver (Zhang Rui).
 
  - Remove an obsolete comment regarding the C-states handling in the
    ACPI processor driver (Giovanni Gherdovich).
 
  - Simplify PCC shared memory region handling (Sudeep Holla).
 
  - Rework and extend functions for reading CPPC register values and for
    updating CPPC registers (Lifeng Zheng).
 
  - Add three functions related to autonomous CPU performance state
    selection to the CPPC library (Lifeng Zheng).
 
  - Turn the acpi_pci_root_remap_iospace() fwnode_handle parameter into a
    const pointer (Pei Xiao).
 
  - Round battery capacity percengate in the ACPI battery driver to the
    closest integer to avoid user confusion (shitao).
 
  - Make the ACPI battery driver report the current as a negative number
    to the power supply framework when the battery is discharging as
    documented (Peter Marheine).
 
  - Add TUXEDO InfinityBook Pro AMD Gen9 to the acpi_ec_no_wakeup[] list
    to prevent spurious wakeups from suspend-to-idle (Werner Sembach).
 
  - Convert the APEI EINJ driver to a faux device one (Sudeep Holla, Jon
    Hunter).
 
  - Remove redundant calls to einj_get_available_error_type() from the
    APEI EINJ driver (Zaid Alali).
 
  - Fix a typo for MECHREVO in irq1_edge_low_force_override[] (Mingcong
    Bai).
 
  - Add an LPS0 check() callback to the AMD pinctrl driver and fix up
    config symbol dependencies in it (Mario Limonciello, Rafael Wysocki).
 
  - Avoid initializing the ACPI platform profile driver on non-ACPI
    platforms (Alexandre Ghiti).
 
  - Document that references to ACPI data (non-device) nodes should use
    string-only references in hierarchical data node packages (Sakari
    Ailus).
 
  - Fail the ACPI bus registration if acpi_kobj registration fails (Armin
    Wolf).
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmg0rlUSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO16GUH/jtsD33u0tSopncGA+MYQO/rd3MA1sW0
 2W9NACvdPDtoOpDiKLa3ptw6FaicJMrPvghZ6LMZ1Wjt3JKqjGZLtj5zzZcCaCxt
 34UOwr1V4FUDNQ7mfXRMRdwDnGj5UCaBLV80fekwr8gYhfEWM5F9MpeRuFR4QOAf
 HGvmtI8NCAaYn2utHSvP/XkH2+C257k5lbdt1PMnQg7E7iQBoz3Nn39EuQ2MrkFN
 1YEZzBR2wZkfQRTf1ZeK6SFKixNKCtDAJj7YcnKhwafj5YKvynr8EnuMDNc9B4Xh
 dFGj9P/Jkxyol7sJqC+CjdyhDCY24cSBbk/+naCsInD0taSdK/FJW+w=
 =/Ek0
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "The most significant part of these changes is an ACPICA update
  covering two upstream ACPICA releases, 20241212 and 20250404, that
  have not been included into the kernel code base yet.

  Among other things, it adds definitions needed to address GCC 15's
  -Wunterminated-string-initialization warnings, adds support for three
  new tables (MRRM, ERDT, RIMT), extends support for two tables (RAS2,
  DMAR), and fixes some issues.

  On top of the above, there is a new parser for the MRRM table, more
  changes related to GCC 15's -Wunterminated-string-initialization
  warnings, a CPPC library update including functions related to
  autonomous CPU performance state selection, a couple of new quirks,
  some assorted fixes and some code cleanups.

  Specifics:

   - Fix two ACPICA SLAB cache leaks (Seunghun Han)

   - Add EINJv2 get error type action and define Error Injection Actions
     in hex values to avoid inconsistencies between the specification
     and the code (Zaid Alali)

   - Fix typo in comments for SRAT structures (Adam Lackorzynski)

   - Prevent possible loss of data in ACPICA because of u32 to u8
     conversions (Saket Dumbre)

   - Fix reading FFixedHW operation regions in ACPICA (Daniil Tatianin)

   - Add support for printing AML arguments when the ACPICA debug level
     is ACPI_LV_TRACE_POINT (Mario Limonciello)

   - Drop a stale comment about the file content from actbl2.h (Sudeep
     Holla)

   - Apply pack(1) to union aml_resource (Tamir Duberstein)

   - Fix overflow check in the ACPICA version of vsnprintf() (gldrk)

   - Interpret SIDP structures in DMAR added revision 3.4 of the VT-d
     specification (Alexey Neyman)

   - Add typedef and other definitions related to MRRM to ACPICA (Tony
     Luck)

   - Add definitions for RIMT to ACPICA (Sunil V L)

   - Fix spelling mistake "Incremement" -> "Increment" in the ACPICA
     utilities code (Colin Ian King)

   - Add typedef and other definitions for ERDT to ACPICA (Tony Luck)

   - Introduce ACPI_NONSTRING and use it (Kees Cook, Ahmed Salem)

   - Rename structure and field names of the RAS2 table in actbl2.h
     (Shiju Jose)

   - Fix up whitespace in acpica/utcache.c (Zhe Qiao)

   - Avoid sequence overread in a call to strncmp() in
     ap_get_table_length() and replace strncpy() with memcpy() in ACPICA
     in some places (Ahmed Salem)

   - Update copyright year in all ACPICA files (Saket Dumbre)

   - Add __nonstring annotations for unterminated strings in the static
     ACPI tables parsing code (Kees Cook)

   - Add support for parsing the MRRM ACPI table and sysfs files to
     describe memory regions listed in it (Tony Luck, Anil
     Keshavamurthy)

   - Remove an (explicitly) unused header file include from the VIOT
     ACPI table parser file (Andy Shevchenko)

   - Improve logging around acpi_initialize_tables() (Bartosz
     Szczepanek)

   - Clean up the initialization of CPU data structures in the ACPI
     processor driver (Zhang Rui)

   - Remove an obsolete comment regarding the C-states handling in the
     ACPI processor driver (Giovanni Gherdovich)

   - Simplify PCC shared memory region handling (Sudeep Holla)

   - Rework and extend functions for reading CPPC register values and
     for updating CPPC registers (Lifeng Zheng)

   - Add three functions related to autonomous CPU performance state
     selection to the CPPC library (Lifeng Zheng)

   - Turn the acpi_pci_root_remap_iospace() fwnode_handle parameter into
     a const pointer (Pei Xiao)

   - Round battery capacity percengate in the ACPI battery driver to the
     closest integer to avoid user confusion (shitao)

   - Make the ACPI battery driver report the current as a negative
     number to the power supply framework when the battery is
     discharging as documented (Peter Marheine)

   - Add TUXEDO InfinityBook Pro AMD Gen9 to the acpi_ec_no_wakeup[]
     list to prevent spurious wakeups from suspend-to-idle (Werner
     Sembach)

   - Convert the APEI EINJ driver to a faux device one (Sudeep Holla,
     Jon Hunter)

   - Remove redundant calls to einj_get_available_error_type() from the
     APEI EINJ driver (Zaid Alali)

   - Fix a typo for MECHREVO in irq1_edge_low_force_override[] (Mingcong
     Bai)

   - Add an LPS0 check() callback to the AMD pinctrl driver and fix up
     config symbol dependencies in it (Mario Limonciello, Rafael
     Wysocki)

   - Avoid initializing the ACPI platform profile driver on non-ACPI
     platforms (Alexandre Ghiti)

   - Document that references to ACPI data (non-device) nodes should use
     string-only references in hierarchical data node packages (Sakari
     Ailus)

   - Fail the ACPI bus registration if acpi_kobj registration fails
     (Armin Wolf)"

* tag 'acpi-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits)
  ACPI: MRRM: Fix default max memory region
  ACPI: bus: Bail out if acpi_kobj registration fails
  ACPI: platform_profile: Avoid initializing on non-ACPI platforms
  pinctrl: amd: Fix hibernation support with CONFIG_SUSPEND unset
  ACPI: tables: Improve logging around acpi_initialize_tables()
  ACPI: VIOT: Remove (explicitly) unused header
  ACPI: Add documentation for exposing MRRM data
  ACPI: MRRM: Add /sys files to describe memory ranges
  ACPI: MRRM: Minimal parse of ACPI MRRM table
  ACPICA: Update copyright year
  ACPICA: Logfile: Changes for version 20250404
  ACPICA: Replace strncpy() with memcpy()
  ACPICA: Apply ACPI_NONSTRING in more places
  ACPICA: Avoid sequence overread in call to strncmp()
  ACPICA: Adjust the position of code lines
  ACPICA: actbl2.h: ACPI 6.5: RAS2: Rename structure and field names of the RAS2 table
  ACPICA: Apply ACPI_NONSTRING
  ACPICA: Introduce ACPI_NONSTRING
  ACPICA: actbl2.h: ERDT: Add typedef and other definitions
  ACPICA: infrastructure: Add new DMT_BUF types and shorten a long name
  ...
2025-05-27 16:32:30 -07:00
Linus Torvalds
2bd1bea5fa A set of cleanups for the generic interrupt subsystem:
- Consolidate on one set of functions for the interrupt domain code to
     get rid of pointlessly duplicated code with only marginal different
     semantics.
 
   - Update the documentation accordingly and consolidate the coding style
     of the irqdomain header.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmgzd+MTHHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYodTRD/0RmG5tngCbEJmTw6lPDQzRZH4OO3ja
 yRYlyBipemoRmvJRGjV4uHqN2QPrdOuoqMuyBO1aWcMdkpww5bAHcbgSFrlGM1lW
 kqtaxVMbufPiLQSGYe7OQf478CE1ykoBd5Va8whFKrtA73qEUdEMfWT0stspg780
 7BlmQOemL91p7Ytf03FbDdo8tZ5Xu9uXGAulwY9FZsFtsCNyvhl7nOv5Sk8ZQtGO
 xHRCeunjZLWR+IaK59hdakvQybXwSnjT6jODp96nlyKABEKSPShGSPFDWd3g9px7
 4911QwgnvTbcrsk6YmQEmPIOgXZzypjbnjpJr8tFpTbkVIy+6chi5cBJzXoqsUaM
 ylTwFcUQNvcP8yF447qb+nyPFKM5xsC07W0UpZMuJUDmhhPRtDm5pK0jpsif96GP
 l4aMsWe65PUmXHQqLdE89RJXAa8XQ2qspKVtNKq9DmEVgTviQ09Z9SSQIx4U0yIx
 w+YPde8kH2+O+YtMUn/MmfHhUP4MKya7j5zd8Bnv8wLBi7XGPPA5EKKh9I0dz9m+
 X94lweNXyH+Q8U9mt2cQf8VG8Yzgk0eeC0sliJIlybwRgEgRcQbVWw0VvZUA1ySa
 VBlaj3SinO90FEQ0CctT51ss2mUJ/XsGCnxpiGZXfqIZzFbyD1YfZQnXJH0H67DI
 CqdHw22I27Mu/A==
 =9nLp
 -----END PGP SIGNATURE-----

Merge tag 'irq-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq cleanups from Thomas Gleixner:
 "A set of cleanups for the generic interrupt subsystem:

   - Consolidate on one set of functions for the interrupt domain code
     to get rid of pointlessly duplicated code with only marginal
     different semantics.

   - Update the documentation accordingly and consolidate the coding
     style of the irqdomain header"

* tag 'irq-cleanups-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
  irqdomain: Consolidate coding style
  irqdomain: Fix kernel-doc and add it to Documentation
  Documentation: irqdomain: Update it
  Documentation: irq-domain.rst: Simple improvements
  Documentation: irq/concepts: Minor improvements
  Documentation: irq/concepts: Add commas and reflow
  irqdomain: Improve kernel-docs of functions
  irqdomain: Make struct irq_domain_info variables const
  irqdomain: Use irq_domain_instantiate()'s return value as initializers
  irqdomain: Drop irq_linear_revmap()
  pinctrl: keembay: Switch to irq_find_mapping()
  irqchip/armada-370-xp: Switch to irq_find_mapping()
  gpu: ipu-v3: Switch to irq_find_mapping()
  gpio: idt3243x: Switch to irq_find_mapping()
  sh: Switch to irq_find_mapping()
  powerpc: Switch to irq_find_mapping()
  irqdomain: Drop irq_domain_add_*() functions
  powerpc: Switch irq_domain_add_nomap() to use fwnode
  thermal: Switch to irq_domain_create_linear()
  soc: Switch to irq_domain_create_*()
  ...
2025-05-27 08:07:32 -07:00
Rafael J. Wysocki
db0e4d5429 Merge branches 'acpi-resource', 'acpi-pm', 'acpi-platform-profile' and 'acpi-docs'
Merge an ACPI resources management update, ACPI power management
updates, an ACPI platform profile driver fix and an ACPI documentation
update related to device properties for 6.16-rc1:

 - Fix a typo for MECHREVO in irq1_edge_low_force_override[] (Mingcong
   Bai).

 - Add an LPS0 check() callback to the AMD pinctrl driver and fix up
   config symbol dependencies in it (Mario Limonciello, Rafael Wysocki).

 - Avoid initializing the ACPI platform profile driver on non-ACPI
   platforms (Alexandre Ghiti).

 - Document that references to ACPI data (non-device) nodes should use
   string-only references in hierarchical data node packages (Sakari
   Ailus).

* acpi-resource:
  ACPI: resource: fix a typo for MECHREVO in irq1_edge_low_force_override[]

* acpi-pm:
  pinctrl: amd: Fix hibernation support with CONFIG_SUSPEND unset
  pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'
  pinctrl: amd: Add an LPS0 check() callback
  ACPI: Add missing prototype for non CONFIG_SUSPEND/CONFIG_X86 case

* acpi-platform-profile:
  ACPI: platform_profile: Avoid initializing on non-ACPI platforms

* acpi-docs:
  Documentation: ACPI: Use all-string data node references
2025-05-26 19:42:29 +02:00
Jacky Bai
08dcbe30be pinctrl: freescale: Add support for imx943 pinctrl
The i.MX943 System Manager (SM) firmware supports the System Control
Management Interface (SCMI) pinctrl protocol, similar to the i.MX95 SM.
The base offset for the i.MX943 IOMUXC Daisy input register differs from
that of the i.MX95. Update the pinctrl-imx-scmi driver to add support for
i.MX943.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/20250516100423.1685732-1-ping.bai@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-21 10:12:14 +02:00
Thomas Richard
2e9ba1d9a3 pinctrl: core: add devm_pinctrl_register_mappings()
Using devm_pinctrl_register_mappings(), the core can automatically
unregister pinctrl mappings.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/20250520-aaeon-up-board-pinctrl-support-v6-3-dcb3756be3c6@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-21 10:09:47 +02:00
Nícolas F. R. A. Prado
1c9977b263 pinctrl: mediatek: eint: Fix invalid pointer dereference for v1 platforms
Commit 3ef9f710ef ("pinctrl: mediatek: Add EINT support for multiple
addresses") introduced an access to the 'soc' field of struct
mtk_pinctrl in mtk_eint_do_init() and for that an include of
pinctrl-mtk-common-v2.h.

However, pinctrl drivers relying on the v1 common driver include
pinctrl-mtk-common.h instead, which provides another definition of
struct mtk_pinctrl that does not contain an 'soc' field.

Since mtk_eint_do_init() can be called both by v1 and v2 drivers, it
will now try to dereference an invalid pointer when called on v1
platforms. This has been observed on Genio 350 EVK (MT8365), which
crashes very early in boot (the kernel trace can only be seen with
earlycon).

In order to fix this, since 'struct mtk_pinctrl' was only needed to get
a 'struct mtk_eint_pin', make 'struct mtk_eint_pin' a parameter
of mtk_eint_do_init() so that callers need to supply it, removing
mtk_eint_do_init()'s dependency on any particular 'struct mtk_pinctrl'.

Fixes: 3ef9f710ef ("pinctrl: mediatek: Add EINT support for multiple addresses")
Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/20250520-genio-350-eint-null-ptr-deref-fix-v2-1-6a3ca966a7ba@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-21 00:39:30 +02:00
Dmitry Baryshkov
41e452e693 pinctrl: qcom: switch to devm_register_sys_off_handler()
Error-handling paths in msm_pinctrl_probe() don't call
a function required to unroll restart handler registration,
unregister_restart_handler(). Instead of adding calls to this function,
switch the msm pinctrl code into using devm_register_sys_off_handler().

Fixes: cf1fc18762 ("pinctrl: qcom: use restart_notifier mechanism for ps_hold")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250513-pinctrl-msm-fix-v2-2-249999af0fc1@oss.qualcomm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-20 23:41:29 +02:00
Alexander Stein
a660d9e885 pinctrl: freescale: Enable driver if platform is enabled.
The pinctrl drivers are not enabled in defconfig. Instead of listing
each driver in the defconfig, enable then by default if the platform/soc
support is enabled as well.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Esben Haabendal <esben@geanix.com>
Link: https://lore.kernel.org/20250514131342.755840-2-alexander.stein@ew.tq-group.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-20 23:39:52 +02:00
Alexander Stein
939be10e5e pinctrl: freescale: Depend imx-scu driver on OF
Although the driver itself does not depend on OF itself, it selects
PINCTRL_IMX which depends on OF. So only select PINCTRL_IMX if OF is
already selected to ensure dependencies are met.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/20250514131342.755840-1-alexander.stein@ew.tq-group.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-20 23:39:52 +02:00
Jiri Slaby (SUSE)
609f900ad6 pinctrl: keembay: Switch to irq_find_mapping()
irq_linear_revmap() is deprecated, so remove all its uses and supersede
them by an identical call to irq_find_mapping().

[ tglx: Fix up subject prefix ]

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/all/20250319092951.37667-48-jirislaby@kernel.org
2025-05-16 21:06:12 +02:00
Jiri Slaby (SUSE)
219182fe21 pinctrl: Switch to irq_domain_create_*()
irq_domain_add_*() interfaces are going away as being obsolete now.
Switch to the preferred irq_domain_create_*() ones. Those differ in the
node parameter: They take more generic struct fwnode_handle instead of
struct device_node. Therefore, of_fwnode_handle() is added around the
original parameter.

Note some of the users can likely use dev->fwnode directly instead of
indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not
guaranteed to be set for all, so this has to be investigated on case to
case basis (by people who can actually test with the HW).

[ tglx: Fix up subject prefix ]

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/all/20250319092951.37667-31-jirislaby@kernel.org
2025-05-16 21:06:11 +02:00
Linus Walleij
8cefeddf9a Merge branch 'ib-armada-for-v6.16' into devel
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:25:42 +02:00
Gabor Juhos
4229c28323 pinctrl: armada-37xx: propagate error from armada_37xx_pmx_set_by_name()
The regmap_update_bits() function can fail, so propagate its error
up to the stack instead of silently ignoring that.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-7-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
6481c0a833 pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get_direction()
The regmap_read() function can fail, so propagate its error up to
the stack instead of silently ignoring that.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-6-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
bfa0ff804f pinctrl: armada-37xx: propagate error from armada_37xx_pmx_gpio_set_direction()
The armada_37xx_gpio_direction_{in,out}put() functions can fail, so
propagate their error values back to the stack instead of silently
ignoring those.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-5-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
57273ff8bb pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get()
The regmap_read() function can fail, so propagate its error up to
the stack instead of silently ignoring that.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-4-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
0396a8731e pinctrl: armada-37xx: propagate error from armada_37xx_gpio_direction_output()
The regmap_update_bits() function can fail, so propagate its error
up to the stack instead of silently ignoring that.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-3-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
e6ebd49429 pinctrl: armada-37xx: set GPIO output value before setting direction
Changing the direction before updating the output value in the
OUTPUT_VAL register may result in a glitch on the output line
if the previous value in the OUTPUT_VAL register is different
from the one we want to set.

In order to avoid that, update the output value before changing
the direction.

Cc: stable@vger.kernel.org
Fixes: 6702abb3bf ("pinctrl: armada-37xx: Fix direction_output() callback behavior")
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-2-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Gabor Juhos
947c93eb29 pinctrl: armada-37xx: use correct OUTPUT_VAL register for GPIOs > 31
The controller has two consecutive OUTPUT_VAL registers and both
holds output value for 32 GPIOs. Due to a missing adjustment, the
current code always uses the first register while setting the
output value whereas it should use the second one for GPIOs > 31.

Add the missing armada_37xx_update_reg() call to adjust the register
according to the 'offset' parameter of the function to fix the issue.

Cc: stable@vger.kernel.org
Fixes: 6702abb3bf ("pinctrl: armada-37xx: Fix direction_output() callback behavior")
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-1-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-15 00:18:14 +02:00
Linus Walleij
86ea0b826f Samsung pinctrl drivers changes for v6.16
Refactor the driver suspend and resume to handle Google GS101 EINT GPIO
 pin banks and add the alive pin bank for that SoC.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmgjJegQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD18A8D/0cy75aTDo+XmIazXla+NFTg0xc2mhPbV3W
 p5bNPaBwlnbES8hHPDS32kS3mYkXBErCzoWgKl08CsyJ6fS+b9/R7Azc+N4+FA/i
 lytU4xGzcq7YKqWYa2Y6EJtdI5xEweFbaQHnq4IGJsSFVvZEYNgQHE7lEh6Ugzka
 7r2/AjnruaSWr/NqRLh0FfJnixaCgpAZcj9GimLmedh9PeRFICuD+jS6cBw9ieEz
 Idg/4ZfA+QanBJqetd3Q+IDE7QY4TcwZSqmI5sxd4UOFAhUlT5FqEaj9C1H8Ff8G
 cFEbXi1Nz7a5u655Li43rds+sLq/1wl/uZ1YzAYNlRkKht6kobW6tVF2adudV+7v
 r92wEHgDLa3E155e1DEY3oWOtJZ39hR7AL0ZXyWAwOADecfgFCxul8c3QdY7aDHL
 6hBRxjVZf3C1QsQbZjviXzSb3KIrLS9FnS7NJD17LijDlR5LYYGzMKvNo08mG6hD
 Wqw+HZLvI3UxzNnPUyWxGRZzhSW/PXCX+kbPO7z0HF27Awek6nshh3Rmw0jWGPXv
 nDKGZjHRCxvc795bNMpa4N11qnc38TxkRHkw/Vofpq8r2hbnYdxNuMpu7h79854B
 iAB5pE6a6PLHTKcJxxsdUZ2ssA/wtIZTH0h858uZuioB0/jcmobPk+1/TbmqWFYv
 cUAMYAOJVA==
 =wwRs
 -----END PGP SIGNATURE-----

Merge tag 'samsung-pinctrl-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel

Samsung pinctrl drivers changes for v6.16

Refactor the driver suspend and resume to handle Google GS101 EINT GPIO
pin banks and add the alive pin bank for that SoC.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-14 00:01:56 +02:00
Krzysztof Kozlowski
a5fd6b67fe pinctrl: meson: Drop unused aml_pctl_find_group_by_name()
aml_pctl_find_group_by_name() is not used anywhere, as reported by W=1
clang build:

  pinctrl-amlogic-a4.c:600:2: error: unused function 'aml_pctl_find_group_by_name' [-Werror,-Wunused-function]

Fixes: 6e9be3abb7 ("pinctrl: Add driver support for Amlogic SoCs")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/20250509150114.299962-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 23:51:56 +02:00
Andy Shevchenko
762ef7d1e6 pinctrl: at91: Fix possible out-of-boundary access
at91_gpio_probe() doesn't check that given OF alias is not available or
something went wrong when trying to get it. This might have consequences
when accessing gpio_chips array with that value as an index. Note, that
BUG() can be compiled out and hence won't actually perform the required
checks.

Fixes: 6732ae5cb4 ("ARM: at91: add pinctrl support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Closes: https://lore.kernel.org/r/202505052343.UHF1Zo93-lkp@intel.com/
Link: https://lore.kernel.org/20250508200807.1384558-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 15:26:51 +02:00
Bartosz Golaszewski
3b38cce83f pinctrl: add stubs for OF-specific pinconf functions
Allow building drivers using these interfaces with COMPILE_TEST enabled
and OF disabled by providing stub definitions.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505072245.OgSXI1hh-lkp@intel.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250507143551.47056-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 15:05:45 +02:00
Lijuan Gao
32b5361a0d pinctrl: qcom: correct the ngpios entry for QCS8300
Correct the ngpios entry to account for the UFS_RESET pin, which is
expected to be wired to the reset pin of the primary UFS memory and is
exported as GPIOs in addition to the real GPIOs, allowing the UFS driver
to toggle it.

Fixes: 0c4cd2cc87 ("pinctrl: qcom: add the tlmm driver for QCS8300 platforms")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Lijuan Gao <quic_lijuang@quicinc.com>
Link: https://lore.kernel.org/20250506-correct_gpio_ranges-v3-4-49a7d292befa@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 14:53:23 +02:00
Lijuan Gao
d18cdb975b pinctrl: qcom: correct the ngpios entry for QCS615
Correct the ngpios entry to account for the UFS_RESET pin being exported
as a GPIO in addition to the real GPIOs, allowing the UFS driver to toggle
it.

Fixes: b698f36a9d ("pinctrl: qcom: add the tlmm driver for QCS615 platform")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Lijuan Gao <quic_lijuang@quicinc.com>
Link: https://lore.kernel.org/20250506-correct_gpio_ranges-v3-3-49a7d292befa@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 14:53:23 +02:00
Rafael J. Wysocki
dc918c34e2 pinctrl: amd: Fix hibernation support with CONFIG_SUSPEND unset
After recent changes, pinctrl-amd will not support hibernation when
CONFIG_HIBERNATION is set and CONFIG_SUSPEND isn't because it will not
register amd_gpio_pm_ops then.

Address this by restoring dependencies on CONFIG_PM_SLEEP where
necessary for hibernation support.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/5889368.DvuYhMxLoT@rjwysocki.net
2025-05-13 13:45:19 +02:00
Linus Walleij
7620eeaa90 pinctrl: renesas: Updates for v6.16
- Add support for the RZ/V2N (R9A09G056) Soc.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCaB4HugAKCRCKwlD9ZEnx
 cEtPAP9cIjbwqTuO10trGm6lOhyQUQpgCMb9xjQXgT6lLVtn3wD+Jlf/N97aGDdw
 u2v3w+YP5/bcSxQvOSRRHIZVZAhHcw0=
 =a6Y8
 -----END PGP SIGNATURE-----

Merge tag 'renesas-pinctrl-for-v6.16-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel

pinctrl: renesas: Updates for v6.16

  - Add support for the RZ/V2N (R9A09G056) Soc.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-13 00:39:50 +02:00
Bartosz Golaszewski
941a099ddc pinctrl: bcm2835: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-bcm-v1-3-6b8883d79b66@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:05:52 +02:00
Bartosz Golaszewski
6752dbe5b6 pinctrl: bcm: iproc-gpio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-bcm-v1-2-6b8883d79b66@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:05:52 +02:00
Bartosz Golaszewski
c84c4a1db6 pinctrl: bcm: nsp-gpio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-bcm-v1-1-6b8883d79b66@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:05:52 +02:00
Bartosz Golaszewski
23a5fa371c pinctrl: mediatek: common: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-mediatek-v1-5-93e6a01855e7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:04:45 +02:00
Bartosz Golaszewski
8a3f17df00 pinctrl: mediatek: moore: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-mediatek-v1-4-93e6a01855e7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:04:45 +02:00
Bartosz Golaszewski
1849d1a3d3 pinctrl: mediatek: paris: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-mediatek-v1-3-93e6a01855e7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:04:45 +02:00
Bartosz Golaszewski
9c791cbaf3 pinctrl: mediatek: paris: don't double-check the GPIO number
GPIO core already makes sure we don't pass invalid GPIO numbers down to
the driver callbacks. Remove needless checks from the driver.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-mediatek-v1-2-93e6a01855e7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:04:45 +02:00
Bartosz Golaszewski
7464c88169 pinctrl: mediatek: airoha: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/20250425-gpiochip-set-rv-pinctrl-mediatek-v1-1-93e6a01855e7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-09 10:04:45 +02:00
Bartosz Golaszewski
781411f0ee pinctrl: at91: drop unneeded dependency on OF_GPIO
This driver does not use any symbols from gpiolib-of.c. There's no
reason for it to select OF_GPIO directly. This addresses a kismet issue
reported by the build bot.

Fixes: 8e86af65f3 ("pinctrl: at91: allow building the module with COMPILE_TEST=y")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505010447.kUlI61vt-lkp@intel.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250502100841.113091-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-05-08 22:12:13 +02:00
Mario Limonciello
b841c1d84a pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops'
`pinctrl_amd_s2idle_dev_ops` is hidden under both `CONFIG_ACPI` and
`CONFIG_PM_SLEEP` so the functions that use it need the same scope.

Adjust checks to look for both, and while updating make it CONFIG_SUSPEND
instead as that's what the ACPI header uses.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504100420.88UPkUTU-lkp@intel.com/
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20250414203551.779320-1-superm1@kernel.org
[ rjw: Add missing #ifdef/#endif block ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-05-06 15:54:05 +02:00
Lad Prabhakar
5488aa013e pinctrl: renesas: rzg2l: Add support for RZ/V2N SoC
Add pinctrl support for the Renesas RZ/V2N SoC by reusing the existing
RZ/V2H(P) pin configuration data. The PFC block is nearly identical, with
the only difference being the absence of `PCIE1_RSTOUTB` on RZ/V2N.

To handle this, the rzv2h_dedicated_pins array is refactored into a common
and pcie1 subset. This enables reuse of the common portion across both
SoCs, while excluding PCIE1_RSTOUTB for RZ/V2N.

This change allows the pinctrl-rzg2l driver to support RZ/V2N without
duplicating large parts of the RZ/V2H configuration.

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/20250415130854.242227-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2025-05-05 10:50:10 +02:00
Bartosz Golaszewski
9e4c444755 pinctrl: samsung: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-12-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:46 +02:00
Bartosz Golaszewski
e52254e5ce pinctrl: pistachio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-11-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:46 +02:00
Bartosz Golaszewski
8152769f9f pinctrl: armada-37xx: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-10-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:46 +02:00
Bartosz Golaszewski
b0dfc1bd6f pinctrl: at91: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-9-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
8e86af65f3 pinctrl: at91: allow building the module with COMPILE_TEST=y
Extend the build coverage by allowing to build the module with
COMPILE_TEST enabled. We can do this as the driver doesn't depend on any
architecture-specific bits.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-8-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
f0401cce03 pinctrl: microchip-sgpio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-7-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
eac1183a17 pinctrl: ingenic: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-6-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
43c8981b02 pinctrl: stm32: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-5-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
059f547079 pinctrl: owl: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-4-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
8657c6ee9b pinctrl: stmfx: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-3-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:45 +02:00
Bartosz Golaszewski
fa10247914 pinctrl: axp209: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-2-504f91120b99@linaro.org
[Drop unnecessary curly braces]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:34:19 +02:00
Bartosz Golaszewski
ec08e2c670 pinctrl: amd: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250424-gpiochip-set-rv-pinctrl-part2-v1-1-504f91120b99@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:30:59 +02:00
Maulik Shah
12b8a672d2 pinctrl: qcom: Fix PINGROUP definition for sm8750
On newer SoCs intr_target_bit position is at 8 instead of 5. Fix it.

Also add missing intr_wakeup_present_bit and intr_wakeup_enable_bit which
enables forwarding of GPIO interrupts to parent PDC interrupt controller.

Fixes: afe9803e3b ("pinctrl: qcom: Add sm8750 pinctrl driver")
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Melody Olvera <melody.olvera@oss.qualcomm.com>
Link: https://lore.kernel.org/20250429-pinctrl_sm8750-v2-1-87d45dd3bd82@oss.qualcomm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-29 10:27:25 +02:00
Dan Carpenter
446d285847 pinctrl: mediatek: common-v1: Fix error checking in mtk_eint_init()
The devm_kzalloc() function doesn't return error pointers, it returns
NULL on error.  Then on the next line it checks the same pointer again
by mistake, "->base" instead of "->base[0]".

Fixes: fe412e3a6c ("pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/aAijc10fHka1WAMX@stanley.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-23 12:58:57 +02:00
Hao Chang
34024cf69c pinctrl: mediatek: Fix new design debounce issue
Calculate the true offset of eint according to index.

Fixes: 3ef9f710ef ("pinctrl: mediatek: Add EINT support for multiple addresses")
Signed-off-by: Hao Chang <ot_chhao.chang@mediatek.com>
Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Link: https://lore.kernel.org/20250422075216.14073-1-ot_chhao.chang@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-23 10:45:23 +02:00
Hao Chang
bd91eae5dc pinctrl: mediatek: pinctrl: mediatek: add mt8196 eint pin
Add eint pin support for MediaTek mt8196 SoC.

Signed-off-by: Hao Chang <ot_chhao.chang@mediatek.com>
Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Acked-by: Cathy Xu (许华婷) <ot_cathy.xu@mediatek.com>
Link: https://lore.kernel.org/20250411084159.3307-1-ot_chhao.chang@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-23 10:40:50 +02:00
Yixun Lan
5a740280de pinctrl: spacemit: add clock support for K1 SoC
For SpacemiT K1 SoC's pinctrl, explicitly acquiring clocks in
the driver instead of relying on bootloader or default hardware
settings to enable it.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
Reviewed-by: Alex Elder <elder@riscstar.com>
Link: https://lore.kernel.org/20250416-02-k1-pinctrl-clk-v2-2-2b5fcbd4183c@gentoo.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-23 10:39:03 +02:00
Chen-Yu Tsai
fe412e3a6c pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers
When EINT support for multiple addresses was introduced, the driver
library for the older generations (pinctrl-mtk-common) was not fixed
together. This resulted in invalid pointer accesses.

Fix up the filled in |struct mtk_eint| in pinctrl-mtk-common to match
what is now expected by the mtk-eint library.

Reported-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Tested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Closes: https://lore.kernel.org/all/43nd5jxpk7b7fv46frqlfjnqfh5jlpqsemeoakqzd4wdi3df6y@w7ycd3k5ezvn/
Fixes: 3ef9f710ef ("pinctrl: mediatek: Add EINT support for multiple addresses")
Cc: Hao Chang <ot_chhao.chang@mediatek.com>
Cc: Qingliang Li <qingliang.li@mediatek.com>
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/20250415112339.2385454-1-wenst@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:44:52 +02:00
Linus Walleij
92b17a6390 pinctr: nomadik: abx500: Restrict compile test
The ABX500 module depends hard on AB8500_CORE it cannot
be compile-tested in isolation.

Fixes: 720abc5c58 ("pinctrl: abx500: enable building modules with COMPILE_TEST=y")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/20250417-abx500-pinctrl-v1-1-0691ad29e2a6@linaro.org
2025-04-17 09:40:43 +02:00
Guodong Liu
f7a29377c2 pinctrl: mediatek: Add pinctrl driver on mt8196
Add pinctrl driver support for MediaTek Soc mt8196.

Signed-off-by: Guodong Liu <guodong.liu@mediatek.com>
Signed-off-by: Cathy Xu <ot_cathy.xu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/20250414090215.16091-4-ot_cathy.xu@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
AngeloGioacchino Del Regno
8004507179 pinctrl: mediatek: Add pinctrl driver for MT6893 Dimensity 1200
Add support for the MediaTek Dimensity 1200 (MT6893) SoC's
GPIO/pinmux controller.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/20250410144044.476060-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
454071ac3c pinctrl: qcom: ssbi-mpp: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-6-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
cd5a048c1a pinctrl: qcom: ssbi-gpio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-5-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
b9b4e5bd53 pinctrl: qcom: spmi-mpp: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-4-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
1c3f1c1d83 pinctrl: qcom: spmi-gpio: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-3-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
4dc41ae5c0 pinctrl: qcom: msm: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-2-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
17bb810d74 pinctrl: qcom: lpass-lpi: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250410-gpiochip-set-rv-pinctrl-qcom-v1-1-6a6891338aae@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Wojciech Slenska
c0e1e86173 pinctrl: qcom: pinctrl-qcm2290: Add egpio support
qcm2290 supports the egpio feature on GPIOs ranging from 98 to 126.
This change is necessary to allow these GPIOs to be driven by TLMM.

Signed-off-by: Wojciech Slenska <wojciech.slenska@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/20250409080030.62254-1-wojciech.slenska@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
1437b5af85 pinctrl: cy8c95x0: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-10-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
089f1cad35 pinctrl: ocelot: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-9-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
88c7e0bb9e pinctrl: sx150x: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-8-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-17 09:39:15 +02:00
Bartosz Golaszewski
e1d2a8ec9a pinctrl: amlogic-a4: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-6-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:10 +02:00
Bartosz Golaszewski
18ef5d5b4d pinctrl: meson: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-5-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:10 +02:00
Bartosz Golaszewski
4f15389ba3 pinctrl: abx500: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-4-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:09 +02:00
Bartosz Golaszewski
720abc5c58 pinctrl: abx500: enable building modules with COMPILE_TEST=y
Increase the build coverage by enabling the abx500 modules with
COMPILE_TEST=y.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-3-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:09 +02:00
Bartosz Golaszewski
9e8c4a2e4c pinctrl: rk805: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-2-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:09 +02:00
Bartosz Golaszewski
d843a42635 pinctrl: at91-pio4: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/20250408-gpiochip-set-rv-pinctrl-part1-v1-1-c9d521d7c8c7@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 23:48:09 +02:00
Krzysztof Kozlowski
b883eb49ec pinctrl: uniphier: Do not enable by default during compile testing
Enabling the compile test should not cause automatic enabling of all
drivers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20250404115719.309999-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 10:08:42 +02:00
Krzysztof Kozlowski
10dca7cdd4 pinctrl: meson: Do not enable by default during compile testing
Enabling the compile test should not cause automatic enabling of all
drivers.  Restrict the default to ARCH also for individual drivers, even
though their choice is not visible without selecting parent Kconfig
symbol, because otherwise selecting parent would select the child during
compile testing.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/20250404115719.309999-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 10:08:42 +02:00
Christian Marangi
457d9772e8 pinctrl: airoha: fix wrong PHY LED mapping and PHY2 LED defines
The current PHY2 LED define are wrong and actually set BITs outside the
related mask. Fix it and set the correct value. While at it, also use
FIELD_PREP_CONST macro to make it simple to understand what values are
actually applied for the mask.

Also fix wrong PHY LED mapping. The SoC Switch supports up to 4 port but
the register define mapping for 5 PHY port, starting from 0. The mapping
was wrongly defined starting from PHY1. Reorder the function group to
start from PHY0. PHY4 is actually never supported as we don't have a
GPIO pin to assign.

Cc: stable@vger.kernel.org
Fixes: 1c8ace2d07 ("pinctrl: airoha: Add support for EN7581 SoC")
Reviewed-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/20250401135026.18018-1-ansuelsmth@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:59:04 +02:00
Martin Blumenstingl
e56088a137 pinctrl: meson: define the pull up/down resistor value as 60 kOhm
The public datasheets of the following Amlogic SoCs describe a typical
resistor value for the built-in pull up/down resistor:
- Meson8/8b/8m2: not documented
- GXBB (S905): 60 kOhm
- GXL (S905X): 60 kOhm
- GXM (S912): 60 kOhm
- G12B (S922X): 60 kOhm
- SM1 (S905D3): 60 kOhm

The public G12B and SM1 datasheets additionally state min and max
values:
- min value: 50 kOhm for both, pull-up and pull-down
- max value for the pull-up: 70 kOhm
- max value for the pull-down: 130 kOhm

Use 60 kOhm in the pinctrl-meson driver as well so it's shown in the
debugfs output. It may not be accurate for Meson8/8b/8m2 but in reality
60 kOhm is closer to the actual value than 1 Ohm.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/20250329190132.855196-1-martin.blumenstingl@googlemail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:47:37 +02:00
John Madieu
434ad6905a pinctrl: apple: Make regmap_config static const and fix indentation
Mark the regmap_config as static const since it is only used in this file
and never modified, allowing the compiler to optimize it and enforce
const-correctness.

Also fix minor indentation inconsistencies in function parameter alignment
to conform with kernel coding style.

Signed-off-by: John Madieu <john.madieu@labcsmart.com>
Link: https://lore.kernel.org/20250329181506.890043-1-john.madieu@labcsmart.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:46:31 +02:00
Hao Chang
86dee87f4b pinctrl: mediatek: Fix the invalid conditions
The variable count_reg_names is defined as an int type and cannot be
directly compared to an unsigned int. To resolve this issue,
first verify the correctness of count_reg_names.

Link: https://lore.kernel.org/all/5ae93d42e4c4e70fb33bf35dcc37caebf324c8d3.camel@mediatek.com/T/
Signed-off-by: Hao Chang <ot_chhao.chang@mediatek.com>
Signed-off-by: Qingliang Li <qingliang.li@mediatek.com>
Link: https://lore.kernel.org/20250329024533.5279-1-ot_chhao.chang@mediatek.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:45:07 +02:00
Hui Wang
e64c0ff0d5 pinctrl: imx: Return NULL if no group is matched and found
Currently if no group is matched and found, this function will return
the last grp to the caller, this is not expected, it is supposed to
return NULL in this case.

Fixes: e566fc11ea ("pinctrl: imx: use generic pinctrl helpers for managing groups")
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/20250327031600.99723-1-hui.wang@canonical.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:42:15 +02:00
Charles Han
1938be9fba pinctrl: qcom: tlmm-test: Fix potential null dereference in tlmm kunit test
kunit_kzalloc() may return a NULL pointer, dereferencing it without
NULL check may lead to NULL dereference.
Add a NULL check for grp.

Fixes: c7984dc0a2 ("pinctrl: qcom: Add test case for TLMM interrupt handling")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Link: https://lore.kernel.org/20250325094932.4733-1-hanchunchao@inspur.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:23:07 +02:00
Mike Looijmans
3ede3f8b4b pinctrl: mcp23s08: Reset all pins to input at probe
At startup, the driver just assumes that all registers have their
default values. But after a soft reset, the chip will just be in the
state it was, and some pins may have been configured as outputs. Any
modification of the output register will cause these pins to be driven
low, which leads to unexpected/unwanted effects. To prevent this from
happening, set the chip's IO configuration register to a known safe
mode (all inputs) before toggling any other bits.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Link: https://lore.kernel.org/20250314151803.28903-1-mike.looijmans@topic.nl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-15 09:17:39 +02:00
Wentao Liang
a63cafe241 pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux()
In atmel_pctl_dt_subnode_to_map(), the return value of
pinctrl_utils_add_map_mux() needs to be checked, for the function
will fail to associate group when the group map is full. Add error
handling for pinctrl_utils_add_map_mux() to return immediately and
propagate the error code to caller function when the function fails.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/20250318030717.781-1-vulab@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-04-11 00:33:56 +02:00
Mario Limonciello
179db1909c pinctrl: amd: Add an LPS0 check() callback
During suspend the pinctrl_amd driver disables the interrupts for
any GPIOs that are not marked as wake sources.

This however does not prevent them from changing the wake status
bit during suspend, it just stops the system from waking.

If the system wakes from hardware sleep for another reason (such
as plugging in the AC adapter) this wake bits might be active.

This could potentially cause problems with going back to hardware
sleep.  Add an extra debugging message when PM debugging is enabled
to help identify if this is happening.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3929
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20250407183656.1503446-2-superm1@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-04-09 16:10:37 +02:00
Peter Griffin
a30692b4f8 pinctrl: samsung: Add filter selection support for alive bank on gs101
Newer Exynos based SoCs have a filter selection bitfield in the filter
configuration registers on alive bank pins. This allows the selection of
a digital or analog delay filter for each pin. Add support for selecting
and enabling the filter.

On suspend we set the analog filter to all pins in the bank (as the
digital filter relies on a clock). On resume the digital filter is
reapplied to all pins in the bank. The digital filter is working via
a clock and has an adjustable filter delay flt_width bitfield, whereas
the analog filter uses a fixed delay.

The filter determines to what extent signal fluctuations received through
the pad are considered glitches.

The code path can be exercised using
echo mem > /sys/power/state
And then wake the device using a eint gpio

Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20250402-pinctrl-fltcon-suspend-v6-4-78ce0d4eb30c@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-04-08 20:57:51 +02:00
Peter Griffin
bdbe0a0f71 pinctrl: samsung: add gs101 specific eint suspend/resume callbacks
gs101 differs to other SoCs in that fltcon1 register doesn't
always exist. Additionally the offset of fltcon0 is not fixed
and needs to use the newly added eint_fltcon_offset variable.

Fixes: 4a8be01a1a ("pinctrl: samsung: Add gs101 SoC pinctrl configuration")
Cc: stable@vger.kernel.org  # depends on the previous three patches
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20250402-pinctrl-fltcon-suspend-v6-3-78ce0d4eb30c@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-04-08 20:57:47 +02:00
Peter Griffin
77ac6b742e pinctrl: samsung: add dedicated SoC eint suspend/resume callbacks
Refactor the existing platform specific suspend/resume callback
so that each SoC variant has it's own callback containing the
SoC specific logic.

This allows exynosautov920 to have a dedicated function for using
eint_con_offset and eint_mask_offset. Also it is easily extendable
for gs101 which will need dedicated logic for handling the varying
register offset of fltcon0 via eint_fltcon_offset.

Reviewed-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20250402-pinctrl-fltcon-suspend-v6-2-78ce0d4eb30c@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-04-08 20:57:47 +02:00
Peter Griffin
3ade961e97 pinctrl: samsung: refactor drvdata suspend & resume callbacks
This enables the clk_enable() and clk_disable() logic to be removed
from each callback, but otherwise should have no functional impact.

It is a prepatory patch so that the callbacks can become SoC
specific.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Link: https://lore.kernel.org/r/20250402-pinctrl-fltcon-suspend-v6-1-78ce0d4eb30c@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-04-08 20:57:46 +02:00
Linus Torvalds
29d9983b2c Pin control changes for the v6.15 kernel cycle:
Core changes:
 
 - None really.
 
 New drivers:
 
 - AMD ISP411 "AMD ISP" driver.
 
 - Exynos 2200 and 7870 SoC subdrivers.
 
 - Sophgo RISC-V SG2042 and SG2044 subdrivers.
 
 - Amlogic A4 subdriver.
 
 - Rockchip RK3528 subdriver.
 
 - Broadcom BCM21664 subdriver.
 
 - Allwinner A523/T527 subdriver.
 
 - Ingenic X1600 subdriver.
 
 - Microchip SAMA7D65 subdriver, essentially a re-branded
   Atmel AT91 PIO4 driver, but nowadays a Microschip SoC line.
 
 Improvements:
 
 - Bring in the devm_kmemdup_array() helper and use it throughout,
   also bring in changes to other subsystems for this to establish
   this helper.
 
 - Support EGPIO on the Qualcomm SA8775P SoC.
 
 - Extend EINT support in the Mediatek driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmfmehEACgkQQRCzN7AZ
 XXMP7xAAislvKr11tILu/pJerSOI+OI6VcqJHa+u2AZbW/KuVpfMJNM5por5eXrX
 sCKJh86zXd39fhC5znLFaESvrmCWdwjPu4HKfHA+BsPLOt3mEbM6XQUlxHJnnU8A
 JrLDZFit7odPFxou9nApdd6QtM+Pqaaib4YSXFDrvULNyjoi0O6/NDuoOjunV4q9
 C0S1yHSVOqO91qTZqpFE1PMVdNgzO7EmQ8UYQgGSPijl4NRS9CP7lFAxD9Z0VGhh
 4Yjnlhr3ZSn3VklbGTBN8AcC8Yv69KSh2oYrue90PQwYI9yo3twIplqEIVFkDm39
 27oLZoC+RLXNPTbrzSsdYwzti2Rg7mObJC7WMxyrl4wbu1ikzuBG8HjSj1Ai0Vmt
 f4uchPA2w+L5hP0WLhujd7ocXrG2YNohjaduYZU/1y6Cvu2L7kF6+MK/fjlFWbVr
 7JIKAR7ALvkpmPLQoUTsJxKLrwbvY5Q6Qh6plLdh6/L0rNQ1tLrJpklHhf3VzkCC
 GuZSyC89Ym1smKO3XcfC+cmVUVheJQj0/NoY59RBkc0rDgApc6Uvs0icELBoDpLr
 4XmghtMFdhTdUEs6n9Q4laEbHgYBAKrnN0BYWvaCmBxnZBZbUO44G7sbFOTMC+9l
 wFs7MnH0f0YmzeF1LDz5z/oF8T3Xl0xMUL7qWoSu4zS1gjziJP8=
 =iPMS
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "Core changes:

   - None really.

  New drivers:

   - AMD ISP411 "AMD ISP" driver

   - Exynos 2200 and 7870 SoC subdrivers

   - Sophgo RISC-V SG2042 and SG2044 subdrivers

   - Amlogic A4 subdriver

   - Rockchip RK3528 subdriver

   - Broadcom BCM21664 subdriver

   - Allwinner A523/T527 subdriver

   - Ingenic X1600 subdriver

   - Microchip SAMA7D65 subdriver, essentially a re-branded Atmel AT91
     PIO4 driver, but nowadays a Microschip SoC line

  Improvements:

   - Bring in the devm_kmemdup_array() helper and use it throughout,
     also bring in changes to other subsystems for this to establish
     this helper

   - Support EGPIO on the Qualcomm SA8775P SoC

   - Extend EINT support in the Mediatek driver"

* tag 'pinctrl-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (101 commits)
  pinctrl: mediatek: Add EINT support for multiple addresses
  pinctrl: amlogic-a4: Drop surplus semicolon
  pinctrl: nuvoton: Reduce use of OF-specific APIs
  pinctrl: nuvoton: Convert to use struct group_desc
  pinctrl: nuvoton: Make use of struct pinfunction and PINCTRL_PINFUNCTION()
  pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  pinctrl: npcm8xx: Fix incorrect struct npcm8xx_pincfg assignment
  pinctrl: tegra: Fix off by one in tegra_pinctrl_get_group()
  pinctrl: PINCTRL_AMDISP should depend on DRM_AMD_ISP
  pinctrl: qcom: sa8775p: Enable egpio function
  dt-bindings: pinctrl: qcom: Add egpio function for sa8775p
  pinctrl: qcom: tlmm-test: Validate irq_enable delivers edge irqs
  pinctrl: qcom: Clear latched interrupt status when changing IRQ type
  dt-bindings: pinctrl: airoha: Add missing gpio-ranges property
  pinctrl: bcm281xx: Add missing assignment in bcm21664_pinctrl_lock_all()
  pinctrl: amd: isp411: Fix IS_ERR() vs NULL check in probe()
  dt-bindings: pinctrl: at91-pio4: add microchip,sama7d65-pinctrl
  pinctrl: tegra: Set SFIO mode to Mux Register
  pinctrl-tegra: Restore SFSEL bit when freeing pins
  pinctrl: tegra: Add descriptions for SoC data fields
  ...
2025-03-29 16:59:16 -07:00
Hao Chang
3ef9f710ef 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>
2025-03-24 08:51:09 +01:00
Linus Walleij
5df0211a67 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>
2025-03-22 21:33:43 +01:00
Andy Shevchenko
693c9ecd83 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>
2025-03-20 09:14:10 +01:00
Andy Shevchenko
d52ecc655a 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>
2025-03-20 09:14:10 +01:00
Andy Shevchenko
1bce744173 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>
2025-03-20 09:14:10 +01:00
Andy Shevchenko
1a65846509 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>
2025-03-20 09:14:10 +01:00
Andy Shevchenko
113ec87b0f 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: acf4884a57 ("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>
2025-03-20 09:14:09 +01:00
Dan Carpenter
5a062c3c3b 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: c12bfa0fee ("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>
2025-03-20 09:12:44 +01:00
Geert Uytterhoeven
813b1a1a21 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: e97435ab09 ("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>
2025-03-18 15:23:52 +01:00
Geert Uytterhoeven
c746ff4a67 pinctrl: spacemit: PINCTRL_SPACEMIT_K1 should not default to y unconditionally
Merely enabling compile-testing should not enable additional
functionality.

Fixes: 7ff4faba63 ("pinctrl: spacemit: enable config option")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Alex Elder <elder@riscstar.com>
Reviewed-by: Alex Elder <elder@riscstar.com>
Link: https://lore.kernel.org/6881b8d1ad74ac780af8a974e604b5ef3f5d4aad.1742198691.git.geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2025-03-18 14:11:46 +01:00
Linus Walleij
eb8578843f 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmfW4GQQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD13QSEACYr14mY3bEzRDyxchkOiwi50uNgieKCI2/
 JQIEs/TtGqDAlvwN+OODkyIKzwyc0PDkbKGBP/kUOblHr/4i9H06dT653d8mgzkZ
 Kkoe9SLeniW717YCS9N5vrZOYmQNIqYA0rEHFO5G45fAWQCNomFjrbtakkdG4Zx3
 jEEGoxFygR4Pu4vymEYhdzX8W3KgcqNQEwxf6gN+HOM18DNq/0zW6lcP6Pe66eaR
 3VcoyvaU7B8UAJOLecOwKOfcCc1g32+hBkWuLHsSwcky8yK/Nt6sW7xbeUflcEwU
 XYJeqv9B4OzPHNiTVovAgBw/ZRcv1x4jeajqI0+pU22JZj80orI+lzQEBpjRpUmh
 u6g/e8K9Y/66Xnyt/T5fvTWlkOkSWZh0tL3aqcS6JJ/7RNFB9FBaClydlyEAprhs
 UZ1ACsX9xZz+XeKIL864zQlUa/lKJWcS+bzviuqB83Kqtwqv6tW2ijReco87MIaf
 jeP6IGlFFotLofCfphbLn8ppuiG+r+1aZKfZryMurL27KM4LL/cffWTYxyvgOjZs
 IoxIfZaXtJrJk7B7U5mmajMziT7Mzly7fQIuTDmlSWNnxi7xklCkvLFzW//r4341
 2jFjIsX3avNzsckq3laJtLX36w5oOlv1V8RIdWOOE4YlsBZhIXEZj2HIznPhdnCd
 2MccU8vOrg==
 =H+LK
 -----END PGP SIGNATURE-----

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>
2025-03-18 11:09:15 +01:00
Wasim Nazir
a326b0523f 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>
2025-03-17 14:24:45 +01:00
Bjorn Andersson
b938feb790 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>
2025-03-17 14:24:45 +01:00
Stephan Gerhold
e225128c3f 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: cf9d052aa6 ("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>
2025-03-17 14:24:45 +01:00
Dan Carpenter
774e344716 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: 60d69769c8 ("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>
2025-03-17 14:24:45 +01:00
Dan Carpenter
465cf67671 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: e97435ab09 ("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>
2025-03-17 14:24:45 +01:00
Prathamesh Shete
17013f0acb 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: 971dac7123 ("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>
2025-03-17 14:24:21 +01:00
Prathamesh Shete
c12bfa0fee 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>
2025-03-14 11:03:49 +01:00
Prathamesh Shete
4fd41e74bd 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>
2025-03-14 11:03:49 +01:00
Bartosz Golaszewski
597b3627d5 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>
2025-03-14 11:02:08 +01:00
H. Nikolaus Schaller
8171e7b929 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>
2025-03-14 10:51:23 +01:00
H. Nikolaus Schaller
4b490ccbc3 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>
2025-03-14 10:51:23 +01:00
Paul Boddie
4da56f9c6f 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>
2025-03-14 10:51:22 +01:00
Andre Przywara
b8a51e95b3 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>
2025-03-13 14:48:57 +01:00
Andre Przywara
648be4cd95 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>
2025-03-13 14:48:57 +01:00
Andre Przywara
f5e2cd34b1 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>
2025-03-13 14:48:57 +01:00
Andre Przywara
6d079d93e4 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>
2025-03-13 14:48:56 +01:00
Andre Przywara
c6c4dc75a1 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>
2025-03-13 14:48:56 +01:00
Andre Przywara
4713b70cc4 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>
2025-03-13 14:48:56 +01:00
Andre Przywara
12966fdfba 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>
2025-03-13 14:48:55 +01:00
Linus Walleij
bc9527fb07 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()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmfRVwoACgkQb7wzTHR8
 rChzOBAAxUnpx5kPeoWYV7LWtN9GWeO4lRyM86els3nW+wFBJ4qozq5cUO0gw5RA
 vOtCW/ErCja0fs364L1IB2grDF8McmeEqCbLnuuhrrUQ09hd3dGX+8G4kmhzNi4R
 5Hj2cyrTFiOHBrWI5QFe0l6mq3IMVfmzv3VxjD9b/xW7yJ20KTu42cmHpmIvS4xe
 jph5XoCI8FQNPfQB5xu/5IGf0hKwJl3xBGWtRyRVar/KaZfBkrKNXXOrqDcckboP
 A0wXKZyU5DJwvdeOWE05wYUVuOZ+rzwWpZpdk3OmLMTp2Z6e+rJ4DgvkG+xh7zip
 1w9bCaSBS24eYpEvNCjjlnX5zGHrAHg1tu9T802ZcPybmPvGV0gsXEN4+EIKkUOA
 KkVhghci57muWE0OkDblH8w3BYWnM5p9aUs0KoYghjDKKRR34HY6UPau0K407BeO
 zT/5hHzyhd77zzzLY3LKwXUNNpmUKlYcIRwZhrwV19DJhpzftsczt4z3RYgntpmj
 cYAotxlvhgI1RmQsYXmsrwQ6NPOrXb0/Zby1aDTB9EOyY99mb0u5EyQIe4KX2nfS
 eyZyzU4E5eyp4Y2noyYdfJV9XwFK+OH7hdHuvZOsxf59kJWR9fsQSX64XGNomjdW
 F48l0l+Sf3ILHgn459PAvtO22UeoWet3e8LWUMBszZFyCmsZa0I=
 =SG01
 -----END PGP SIGNATURE-----

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>
2025-03-13 09:58:14 +01:00
Linus Walleij
7dadc4b152 pinctrl: renesas: Updates for v6.15 (take two)
- Add missing of_node_put() calls.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZ8sTCwAKCRCKwlD9ZEnx
 cJNoAQCHoa7kwfKCbFIpTRQLX4l3PlzM9gAwoHI6AsfokcgzqwEA7BZFRmhmcXTQ
 HWKP8aeSrfiiKvhrjU5j3hr6n9geWgo=
 =dy1I
 -----END PGP SIGNATURE-----

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>
2025-03-13 09:56:13 +01:00
Peter Griffin
701d0e9109 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: 4a8be01a1a ("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>
2025-03-11 20:37:29 +01:00
Fabrizio Castro
abcdeb4e29 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: b59d0e7827 ("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>
2025-03-06 16:41:46 +01:00
Fabrizio Castro
5a550b0070 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: 92a9b82525 ("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>
2025-03-06 16:41:43 +01:00
Fabrizio Castro
a5779e625e 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: c4c4637eb5 ("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>
2025-03-06 16:41:30 +01:00
Artur Weber
60d69769c8 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>
2025-03-05 09:01:47 +01:00
Artur Weber
596c185284 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>
2025-03-05 09:00:47 +01:00
Artur Weber
07b5a2a13f 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>
2025-03-05 08:53:29 +01:00
Pratap Nirujogi
e97435ab09 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>
2025-03-05 08:47:43 +01:00
Colin Ian King
7f7a793d71 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>
2025-03-04 09:39:32 +01:00
Xianwei Zhao
c3a0b61e49 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: 6e9be3abb7 ("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>
2025-03-04 09:37:33 +01:00
Bartosz Golaszewski
75f87f5d04 pinctrl: bcm2835: don't -EINVAL on alternate funcs from get_direction()
Since commit 9d846b1aeb ("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: 9d846b1aeb ("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>
2025-03-04 08:52:34 +01:00
Steven Liu
a5e4cde647 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>
2025-03-04 08:50:05 +01:00