Commit Graph

6669 Commits

Author SHA1 Message Date
Krzysztof Kozlowski 6ea5c72b04 pinctrl: qcom: lpass-lpi: allow slew rate bit in main pin config register
Existing Qualcomm SoCs have the LPASS pin controller slew rate control
in separate register, however this will change with upcoming Qualcomm
SoCs.  The slew rate will be part of the main register for pin
configuration, thus second device IO address space is not needed.

Prepare for supporting new SoCs by adding flag customizing the driver
behavior for slew rate.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231013145935.220945-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-14 08:44:40 +01:00
Krzysztof Kozlowski 28bb7c555c pinctrl: qcom: lpass-lpi: split slew rate set to separate function
Setting slew rate for each pin will grow with upcoming Qualcomm SoCs,
so split the code responsible for this into separate function for easier
readability and maintenance.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231013145935.220945-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-14 08:44:40 +01:00
Raag Jadav 22f57707fa pinctrl: intel: allow independent COMPILE_TEST
Now that we have completed the transition to standard ACPI helpers for the
entire Intel pinctrl tree, we can detach COMPILE_TEST from ACPI dependency.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 17:50:18 +02:00
Chen Ni b0eeba527e pinctrl: stm32: Add check for devm_kcalloc
Add check for the return value of devm_kcalloc() and return the error
if it fails in order to avoid NULL pointer dereference.

Fixes: 32c170ff15 ("pinctrl: stm32: set default gpio line names using pin names")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20231031080807.3600656-1-nichen@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-13 15:12:29 +01:00
Neil Armstrong 22a4a9ed37 pinctrl: qcom: Introduce the SM8650 Top Level Mode Multiplexer driver
Add Top Level Mode Multiplexer (pinctrl) support for the SM8650 platform.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-tlmm-v3-3-0e179c368933@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-13 15:05:13 +01:00
Neil Armstrong 76b446f5b8 pinctrl: qcom: handle intr_target_reg wakeup_present/enable bits
New platforms uses a new set of bits to control the wakeirq
delivery to the PDC block.

The intr_wakeup_present_bit indicates if the GPIO supports
wakeirq and intr_wakeup_enable_bit enables wakeirq delivery
to the PDC block.

While the name seems to imply this only enables wakeup events,
it is required to allow interrupts events to the PDC block.

Enable this bit in the irq resource request/free if:
- gpio is in wakeirq map
- has the intr_wakeup_present_bit
- the intr_wakeup_enable_bit is set

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231106-topic-sm8650-upstream-tlmm-v3-2-0e179c368933@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-13 15:01:37 +01:00
Krzysztof Kozlowski c4e4767385 pinctrl: qcom: sm8650-lpass-lpi: add SM8650 LPASS
Add driver for the pin controller in Low Power Audio SubSystem (LPASS)
of Qualcomm SM8650 SoC.

Notable differences against SM8550 LPASS pin controller:
1. Additional address space for slew rate thus driver uses
   LPI_FLAG_SLEW_RATE_SAME_REG and sets slew rate via different
   register.

2. Two new pin mux functions: qca_swr_clk and qca_swr_data

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231027093615.140656-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-13 14:58:02 +01:00
Thierry Reding bf800ca415 pinctrl: tegra: Display pin function in pinconf-groups
The function that a pin is muxed to can be read from the top-level
pinctrl-maps debugfs file. However, this only reflects the values that
were specified in device tree, so they will only show deviations from
the hardware default setting. Display the current pinmux setting in the
per-controller pinconf-groups debugfs file along with the rest of the
per-pin configuration settings.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20230929122101.466266-1-thierry.reding@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-13 14:57:22 +01:00
Andy Shevchenko a35c62ba7a pinctrl: intel: Refactor intel_pinctrl_get_soc_data()
Refactor intel_pinctrl_get_soc_data() to drop initial assignment
of the data variable. It's only used in ACPI case and instead
we may always assign it there as the ACPI ID table has the terminator
entry that has driver data set to NULL.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:56:42 +02:00
Andy Shevchenko 6217728b38 pinctrl: intel: Move default strength assignment to a switch-case
iWhen ->pin_config_set() is called from the GPIO library (assumed
GpioIo() ACPI resource), the argument can be 1, when, for example,
PullDefault is provided. In such case we supply sane default in
the driver. Move that default assingment to a switch-case, so
it will be consolidated in one place.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:56:42 +02:00
Andy Shevchenko 0a4cfed79e pinctrl: tangier: Move default strength assignment to a switch-case
iWhen ->pin_config_set() is called from the GPIO library (assumed
GpioIo() ACPI resource), the argument can be 1, when, for example,
PullDefault is provided. In such case we supply sane default in
the driver. Move that default assingment to a switch-case, so
it will be consolidated in one place.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:52:56 +02:00
Andy Shevchenko 2b9282afa8 pinctrl: tangier: Enable 910 Ohm bias
Family 7 (I2C) supports special bias value, i.e. 910 Ohm.

Enable it for configuring pin.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:50:55 +02:00
Andy Shevchenko 649e984f5e pinctrl: intel: Make PM ops functions static
No more users outside of the main module.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-18-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:28 +02:00
Andy Shevchenko ee4c71f577 pinctrl: tigerlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-17-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:28 +02:00
Andy Shevchenko 0a327638cf pinctrl: sunrisepoint: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-16-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:28 +02:00
Andy Shevchenko 4a3b7e6a27 pinctrl: meteorlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-15-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:28 +02:00
Andy Shevchenko 5d5e83f973 pinctrl: lewisburg: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-14-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:28 +02:00
Andy Shevchenko 8e5f001396 pinctrl: lakefield: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-13-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 5ce3422e04 pinctrl: jasperlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-12-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko b70c674cf4 pinctrl: icelake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 3f6791067d pinctrl: geminilake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-10-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko e35ed82182 pinctrl: emmitsburg: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko ec79e6e6fb pinctrl: elkhartlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 6dde85169a pinctrl: denverton: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko a4f777ef30 pinctrl: cedarfork: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 020861b5ce pinctrl: cannonlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 4cc4ff1b24 pinctrl: broxton: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko 33f1c0b0bf pinctrl: alderlake: Switch to use Intel pin control PM ops
The main driver conditionally exports the PM ops structure.
Switch this driver to use it instead of customly wrapped one.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Andy Shevchenko b10a74b5c0 pinctrl: intel: Provide Intel pin control wide PM ops structure
With the help of EXPORT_NS_GPL_DEV_PM_OPS() and
NOIRQ_SYSTEM_SLEEP_PM_OPS() we may convert PM ops functions to become
static. This also takes into account the PM configuration options such
as CONFIG_PM and CONFIG_PM_SLEEP. Hence the first step is to provide
a generic PM ops structure that can be used by drivers directly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231030120734.2831419-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-11-13 13:33:27 +02:00
Bartosz Golaszewski 11d84b2033 pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free()
pinctrl_gpio_*() helpers now have signatures corresponding with those of
the GPIOLIB callbacks. We can drop the wrappers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski de38bdbe01 pinctrl: nuvoton: npcm7xx: drop wrappers around pinctrl_gpio_request/free()
pinctrl_gpio_*() helpers now have signatures corresponding with those of
the GPIOLIB callbacks. We can drop the wrappers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski b04ce10d22 pinctrl: stm32: drop wrappers around pinctrl_gpio_free/input()
pinctrl_gpio_*() helpers now have signatures corresponding with those of
the GPIOLIB callbacks. We can drop the wrappers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski 895bf1d826 pinctrl: starfive: jh7110: drop wrappers around pinctrl_gpio_request/free()
pinctrl_gpio_*() helpers now have signatures corresponding with those of
the GPIOLIB callbacks. We can drop the wrappers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski 0b261df49f pinctrl: starfive: jh7100: drop wrappers around pinctrl_gpio_request/free()
pinctrl_gpio_*() helpers now have signatures corresponding with those of
the GPIOLIB callbacks. We can drop the wrappers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski 653e95f1fc pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski d35e579d60 pinctrl: cirrus: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski c1649a7db4 pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrappers around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski f00f921fd3 pinctrl: mediatek: moore: drop the wrappers around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrappers around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski 5835b3f2a2 pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:23 +01:00
Bartosz Golaszewski 36077c86fe pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski ffed728761 pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 54d9eab19e pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 22c7203db3 pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski b6d83d010d pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input()
pinctrl_gpio_direction_input() now has the same signature as the
wrapper around it so we can drop it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 6042aaef31 pinctrl: change the signature of pinctrl_ready_for_gpio_range()
Modify pinctrl_ready_for_gpio_range() to be in line with public GPIO
helpers and take a pair of GPIO chip & offset as arguments

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 31d4e8d101 pinctrl: change the signature of gpio_to_pin()
Modify gpio_to_pin() to be in line with public GPIO helpers and take
a pair of GPIO chip & offset as arguments.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 58e772f437 pinctrl: change the signature of pinctrl_match_gpio_range()
Modify pinctrl_match_gpio_range() to be in line with public GPIO
helpers and take a pair of GPIO chip & offset as arguments.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 82059c3d78 pinctrl: change the signature of pinctrl_get_device_gpio_range()
Modify pinctrl_get_device_gpio_range() to be in line with public GPIO
helpers and take a pair of GPIO chip & offset as arguments.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 315c4418ac pinctrl: change the signature of pinctrl_gpio_direction()
Modify pinctrl_gpio_direction() to be in line with public GPIO helpers
and take a pair of GPIO chip & offset as arguments.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski acf2981b84 treewide: rename pinctrl_gpio_set_config_new()
Now that pinctrl_gpio_set_config() is no longer used, let's drop the
'_new' suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski b679d6c06b treewide: rename pinctrl_gpio_direction_output_new()
Now that pinctrl_gpio_direction_output() is no longer used, let's drop
the '_new' suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 315c46f9b6 treewide: rename pinctrl_gpio_direction_input_new()
Now that pinctrl_gpio_direction_input() is no longer used, let's drop the
'_new' suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:22 +01:00
Bartosz Golaszewski 4fccb263f3 treewide: rename pinctrl_gpio_free_new()
Now that pinctrl_gpio_free()() is no longer used, let's drop the '_new'
suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski acb38be654 treewide: rename pinctrl_gpio_request_new()
Now that pinctrl_gpio_request() is no longer used, let's drop the '_new'
suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 00762e416c treewide: rename pinctrl_gpio_can_use_line_new()
Now that pinctrl_gpio_can_use_line() is no longer used, let's drop the
'_new' suffix from its improved variant.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski ab56e2bfce pinctrl: remove pinctrl_gpio_set_config()
There are no more users of pinctrl_gpio_set_config() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 45d2055b00 pinctrl: remove pinctrl_gpio_direction_output()
There are no more users of pinctrl_gpio_direction_output() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski aec96797f9 pinctrl: remove pinctrl_gpio_direction_input()
There are no more users of pinctrl_gpio_direction_input() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 1d2c88450f pinctrl: remove pinctrl_gpio_free()
There are no more users of pinctrl_gpio_free() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 699f078463 pinctrl: remove pinctrl_gpio_request()
There are no more users of pinctrl_gpio_request() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski a063e57adf pinctrl: remove pinctrl_gpio_can_use_line()
There are no more users of pinctrl_gpio_can_use_line() so remove it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski c6801e2332 pinctrl: st: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 578d009b1b pinctrl: lynxpoint: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 262abd2d17 pinctrl: intel: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 588ad2b1b6 pinctrl: cherryview: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:21 +01:00
Bartosz Golaszewski 78329866ef pinctrl: ingenic: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 4125651b3d pinctrl: as3722: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski b2979a1786 pinctrl: cy8c95x0: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski f7fdb230ca pinctrl: vt8500: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski ddfba5bde6 pinctrl: axp209: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 47ad5c97ba pinctrl: mediatek: paris: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 6232d8b934 pinctrl: mediatek: common: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 1b5f829b17 pinctrl: mediatek: moore: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 3607ac37a4 pinctrl: cirrus: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 91dff6b66e pinctrl: rk805: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski da70bf79ef pinctrl: ocelot: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski fed493fce8 pinctrl: starfive: jh7110: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski 7cdd1db6af pinctrl: starfive: jh7100: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:20 +01:00
Bartosz Golaszewski a330504905 pinctrl: spear: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski 164fcf1eb3 pinctrl: stm32: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski 0bea3e7c15 pinctrl: bcm: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski af80a91199 pinctrl: renesas: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski 481a59fb3d pinctrl: nuvoton: npcm8xx: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski c54d686d7d pinctrl: nuvoton: npcm7xx: use new pinctrl GPIO helpers
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:19 +01:00
Bartosz Golaszewski ec963d04ca pinctrl: provide new GPIO-to-pinctrl glue helpers
Currently the pinctrl GPIO helpers all take a number from the global
GPIO numberspace - of which we're trying to get rid of as argument.

These helpers are almost universally called from GPIOLIB driver
callbacks which take a pointer to the backing gpio_chip and the
controller-relative offset as arguments.

Let's provide improved variants of these functions that match the
GPIOLIB signatures as the first step in removing the older flavor.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2023-11-04 10:23:18 +01:00
Linus Torvalds 90b0c2b2ed Pin control changes for the v6.7 kernel cycle
New drivers:
 
 - Realtek RTD family pin control driver and RTD1619B,
   RTD1319D and RTD1315E subdrivers.
 
 - Nuvoton NPCM8xx combined pin control and GPIO driver.
 
 - Amlogic T7 pin control driver.
 
 - Renesas RZ/G3S pin control driver.
 
 Improvements:
 
 - A number of additional UART groups added to the Mediatek
   MT7981 driver.
 
 - MPM pin maps added for Qualcomm MSM8996, SM6115, SM6125
   and SDM660.
 
 - Extra GPIO banks for the Sunxi H616.
 
 - MLSP I2C6 function support in Qualcomm MSM8226.
 
 - Some __counted_by() annotations for dynamic arrays.
 
 - Ongoing work to make remove() return void.
 
 - LSBC groups and functions in the Renesas R8A7778.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmVEp+oACgkQQRCzN7AZ
 XXPmqg/7BX2u2/1jpOpEjoqbUC7KEU3ptR2j1vAMCBibBq0IsnHVUH3DQ80leEpf
 gcf5vbY72PCTg5KGYZZ35XvrqzEP/z25qOnUZ+4Y7JljoXyNBb6eW1I3UstdPR1C
 E9hFVjMVFD7YePCGK/Ytwp/1dFLgLsADjk6Zc4gfHlPV/Op8NaxIIcM0FjFvu+X1
 znf3lRkaxedhdM0TsL6efOoNXJNHGZNXI+dUzgbEr+fyYcjHJFjh8HejJvcZDyvc
 581k6EVE0aGBz857OZz+ojADhtnE2+GYCB2kkdT5iHFeHtHGbRrwIc6Fh3gInMBI
 6yj86AaZEFJwLec/ckMn+kWdKwF17Q2qUOryr7UHlU8YP5DBAjSAZaocFynNto+I
 ikQPde2s04tRpveMCJSYnvy2eQpJ2DEpWtkSAGMzg0Ly71zfSH1TMrhjR9AxDP0F
 nrIBB7hEzTosxvrFTXHcCh8LxSDlohUL/UveA2Tiz/m1gvR51OnIx61EzqizHF5x
 WkuLxgLlC4P1ZqFyV1guwcOqUD4rpwpqTyIgAIoVIQfnvZR5jgFXHBKDJPXyjJTD
 oDEX8fVWX0xzwAoqBXqVs/TJcD9q8qKuuPaK8266XP5D/zM/PP1jRKQnC8IFPSq2
 Ory4TDLCrSmVw+c8q+jZHgKiEXuwGzPJ+ImypTMV+uZZzCdR4YE=
 =vonG
 -----END PGP SIGNATURE-----

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

Pull pin control updates from Linus Walleij:
 "No pin control core changes this time.

  New drivers:

   - Realtek RTD family pin control driver and RTD1619B, RTD1319D and
     RTD1315E subdrivers

   - Nuvoton NPCM8xx combined pin control and GPIO driver

   - Amlogic T7 pin control driver

   - Renesas RZ/G3S pin control driver

  Improvements:

   - A number of additional UART groups added to the Mediatek MT7981
     driver

   - MPM pin maps added for Qualcomm MSM8996, SM6115, SM6125 and SDM660

   - Extra GPIO banks for the Sunxi H616

   - MLSP I2C6 function support in Qualcomm MSM8226

   - Some __counted_by() annotations for dynamic arrays

   - Ongoing work to make remove() return void

   - LSBC groups and functions in the Renesas R8A7778"

* tag 'pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (110 commits)
  pinctrl: Use device_get_match_data()
  dt-bindings: pinctrl: qcom,sa8775p-tlmm: add missing wakeup-parent
  dt-bindings: pinctrl: nuvoton,npcm845: Add missing additionalProperties on gpio child nodes
  dt-bindings: pinctrl: brcm: Ensure all child node properties are documented
  pinctrl: renesas: rzn1: Convert to platform remove callback returning void
  pinctrl: renesas: rzg2l: Add RZ/G3S support
  dt-bindings: pinctrl: renesas: Document RZ/G3S SoC
  pinctrl: renesas: rzg2l: Add support for different DS values on different groups
  pinctrl: renesas: rzg2l: Move DS and OI to SoC-specific configuration
  pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S
  pinctrl: renesas: rzg2l: Adapt for different SD/PWPR register offsets
  pinctrl: renesas: rzg2l: Index all registers based on port offset
  pinctrl: renesas: rzg2l: Add validation of GPIO pin in rzg2l_gpio_request()
  pinctrl: renesas: r8a7778: Add LBSC pins, groups, and functions
  pinctrl: intel: fetch community only when we need it
  pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case
  pinctrl: cherryview: Convert to platform remove callback returning void
  pinctrl: sprd-sc9860: Convert to platform remove callback returning void
  pinctrl: qcom/msm: Convert to platform remove callback returning void
  pinctrl: qcom/lpi: Convert to platform remove callback returning void
  ...
2023-11-03 19:15:19 -10:00
Linus Torvalds b05ddad009 gpio updates for v6.7-rc1
GPIOLIB core:
 - provide interfaces allowing users to retrieve, manage and query the
   reference counted GPIO device instead of accessing the private gpio_chip
   structure
 - replace gpiochip_find() with gpio_device_find()
 - remove unused acpi_get_and_request_gpiod()
 - improve the ignore_interrupt functionality in GPIO ACPI
 - correct notifier return codes in gpiolib-of
 - unexport gpiod_set_transitory() as it's unused outside of core GPIO code
 - while there are still external users accessing struct gpio_chip, let's
   make gpiochip_get_desc() public so that they at least use the preferred
   helper
 - improve locking for lookup tables
 - annotate struct linereq with __counted_by
 - improve GPIOLIB docs
 - add an OF quirk for LED trigger sources
 
 Driver improvements:
 - convert all GPIO drivers with .remove() callbacks to using the new
   variant returning void instead of int
 - stop accessing the GPIOLIB private structures in gpio-mockup,
   i2c-mux-gpio, hte-tegra194, gpio-sim
 - use the recommended pattern for autofree variables in gpio-sim
 - add support for more models to gpio-loongson
 - use a notifier chain to notify other blocks about interrupts in
   gpio-eic-sprd instead of looking up GPIO devices on every interrupt
 - convert gpio-pca953x and gpio-fx6408 to using the maple tree regmap
   cache
 - don't include GPIOLIB internal headers in drivers which don't need them
 - move the ingenic NAND quirk into gpiolib-of
 - add an ignore interrupt quirk for Peaq C1010
 - drop static GPIO base from gpio-omap, gpio-f7188x
 - use the preferred device_get_match_data() function in drivers that still
   don't
 - refactor gpio-pca953x: switch to using DEFINE_SIMPLE_DEV_PM_OPS(), use
   cleanup helpers, use dev_err_probe() where it makes sense, fully convert
   to using devres and some other minor tweaks
 
 DT bindings:
 - add support for a new model to gpio-vf610 and update existing properties
 - add support for more loongson models
 - add missing support for imx models that are used but undocumented
 - convert bindings for Intel IXP4xx to schema
 
 Minor stuff:
 - deprecate gpio-mockup in favor of gpio-sim
 - include missing headers here and there
 - stop using gpiochip_find() in OMAP1 board files
 - minor tweaks in gpio-vf610, gpio-hisi
 - remove unneeded 'extern' specifiers from headers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmU7ixgACgkQEacuoBRx
 13JwfxAA4CeZdXdUpx6EMUw+6ST4EWb5JanrPjNcQbyBxNFrHx+6yJJL4AOQJStQ
 WkG+Zi8Li9uV3wZQixBDs0WN8xVwJU+4QLSwwtNhEjl2x9MkVjghh4la6TqBrMj8
 e/iJufTyKUgcm2P4MRTDXFarAin4doBQUPKWfCgL18VvlKxLXG0KMndUl3jAd/Rm
 YZLm4Z/iqWaxjfrm+E9LfWFmWS5T7t/g+7TYzMp2AHQ9dHFiwoodpiHTkdWH4dfL
 zxF8Ek2132Up0BYC1lQlwz1aoLIlHcr9xVOqOrIxZI/B5xRcUfoXnQQmCCfH2UYr
 wtfwKMI7IO2d5E+F7anFC67d9wm7tWacKEifw9lWUAD6xr6yv/13ZOU6aoWXj1Vq
 xOMe6gEeZSboF/XiqlmrpZYH+ljDp/mYWkGcOJrUg7WYUgvUCFWu6l6DmuUFMr7m
 ACtOUqwbTuWTXN28QtMOpjiQRqlAWyrY6PqhBCllhmcjsoVaZNgWEfriPlSOyoBg
 EBRBcURXLs7/h86nEsK/8BIsC0myHbpNiNpG5qaMjrrYJxMh4qS4MIG83MWAy1dZ
 8ZtYrxx4XClyaYwYomsIkseLaSCrBTIoYws7wmyTjYfKC7P/t6/XXPS1suyMnf9I
 /n5tN8Rv1pDrnS3iQflHQVl9H5m4yezHOOBJUiWW+gs5MUr4vK0=
 =1QF8
 -----END PGP SIGNATURE-----

Merge tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We don't have any new drivers. The loongson driver is getting extended
  with support for new models. There's a big refactor of gpio-pca953x
  and many small improvements to others.

  The GPIO code in the kernel has acquired a lot of cruft over the years
  as well as many abusers of the API across the kernel tree. This
  release cycle we have started a major cleanup and improvement effort
  that will most likely span several releases. We have started by
  converting external users of struct gpio_chip to accessing the wrapper
  around it - struct gpio_device. This is because the latter is
  reference counted while the former is removed when the provider is
  unbound. We also removed several instances of drivers accessing
  private GPIOLIB structures and including the private header from
  drivers/gpio/.

  To that end you'll see several commits aimed at different subsystems
  (acked by relevant maintainers) as well as two merges from the
  x86/platform tree.

  We'll then rework the locking in GPIOLIB which currently uses a big
  spinlock for many different things and could use becoming more
  fine-grained, especially as it doesn't even get the locking right.
  We'll also use SRCU for protecting the gpio_chip pointer against
  in-kernel hot-unplug crashes similar to what we saw triggered from
  user-space and fixed with semaphores in gpiolib-cdev. The core GPIOLIB
  is still vulnerable to these use-cases. I'm just mentioning the plans
  here, this is not part of this PR.

  You'll see some new instances of using __free(). We've added a
  gpio_device_put cleanup helper similar to the put_device one
  introduced by Peter Zijlstra and used it according to the preferred
  pattern except where it didn't make sense.

  GPIOLIB core:
   - provide interfaces allowing users to retrieve, manage and query the
     reference counted GPIO device instead of accessing the private
     gpio_chip structure
   - replace gpiochip_find() with gpio_device_find()
   - remove unused acpi_get_and_request_gpiod()
   - improve the ignore_interrupt functionality in GPIO ACPI
   - correct notifier return codes in gpiolib-of
   - unexport gpiod_set_transitory() as it's unused outside of core GPIO
     code
   - while there are still external users accessing struct gpio_chip,
     let's make gpiochip_get_desc() public so that they at least use the
     preferred helper
   - improve locking for lookup tables
   - annotate struct linereq with __counted_by
   - improve GPIOLIB docs
   - add an OF quirk for LED trigger sources

  Driver improvements:
   - convert all GPIO drivers with .remove() callbacks to using the new
     variant returning void instead of int
   - stop accessing the GPIOLIB private structures in gpio-mockup,
     i2c-mux-gpio, hte-tegra194, gpio-sim
   - use the recommended pattern for autofree variables in gpio-sim
   - add support for more models to gpio-loongson
   - use a notifier chain to notify other blocks about interrupts in
     gpio-eic-sprd instead of looking up GPIO devices on every interrupt
   - convert gpio-pca953x and gpio-fx6408 to using the maple tree regmap
     cache
   - don't include GPIOLIB internal headers in drivers which don't need
     them
   - move the ingenic NAND quirk into gpiolib-of
   - add an ignore interrupt quirk for Peaq C1010
   - drop static GPIO base from gpio-omap, gpio-f7188x
   - use the preferred device_get_match_data() function in drivers that
     still don't
   - refactor gpio-pca953x: switch to using DEFINE_SIMPLE_DEV_PM_OPS(),
     use cleanup helpers, use dev_err_probe() where it makes sense,
     fully convert to using devres and some other minor tweaks

  DT bindings:
   - add support for a new model to gpio-vf610 and update existing
     properties
   - add support for more loongson models
   - add missing support for imx models that are used but undocumented
   - convert bindings for Intel IXP4xx to schema

  Minor stuff:
   - deprecate gpio-mockup in favor of gpio-sim
   - include missing headers here and there
   - stop using gpiochip_find() in OMAP1 board files
   - minor tweaks in gpio-vf610, gpio-hisi
   - remove unneeded 'extern' specifiers from headers"

* tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (108 commits)
  hte: tegra194: add GPIOLIB dependency
  hte: tegra194: don't access struct gpio_chip
  gpiolib: provide gpio_device_get_base()
  i2c: mux: gpio: don't fiddle with GPIOLIB internals
  gpiolib: provide gpiod_to_gpio_device()
  gpiolib: provide gpio_device_to_device()
  gpio: hisi: Fix format specifier
  gpiolib: provide gpio_device_find_by_fwnode()
  gpio: acpi: remove acpi_get_and_request_gpiod()
  gpio: Use device_get_match_data()
  gpio: vf610: update comment for i.MX8ULP and i.MX93 legacy compatibles
  platform/x86: int3472: Switch to devm_get_gpiod()
  platform/x86: int3472: Stop using gpiod_toggle_active_low()
  platform/x86: int3472: Add new skl_int3472_gpiod_get_from_temp_lookup() helper
  platform/x86: int3472: Add new skl_int3472_fill_gpiod_lookup() helper
  gpio: vf610: simplify code by dropping data check
  gpio: vf610: add i.MX8ULP of_device_id entry
  dt-bindings: gpio: vf610: add i.MX95 compatible
  dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93
  dt-bindings: gpio: vf610: update gpio-ranges
  ...
2023-10-31 17:21:54 -10:00
Rob Herring 63bffc2d3a pinctrl: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231009172923.2457844-18-robh@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-30 14:50:42 +01:00
Rafael J. Wysocki e8c3c7f97a Merge branches 'acpi-ec', 'acpi-sysfs', 'acpi-misc' and 'acpi-uid'
Merge ACPI EC driver updates, ACPI sysfs interface updates, misc updates
related to ACPI and changes related to ACPI _UID handling for 6.7-rc1:

 - Add EC GPE detection quirk for HP 250 G7 Notebook PC (Jonathan
   Denose).

 - Fix and clean up create_pnp_modalias() and create_of_modalias()
   (Christophe JAILLET).

 - Modify 2 pieces of code to use acpi_evaluate_dsm_typed() (Andy
   Shevchenko).

 - Define acpi_dev_uid_match() for matching _UID and use it in several
   places (Raag Jadav).

 - Use acpi_device_uid() for fetching _UID in 2 places (Raag Jadav).

* acpi-ec:
  ACPI: EC: Add quirk for HP 250 G7 Notebook PC

* acpi-sysfs:
  ACPI: sysfs: Clean up create_pnp_modalias() and create_of_modalias()
  ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias()

* acpi-misc:
  ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed()
  ACPI: PCI: Switch to use acpi_evaluate_dsm_typed()

* acpi-uid:
  perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID
  ACPI: x86: use acpi_dev_uid_match() for matching _UID
  ACPI: utils: use acpi_dev_uid_match() for matching _UID
  pinctrl: intel: use acpi_dev_uid_match() for matching _UID
  ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID
  perf: qcom: use acpi_device_uid() for fetching _UID
  ACPI: sysfs: use acpi_device_uid() for fetching _UID
2023-10-26 14:59:52 +02:00
Raag Jadav 2d5bd3cbb0 pinctrl: intel: use acpi_dev_uid_match() for matching _UID
Convert manual _UID references to use the standard ACPI helper.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-10-24 21:49:27 +02:00
Andy Shevchenko 62140a1e4d Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()"
The commit breaks MMC enumeration on the Intel Merrifield
plaform.

Before:
[   36.439057] mmc0: SDHCI controller on PCI [0000:00:01.0] using ADMA
[   36.450924] mmc2: SDHCI controller on PCI [0000:00:01.3] using ADMA
[   36.459355] mmc1: SDHCI controller on PCI [0000:00:01.2] using ADMA
[   36.706399] mmc0: new DDR MMC card at address 0001
[   37.058972] mmc2: new ultra high speed DDR50 SDIO card at address 0001
[   37.278977] mmcblk0: mmc0:0001 H4G1d 3.64 GiB
[   37.297300]  mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10

After:
[   36.436704] mmc2: SDHCI controller on PCI [0000:00:01.3] using ADMA
[   36.436720] mmc1: SDHCI controller on PCI [0000:00:01.0] using ADMA
[   36.463685] mmc0: SDHCI controller on PCI [0000:00:01.2] using ADMA
[   36.720627] mmc1: new DDR MMC card at address 0001
[   37.068181] mmc2: new ultra high speed DDR50 SDIO card at address 0001
[   37.279998] mmcblk1: mmc1:0001 H4G1d 3.64 GiB
[   37.302670]  mmcblk1: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10

This reverts commit c153a4edff.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231017141806.535191-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-19 10:12:48 +02:00
Linus Walleij 593bcf6889 intel-pinctrl for v6.7-1
* Merge "Drop runtime PM support for Baytrail and Lynxpoint pinctrl" (Raag)
 * Small improvements here and there in the Intel pin control drivers (Raag)
 * Switch to RAII for locking in the Intel core and Cherry View drivers
 * Enable non-ACPI enumeration in the Intel Denverton driver
 * Use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() in a couple of drivers
 * Introduce array_size.h and use in in the Intel pin control drivers
 
 The following is an automated git shortlog grouped by driver:
 
 baytrail:
  -  Replace kernel.h by what is actually being used
  -  drop runtime PM support
  -  fix debounce disable case
 
 broxton:
  -  Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
 
 cherryview:
  -  reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case
  -  Convert to platform remove callback returning void
  -  Simplify code with cleanup helpers
  -  Avoid duplicated I/O
  -  Replace kernel.h by what is actually being used
 
 denverton:
  -  Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
  -  Enable platform device in the absence of ACPI enumeration
 
 intel:
  -  fetch community only when we need it
  -  refine intel_config_set_pull() function
  -  Replace kernel.h by what is actually being used
  -  Simplify code with cleanup helpers
 
 lynxpoint:
  -  Replace kernel.h by what is actually being used
  -  drop runtime PM support
 
 merrifield:
  -  Replace kernel.h by what is actually being used
 
 moorefield:
  -  Replace kernel.h by what is actually being used
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmUtPmkACgkQb7wzTHR8
 rCjQ2Q/+MdyxO1vlv2ZN6xpY25lpzELfRs6S2EHcrnRMoONjH6t1k6yh2Xmnlmte
 byMFggOSDoyZAmqzmQioWo6e8tO9zme17mAhNOnmNpZ4luyPOhgCp0SF61UpOrl/
 r2MBJyhFfCyI/7aXQ8p0+tVX988CgezYWEhfeXP2Xt10o90eK+fbks8bBW5a3gZ5
 Gpx3L3EXkBBIpW4ec1ji4vXNKiKVvePZZWIb612KZ3ttfk7jGqaC3kJXFFGGWO2z
 eKxuuDo5oNbYocS+/jNxSCBBoqKw50r507sqireQ/cV3H22wOK/OmejKJzSPszqB
 tQnvafqx8EaNLajhDW9EG1nzexeYbT6jHaNg/b2y0rSPWNSwi5zXgL2lEaPo+c5N
 Pv9Ys6dp+ftfM/zO8fjKWOYyjo0zqTRAB/yxTwfw+hXUvMQuzbHOaoMnVpmj+7he
 GqRbjyM5thWYFTFIz7Hearq12a9csvJPNKWz4ClPey4/AEkMyR0csvIgkmh8GZu+
 ORPwKmGIqQWC1JkJKMsmLx4j92JPN0xaIf6ILTMwgnzYihhPeCfIFMv1VbXZCaZA
 SfdbwK2f4cGMUS2s16Zf3Dl79jSrJ140igmCvsz8HDBZrz2C6Bey0qnWF4tQEy1Q
 NVGpyYpDTNtLZxelDZfB6bezyYoX7TLlCoTUvcYxbMIF7ax4QYI=
 =o8D/
 -----END PGP SIGNATURE-----

Merge tag 'intel-pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel

intel-pinctrl for v6.7-1

* Merge "Drop runtime PM support for Baytrail and Lynxpoint pinctrl" (Raag)
* Small improvements here and there in the Intel pin control drivers (Raag)
* Switch to RAII for locking in the Intel core and Cherry View drivers
* Enable non-ACPI enumeration in the Intel Denverton driver
* Use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() in a couple of drivers
* Introduce array_size.h and use in in the Intel pin control drivers

The following is an automated git shortlog grouped by driver:

baytrail:
 -  Replace kernel.h by what is actually being used
 -  drop runtime PM support
 -  fix debounce disable case

broxton:
 -  Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()

cherryview:
 -  reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case
 -  Convert to platform remove callback returning void
 -  Simplify code with cleanup helpers
 -  Avoid duplicated I/O
 -  Replace kernel.h by what is actually being used

denverton:
 -  Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
 -  Enable platform device in the absence of ACPI enumeration

intel:
 -  fetch community only when we need it
 -  refine intel_config_set_pull() function
 -  Replace kernel.h by what is actually being used
 -  Simplify code with cleanup helpers

lynxpoint:
 -  Replace kernel.h by what is actually being used
 -  drop runtime PM support

merrifield:
 -  Replace kernel.h by what is actually being used

moorefield:
 -  Replace kernel.h by what is actually being used
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-16 22:00:13 +02:00
Krzysztof Kozlowski c8befdc411 pinctrl: qcom: lpass-lpi: fix concurrent register updates
The Qualcomm LPASS LPI pin controller driver uses one lock for guarding
Read-Modify-Write code for slew rate registers.  However the pin
configuration and muxing registers have exactly the same RMW code but
are not protected.

Pin controller framework does not provide locking here, thus it is
possible to trigger simultaneous change of pin configuration registers
resulting in non-atomic changes.

Protect from concurrent access by re-using the same lock used to cover
the slew rate register.  Using the same lock instead of adding second
one will make more sense, once we add support for newer Qualcomm SoC,
where slew rate is configured in the same register as pin
configuration/muxing.

Fixes: 6e261d1090 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")
Cc: stable@vger.kernel.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231013145705.219954-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-16 14:56:49 +02:00
Linus Walleij 30d75d3c6f Samsung pinctrl drivers changes for v6.7
Few cleanups, improvements (use __counted_by annotation) and finally
 switch to dynamic allocation of GPIO numberspace.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmUs5/MQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD10rBD/921tnV/Wd7hLuz93/X4uOSwdhnzzb+7kQl
 AhmiwOu3EfatKHZR3UyC7kdZzY/ksw63kwxZRRRB33k6HvvB22UIqUvUQ6gRMA14
 k/nCMQeRLCTVk+qHiGoHPGhuAb5jkd6O70WKLIcMQm7kEF1AW1zyRCXzU2kztCzP
 dqbE7yzM7VCECZVOFz0k5ByL19Pynz12R76GLZJVl7v9hiVMSNSgX3Iscqo/kgLk
 w0uTUkTt5q1eqej27M92kzasiVc4aUlAieHAkYlZ1GVU02wktPdS5gGXB0rj4wCN
 YJ/VMsT4Ob+UkrK+O/qaYDLnLLBkSgHK0yQm5Qn+sfQlr+l0tkR4H2qP4AzWB8jg
 WsEU6VW2g2yzeHr/QUn6J+pOsBabkO0Xm4fob+Zx0NxfJtnjryKdsPbhZGnHC8U7
 xJ77PFn/kfOoZW8LJsxf0nSKmmoDdfdCseirDDUHZvjqqadycqsrYrojU5wrvW4A
 jAs0GglS7Tt0w1KmppeY+2ryn58Yj+35LZ8BYHypDxYgflscLUUNOazmokUqX57G
 P2plzxbh1oBTx9NAqDCRotxlRjU6vlVK2JTLfTyT2/aYzp9cWdHd7axLhoXHWjp5
 b3N3tBj/snSrMg/kmmgQMj09kvkE6WrsGGq6hRPqRQaRNURXYFBDVHukcbUx83Q1
 NDsgS+rSEg==
 =ghzy
 -----END PGP SIGNATURE-----

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

Samsung pinctrl drivers changes for v6.7

Few cleanups, improvements (use __counted_by annotation) and finally
switch to dynamic allocation of GPIO numberspace.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-16 11:41:53 +02:00
Linus Walleij b4e10c3190 pinctrl: renesas: Updates for v6.7 (take two)
- Add pin groups for the Local Bus State Controller (LBSC) on R-Car
     M1A,
   - Add support for the RZ/G3S (R9A08G045) SoC,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZSk0XwAKCRCKwlD9ZEnx
 cCykAP9rDQKb83aBYHLBAmlyRKT1+e8Lm1r4QC7KeiC0v8WHQwEAyLILM38KFwyG
 vGaiXlp0MfGmA82a0orjdRBiUdyHqAE=
 =QFrw
 -----END PGP SIGNATURE-----

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

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

  - Add pin groups for the Local Bus State Controller (LBSC) on R-Car
    M1A,
  - Add support for the RZ/G3S (R9A08G045) SoC,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-13 15:32:09 +02:00
Uwe Kleine-König 583d807320 pinctrl: renesas: rzn1: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231009083856.222030-20-u.kleine-koenig@pengutronix.de
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea c6a088e5a0 pinctrl: renesas: rzg2l: Add RZ/G3S support
Add basic support for RZ/G3S to be able to boot from SD card, have a
running console port, and use GPIOs.  RZ/G3S has 82 general-purpose IO
ports.  Support for the remaining pin functions (e.g. Ethernet, XSPI)
will be added along with controller-specific support.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230929053915.1530607-22-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea ae5b425faf pinctrl: renesas: rzg2l: Add support for different DS values on different groups
RZ/G3S supports different drive strength values for different power
sources and pin groups (A, B, C).  On each group there could be up to 4
drive strength values per power source.  Available power sources are
1v8, 2v5, 3v3.  Drive strength values are more fine tuned than what was
previously available on the driver thus the necessity of having
micro-amp support.  As drive strength and power source values are linked
together the hardware setup for these was moved at the end of
rzg2l_pinctrl_pinconf_set() to ensure proper validation of the new
values.

The drive strength values are expected to be initialized though the
SoC-specific hardware configuration data structure.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230929053915.1530607-19-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea cca38201b4 pinctrl: renesas: rzg2l: Move DS and OI to SoC-specific configuration
Move drive strength and output impedance values to the SoC-specific
configuration data structure (struct rzg2l_hwcfg).  This allows
extending the drive strength support for RZ/G3S.  Along with this the DS
values were converted to uA for simple integration with RZ/G3S support.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230929053915.1530607-18-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea 35a3610e5a pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S
On RZ/G3S PFC register allow setting 8 functions for individual ports
(function1 to function8). For function1 the register need to be
configured with 0, for function8 the register need to be configured with
7.  We cannot use zero based addressing when requesting functions from
different code places as the documentation
(RZG3S_pinfunction_List_r1.0.xlsx) states explicitly that function0 is
GPIO.

Add a new member to struct rzg2l_hwcfg that will keep the offset that
needs to be substracted before applying a value to a PFC register.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230929053915.1530607-17-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea 1f89aa906f pinctrl: renesas: rzg2l: Adapt for different SD/PWPR register offsets
SD, PWPR power registers have different offsets b/w RZ/G2L and RZ/G3S.
Add a per SoC configuration data structure that is initialized with the
proper register offsets for individual SoCs.  The rzg2l_hwcfg structure
will be extended further in later commits.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230929053915.1530607-16-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Claudiu Beznea 77e18969da pinctrl: renesas: rzg2l: Index all registers based on port offset
To get the address that needs to be read/written for specific port
functionalities, the P(), PM(), PMC(), PFC(), PIN(), IOLH() IEN(),
ISEL() macros are used.  Some of these macros receive as argument the
hardware port identifier, some the hardware port offset address (e.g.
ISEL() received port identifier, IOLH() received port offset address).
This makes it hard to extend the current driver for SoCs where port
identifiers are not contiguous in the memory map of the pin controller.
This is the case for the RZ/G3S pin controller where ports are mapped as
follows:

    port offset    port identifier
    -----------    ---------------
    0x20           P0
    0x21           P5
    0x22           P6
    0x23           P11
    0x24           P12
    0x25           P13
    0x26           P14
    0x27           P15
    0x28           P16
    0x29           P17
    0x2a           P18
    0x30           P1
    0x31           P2
    0x32           P3
    0x33           P4
    0x34           P7
    0x35           P8
    0x36           P8
    0x37           P10

To make this achievable, change all the above macros used to get the
address of a port register for a specific port functionality based on
the port hardware address.  Summarized, all the above macros will get as
argument the port offset address listed in the above table.

With this RZG2L_SINGLE_PIN_GET_PORT_OFFSET(),
RZG2L_PIN_ID_TO_PORT_OFFSET() and RZG2L_GPIO_PORT_GET_INDEX() were
replaced by RZG2L_PIN_CFG_TO_PORT_OFFSET(); RZG2L_SINGLE_PIN_GET_CFGS()
and RZG2L_GPIO_PORT_GET_CFGS() were replaced by RZG2L_PIN_CFG_TO_CAPS().

Also rzg2l_pinctrl_set_pfc_mode() does not need the port argument
anymore.  Also rzg2l_gpio_direction_input() and
rzg2l_gpio_direction_output() do not need to translate port and bit
locally as this can be done by rzg2l_gpio_set_direction().

To use the same naming for port, bit/pin, and register offset, replace
the port_offset variable names in different places by variables named
off.  There is no longer a need to initialize cfg and bit in different
code places.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20230929053915.1530607-15-claudiu.beznea@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:05 +02:00
Lad Prabhakar c944d9dea7 pinctrl: renesas: rzg2l: Add validation of GPIO pin in rzg2l_gpio_request()
Validate the GPIO pin request in the rzg2l_gpio_request() callback using
the rzg2l_validate_gpio_pin() function.  This stops any accidental usage
of GPIO pins which are not supported by the SoC.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20230925154548.27048-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2023-10-13 09:38:04 +02:00
Geert Uytterhoeven 84ba513169 pinctrl: renesas: r8a7778: Add LBSC pins, groups, and functions
Add pins, groups, and functions for the Local Bus State Controller
(LBSC) on the Renesas R-Car M1A (R8A7778) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/347b9f7627871b45aec04a3351d50219d4d260fe.1694768311.git.geert+renesas@glider.be
2023-10-13 09:38:04 +02:00
Ralph Siemsen f055ff23c3 pinctrl: renesas: rzn1: Enable missing PINMUX
Enable pin muxing (eg. programmable function), so that the RZ/N1 GPIO
pins will be configured as specified by the pinmux in the DTS.

This used to be enabled implicitly via CONFIG_GENERIC_PINMUX_FUNCTIONS,
however that was removed, since the RZ/N1 driver does not call any of
the generic pinmux functions.

Fixes: 1308fb4e4e ("pinctrl: rzn1: Do not select GENERIC_PIN{CTRL_GROUPS,MUX_FUNCTIONS}")
Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231004200008.1306798-1-ralph.siemsen@linaro.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-12 09:10:40 +02:00
Raag Jadav 8d751da9f1 pinctrl: intel: fetch community only when we need it
We check community features only in case PIN_CONFIG_BIAS_PULL_DOWN while
setting/getting pad termination. No need to fetch the community otherwise.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-11 23:40:56 +03:00
Raag Jadav 6fe13aa7c8 pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case
We have a couple of pinconfig cases inside the braces which are meant for
PIN_CONFIG_BIAS_HIGH_IMPEDANCE case. Although it is valid C, it makes the
code less readable and prone to misinterpretation. Limit the braces to
PIN_CONFIG_BIAS_HIGH_IMPEDANCE case to avoid this.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-11 23:40:56 +03:00
Uwe Kleine-König e0ba7366a6 pinctrl: cherryview: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-11 23:40:49 +03:00
Uwe Kleine-König c341ac65bf pinctrl: sprd-sc9860: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

To convert the sprd-sc9860 driver, make sprd_pinctrl_remove()
return void (instead of zero) and use .remove_new as callback.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009162510.335208-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:47:50 +02:00
Uwe Kleine-König 22ee670a8a pinctrl: qcom/msm: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

To convert all those qcom pinctrl drivers, make msm_pinctrl_remove()
return void (instead of zero) and use .remove_new in all drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009162510.335208-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:47:49 +02:00
Uwe Kleine-König 776d54c137 pinctrl: qcom/lpi: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

To convert all those qcom pinctrl drivers, make msm_pinctrl_remove()
return void (instead of zero) and use .remove_new in all drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009162510.335208-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:47:49 +02:00
Uwe Kleine-König 93650550df pinctrl: ti: ti-iodelay: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-21-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:45:35 +02:00
Uwe Kleine-König a80252efb5 pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:43:56 +02:00
Uwe Kleine-König a37b06133a pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-18-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:43:31 +02:00
Uwe Kleine-König ab06ab8406 pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-17-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:43:03 +02:00
Uwe Kleine-König 348e1488ba pinctrl: qcom: spmi-gpio: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-16-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:42:37 +02:00
Uwe Kleine-König 14a16555e7 pinctrl: tb10x: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:42:07 +02:00
Uwe Kleine-König 86bc4c7f9e pinctrl: stmfx: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-14-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:41:35 +02:00
Uwe Kleine-König a6992a0d31 pinctrl: single: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-13-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:40:54 +02:00
Uwe Kleine-König 9725877765 pinctrl: rockchip: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20231009083856.222030-12-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:40:22 +02:00
Uwe Kleine-König f0c3958800 pinctrl: as3722: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-11-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:39:42 +02:00
Uwe Kleine-König b340412a87 pinctrl: artpec6: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Link: https://lore.kernel.org/r/20231009083856.222030-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:39:10 +02:00
Uwe Kleine-König 23a35fd90c pinctrl: amd: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:38:42 +02:00
Uwe Kleine-König a304b56f42 pinctrl: nomadik: abx500: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:38:12 +02:00
Uwe Kleine-König 9eb95648f1 pinctrl: cirrus: madera-core: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231009083856.222030-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:37:19 +02:00
Uwe Kleine-König 88b3f10850 pinctrl: ti: ti-iodelay: Drop if block with always false condition
ti_iodelay_remove() is only called after ti_iodelay_probe() completed
successfully. In this case platform_set_drvdata() was called with a
non-NULL argument and so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:36:44 +02:00
Uwe Kleine-König 71e6702667 pinctrl: single: Drop if block with always false condition
pcs_remove() is only called after pcs_probe() completed successfully. In
this case platform_set_drvdata() was called with a non-NULL argument and
so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:35:56 +02:00
Uwe Kleine-König 35df4b75bd pinctrl: stmfx: Improve error message in .remove()'s error path
The driver core has no handling for errors returned by the .remove()
callback. The only action on error is a dev_warn() with generic error
message that the returned value is returned.

Replace it by a more specific and useful message. Then returning zero is
the right thing to do, the only effect is to suppress the core's
warning.

This prepares the driver for the conversion to .remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 15:34:52 +02:00
Andy Shevchenko 10f94f9cad pinctrl: core: Remove unneeded {} around one line conditional body
The one line conditional body doesn't require {} surrounding it.
Remove unneeded {}.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231003120648.2838047-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 14:05:38 +02:00
Zev Weiss d875d6ccd3 pinctrl: aspeed: Allow changing SPI mode from hardware strap defaults
Some platforms unfortunately have their SPI mode selection bits
strapped incorrectly (such as being configured for passthrough mode
when master mode is in fact the only useful configuration for it) and
thus require correction in software.  Add the SPI mode bits to the
GPIO passthrough bits as the exceptions to the read-only rule for the
hardware strap register so that the pinctrl subsystem can be used for
such corrections.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20231005030849.11352-2-zev@bewilderbeest.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 14:01:30 +02:00
Fabio Estevam 54a33423f2 pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property
The 'fsl,mxs-gpio' property is not documented in gpio-mxs.yaml, but
the imx23 and imx28 dtsi describe the gpios as:

compatible = "fsl,imx28-gpio", "fsl,mxs-gpio";

This gives schema warnings like:

imx28-cfa10037.dtb: pinctrl@80018000: gpio@0:compatible: ['fsl,imx28-gpio', 'fsl,mxs-gpio'] is too long
	from schema $id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml#

"fsl,mxs-gpio" is only used inside pinctrl-mxs, but can be removed if
the compatible check is done against fsl,imx23-gpio and fsl,imx28-gpio.

Introduce is_mxs_gpio() and remove the need for "fsl,mxs-gpio".

Tested on a imx28-evk.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20230928134321.438547-1-festevam@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 13:41:37 +02:00
Biju Das 2e44555b05 pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init()
Add struct mcp23s08_info and simplify probe()/mcp23s08_spi_regmap_init() by
replacing match data 'type' with 'struct mcp23s08_info'.

While at it, replace 'dev_err()'->'dev_err_probe()' and drop printing
'type' in error path for i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231001150113.7752-4-biju.das.jz@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 13:39:38 +02:00
Biju Das b03f7aa802 pinctrl: mcp23s08_spi: Simplify probe()
Simpilfy probe() by replacing device_get_match_data() and ID lookup for
retrieving match data by spi_get_device_match_data().

While at it, replace data type of variable type from 'int'->'unsigned int'
and declare variables following a reverse christmas tree order.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231001150113.7752-3-biju.das.jz@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 13:39:38 +02:00
Biju Das 880d3fcbe5 pinctrl: mcp23s08_i2c: Extend match support for OF tables
The driver has OF match table, still it uses ID lookup table for
retrieving match data. Currently the driver is working on the
assumption that a I2C device registered via OF will always match a
legacy I2C device ID. The correct approach is to have an OF device ID
table using of_device_match_data() if the devices are registered via OF.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231001150113.7752-2-biju.das.jz@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-10 13:39:38 +02:00
Mateusz Majewski 8aec97decf pinctrl: samsung: do not offset pinctrl numberspaces
Past versions of this driver have manually calculated base values for
both the pinctrl numberspace and the global GPIO numberspace, giving
both the same values. This was necessary for the global GPIO
numberspace, since its values need to be unique system-wide. However, it
was not necessary for the pinctrl numberspace, since its values only
need to be unique for a single instance of the pinctrl device. It was
just convenient to use the same values for both spaces.

Right now those calculations are only used for the pinctrl numberspace,
since GPIO numberspace bases are selected by the GPIO subsystem.
Therefore, those calculations are unnecessary.

Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20231006125557.212681-5-m.majewski2@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2023-10-09 12:37:21 +02:00
Mateusz Majewski deb79167e1 pinctrl: samsung: choose GPIO numberspace base dynamically
Selecting it statically is deprecated and results in a warning while
booting the system:

gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.

Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20231006125557.212681-4-m.majewski2@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2023-10-09 12:37:21 +02:00
Mateusz Majewski bf128c1f0f pinctrl: samsung: use add_pin_ranges method to add pinctrl ranges
This is preferable since we can read the base in the global GPIO
numberspace from the chip instead of needing to select it ourselves.

Past versions could not do this, since they needed to add all the ranges
before enabling the pinctrl subsystem, which was done before registering
the GPIO chip. However, right now we enable the pinctrl subsystem after
registering the chip and so this became possible.

Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20231006125557.212681-3-m.majewski2@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2023-10-09 12:37:21 +02:00
Mateusz Majewski 2aca5c591e pinctrl: samsung: defer pinctrl_enable
dev_pinctrl_register function immediately enables the pinctrl subsystem,
which is unpreferable in general, since drivers might be unable to
handle calls immediately. Hence devm_pinctrl_register_and_init, which
does not call pinctrl_enable, is preferred.

In case of our driver using the old function does not seem to be
problematic for now, but will become an issue when we postpone parts of
pinctrl initialization in a future commit, and it is a good idea to move
off a deprecated-ish function anyway.

Signed-off-by: Mateusz Majewski <m.majewski2@samsung.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20231006125557.212681-2-m.majewski2@samsung.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2023-10-09 12:37:20 +02:00
Kees Cook 4e1e21117e pinctrl: samsung: Annotate struct exynos_muxed_weint_data with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct
exynos_muxed_weint_data. Additionally, since the element count member
must be set before accessing the annotated flexible array member, move
its initialization earlier.

Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-hardening@vger.kernel.org
Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1]
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20231006201707.work.405-kees@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2023-10-08 13:36:40 +02:00
Linus Walleij 0aa5369fdb pinctrl: realtek: Fix some NULL dereference warnings
Just inspecting the code doesn't convince me that this is a real
issue, but the tools complain that it is so I will just handle it.

Cc: Tzuyi Chang <tychang@realtek.com>
Link: https://lore.kernel.org/oe-kbuild-all/202309270234.aJGlDE0P-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-2-09af253312ba@linaro.org
2023-10-06 23:11:32 +02:00
Linus Walleij d48f8a6f4a pinctrl: realtek: Tag unused pins as __maybe_unused
These pin definitions are helpful to have when working with the
driver in the future, so they are in a sense a bit like
documentation. They could be commented out as well, but why.

This should fix these build warnings:

drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_boot_sel_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_reset_n_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_scan_switch_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_testmode_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_wd_rset_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_boot_sel_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_reset_n_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_scan_switch_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_testmode_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_wd_rset_pins' defined but not used [-Wunused-const-variable=]

Cc: Tzuyi Chang <tychang@realtek.com>
Link: https://lore.kernel.org/oe-kbuild-all/202309270313.mBEc9o1A-lkp@intel.com/
Link: https://lore.kernel.org/oe-kbuild-all/202309270448.7Aen3Sgx-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org
2023-10-06 23:11:32 +02:00
Dan Carpenter 8c58f51ff3 pinctrl: realtek: Fix error handling in probe()
There are several issues in the probe function:
1) of_iomap() return NULL on error but the code checks for error
   pointers.
2) pinctrl_register() is the reverse.  It returns error pointers
   but the code checks for NULL.
3) The error paths need to call iounmap(data->base) before returning
   to avoid a resource leak.

Fixes: e99ce78030 ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/590b337a-13ce-4391-a09d-d2b06fbc912d@moroto.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-06 23:05:28 +02:00
Andy Shevchenko d59b099c66 pinctrl: cherryview: Simplify code with cleanup helpers
Use macros defined in linux/cleanup.h to automate resource lifetime
control in the driver.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-06 13:36:56 +03:00
Andy Shevchenko d338655215 pinctrl: cherryview: Avoid duplicated I/O
In some cases we already read the value from the register followed
by a reading of it again for other purposes, but the both reads
are under the lock and bits we are insterested in are not going
to change (they are not volatile from HW perspective). Hence, no
need to read the same register twice.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-06 13:35:39 +03:00
Andy Shevchenko 3013c7f778 pinctrl: denverton: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
As Krzysztof pointed out the better is to use MODULE_DEVICE_TABLE()
as it will be consistent with the content of the real ID table of
the platform devices.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-06 11:23:25 +03:00
Andy Shevchenko a9d7dfaaa8 pinctrl: broxton: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
As Krzysztof pointed out the better is to use MODULE_DEVICE_TABLE()
as it will be consistent with the content of the real ID table of
the platform devices.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-06 11:23:10 +03:00
Andy Shevchenko f2bbe6f1f4 pinctrl: moorefield: Replace kernel.h by what is actually being used
The kernel.h is a mess of unrelated things and we only used it
as a proxy to array_size.h, hence switch from former to the latter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-03 16:29:31 +03:00
Andy Shevchenko 068866fb5c pinctrl: merrifield: Replace kernel.h by what is actually being used
The kernel.h is a mess of unrelated things and we only used it
as a proxy to array_size.h, hence switch from former to the latter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-03 16:29:31 +03:00
Andy Shevchenko 1cb71a63f6 pinctrl: lynxpoint: Replace kernel.h by what is actually being used
The kernel.h is a mess of unrelated things and we only used it
as a proxy to array_size.h, hence switch from former to the latter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-03 16:29:31 +03:00
Andy Shevchenko 315ef5fcd2 pinctrl: cherryview: Replace kernel.h by what is actually being used
The kernel.h is a mess of unrelated things and we only used it
as a proxy to array_size.h, hence switch from former to the latter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-10-03 16:29:30 +03:00