Commit Graph

6992 Commits

Author SHA1 Message Date
Linus Walleij
2659f36a56 pinctrl: renesas: Updates for v6.11
- Add support for the new RZ/V2H(P) (R9A09G057) Soc,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZmwB0AAKCRCKwlD9ZEnx
 cKIJAQDoO2BVZmaYJvJoiV8mHUdcRqj94pL5GF2tvNb/cKqdwQEA8ceFXJC2zp0L
 6yjNrDI29WVHsdcQLTy5dAWYeRgJPAQ=
 =O4N5
 -----END PGP SIGNATURE-----

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

pinctrl: renesas: Updates for v6.11

  - Add support for the new RZ/V2H(P) (R9A09G057) Soc,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:27:36 +02:00
Nathan Chancellor
c47d254117 pinctrl: keembay: Fix func conversion in keembay_build_functions()
A recent refactoring to use the func member in struct function_desc
missed converting one uses of name in keembay_build_functions(),
resulting in a build failure:

  drivers/pinctrl/pinctrl-keembay.c: In function 'keembay_build_functions':
  drivers/pinctrl/pinctrl-keembay.c:1630:35: error: 'struct function_desc' has no member named 'name'
   1630 |                         if (!fdesc->name) {
        |                                   ^~

Perform the same conversion to resolve the build error.

Fixes: 73ee52205e5a ("pinctrl: keembay: Convert to use func member")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240611-pinctrl-keembay-fix-func-conversion-v1-1-3197f2ded3f7@kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406131133.WwdetfBL-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:26:28 +02:00
Peng Fan
b755521fd6 pinctrl: imx: support SCMI pinctrl protocol for i.MX95
The generic pinctrl-scmi.c driver could not be used for i.MX95 because
i.MX95 SCMI firmware not supports functions, groups or generic
'Pin Configuration Type and Enumerations' listed in SCMI Specification.

i.MX95 System Control Management Interface(SCMI) firmware only supports
below pin configuration types which are OEM specific types:
    192: PIN MUX
    193: PIN CONF
    194: DAISY ID
    195: DAISY VAL

To Support fsl,pins property together with SCMI OEM protocol, add this
driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Link: https://lore.kernel.org/r/20240521-pinctrl-scmi-imx95-v1-3-9a1175d735fd@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:26:18 +02:00
Peng Fan
dbd47012a4 pinctrl: scmi: add blocklist
i.MX95 will have its own pinctrl scmi driver, so need block
pinctrl-scmi driver for i.MX95, otherwise there will be two pinctrl
devices for a single scmi protocol@19.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Link: https://lore.kernel.org/r/20240521-pinctrl-scmi-imx95-v1-2-9a1175d735fd@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:26:04 +02:00
Richard Acayan
d85e2ccdf1 pinctrl: qcom: sdm670: add pdc wakeirq map
The PDC was hooked up as a wakeup parent in the DTS in
commit 71f080633d ("arm64: dts: qcom: sdm670: Hook up PDC as
wakeup-parent of TLMM"), but the wakeirq mapping was not defined so it
had no effect. Add the mapping for wakeup interrupts on the PDC to their
corresponding pins.

Configuring a pin IRQ as dual-edge would break it unless the
wakeirq_dual_edge_errata flag is set.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Link: https://lore.kernel.org/r/20240523230619.256882-2-mailingradian@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:25:45 +02:00
Patrick Rudolph
7f53a8eeb5 pinctrl: cy8c95x0: Use REGCACHE_MAPLE
Use REGCACHE_MAPLE instead of REGCACHE_FLAT.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240521152602.1097764-3-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:25:37 +02:00
Patrick Rudolph
8670de9fae pinctrl: cy8c95x0: Use regmap ranges
Instead of implementing a custom register paging mechanism in
the driver use the existing regmap ranges feature.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240521152602.1097764-2-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:25:27 +02:00
Patrick Rudolph
f71aba339a pinctrl: cy8c95x0: Use single I2C lock
Currently there are 3 locks being used when accessing the chip, one
in the driver and one in each regmap. Reduce that to one driver only
lock that protects all regmap and regcache accesses.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240521152602.1097764-1-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:25:19 +02:00
Andy Shevchenko
c501b780c1 pinctrl: pinmux: Remove unused members from struct function_desc
All drivers are converted to use embedded struct pinfunction.
Remove unused members from struct function_desc.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-12-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:25:11 +02:00
Andy Shevchenko
6273a1b1ce pinctrl: mediatek: moore: Convert to use func member
Convert drivers to use func member embedded in struct function_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin function description.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-11-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:57 +02:00
Andy Shevchenko
ab8866c5d3 pinctrl: keembay: Convert to use func member
Convert drivers to use func member embedded in struct function_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin function description.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-10-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:49 +02:00
Andy Shevchenko
be9e92afd3 pinctrl: ingenic: Convert to use func member
Convert drivers to use func member embedded in struct function_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin function description.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-9-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:42 +02:00
Andy Shevchenko
f3e0473aa8 pinctrl: imx: Convert to use func member
Convert drivers to use func member embedded in struct function_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin function description.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-8-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:30 +02:00
Andy Shevchenko
37997d7b55 pinctrl: pinmux: Embed struct pinfunction into struct function_desc
struct function_desc is a particular version of the struct pinfunction
with associated opaque data. Start switching pin control core and
drivers to use it explicitly.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-7-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:22 +02:00
Andy Shevchenko
f26945d76a pinctrl: pinmux: Add a convenient define PINCTRL_FUNCTION_DESC()
Add PINCTRL_FUNCTION_DESC() macro for inline use.

While at it, fix adjective form in the comment of PINCTRL_GROUP_DESC().

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-6-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:13 +02:00
Andy Shevchenko
dc02d925dc pinctrl: mediatek: moore: Provide a helper macro PINCTRL_PIN_FUNCTION()
Provide a helper macro to assign the struct function_desc entries.
This helps further refactoring.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-5-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:24:05 +02:00
Andy Shevchenko
7f2a2af088 pinctrl: ingenic: Provide a helper macro INGENIC_PIN_FUNCTION()
Provide a helper macro to assign the struct function_desc entries.
This helps further refactoring.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-4-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:56 +02:00
Andy Shevchenko
18f5c202de pinctrl: equilibrium: Make use of struct pinfunction
Since pin control provides a generic data type for the pin function,
use it in the driver.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-3-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:43 +02:00
Andy Shevchenko
5d421ff557 pinctrl: berlin: Make use of struct pinfunction
Since pin control provides a generic data type for the pin function,
use it in the driver.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240530085745.1539925-2-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:34 +02:00
Dmitry Yashin
a8f2548548 pinctrl: rockchip: update rk3308 iomux routes
Some of the rk3308 iomux routes in rk3308_mux_route_data belong to
the rk3308b SoC. Remove them and correct i2c3 routes.

Fixes: 7825aeb7b2 ("pinctrl: rockchip: add rk3308 SoC support")
Signed-off-by: Dmitry Yashin <dmt.yashin@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20240515121634.23945-2-dmt.yashin@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:26 +02:00
Swati Agarwal
5028736781 pinctrl: pinctrl-zynqmp: Use pin numbers stored in pin descriptor
Use pin numbers stored in the pin descriptors instead of index value while
creating the pin groups. Pin Id's are not same as Index values for Xilinx
Versal platform, so use the pin values from descriptor which works for both
ZynqMP and Versal platforms.

Signed-off-by: Swati Agarwal <swati.agarwal@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/2413a1f99278d70313960f13daecda9ef54172d8.1716807432.git.michal.simek@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:18 +02:00
Weihao Li
0a2bcac1a2 pinctrl: ralink: mt76x8: fix pinmux function
The current version of the pinctrl driver has some issues:

1. Duplicated "gpio" pmx function

The common code will add a "gpio" pmx functon to every pin group, so
it's not necessary to define a separate "gpio" pmx function in pin
groups.

2. Duplicated pmx function name

There are some same function name in different pin groups, which will
cause some problems. For example, when we want to use PAD_GPIO0 as
refclk output function, the common clk framework code will search the
entire pin function lists, then return the first one matched, in this
case the matched function list only include the PAD_CO_CLKO pin group
because there are three "refclk" pin function, which is added by
refclk_grp, spi_cs1_grp and gpio_grp.

To solve this problem, a simple way is just add a pingrp refix to
function name like mt7620 pinctrl driver does.

3. Useless "-" or "rsvd" functon

It's really unnecessary to add a reserved pin mux function to the
function lists, because we never use it.

Signed-off-by: Weihao Li <cn.liweihao@gmail.com>
Link: https://lore.kernel.org/r/20240527022036.31985-1-user@blabla
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:23:02 +02:00
Nirmala Devi Mal Nadar
72636eb9c1 pinctrl: pinctrl-tps6594: make tps65224_muxval_remap and tps6594_muxval_remap as static to fix sparse warning
pinctrl: tps6594: Fix sparse warning.

warning: symbol 'tps65224_muxval_remap' was not declared. Should it be static?
warning: symbol 'tps6594_muxval_remap' was not declared. Should it be static?

Signed-off-by: Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405111523.9yt759uX-lkp@intel.com/
Link: https://lore.kernel.org/r/0109018f85002ae1-6fb831b2-74c2-4559-98f1-a3ef25e72558-000000@ap-south-1.amazonses.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:22:49 +02:00
Konrad Dybcio
db43edf669 pinctrl: qcom: spmi: Add PMC8380
PMC8380 is a new chip, featuring 10 GPIOs. Describe it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240525-topic-pmc8380_gpio-v2-2-2de50cb28ac1@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:22:41 +02:00
Léo DUBOIN
9dfbcf2fc5 pinctrl: core: reset gpio_device in loop in pinctrl_pins_show()
We were not resetting the pointer to the associated gpio_device once
we are done displaying a pin's information.

This meant that once we reached the end of a gpio-range, if there
were pins right after it that did not belong to any known range,
they would be associated with the previous range's gpio device.

This resulted in those pins appearing as <4294966783:old_gdev> instead
of the expected <0:?> (due to gpio_num being -1).

Signed-off-by: Léo DUBOIN <lduboin@freebox.fr>
Link: https://lore.kernel.org/r/c40d0634abefa19e689ffd450e0f48a8d63c4fc4.1714049455.git.lduboin@freebox.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:22:24 +02:00
Léo DUBOIN
db5032981a pinctrl: core: take into account the pins array in pinctrl_pins_show()
We previously only looked at the 'pin_base' of the pinctrl_gpio_ranges
struct for determining if a pin matched a GPIO number.

This value is present only if the 'pins' array is not NULL,
and is 0 otherwise. This means that GPIO ranges declared using
gpiochip_add_pingroup_range(), thus making use of pins, were always matched
by the pins in the range [0-npins] even if they contained pins in a
completely separate range.

Signed-off-by: Léo DUBOIN <lduboin@freebox.fr>
Link: https://lore.kernel.org/r/6df39bd47942156be5713f8f4e317d2ad3e0ddeb.1714049455.git.lduboin@freebox.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:22:15 +02:00
Jacky Huang
f805e35631 pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver
Add common pinctrl and GPIO driver for Nuvoton MA35 series SoC, and
add support for ma35d1 pinctrl.

Signed-off-by: Jacky Huang <ychuang3@nuvoton.com>
Link: https://lore.kernel.org/r/20240521012447.42211-4-ychuang570808@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:22:03 +02:00
Peng Fan
b7141b18bf pinctrl: st: Use scope based of_node_put() cleanups
Use scope based of_node_put() cleanup to simplify code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20240504-pinctrl-cleanup-v2-8-26c5f2dc1181@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:21:38 +02:00
Peng Fan
2dbcd12d9e pinctrl: stm32: Use scope based of_node_put() cleanups
Use scope based of_node_put() cleanup to simplify code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20240504-pinctrl-cleanup-v2-3-26c5f2dc1181@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:21:32 +02:00
Peng Fan
993e2fc48f pinctrl: imx: Add pinctrl driver support for i.MX91
Add NXP i.MX91 pinctrl driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20240513-imx91-pinctrl-v1-2-c99a23c6843a@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:21:21 +02:00
Johan Hovold
8da86499d4 pinctrl: qcom: spmi-gpio: drop broken pm8008 support
The SPMI GPIO driver assumes that the parent device is an SPMI device
and accesses random data when backcasting the parent struct device
pointer for non-SPMI devices.

Fortunately this does not seem to cause any issues currently when the
parent device is an I2C client like the PM8008, but this could change if
the structures are reorganised (e.g. using structure randomisation).

Notably the interrupt implementation is also broken for non-SPMI devices.

Also note that the two GPIO pins on PM8008 are used for interrupts and
reset so their practical use should be limited.

Drop the broken GPIO support for PM8008 for now.

Fixes: ea119e5a48 ("pinctrl: qcom-pmic-gpio: Add support for pm8008")
Cc: stable@vger.kernel.org	# 5.13
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240529162958.18081-9-johan+linaro@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-06-17 09:16:54 +02:00
Lad Prabhakar
9bd95ac86e pinctrl: renesas: rzg2l: Add support for RZ/V2H SoC
Add pinctrl driver support for RZ/V2H(P) SoC.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240530173857.164073-16-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:25 +02:00
Lad Prabhakar
951eaac107 pinctrl: renesas: rzg2l: Acquire lock in rzg2l_pinctrl_pm_setup_pfc()
To keep consistency with rzg2l_pinctrl_set_pfc_mode(), acquire the lock
in rzg2l_pinctrl_pm_setup_pfc() during PFC setup.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-15-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:24 +02:00
Lad Prabhakar
d930e8f783 pinctrl: renesas: rzg2l: Add support for custom parameters
In preparation for passing custom params for RZ/V2H(P) SoC assign the
custom params that are being passed via struct rzg2l_pinctrl_data.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240530173857.164073-14-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:24 +02:00
Lad Prabhakar
6f38a02ad8 pinctrl: renesas: rzg2l: Pass pincontrol device to pinconf_generic_parse_dt_config()
Pass the pincontrol device pointer to pinconf_generic_parse_dt_config()
in preparation for passing custom params.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-13-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:24 +02:00
Lad Prabhakar
19d4bce9ce pinctrl: renesas: rzg2l: Add support for pull-up/down
Add support to configure bias-disable, bias-pull-up, and bias-pull-down
properties of the pin.

Two new function pointers, hw_to_bias_param() and bias_param_to_hw(),
are introduced in the struct rzg2l_pinctrl_data to configure bias
settings, as the values in the PUPD register differ when compared to the
RZ/G2L family and the RZ/V2H(P) SoC.

Value | RZ/G2L        | RZ/V2H
---------------------------------
00b:  | Bias Disabled | Pull up/down disabled
01b:  | Pull-up       | Pull up/down disabled
10b:  | Pull-down     | Pull-down
11b:  | Prohibited    | Pull-up

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240530173857.164073-12-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:24 +02:00
Lad Prabhakar
b588b53b2c pinctrl: renesas: rzg2l: Add support to configure slew-rate
Add support to configure slew-rate property of the pin.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240530173857.164073-11-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:50:24 +02:00
Lad Prabhakar
7d566a4d27 pinctrl: renesas: rzg2l: Add function pointers for OEN register access
Introduce function pointers oen_read() and oen_write(), in the struct
rzg2l_pinctrl_data to facilitate reading and writing to the PFC_OEN
register.  On the RZ/V2H(P) SoC, unlocking the PWPR.REGWE_B bit before
writing to the PFC_OEN register is necessary, and the PFC_OEN register
has more bits compared to the RZ/G2L family.  To handle these
differences between RZ/G2L and RZ/V2H(P) and to reuse the existing code
for RZ/V2H(P), these function pointers are introduced.

Additionally, populate these function pointers with appropriate data for
existing SoCs.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-10-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:49:55 +02:00
Lad Prabhakar
ede014cd1e pinctrl: renesas: rzg2l: Add function pointer for PMC register write
Introduces pmc_writeb() function pointer, in the struct
rzg2l_pinctrl_data to facilitate writing to the PMC register.  On the
RZ/V2H(P) SoC, unlocking the PWPR.REGWE_A bit before writing to PMC
registers is required, whereas this is not the case for the existing
RZ/G2L family.  This addition enables the reuse of existing code for
RZ/V2H(P).  Additionally, populate this function pointer with
appropriate data for existing SoCs.

Note that this functionality is only handled in rzg2l_gpio_request(), as
PMC unlock/lock during PFC setup will be taken care of in the
pwpr_pfc_lock_unlock() function pointer.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-9-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:46:40 +02:00
Lad Prabhakar
14c32dc1f6 pinctrl: renesas: rzg2l: Add function pointer for PFC register locking
On the RZ/G2L SoC, the PFCWE bit controls writing to PFC registers.
However, on the RZ/V2H(P) SoC, the PFCWE (REGWE_A on RZ/V2H) bit controls
writing to both PFC and PMC registers.  Additionally, BIT(7) B0WI is
undocumented for the PWPR register on RZ/V2H(P) SoC.  To accommodate these
differences across SoC variants, introduce the pwpr_pfc_lock_unlock()
function pointer.

Note, in rzg2l_pinctrl_set_pfc_mode() the pwpr_pfc_lock_unlock(.., false)
is now called before PMC read/write and pwpr_pfc_lock_unlock(.., true) is
now called after PMC read/write this is to keep changes minimal for
RZ/V2H(P) SoC.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-8-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:46:29 +02:00
Lad Prabhakar
a3a632ed87 pinctrl: renesas: rzg2l: Validate power registers for SD and ETH
On RZ/V2H(P) SoC, the power registers for SD and ETH do not exist,
resulting in invalid register offsets.  Ensure that the register offsets
are valid before any read/write operations are performed.  If the power
registers are not available, both SD and ETH will be set to '0'.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-7-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:46:19 +02:00
Lad Prabhakar
08b68ae5a0 pinctrl: renesas: rzg2l: Enable variable configuration for all
Enable parsing of variable configuration for all architectures. This
prepares for adding support for the RZ/V2H SoC, which utilizes the ARM64
architecture and features port pins with variable configuration.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-6-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:46:07 +02:00
Lad Prabhakar
13a8cae6e5 pinctrl: renesas: rzg2l: Drop struct rzg2l_variable_pin_cfg
Drop the rzg2l_variable_pin_cfg struct and instead use the
RZG2L_VARIABLE_PIN_CFG_PACK() macro for the variable pin configuration.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:45:42 +02:00
Lad Prabhakar
8081a03793 pinctrl: renesas: rzg2l: Allow more bits for pin configuration
The pin configuration bits have been growing for every new SoCs being
added for the pinctrl-rzg2l driver which would mean updating the macros
every time for each new configuration.  To avoid this allocate additional
bits for pin configuration by relocating the known fixed bits to the very
end of the configuration.

Also update the size of 'cfg' to 'u64' to allow more configuration bits
in the 'struct rzg2l_variable_pin_cfg'.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://lore.kernel.org/r/20240530173857.164073-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-06-11 09:45:19 +02:00
Geert Uytterhoeven
f07a320691 pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped()
Use the scoped variant of for_each_child_of_node() to simplify the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/c0a28f466c42d5d59c7fadfa1fd05fd512d43b6f.1717060708.git.geert+renesas@glider.be
2024-06-07 14:12:10 +02:00
Peng Fan
c45c3f5f95 pinctrl: renesas: Use scope based of_node_put() cleanups
Use scope based of_node_put() cleanup to simplify code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240504-pinctrl-cleanup-v2-7-26c5f2dc1181@nxp.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-05-28 09:29:22 +02:00
Claudiu Beznea
a39741d38c pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore}
On PREEMPT_RT kernels the spinlock_t maps to an rtmutex. Using
raw_spin_lock_irqsave()/raw_spin_unlock_irqrestore() on
&pctrl->lock.rlock breaks the PREEMPT_RT builds. To fix this use
spin_lock_irqsave()/spin_unlock_irqrestore() on &pctrl->lock.

Fixes: 02cd2d3be1 ("pinctrl: renesas: rzg2l: Configure the interrupt type on resume")
Reported-by: Diederik de Haas <didi.debian@cknow.org>
Closes: https://lore.kernel.org/all/131999629.KQPSlr0Zke@bagend
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/20240522055421.2842689-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-05-27 17:13:31 +02:00
Linus Torvalds
a85629f435 - New Device Support
- Add support for X-Powers AXP717 PMIC to AXP22X
    - Add support for Rockchip RK816 PMIC to RK8XX
    - Add support for TI TPS65224 PMIC to TPS6594
 
  - New Functionality
    - Add Power Off functionality to Rohm BD71828
    - Allow I2C SMBus access in Renesas RSMU
 
  - Fix-ups
    - Device Tree binding adaptions/conversions/creation
    - Shift Intel support over to MSI interrupts
    - Generify adding platform data away from being ACPI specific
    - Use device core supplied attribute to register sysfs entries
    - Replace hand-rolled functionality with generic APIs
    - Utilise centrally provided helpers and macros
    - Clean-up error handling
    - Remove superfluous/duplicated/unused sections
    - Trivial; spelling, whitespace, coding-style adaptions
    - More Maple Tree conversions
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmZNwaMACgkQUa+KL4f8
 d2Gh8BAAlD0/SUXVKuMppST6pyqGp90BucELY/enaFFI7eHTrevxSM5Ywtbjig0l
 +pz7WYm0bmCGXhr1yGrrhryKc2hGWacT2MhM8mHpkomHpN3qEnRQRKnjISTHDLG5
 9t1UyqDaBsoI7HPO0iiHPiinoQnM/WIHEjaelQNgl4g2sj9iFMmGhXcYX6IXQwHs
 Yu3l58Yju7nBxjjmgb4tFs8CPf+/CCP0jpwzWd99kZHPcRhupULmQgSLhmbSf4H8
 /KQg7wFSufabxuJOKKR2gUIdGeMlaNhyoPtSdDyn0Pji7lubNyvfaK+JSyae9Esp
 HYD1RD87aQLFyJAfRnDUPI9xQauPpz29V/wGujlqTiz0GYEVGy4Yo2yWH/CoHhUV
 +yb3I/7I6u+rvQHH2bnsAUQ3doh6fuFNvjNJgNbBtqraJ2Pt3nJNGxfSolwPf3mt
 GEb60ahbzLMGtxbVoVOLbDvZgN3FeIKMcdamS1JvKTPTf62H9AOyhUIlzibm1AVl
 i3u2cEfygTeyqUdCIhNLEavmj4uHbFeGXgvveuvbizJTtdEoQ2QIuslwLTrpivkq
 URaDpZfclu9sv+FNY1wiQMnlC4uueyJpkfItEHX876uB7r1ReWMQD8Lf3hI5xJeh
 JM0si93OorG9DR3h5iBnJu1kHqtQ56E46BFP8oh70p9N+Hpaw5c=
 =QAjw
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for X-Powers AXP717 PMIC to AXP22X
   - Add support for Rockchip RK816 PMIC to RK8XX
   - Add support for TI TPS65224 PMIC to TPS6594

  New Functionality:
   - Add Power Off functionality to Rohm BD71828
   - Allow I2C SMBus access in Renesas RSMU

  Fix-ups:
   - Device Tree binding adaptions/conversions/creation
   - Shift Intel support over to MSI interrupts
   - Generify adding platform data away from being ACPI specific
   - Use device core supplied attribute to register sysfs entries
   - Replace hand-rolled functionality with generic APIs
   - Utilise centrally provided helpers and macros
   - Clean-up error handling
   - Remove superfluous/duplicated/unused sections
   - Trivial; spelling, whitespace, coding-style adaptions
   - More Maple Tree conversions"

* tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (44 commits)
  dt-bindings: mfd: Use full path to other schemas
  mfd: rsmu: support I2C SMBus access
  dt-bindings: mfd: Convert lp873x.txt to json-schema
  dt-bindings: mfd: aspeed: Drop 'oneOf' for pinctrl node
  dt-bindings: mfd: allwinner,sun6i-a31-prcm: Use hyphens in node names
  mfd: ssbi: Remove unused field 'slave' from 'struct ssbi'
  mfd: kempld: Remove custom DMI matching code
  mfd: cs42l43: Update patching revision check
  dt-bindings: mfd: qcom: pm8xxx: Add pm8901 compatible
  mfd: timberdale: Remove redundant assignment to variable err
  dt-bindings: mfd: qcom,spmi-pmic: Add pbs to SPMI device types
  dt-bindings: mfd: syscon: Add ti,am62p-cpsw-mac-efuse compatible
  dt-bindings: mfd: qcom,tcsr: Add compatible for SDX75
  mfd: axp20x: Convert to use Maple Tree register cache
  mfd: bd71828: Remove commented code lines
  mfd: intel-m10-bmc: Change staging size to a variable
  dt-bindings: mfd: Add ROHM BD71879
  mfd: Tidy Kconfig dependency's parentheses
  mfd: ocelot-spi: Use spi_sync_transfer()
  dt-bindings: mfd: syscon: Add missing simple syscon compatibles
  ...
2024-05-22 10:41:14 -07:00
Linus Torvalds
2de68638aa Pin control changes for the v6.10 kernel cycle:
Core changes:
 
 - Use DEFINE_SHOW_STORE_ATTRIBUTE() in debugfs entries.
 
 New drivers:
 
 - Qualcomm PMIH0108, PMD8028, PMXR2230 and PM6450
   pin control support.
 
 Improvements:
 
 - Serious cleanup of the recently merged aw9523 driver.
 
 - Fix PIN_CONFIG_BIAS_DISABLE handling in pinctrl-single.
 
 - A slew of device tree binding cleanups.
 
 - Support a bus clock in the Samsung driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmZLAM8ACgkQQRCzN7AZ
 XXNxcRAAhkMY+TH2J83NTFZ9ATMguQGaozLM3eGiVXGtOQmNqDo7aHmP/zTi+0Ve
 wC6UTQG0/s+MCkbEQPGN5DzEuEJxEJzWKiGjqNV4gl07QcHV8ZeSWu1lRHvW21PB
 LcRBYmw+wAI0tXCz5t3gAkjs8fc5Vj0uqbWdkgreukULbhikXLmcm5meQ9maZleT
 9GSK/nDqfHahp9hmALz8n1/niPtF4JzNnEfVcVcnBFlX/oszD6vxc0foM0TBEWKI
 q3HYOj1tw0ei+ke01eTlivi+suXDkrw0bDLozWYtFMhs9juJbEhf2RkKKfs4r1iW
 gukzogalaUDEgFK9MRboCqNEbnRkX8yNZQhAVqt5Q0yhaepl2UVgLfGI9TwQY/17
 r8f10fp7sKuf9bhRlVr+fMYT0M2QqowMgO8jpA+m4QeKrZKfYvuHFJUIKhtYV1zK
 6lGicvu5LBIbF2NOmoFvp1XiiWnoD1abrHxmEH/HRfm62bOEQYO/KKWuDY3WIuNb
 xtgQmkt6+WFMF693ygKErbtJKAR3IlFVZ/3mgL1areKp0fOETxqRng0ImYOaFwTG
 gijYm9MLJIlzX/yht/X7V77Sp4kIPz6WCqBIIataHpvDbEL4SBGjLIv/H1+pXtxi
 SHSuOPygJLzURogkVeANWQ2jT9LJVR1A/m9xoeA2HejEOlbFMnA=
 =9Ty5
 -----END PGP SIGNATURE-----

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

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

   - Use DEFINE_SHOW_STORE_ATTRIBUTE() in debugfs entries

  New drivers:

   - Qualcomm PMIH0108, PMD8028, PMXR2230 and PM6450 pin control support

  Improvements:

   - Serious cleanup of the recently merged aw9523 driver

   - Fix PIN_CONFIG_BIAS_DISABLE handling in pinctrl-single

   - A slew of device tree binding cleanups

   - Support a bus clock in the Samsung driver"

* tag 'pinctrl-v6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (48 commits)
  pinctrl: bcm2835: Make pin freeing behavior configurable
  dt-bindings: pinctrl: qcom,pmic-gpio: Fix "comptaible" typo for PMIH0108
  pinctrl: qcom: pinctrl-sm7150: Fix sdc1 and ufs special pins regs
  dt-bindings: pinctrl: mediatek: mt7622: add "antsel" function
  dt-bindings: pinctrl: mediatek: mt7622: fix array properties
  pinctrl: samsung: drop redundant drvdata assignment
  pinctrl: samsung: support a bus clock
  dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
  pinctrl: renesas: rzg2l: Limit 2.5V power supply to Ethernet interfaces
  pinctrl: renesas: r8a779h0: Add INTC-EX pins, groups, and function
  pinctrl: renesas: r8a779h0: Fix IRQ suffixes
  pinctrl: renesas: rzg2l: Remove extra space in function parameter
  dt-bindings: pinctrl: qcom,pmic-mpp: add support for PM8901
  pinctrl: pinconf-generic: print hex value
  pinctrl: realtek: fix module autoloading
  pinctrl: qcom: sm7150: fix module autoloading
  pinctrl: loongson2: fix module autoloading
  pinctrl: mediatek: fix module autoloading
  pinctrl: freescale: imx8ulp: fix module autoloading
  dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes
  ...
2024-05-20 08:51:53 -07:00
Linus Torvalds
ce952d8f0e gpio updates for v6.10-rc1
GPIO core:
 - remove more unused legacy interfaces (after converting the last remaining
   users to better alternatives)
 - update kerneldocs
 - improve error handling and log messages in GPIO ACPI code
 - remove dead code (always true checks) from GPIOLIB
 
 New drivers:
 - add a driver for Intel Granite Rapids-D vGPIO
 
 Driver improvements:
 - use -ENOTSUPP consistently in gpio-regmap and gpio-pcie-idio-24
 - provide an ID table for gpio-cros-ec to avoid a driver name fallback check
 - add support for gpio-ranges for GPIO drivers supporting multiple GPIO banks
 - switch to using dynamic GPIO base in gpio-brcmstb
 - fix irq handling in gpio-npcm-sgpio
 - switch to memory mapped IO accessors in gpio-sch
 
 DT bindings:
 - add support for gpio-ranges to gpio-brcmstb
 - add support for a new model and the gpio-line-names property to gpio-mpfs
 
 Documentation:
 - replace leading tabs with spaces in code blocks
 - fix typos
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmZDFa4ACgkQEacuoBRx
 13IJuA//cdR+Y1xaiORhVg9gMjmeQtgP7ve6QK4p/vuwAuZJMxboc4ATPY4cBlvp
 VoMFQD8FgjbxcKRLjugS0wB/5isELzo5C+q699YKY/0R07WMBiTIt6FgS4JJ1j57
 RoAlLrZ7gxmJQyUWuk2dvvQ55MnCL4fzVCzCrQB+foWsZluyeQMnndFU7z+P96bK
 ckvNrfFlZjaTwRBVf9MVpcNUxuk+pFKMKfXCgNCvmhToOaOM3sKkFwMMZCOVRLpJ
 oCcAz6rbj+fn2x3Id2FS2R5f5GoZx31dalLnbJCY4OLgDNhjx1A7sONq+hplfO24
 LXxQgCP26myaxmCFsiKqYgYzh/1bnAeCaRjy+41+RWXy7LUil6c0yP1Z3pOlOK+h
 j32+/LS9aflneoxjXyAAQLAvMulDbIvKeWHUakPXk6bS/AR6zyL16rwfF9U3K795
 ZGAz37xuOCpAevGnRTpPz9eCWwnNFq5v8UMjvVmoMgtbJbIwP4J3cRzj6RCiBvrq
 AvveulP+oXde3vFydAf1NbjaRxf53b8vZp6DLFDqcU+76QCQwG55QqlhT4Nqm/Y4
 KASQYM4vlH+96vnCMW+p2DmN92dkoadwk5pBvEaY7q7eEC2EdAMfujUZ1VdB9OZ+
 FPZ6zAp6T2khVt4jzKFxbobV8xt3FznntEhbm4bo3Ugb2HRwD8g=
 =mBWd
 -----END PGP SIGNATURE-----

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

Pull gpio updates from Bartosz Golaszewski
 "This was a quiet release cycle for the GPIO tree and so this
  pull-request is relatively small.

  We have one new driver, some minor improvements to the GPIO core code
  and across several drivers, some DT and documentation updates but in
  general nothing stands out or is controversial. All changes have spent
  time in next with no reported issues (or ones that were quickly
  fixed).

  GPIO core:
   - remove more unused legacy interfaces (after converting the last
     remaining users to better alternatives)
   - update kerneldocs
   - improve error handling and log messages in GPIO ACPI code
   - remove dead code (always true checks) from GPIOLIB

  New drivers:
   - add a driver for Intel Granite Rapids-D vGPIO

  Driver improvements:
   - use -ENOTSUPP consistently in gpio-regmap and gpio-pcie-idio-24
   - provide an ID table for gpio-cros-ec to avoid a driver name
     fallback check
   - add support for gpio-ranges for GPIO drivers supporting multiple
     GPIO banks
   - switch to using dynamic GPIO base in gpio-brcmstb
   - fix irq handling in gpio-npcm-sgpio
   - switch to memory mapped IO accessors in gpio-sch

  DT bindings:
   - add support for gpio-ranges to gpio-brcmstb
   - add support for a new model and the gpio-line-names property to
     gpio-mpfs

  Documentation:
   - replace leading tabs with spaces in code blocks
   - fix typos"

* tag 'gpio-updates-for-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (30 commits)
  gpio: nuvoton: Fix sgpio irq handle error
  gpiolib: Discourage to use formatting strings in line names
  gpio: brcmstb: add support for gpio-ranges
  gpio: of: support gpio-ranges for multiple gpiochip devices
  dt-bindings: gpio: brcmstb: add gpio-ranges
  gpio: Add Intel Granite Rapids-D vGPIO driver
  gpio: brcmstb: Use dynamic GPIO base numbers
  gpiolib: acpi: Set label for IRQ only lines
  gpiolib: acpi: Add fwnode name to the GPIO interrupt label
  gpiolib: Get rid of never false gpio_is_valid() calls
  gpiolib: acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
  gpiolib: acpi: Move acpi_can_fallback_to_crs() out of __acpi_find_gpio()
  gpiolib: acpi: Simplify error handling in __acpi_find_gpio()
  gpiolib: acpi: Extract __acpi_find_gpio() helper
  gpio: sch: Utilise temporary variable for struct device
  gpio: sch: Switch to memory mapped IO accessors
  gpio: regmap: Use -ENOTSUPP consistently
  gpio: pcie-idio-24: Use -ENOTSUPP consistently
  Documentation: gpio: Replace leading TABs by spaces in code blocks
  gpiolib: acpi: Check for errors first in acpi_find_gpio()
  ...
2024-05-14 15:07:07 -07:00
Linus Torvalds
14a60290ed soc: drivers for 6.10
As usual, these are updates for drivers that are specific to certain
 SoCs or firmware running on them. Notable updates include
 
  - The new STMicroelectronics STM32 "firewall" bus driver that is
    used to provide a barrier between different parts of an SoC
 
  - Lots of updates for the Qualcomm platform drivers, in particular
    SCM, which gets a rewrite of its initialization code
 
  - Firmware driver updates for Arm FF-A notification interrupts
    and indirect messaging, SCMI firmware support for pin control
    and vendor specific interfaces, and TEE firmware interface
    changes across multiple TEE drivers
 
  - A larger cleanup of the Mediatek CMDQ driver and some related bits
 
  - Kconfig changes for riscv drivers to prepare for adding Kanaan
    k230 support
 
  - Multiple minor updates for the TI sysc bus driver, memory controllers,
    hisilicon hccs and more
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmY+dbEACgkQYKtH/8kJ
 UifGTBAA3lh2qw++S5i6nk71388/nswb5fZKwqPKl1m+44SndE7r0/nauGm7IZhd
 oM5xiBZzsoYCKuesSuejkBNgPmUPtUhyHBJKSKjwrcak4k1mrjDgXxfSxCqGptVZ
 Ps683koJ/Ic7O/LQNxlVzUlssG/3gmhJELfpaVIB7rG8pmdgF9ocM73+iJrRwW1Q
 fTFXUXeCcXJ2N5Yki7z2+4oB3RebPzTBz4NeIYNdGQj5/u61oG0KzXwvk8eqWhNb
 0KJYsfAQZGzdyAys6XU1MHv4T4L2a3DQL6NMgLnovVEMhP2Hk0XlBmI7X+uAXYiM
 2z289d9Wx3HMoiekulDJ+rpDUPxPXrEqaRkfWZ8G+HSY4KcIeSP7YGmhylr0kdvw
 +Qo6orxZ9lkSPaT1aUkNIIywDzet/E2hY8zV1EcLBu9GWjkybAvT/Uy2lSSN+LLH
 yEQyDf+s90N6QuZwdXN8a3QliP39tHqlye8wou6UQG8aZ7z870fKAKlvA6DjTfPM
 JyhY1rXYH/bvC87sVTi5Qb09+2R6ftvk5xijiMOyXugPpO/6PQKULVataeUnzwgs
 YTgOPhaqXVadDR/nkrG3FzEtvpYeTspwGpDiEpDrNHf5H1tFg6VfPNS8y0QOlSPY
 JcmylQNCtwxCRLTw2NHOb3tLcY4ruDHNmrWf5INTzf6cJe49jaU=
 =4rf0
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "As usual, these are updates for drivers that are specific to certain
  SoCs or firmware running on them.

  Notable updates include

   - The new STMicroelectronics STM32 "firewall" bus driver that is used
     to provide a barrier between different parts of an SoC

   - Lots of updates for the Qualcomm platform drivers, in particular
     SCM, which gets a rewrite of its initialization code

   - Firmware driver updates for Arm FF-A notification interrupts and
     indirect messaging, SCMI firmware support for pin control and
     vendor specific interfaces, and TEE firmware interface changes
     across multiple TEE drivers

   - A larger cleanup of the Mediatek CMDQ driver and some related bits

   - Kconfig changes for riscv drivers to prepare for adding Kanaan k230
     support

   - Multiple minor updates for the TI sysc bus driver, memory
     controllers, hisilicon hccs and more"

* tag 'soc-drivers-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (103 commits)
  firmware: qcom: uefisecapp: Allow on sc8180x Primus and Flex 5G
  soc: qcom: pmic_glink: Make client-lock non-sleeping
  dt-bindings: soc: qcom,wcnss: fix bluetooth address example
  soc/tegra: pmc: Add EQOS wake event for Tegra194 and Tegra234
  bus: stm32_firewall: fix off by one in stm32_firewall_get_firewall()
  bus: etzpc: introduce ETZPC firewall controller driver
  firmware: arm_ffa: Avoid queuing work when running on the worker queue
  bus: ti-sysc: Drop legacy idle quirk handling
  bus: ti-sysc: Drop legacy quirk handling for smartreflex
  bus: ti-sysc: Drop legacy quirk handling for uarts
  bus: ti-sysc: Add a description and copyrights
  bus: ti-sysc: Move check for no-reset-on-init
  soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC
  soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
  firmware: arm_ffa: Fix memory corruption in ffa_msg_send2()
  bus: rifsc: introduce RIFSC firewall controller driver
  of: property: fw_devlink: Add support for "access-controller"
  soc: mediatek: mtk-socinfo: Correct the marketing name for MT8188GV
  soc: mediatek: mtk-socinfo: Add entry for MT8395AV/ZA Genio 1200
  soc: mediatek: mtk-mutex: Add support for MT8188 VPPSYS
  ...
2024-05-13 08:48:42 -07:00
Lee Jones
cac5fd398b Merge branches 'ib-mfd-misc-pinctrl-regulator-6.10', 'ib-mfd-pinctrl-regulator-6.10' and 'ib-mfd-regulator-6.10' into ibs-for-mfd-merged 2024-05-10 15:38:46 +01:00
Arnd Bergmann
a3116c8881 RISC-V SoC Kconfig Updates for v6.10
A few different bits of SoC-related Kconfig work. The first part of
 this is shared with the DT updates - the modification of all SOC_CANAAN
 users to SOC_CANAAN_K210 to split the existing m-mode nommu k210 away
 from the k230 that is able to be used in a "common" kernel.
 
 The other thing here is the removal of most of the SOC_VENDOR options,
 with their ARCH_VENDOR equivalents that've been waiting in the wings for
 1 year+ now made visible. Due a lapse on my part when originally adding
 the ARCH_VENDOR stuff, the Microchip transition isn't complete - the
 _POLARFIRE was a mistake to keep as there's gonna be non-PolarFire
 RISC-V stuff from Microchip soonTM.
 
 Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZjUIHwAKCRB4tDGHoIJi
 0r8RAQD+B5rJde/sQuQlmkJGrmZfyE/6/I1ZFxv0/xHhRPNWRAD/RFTTDthL/7c4
 frMGl/nWSD3fvGmXrQ7Dp6wc1APIdQI=
 =BWHh
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmY57kAACgkQYKtH/8kJ
 Uie0Sg/8D8tZVOtBrpVJG/P5F7W1QdcC336GHBMQCho38C0/4AK5ltvdyxmSxmCl
 k84qaLdYNrGIvJ5o6MRmSAZyzT3y3jLYVA8C2Zsrp+Do8KkvvJGl219pUvp5A0J3
 eoMApJ34wx6dQM9LfpLcvU9C3Z767KeiiRm0h5CTV0IUfJnZB/7IQgwSajEGLOr/
 CHtFZpbYK6VgCDgVhbacSY8495jJrIU4i5RDlILst5K64XrmS2UU2oen2L3X/u8h
 xi5nQ//3qCiIfp5UqvBY12OYF8lVzB+F/Uo9vDCpeF9HFiIE69qMgYJiSviCPbwH
 T54zue+oBPGfL57HQoMTYQGUG4GvlnW7JR841GsIlPjrs54uw2kXDZB586n3tqzN
 esAQCc/sNnCuUX9TYKKBzkIrmQ1oTPRdGO61r+lSgxjYQ/ed++eh6KStlbPmttVo
 piEaxSpLS7TOZcVOyXHFrWK6OR4yB6MD6ZvOGJlJKJZSdfMNTlGcoymiJ0j7hVQb
 QJSr3LaIfQMP+Uf5ZWWlNZIxvwxQKER8v6MbyH3vGAVYa+DnDBzaj9Fh364thJnt
 Uybpz7SDQMIugnB+uSe+D1o65XfTEKOn/OHXYEQVYyoWs63QfTE9012+Q4KqBFBQ
 5ylIkvM9r3xMBkzZT3EU8lgr5gx9r5QQuX9czJ7INSBxo4SmuKE=
 =QGOJ
 -----END PGP SIGNATURE-----

Merge tag 'riscv-config-for-v6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/drivers

RISC-V SoC Kconfig Updates for v6.10

A few different bits of SoC-related Kconfig work. The first part of
this is shared with the DT updates - the modification of all SOC_CANAAN
users to SOC_CANAAN_K210 to split the existing m-mode nommu k210 away
from the k230 that is able to be used in a "common" kernel.

The other thing here is the removal of most of the SOC_VENDOR options,
with their ARCH_VENDOR equivalents that've been waiting in the wings for
1 year+ now made visible. Due a lapse on my part when originally adding
the ARCH_VENDOR stuff, the Microchip transition isn't complete - the
_POLARFIRE was a mistake to keep as there's gonna be non-PolarFire
RISC-V stuff from Microchip soonTM.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

* tag 'riscv-config-for-v6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux:
  riscv: config: enable ARCH_CANAAN in defconfig
  RISC-V: drop SOC_VIRT for ARCH_VIRT
  RISC-V: drop SOC_SIFIVE for ARCH_SIFIVE
  RISC-V: drop SOC_MICROCHIP_POLARFIRE for ARCH_MICROCHIP
  RISC-V: Drop unused SOC_CANAAN
  reset: k210: Deprecate SOC_CANAAN and use SOC_CANAAN_K210
  pinctrl: k210: Deprecate SOC_CANAAN and use SOC_CANAAN_K210
  clk: k210: Deprecate SOC_CANAAN and use SOC_CANAAN_K210
  soc: canaan: Deprecate SOC_CANAAN and use SOC_CANAAN_K210 for K210
  riscv: Kconfig.socs: Split ARCH_CANAAN and SOC_CANAAN_K210

Link: https://lore.kernel.org/r/20240503-mardi-underling-3d81a9f97329@spud
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-05-07 11:02:56 +02:00
Bartosz Golaszewski
68a25c3671 intel-gpio for v6.10-1
* New driver for vGPIO controller on Intel Granite Rapids-D
 * Update ACPI GPIO library to unify the IRQ code path
 * Better GPIO IRQ line labeling for ACPI
 * Switched Intel SCH driver to use "mapped" I/O accessors
 
 The following is an automated git shortlog grouped by driver:
 
 Add Intel Granite Rapids-D vGPIO driver:
  - Add Intel Granite Rapids-D vGPIO driver
 
 crystalcove:
  -  Use -ENOTSUPP consistently
 
 gpiolib:
  -  acpi: Set label for IRQ only lines
  -  acpi: Add fwnode name to the GPIO interrupt label
  -  acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
  -  acpi: Move acpi_can_fallback_to_crs() out of __acpi_find_gpio()
  -  acpi: Simplify error handling in __acpi_find_gpio()
  -  acpi: Extract __acpi_find_gpio() helper
  -  acpi: Check for errors first in acpi_find_gpio()
  -  acpi: Remove never true check in acpi_get_gpiod_by_index()
 
 sch:
  -  Utilise temporary variable for struct device
  -  Switch to memory mapped IO accessors
 
 wcove:
  -  Use -ENOTSUPP consistently
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmY4lK4ACgkQb7wzTHR8
 rCjo8Q//YaGaR/0ZEh9s8pz5lLNz7MiyW3pDrABrRqd68yR4GhQcyHiUaybIrVtf
 ayNoyLn7u9On/j8bVPhru3fYWNGazg0q4KnMJu4BgkNsCCP6KWERHKzVHLuXg52Y
 zQiUsOWxlESYNlIhl0COy/o87dTPxQ3omnthMUDYUEvxuUv6aNIC0uCpXmSNm0+/
 L9bZo7z6AiZMOeU7+XnoGuzWt2OeQjpR3liHo2zgR8ftPIp+iqjiRrA39+adXl7l
 LVro6F76p/xxNfGEzB4qxpz1jwHSkEhhFtcd13+t/CHXAm34BcAMbm1xJN1yHNmU
 e42CQ2gAOZo8F88iW4z56Wr446Uw0knf17Fe91Xd1CpqMdW0Hp9arta7awPoxh0R
 kHx5T71UkilX6+/CwREL7hiolvnNCO/q7djq/XeO//xPT67N0EU5mKZF/1yQiLWz
 NrJpNCRiQq2ZaHhOA0eS/4+iokpkLE0baeXsQhWrIjvFXfif8J82GiSgce1RzbHO
 v0yGeUHRJvY54zdXMKzCXEw+bgOyJZPmk4tZwq9XCkBcCrjxmR4cUtPCkv7B7QWN
 aSaeFh4AAQoSal8jMey/et+nctFZyO87aK8Enze9kzv/9FIc5837yXfz1qfjffPd
 E1m4RYh5t8DgC+msBjwbr1jcOM6FJ5KyEXXZf5CgAEzL5Bespm4=
 =33sC
 -----END PGP SIGNATURE-----

Merge tag 'intel-gpio-v6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next

intel-gpio for v6.10-1

* New driver for vGPIO controller on Intel Granite Rapids-D
* Update ACPI GPIO library to unify the IRQ code path
* Better GPIO IRQ line labeling for ACPI
* Switched Intel SCH driver to use "mapped" I/O accessors

The following is an automated git shortlog grouped by driver:

Add Intel Granite Rapids-D vGPIO driver:
 - Add Intel Granite Rapids-D vGPIO driver

crystalcove:
 -  Use -ENOTSUPP consistently

gpiolib:
 -  acpi: Set label for IRQ only lines
 -  acpi: Add fwnode name to the GPIO interrupt label
 -  acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
 -  acpi: Move acpi_can_fallback_to_crs() out of __acpi_find_gpio()
 -  acpi: Simplify error handling in __acpi_find_gpio()
 -  acpi: Extract __acpi_find_gpio() helper
 -  acpi: Check for errors first in acpi_find_gpio()
 -  acpi: Remove never true check in acpi_get_gpiod_by_index()

sch:
 -  Utilise temporary variable for struct device
 -  Switch to memory mapped IO accessors

wcove:
 -  Use -ENOTSUPP consistently
2024-05-07 09:42:06 +02:00
Linus Walleij
83906257f2 Samsung pinctrl drivers changes for v6.10
1. Add support for toggling bus clock (PCLK) for any pin controller
    register accesses.  This looks needed on newer Samsung chips, like
    Google GS101 and probably Exynos850.
 2. Drop old, deprecated in v6.1 bindings header with register constants.
    The constants were moved to DTS headers.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmY0qykQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD1ylZD/9Y+qotJz/GkLvFomo9sYmGbzuQowJRnYr7
 Twti8xeu8GUP1zye9QM4hLeBjKzdYUxCDAVHTwtDLQuzirgPQ93+DvmxJ1H8f4yT
 isZQhGAbhDnNb14ML/QDOGZueaZsK8Y08fuDCdLW8pWPrg6CsB4UhvoKRD5TgExq
 th8Slyo/aCaf8dVN3xgA1xu4A6yhosG/kCJIA1c2T5iyXJB6UZNBJGcB376vwRms
 yw/jqjQ/FOdWeuA/wDqXOZOlGuaoETJpFzS/+5tCKjE25IF2/PCR9lQeqSI1tglz
 pHIJ69eny+sEAlFcAgzhyr1wvRGnPthW1BqGcNpe1cJl07CnQj5K/SKyHBpp1nGu
 JV/RHCUrqWyzIyk0WNBx65eYpxr+9UldJ9PIU8N1vtPj59UUr4gP6hrYRiPAbvfT
 i/ObSYvczkRW4/DykPI3L8k87Wo/Lk7IJoR8siCQ5aPqpIo+9G/f5Hq+1CUSfAt8
 i5kNX3qNAMYVrsVfOAe9cWPNlpoO6caOqoE8zJgsRVbKR+1OlH3KOXPL6xf3CfJR
 oNYv4mxHzjdvI44cpPk5qp6QXi0GP3XfvcaYoguX32vrmn+/vjKyDTq7udDZXHDz
 ZWj/CrfnCOB9itM4wF848zwnH1kHF7/UP2/0M7WU0Wt35w5ZKK7bIGIEMZ2aSiMH
 ygycIEWs5Q==
 =wjQ1
 -----END PGP SIGNATURE-----

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

Samsung pinctrl drivers changes for v6.10

1. Add support for toggling bus clock (PCLK) for any pin controller
   register accesses.  This looks needed on newer Samsung chips, like
   Google GS101 and probably Exynos850.
2. Drop old, deprecated in v6.1 bindings header with register constants.
   The constants were moved to DTS headers.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-05-06 08:53:50 +02:00
Stefan Wahren
8ff05989b4 pinctrl: bcm2835: Make pin freeing behavior configurable
Until now after a bcm2835 pin was freed its pinmux was set to GPIO_IN.
So in case it was configured as GPIO_OUT before the configured output
level also get lost. As long as GPIO sysfs was used this wasn't
actually a problem because the pins and their possible output level
were kept by sysfs.

Since more and more Raspberry Pi users start using libgpiod they are
confused about this behavior. So make the pin freeing behavior of
GPIO_OUT configurable via module parameter. In case
pinctrl-bcm2835.persist_gpio_outputs is set to 1, the output level is
kept.

This patch based on the downstream work of Phil Elwell.

Link: https://github.com/raspberrypi/linux/pull/6117
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Message-ID: <20240503062745.11298-1-wahrenst@gmx.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-05-06 08:14:01 +02:00
Nirmala Devi Mal Nadar
2088297159 pinctrl: pinctrl-tps6594: Add TPS65224 PMIC pinctrl and GPIO
Add support for TPS65224 pinctrl and GPIOs to TPS6594 driver as they have
significant functional overlap.
TPS65224 PMIC has 6 GPIOS which can be configured as GPIO or other
dedicated device functions.

Signed-off-by: Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>
Signed-off-by: Bhargav Raviprakash <bhargav.r@ltts.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/0109018f2fdce15d-c13bd809-a11b-4202-9b7f-c9380d51b070-000000@ap-south-1.amazonses.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-03 10:07:11 +01:00
Alex Bee
1bd97d64b5 pinctrl: rk805: Add rk816 pinctrl support
This adds support for RK816 to the exising rk805 pinctrl driver

It has a single pin which can be configured as input from a thermistor (for
instance in an attached battery) or as a gpio.

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240416161237.2500037-4-knaerzche@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-03 09:15:33 +01:00
Danila Tikhonov
5ed79863fa pinctrl: qcom: pinctrl-sm7150: Fix sdc1 and ufs special pins regs
SDC1 and UFS_RESET special pins are located in the west memory bank.

SDC1 have address 0x359a000:
0x3500000 (TLMM BASE) + 0x0 (WEST) + 0x9a000 (SDC1_OFFSET) = 0x359a000

UFS_RESET have address 0x359f000:
0x3500000 (TLMM BASE) + 0x0 (WEST) + 0x9f000 (UFS_OFFSET) = 0x359a000

Fixes: b915395c9e ("pinctrl: qcom: Add SM7150 pinctrl driver")
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Message-ID: <20240423203245.188480-1-danila@jiaxyga.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-05-03 09:55:04 +02:00
Linus Torvalds
e5c8fc5955 Pin control fixes for the v6.9 series:
- Fix a double-free in the pinctrl_enable() errorpath.
 
 - Fix a refcount leak in pinctrl_dt_to_map().
 
 - Fix selecting the GPIO pin control state and the UART3
   pin config group in the Intel Baytrail driver.
 
 - Fix readback of schmitt trigger status in the Mediatek
   Paris driver, along with some semantic pin config issues
   in this driver.
 
 - Fix a pin suffix typo in the Meson A1 driver.
 
 - Fix an erroneous register offset in he Aspeed G6 driver.
 
 - Fix an inconsistent lock state and the interrupt type on
   resume in the Renesas RZG2L driver.
 
 - Fix some minor confusion in the Renesas DT bindings.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmYwnFsACgkQQRCzN7AZ
 XXNOgw/9HiN5N8Z869DT92OOQn8cFAshkxB/oN9ltd/Mzc73RquNB6pSAB1k43t1
 6TnhHhMQOswflGOTR9aSdo96iHwx596D1nyCy56uSX9dGa2I9smwIpBoeT1rNTmM
 HEt0CbHAWJ93F2BTBXNy6/fgLM/fZtD4SiCSiUynluUA9s/mSx7JmA6Lly6WSQBF
 cRLj4DbVEKOUaHLcB90G0NI8VtJzjaRIdTkSqawd0SVVz+8vBmdLNWib6XvUsEP7
 rQMs5omy+NSOWK0gKOUzXVZaXq8glbah3lZtFBZkZPjr13ymRjAipyhS0K3G6xhS
 9jCSYfkwnpO3xb/D9/ZYhDd2FC3bQmphxMIzb/LYWoNDp6mdyQxbGtnO5lco9fI1
 TcOfMpP24M6Eong9xiFUiIY/yghX10yBsbWzwX6qEO8O85DHmH0JWu8akHhKKPwJ
 7W1uWxAtC0URWSG3qEDpcUzB8shWK7T5jNjgvsDn/cUyQ7WXk1XjOa17U1Ka019R
 v+XvJ0Z0RHn2eqKme9OfX6W5zC0fD4P5nQpE6KW051U0/wSyQVGPTzcIJGa23JeF
 ZvS/2te2dsmCZtlg0lmwdzi10p3QmFZ4t1xbxVgXt2VMvD6zWRwtyP76O4Nwbwg2
 OaLQVVbinDZQ90e1FaYSWNNN8jTuUo781kEZiq6gEaJfnlblV5A=
 =BG4d
 -----END PGP SIGNATURE-----

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

Pull pin control fixes from Linus Walleij:

 - Fix a double-free in the pinctrl_enable() errorpath

 - Fix a refcount leak in pinctrl_dt_to_map()

 - Fix selecting the GPIO pin control state and the UART3 pin config
   group in the Intel Baytrail driver

 - Fix readback of schmitt trigger status in the Mediatek Paris driver,
   along with some semantic pin config issues in this driver

 - Fix a pin suffix typo in the Meson A1 driver

 - Fix an erroneous register offset in he Aspeed G6 driver

 - Fix an inconsistent lock state and the interrupt type on resume in
   the Renesas RZG2L driver

 - Fix some minor confusion in the Renesas DT bindings

* tag 'pinctrl-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: renesas: rzg2l: Configure the interrupt type on resume
  pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
  pinctrl: baytrail: Add pinconf group for uart3
  pinctrl: baytrail: Fix selecting gpio pinctrl state
  pinctrl: mediatek: paris: Rework support for PIN_CONFIG_{INPUT,OUTPUT}_ENABLE
  pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback
  pinctrl: core: delete incorrect free in pinctrl_enable()
  pinctrl/meson: fix typo in PDM's pin name
  pinctrl: pinctrl-aspeed-g6: Fix register offset for pinconf of GPIOR-T
  pinctrl: renesas: rzg2l: Execute atomically the interrupt configuration
  dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Allow 'input' and 'output-enable' properties
2024-04-30 08:50:58 -07:00
Krzysztof Kozlowski
e5b3732a96 pinctrl: samsung: drop redundant drvdata assignment
Fix W=1 warning:

  drivers/pinctrl/samsung/pinctrl-samsung.c: In function ‘samsung_gpio_set_direction’:
  drivers/pinctrl/samsung/pinctrl-samsung.c:633:42: warning: variable ‘drvdata’ set but not used [-Wunused-but-set-variable]

Fixes: f9c7447479 ("pinctrl: samsung: support a bus clock")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404300825.6lxLwvUY-lkp@intel.com/
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20240430060304.12332-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2024-04-30 09:41:58 +02:00
Arnd Bergmann
21cbc1058a Arm SCMI updates for v6.10
1. Basic support for SCMI v3.2 pincontrol protocol
 
    SCMI v3.2 introduces pincontrol protocol which is intended for
    controlling pins and their configuration. The pin control protocol
    provides commands to:
    - List the pins, groups of pins, available functions, and their
      association with each other.
    - Set the parameter configuration and multiplexing of the pins or
      groups of pins
    - Optionally request exclusive access to a pin or group of pins.
    - Optionally configure the permissions of an agent to access a pin
      or group of pins.
 
   These changes adds basic support for the same in the SCMI core layer
   and an implementation of the generic scmi-pinctrl driver with associated
   DT bindings.
 
 2. Framework support for multiple vendors custom protocols
 
    With the fixed space for vendor protocols, the possibility of having
    multiple vendors implementing distinct SCMI vendor protocols with
    the same overlapping protocol number is very high and with the need
    to support them all in a single kernel image or a module is also high.
 
    In order to implement the same we assume:
    - vendor protocols has to be tagged at build time with a vendor_id
    - vendor protocols could also optionally be tagged at build time with
      sub_vendor_id and implementation version
 
   At the initialisation all the built vendor protocols are registered
   with the SCMI core using a key derived from the above tags
 
 3. Logging and tracing improvements
 
    This includes using dev_err_probe() to bail out from probe, adding
    message dump traces for bad and unexpected replies and widening of
    the tag buffer in trace_scmi_dump_msg to allow diverse tag names
 
 4. Miscellaneous updates or improvements
 
    This includes adding the accessor function get_max_msg_size() used
    in pinctl protocol, updation of dt-bindings examples for protocol@13
    to promote new bindings and simplification of scmi_devm_notifier_unregister
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmYrfzYACgkQAEG6vDF+
 4phXdw//ZmvCV76D3XGJsXnc2Ivv/uaOZKRhzI+IKn0U529hI2YscA9BfhiLZOOI
 68KqWiScMTGH5Zn1oDC5wpIEj0i3S/2ZdXZXWSN35+ccsz6y2hbf2q2ciMl1Vrf0
 co8kxiDABI+RBeGpiSVQ2Yp6TEnxkiNDNAfON+A+xxbHhhLxGLcCCO33xbJ9Ui7e
 QpW2xan7AiSANRTUdvM21h00Uy1O/kAkcZJC2oLtCjUr3lzczrZkBCIor0jBE4VB
 SmM9vvcjWdfLVdfgxeFEAFvxN0fI9RT8ALRyfWbnPcCb37GUUMwS+J/Dz+P3yUa9
 6vGz4CCdXpC1lxcM2z5cZsAqwk3WS8LU840lJyb2+gGxLoSPwr1z0NWNCqZQppkp
 5LDaFh2v5b34epMHRkNUHTytMBHy5p9c81TOSYH7S2bEsQTOi9qjviH0RqSjyR5A
 s9+dlxfUiZfoE71UYQLO2E0knu3AwIRQ6oEkhbmLFedOVegkoTeYkaAfdyEAO+SH
 vqLEX88wwMU6B+bjDnN7lYTuSXbZVKu66TZk6oqMVnv2BQ29pmOR3AFQdFNpLA8W
 lRygSMEbADzNuJla5Az+VH2tWf1hOmpSsMIOAJbZ6/drv0yFnbBwgtGkAmkqEr68
 IQxwJTVQmPlgqpsCATzV29qgSEosHDJo9LZw9/DtgTx5qGL/to0=
 =WRU/
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmYwB/YACgkQYKtH/8kJ
 UicgvxAAh8OV+YcHzBTHdsHDc7iQkb9tmvZg6Cw4sYP8AJ3zZ2NjRYJXLYxxzE6T
 l+W8DIeV3ZQow+B/x6Xexdz9P/NKnxlTPO1/Z7hGpC2aDiBkseP3WliIJgBH0+iF
 m6p3VOSVKcfM8vds0d5l35ITHL0eVJzb7bN6PKUR75I2cDJ2UDbWV6OadNNyt4tX
 eEkCNnmuTx1bhpRXLpAXpEBb4FdbFNc5cSJHw9nbdCyQ8vFtHkaH82L9MCjy4kaW
 fSRwkNzqwWOA2tS3tkDvsczF4360RKoL95Y92lrQVTlnMjGLaUsCbs8FDKwHNZKb
 6hBoiYQERmhGvb76+34kbMM50MyWohjzZcbCL6o3cU195KWJCN1a1cUbq8J+H7k1
 MeK0XuwYUu6HdApwI6AfHl9vCvyJB9/XsvWz1eEocbmP8M2aPeXtl8y3vImZ6rkX
 aj/a9HuSKpAncqsdvpz4FoC0Q16gMZYtW6257kHcPX3QHvRlzJk7fHuqqIAQUsSf
 prOfYGBCvBuPT3S+bgG7L74Ddt4JLGHYjDxdNP4DR9xLR62ek2eQWc+cVqooatoA
 ZNckHV6Bibegtb+p/5RWgFem1XAOePM5gC1i5gvqy3oqsAQDrAd9Mx6s97AfrPzN
 dU9WTMohCjebdyqxYDGb31xzi5VY/L3/UJp3X9moJqbajXX+ty4=
 =Yce+
 -----END PGP SIGNATURE-----

Merge tag 'scmi-updates-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm SCMI updates for v6.10

1. Basic support for SCMI v3.2 pincontrol protocol

   SCMI v3.2 introduces pincontrol protocol which is intended for
   controlling pins and their configuration. The pin control protocol
   provides commands to:
   - List the pins, groups of pins, available functions, and their
     association with each other.
   - Set the parameter configuration and multiplexing of the pins or
     groups of pins
   - Optionally request exclusive access to a pin or group of pins.
   - Optionally configure the permissions of an agent to access a pin
     or group of pins.

  These changes adds basic support for the same in the SCMI core layer
  and an implementation of the generic scmi-pinctrl driver with associated
  DT bindings.

2. Framework support for multiple vendors custom protocols

   With the fixed space for vendor protocols, the possibility of having
   multiple vendors implementing distinct SCMI vendor protocols with
   the same overlapping protocol number is very high and with the need
   to support them all in a single kernel image or a module is also high.

   In order to implement the same we assume:
   - vendor protocols has to be tagged at build time with a vendor_id
   - vendor protocols could also optionally be tagged at build time with
     sub_vendor_id and implementation version

  At the initialisation all the built vendor protocols are registered
  with the SCMI core using a key derived from the above tags

3. Logging and tracing improvements

   This includes using dev_err_probe() to bail out from probe, adding
   message dump traces for bad and unexpected replies and widening of
   the tag buffer in trace_scmi_dump_msg to allow diverse tag names

4. Miscellaneous updates or improvements

   This includes adding the accessor function get_max_msg_size() used
   in pinctl protocol, updation of dt-bindings examples for protocol@13
   to promote new bindings and simplification of scmi_devm_notifier_unregister

* tag 'scmi-updates-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  pinctrl: Implementation of the generic scmi-pinctrl driver
  firmware: arm_scmi: Add basic support for SCMI v3.2 pincontrol protocol
  dt-bindings: firmware: Support SCMI pinctrl protocol
  firmware: arm_scmi: Introduce get_max_msg_size() helper/accessor
  firmware: arm_scmi: Add support for multiple vendors custom protocols
  dt-bindings: firmware: arm,scmi: Update examples for protocol@13
  firmware: arm_scmi: Avoid non-constant printk format strings
  firmware: arm_scmi: Use dev_err_probe to bail out
  firmware: arm_scmi: Simplify scmi_devm_notifier_unregister
  firmware: arm_scmi: Add message dump traces for bad and unexpected replies
  firmware: arm_scmi: Add helper to trace bad messages
  include: trace: Widen the tag buffer in trace_scmi_dump_msg
  firmware: arm_scmi: Log the perf domain names in the error paths

Link: https://lore.kernel.org/r/20240426105031.1526987-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-04-29 22:49:58 +02:00
André Draszik
f9c7447479 pinctrl: samsung: support a bus clock
On some Samsung-based SoCs there are separate bus clocks / gates each
for each pinctrl instance. To be able to access each pinctrl instance's
registers, this bus clock needs to be running, otherwise register
access will hang. Google Tensor gs101 is one example for such an
implementation.

Update the driver to handle this optional bus clock:
* handle an optional bus clock from DT
* prepare it during driver probe
* enclose all relevant register accesses with a clock enable & disable

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20240426-samsung-pinctrl-busclock-v3-2-adb8664b8a7e@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2024-04-29 19:19:30 +02:00
Linus Walleij
dbe0ed3302 pinctrl: renesas: Updates for v6.10
- Add external interrupt pin groups on R-Car V4M,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZitfrwAKCRCKwlD9ZEnx
 cPl0AP4uqQhymD3BnSqmzMQkAE8vHgco6isSm2QHRBBc5im8JAEA/5pa0AohDp+5
 eIF4/FHpeEjMSDyWVWZW3ABoi0UQVwA=
 =91h0
 -----END PGP SIGNATURE-----

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

pinctrl: renesas: Updates for v6.10

  - Add external interrupt pin groups on R-Car V4M,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-29 14:30:52 +02:00
Linus Walleij
ac816e9eb5 intel-pinctrl for v6.9-1
* Correct GPIO selection and add UART3 pins for Intel Bay Trail
 
 The following is an automated git shortlog grouped by driver:
 
 baytrail:
  -  Add pinconf group for uart3
  -  Fix selecting gpio pinctrl state
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmYqSJwACgkQb7wzTHR8
 rChWdg/8DbivW9byob4ITp1xCTnf9D+yIwVKWb98122xHD6ENXjqTZDPqvO5XKLK
 jiOhIJaeDn30PbB7CCm+HKQ+Q5sj/fa5q4Q4X+YityntVcdCs98ZJzpmKX3wUU0T
 LjlnUM9+Od7ExypVncUWrKFx3yPmmxXMm9DCm3EE3JYxrb7yBEXAnADdC9ylP0tD
 5CqUB3pvL4hgl0x5UXl+UJvlWeO4j/TrFbJMzJV/jF8gQHm7B8gKjebc5gpvNbVo
 SOmuyMRhAW9VCIGkMxIltUaKjza7Qkca0OVbCA2CKblVvGEMq/QYbf1L1VP0HF3B
 UGm9NxwJJtmy+kUzEuwSg41gxrqonISmIySCYjbonYLbOFQZYWip8ZBSCgmBUhv3
 3kCiqCC5gQEGjpC5OMJ3MhbY/IdMsrtipDjNa4uwyPUJwhqVKIEESJwZnabMjfbi
 bmy2Y+fbKil/0OLwwIsybI64obnVgcGj9UAoD7/pU0+7UsA6+lY/UzPbeL2oC38t
 OERXibLaFf4NJ6NJDowdu3Rlijy8HRGFdlEAREMzydBXuWGMrNMneluIuCMtyiAd
 /KF+cAHoFKRrD0piA9R54SYqK93rqjJgu81huko3/xnZmQGdDGj8Qy6ssDA6Aoax
 GS4cRr/LMGpiRX5/f5v+vySBSRf4cezkICGief5uWxLOiIJNW7A=
 =PWTy
 -----END PGP SIGNATURE-----

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

intel-pinctrl for v6.9-1

* Correct GPIO selection and add UART3 pins for Intel Bay Trail

The following is an automated git shortlog grouped by driver:

baytrail:
 -  Add pinconf group for uart3
 -  Fix selecting gpio pinctrl state
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-25 14:30:54 +02:00
Linus Walleij
7fb1fe37a1 pinctrl: renesas: Fixes for v6.9 (take two)
- Fix interrupt configuration on RZ/G2L after s2ram.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZiobmAAKCRCKwlD9ZEnx
 cLw/AQDo44Mpw5I6DMkZCg3D9ux6LrSkgGj+BpYUb45n9k2sSgD8CXWktVXYrXd2
 mUtT+Kf8GWa+i2QP7Y/MDqF46pqRxw0=
 =pkn9
 -----END PGP SIGNATURE-----

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

pinctrl: renesas: Fixes for v6.9 (take two)

  - Fix interrupt configuration on RZ/G2L after s2ram.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-25 14:28:31 +02:00
Paul Barker
cd27553b0d pinctrl: renesas: rzg2l: Limit 2.5V power supply to Ethernet interfaces
The RZ/G3S SoC supports configurable supply voltages for several of its
I/O interfaces. All of these interfaces support both 1.8V and 3.3V
supplies, but only the Ethernet and XSPI interfaces support a 2.5V
supply.

Voltage selection for the XSPI interface is not yet supported, so this
leaves only the Ethernet interfaces currently supporting selection of a
2.5V supply. So we need to return an error if there is an attempt to
select a 2.5V supply for any non-Ethernet interface.

Fixes: 51996952b8 ("pinctrl: renesas: rzg2l: Add support to select power source for Ethernet pins")
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240417114132.6605-1-paul.barker.ct@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-04-25 10:35:05 +02:00
Geert Uytterhoeven
21fc4d1959 pinctrl: renesas: r8a779h0: Add INTC-EX pins, groups, and function
Add pins, groups, and function for the Interrupt Controller for External
Devices (INTC-EX) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/258d03b27b77f60cc03fc3257bb4c6715b612a61.1713282028.git.geert+renesas@glider.be
2024-04-23 09:39:23 +02:00
Geert Uytterhoeven
c3bec9547c pinctrl: renesas: r8a779h0: Fix IRQ suffixes
The suffixes of the IRQ identifiers, as used for pins related to the
Interrupt Controller for External Devices (INTC-EX), are inconsistent.
Correct them to match the Pin Multiplex attachment in Rev.0.51 of the
R-Car V4M Series Hardware User's Manual.

Fixes: 291f7856fc ("pinctrl: renesas: Initial R8A779H0 (R-Car V4M) PFC support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/7d3c7498d9e8eda5583b15f9163eb25bb797ed24.1713282028.git.geert+renesas@glider.be
2024-04-23 09:39:23 +02:00
Lad Prabhakar
2487dc87ae pinctrl: renesas: rzg2l: Remove extra space in function parameter
Remove unnecessary space in rzg2l_pinctrl_pm_setup_pfc() function
parameter.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240226192530.141945-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-04-23 09:38:33 +02:00
Claudiu Beznea
02cd2d3be1 pinctrl: renesas: rzg2l: Configure the interrupt type on resume
Commit dce0919c83 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT
source at the same time") removed the setup of TINT from
rzg2l_irqc_irq_enable().  To address the spurious interrupt issue the
setup of TINT has been moved in rzg2l_tint_set_edge() through
rzg2l_disable_tint_and_set_tint_source().  With this, the interrupts are
not properly re-configured after a suspend-to-RAM cycle.  To address
this issue and avoid spurious interrupts while resumming set the
interrupt type before enabling it.

Fixes: dce0919c83 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time")
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/20240419063822.3467424-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-04-22 09:54:00 +02:00
Peng Fan
eb524cb651 pinctrl: Implementation of the generic scmi-pinctrl driver
scmi-pinctrl driver implements pinctrl driver interface and using
SCMI protocol to redirect messages from pinctrl subsystem SDK to
SCMI platform firmware, which does the changes in HW.

Co-developed-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20240418-pinctrl-scmi-v11-4-499dca9864a7@nxp.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-04-19 15:17:37 +01:00
Peng Fan
3ba11e684d pinctrl: pinconf-generic: print hex value
Hex value will be easier to match hardware register bits layout,
so same as pinconf_generic_dump_config, print hex value.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-ID: <20240412005128.2937486-1-peng.fan@oss.nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:53:44 +02:00
Linus Walleij
398c9955bd pinctrl: renesas: Fixes for v6.9
- Fix a dtbs_check warning on RZ/G3S,
   - Fix a lockdep warning on RZ/G2L.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZhkDAgAKCRCKwlD9ZEnx
 cA0nAQC3qUp+KQ9D53F1Mr5FdQd4GhNsqEG/iFxHkkrlKLyMwQEA7nQHcu2xseeS
 7C4wQROe2+DNdks5u3ye7IA7YtntYgY=
 =wObz
 -----END PGP SIGNATURE-----

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

pinctrl: renesas: Fixes for v6.9

  - Fix a dtbs_check warning on RZ/G3S,
  - Fix a lockdep warning on RZ/G2L.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:51:19 +02:00
Krzysztof Kozlowski
9d2df36538 pinctrl: realtek: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these
can be built and used as modules on some generic kernel.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Message-ID: <20240411064614.7409-5-krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:43:50 +02:00
Krzysztof Kozlowski
abda4619f4 pinctrl: qcom: sm7150: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these
can be built and used as modules on some generic kernel.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Message-ID: <20240411064614.7409-4-krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:43:50 +02:00
Krzysztof Kozlowski
75589d6b11 pinctrl: loongson2: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these
can be built and used as modules on some generic kernel.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Message-ID: <20240411064614.7409-3-krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:43:50 +02:00
Krzysztof Kozlowski
d42005c03a pinctrl: mediatek: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these
can be built and used as modules on some generic kernel.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Message-ID: <20240411064614.7409-2-krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:43:50 +02:00
Krzysztof Kozlowski
a310822fe7 pinctrl: freescale: imx8ulp: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.  Pin controllers are
considered core components, so usually they are built-in, however these
can be built and used as modules on some generic kernel.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Message-ID: <20240411064614.7409-1-krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-17 10:43:50 +02:00
Zeng Heng
a0cedbcc88 pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
If we fail to allocate propname buffer, we need to drop the reference
count we just took. Because the pinctrl_dt_free_maps() includes the
droping operation, here we call it directly.

Fixes: 91d5c5060e ("pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map")
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <20240415105328.3651441-1-zengheng4@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-16 15:32:48 +02:00
Andy Shevchenko
57b60ec4b3 gpiolib: acpi: Pass con_id instead of property into acpi_dev_gpio_irq_get_by()
Pass the con_id instead of property so that callers won't repeat
the GPIO suffixes to try.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-04-15 16:12:18 +03:00
Hans de Goede
5d10a157eb pinctrl: baytrail: Add pinconf group for uart3
GPIO_S0_SC57 / GPIO_S0_SC61 can be muxed to PCU_UART_TXD / PCU_UART_RXD,
add a pinconf group for this.

On Bay Trail board schematics using these pins as UART these are
called UART3_TXD / UART3_RXD, name the pinconf group "uart3_grp"
to be consistent with the schematics.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-04-08 17:54:48 +03:00
Hans de Goede
fed6d9a8e6 pinctrl: baytrail: Fix selecting gpio pinctrl state
For all the "score" pin-groups all the intel_pingroup-s to select
the non GPIO function are re-used for byt_score_gpio_groups[].

But this is incorrect since a pin-group includes the mode setting,
which for the non GPIO functions generally is 1, where as to select
the GPIO function mode must be set to 0.

So the GPIO function needs separate intel_pingroup-s with their own mode
value of 0.

Add a new PIN_GROUP_GPIO macro which adds a foo_gpio entry to each
pin-group defined this way and update byt_score_gpio_groups[] to point
to the new foo_gpio entries.

The "sus" usb_oc_grp usb_ulpi_grp and pcu_spi_grp pin-groups are special
because these have a non 0 mode value to select the GPIO functions and
these already have matching foo_gpio pin-groups, leave these are unchanged.

The pmu_clk "sus" groups added in commit 2f46d7f7e9 ("pinctrl: baytrail:
Add pinconf group + function for the pmu_clk") do need to use the new
PIN_GROUP_GPIO macro.

Fixes: 2f46d7f7e9 ("pinctrl: baytrail: Add pinconf group + function for the pmu_clk")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2024-04-08 17:54:48 +03:00
Andy Shevchenko
932640c0f7 pinctrl: Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs
Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for read-write file to reduce some
duplicated code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Message-ID: <20240404193521.3581399-1-andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-08 11:01:18 +02:00
Yangyu Chen
c1556a9b42 pinctrl: k210: Deprecate SOC_CANAAN and use SOC_CANAAN_K210
Since SOC_FOO should be deprecated from patch [1], and cleanup for other
SoCs is already in the mailing list [2,3,4], we remove the use of
SOC_CANAAN and introduced SOC_CANAAN_K210 for K210-specific drivers,

Thus, we replace its drivers depends on SOC_CANAAN_K210 and default select
when it has the symbol SOC_CANAAN_K210.

[1] https://lore.kernel.org/linux-riscv/20221121221414.109965-1-conor@kernel.org/
[2] https://lore.kernel.org/linux-riscv/20240305-praying-clad-c4fbcaa7ed0a@spud/
[3] https://lore.kernel.org/linux-riscv/20240305-fled-undrilled-41dc0c46bb29@spud/
[4] https://lore.kernel.org/linux-riscv/20240305-stress-earflap-d7ddb8655a4d@spud/

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2024-04-05 16:42:50 +01:00
Matthijs Kooijman
b5fe46efc1 pinctrl: single: Fix PIN_CONFIG_BIAS_DISABLE handling
The pinctrl-single driver handles pin_config_set by looking up the
requested setting in a DT-defined lookup table, which defines what bits
correspond to each setting. There is no way to add
PIN_CONFIG_BIAS_DISABLE entries to the table, since there is instead
code to disable the bias by applying the disable values of both the
pullup and pulldown entries in the table.

However, this code is inside the table-lookup loop, so it would only
execute if there is an entry for PIN_CONFIG_BIAS_DISABLE in the table,
which can never exist, so this code never runs.

This commit lifts the offending code out of the loop, so it just
executes directly whenever PIN_CONFIG_BIAS_DISABLE is requested,
skippipng the table lookup loop.

This also introduces a new `param` variable to make the code slightly
more readable.

This bug seems to have existed when this code was first merged in commit
9dddb4df90 ("pinctrl: single: support generic pinconf"). Earlier
versions of this patch did have an entry for PIN_CONFIG_BIAS_DISABLE in
the lookup table, but that was removed, which is probably how this bug
was introduced.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Reviewed-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Message-ID: <20240319110633.230329-1-matthijs@stdin.nl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 21:03:25 +02:00
Christophe JAILLET
a95e2bc817 pinctrl: pinctrl-single: Remove some unused fields in struct pcs_function
In "struct pcs_function", the 'pgnames' and 'npgnames' fields are unused.
This is a left-over from commit 571aec4df5 ("pinctrl: single: Use generic
pinmux helpers for managing functions");

Remove them.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-ID: <a6b653642298d35b1e3656e9bfc6d1b322fbbe68.1712004518.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 21:03:25 +02:00
Christophe JAILLET
922c86f8d3 pinctrl: max77620: Remove an unused fields in struct max77620_pin_info and max77620_pctrl_info
In "struct max77620_pin_info", the 'pull_config' field is unused.
In "struct max77620_pctrl_info", the 'pins_current_opt' field is unused.

Remove them.

On my x86_64 config, with allmodconfig, this shrinks the struct
max77620_pctrl_info from 360 bytes to 296.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-ID: <60af8968864ae4a83a76e589b39a2b1e1f65c9db.1711992588.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 21:03:25 +02:00
Chen-Yu Tsai
c5d3b64c56 pinctrl: mediatek: paris: Rework support for PIN_CONFIG_{INPUT,OUTPUT}_ENABLE
There is a misinterpretation of some of the PIN_CONFIG_* options in this
driver library. PIN_CONFIG_OUTPUT_ENABLE should refer to a buffer or
switch in the output direction of the electrical path. The MediaTek
hardware does not have such a thing. The driver incorrectly maps this
option to the GPIO function's direction.

Likewise, PIN_CONFIG_INPUT_ENABLE should refer to a buffer or switch in
the input direction. The hardware does have such a mechanism, and is
mapped to the IES bit. The driver however sets the direction in addition
to the IES bit, which is incorrect. On readback, the IES bit isn't even
considered.

Ironically, the driver does not support readback for PIN_CONFIG_OUTPUT,
while its readback of PIN_CONFIG_{INPUT,OUTPUT}_ENABLE is what it should
be doing for PIN_CONFIG_OUTPUT.

Rework support for these three options, so that PIN_CONFIG_OUTPUT_ENABLE
is completely removed, PIN_CONFIG_INPUT_ENABLE is only linked to the IES
bit, and PIN_CONFIG_OUTPUT is linked to the GPIO function's direction
and output level.

Fixes: 805250982b ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Message-ID: <20240327091336.3434141-3-wenst@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 15:27:35 +02:00
Chen-Yu Tsai
08f66a8edd pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback
In the generic pin config library, readback of some options are handled
differently compared to the setting of those options: the argument value
is used to convey enable/disable of an option in the set path, but
success or -EINVAL is used to convey if an option is enabled or disabled
in the debugfs readback path.

PIN_CONFIG_INPUT_SCHMITT_ENABLE is one such option. Fix the readback of
the option in the mediatek-paris library, so that the debugfs dump is
not showing "input schmitt enabled" for pins that don't have it enabled.

Fixes: 1bea6afbc8 ("pinctrl: mediatek: Refine mtk_pinconf_get()")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Message-ID: <20240327091336.3434141-2-wenst@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 15:27:18 +02:00
Krzysztof Kozlowski
e798845d68 pinctrl: sunxi: sun9i-a80-r: drop driver owner assignment
Core in platform_driver_register() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Message-ID: <20240330210954.100842-1-krzysztof.kozlowski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:39:47 +02:00
Andy Shevchenko
4aad0ad20f pinctrl: aw9523: Fix indentation in a few places
In the comment, function prototype, and array of strings indentation
is kinda broken. Reindent that.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-11-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
7b8b9b5450 pinctrl: aw9523: Sort headers and group pinctrl/*
One header was misplaced and group pinctrl/* ones to show the relation
with the pin control subsystem.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-10-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
c567b00cc3 pinctrl: aw9523: Make use of dev_err_probe()
Simplify the error handling in probe function by switching from
dev_err() to dev_err_probe().

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-9-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
6bf270863a pinctrl: aw9523: Remove unused irqchip field in struct aw9523_irq
The irqchip field is allocated, assigned but never used. Remove it.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-8-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
4210ef801a pinctrl: aw9523: Get rid of redundant ' & U8_MAX' pieces
When the variable is declared as u8, no need to perform ' & U8_MAX'
as it's implied anyway.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-7-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
66413f0468 pinctrl: aw9523: Use temporary variable for HW IRQ number
There are two different ways on how to get HW IRQ number in some functions.
Unify that by using temporary variable and irqd_to_hwirq() call.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-6-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
418ee9488f pinctrl: aw9523: Make use of struct pinfunction and PINCTRL_PINFUNCTION()
Since pin control provides a generic data type and a macro for
the pin function definition, use them in the driver.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-5-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
091655b928 pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple()
The ports are equivalent from the user's point of view. Don't limit
trying them both if writing to one fails.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-4-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
f91eafcb18 pinctrl: aw9523: Use correct error code for not supported functionality
The pin control subsystem internally uses ENOTSUPP for the not supported
functionality. The checkpatch is false positive about this error code.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-3-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:46 +02:00
Andy Shevchenko
e5e8a58023 pinctrl: aw9523: Destroy mutex on ->remove()
If aw9523_hw_init() fails on ->remove() the mutex left alive.
Destroy it in that case as well. While at it, remove never
true check at the beginning of the function.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-2-andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04 13:16:45 +02:00
Arnd Bergmann
d303735ce5 pinctrl: armada-37xx: remove an unused variable
This variable has never been used and can be removed to avoid a W=1 warning:

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c:837:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
  837 |         int i = 0;

Fixes: 87466ccd94 ("pinctrl: armada-37xx: Add pin controller support for Armada 37xx")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Message-ID: <20240322132205.906729-1-arnd@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-02 14:27:13 +02:00
Linus Torvalds
7e40c2100c Kbuild fixes for v6.9
- Deduplicate Kconfig entries for CONFIG_CXL_PMU
 
  - Fix unselectable choice entry in MIPS Kconfig, and forbid this
    structure
 
  - Remove unused include/asm-generic/export.h
 
  - Fix a NULL pointer dereference bug in modpost
 
  - Enable -Woverride-init warning consistently with W=1
 
  - Drop KCSAN flags from *.mod.c files
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAmYJVK0VHG1hc2FoaXJv
 eUBrZXJuZWwub3JnAAoJED2LAQed4NsGf/sP/3GOk//cQGwPyWCgtCEUo6T4yyD7
 1m2TTR0JQk/lcohSFtYk0I20rhKRqU6yAMAERmyehI66D2QY7lhiYVc16ram5y04
 x0nWxd9IqerIlGJtaWePOvNqKdCw2EP9fS9NKz58rEDMGlsSf0Rd3NEdSsWoH8td
 dECtt8yCawENAMStb/rAfsnL6kn2JIhVMyqwo0RdQfiaVT5Zk6Qgpko0Oq0ncRP2
 qdNgHbvnJdKMy81FHSBAi0QEZOYvhFNX+E+6lFfWEsX6xT+wvXddCNQzJf/YV3Cw
 Klw1tGveV7UGzlZ4fsnFrv4V6g1KO2AD3342efdDo++ypBEBpImVODc+Rp0jE9Nk
 OgdOQRe2k9a5keH0LWY0ehvDbQlSbfNxk0wNtAfo5Kk5e41nHmHJBWCwGG+cXrjJ
 mPJjSrTpuNVSaGV0kt3EskHbDBeBmIIg+5QPbldmW2qcC88kWoavkyLD3WPFsg/a
 CAuR/HqH7MDfxzvsqTCjonlVcyDKX6aW66LrQ1NCtmphI4F8mdKp746CzGlziuIm
 gjYJL/UWVlx0VebMo8dwDpaHvez4/4s6xAJcyqtA+TS5HbrQWKQuwFkiv4iWQxNd
 MvyVdzgKhcMdoXhfFpUZ0LlFvHGefJ+Z6N1FQLoQJkTirt5aqRbEAjP0VXwQB4eH
 zYygkhvvtiH9/STu
 =tx+2
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-fixes-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Deduplicate Kconfig entries for CONFIG_CXL_PMU

 - Fix unselectable choice entry in MIPS Kconfig, and forbid this
   structure

 - Remove unused include/asm-generic/export.h

 - Fix a NULL pointer dereference bug in modpost

 - Enable -Woverride-init warning consistently with W=1

 - Drop KCSAN flags from *.mod.c files

* tag 'kbuild-fixes-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kconfig: Fix typo HEIGTH to HEIGHT
  Documentation/llvm: Note s390 LLVM=1 support with LLVM 18.1.0 and newer
  kbuild: Disable KCSAN for autogenerated *.mod.c intermediaries
  kbuild: make -Woverride-init warnings more consistent
  modpost: do not make find_tosym() return NULL
  export.h: remove include/asm-generic/export.h
  kconfig: do not reparent the menu inside a choice block
  MIPS: move unselectable FIT_IMAGE_FDT_EPM5 out of the "System type" choice
  cxl: remove CONFIG_CXL_PMU entry in drivers/cxl/Kconfig
2024-03-31 11:23:51 -07:00
Arnd Bergmann
c40845e319 kbuild: make -Woverride-init warnings more consistent
The -Woverride-init warn about code that may be intentional or not,
but the inintentional ones tend to be real bugs, so there is a bit of
disagreement on whether this warning option should be enabled by default
and we have multiple settings in scripts/Makefile.extrawarn as well as
individual subsystems.

Older versions of clang only supported -Wno-initializer-overrides with
the same meaning as gcc's -Woverride-init, though all supported versions
now work with both. Because of this difference, an earlier cleanup of
mine accidentally turned the clang warning off for W=1 builds and only
left it on for W=2, while it's still enabled for gcc with W=1.

There is also one driver that only turns the warning off for newer
versions of gcc but not other compilers, and some but not all the
Makefiles still use a cc-disable-warning conditional that is no
longer needed with supported compilers here.

Address all of the above by removing the special cases for clang
and always turning the warning off unconditionally where it got
in the way, using the syntax that is supported by both compilers.

Fixes: 2cd3271b7a ("kbuild: avoid duplicate warning options")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-03-31 11:32:26 +09:00
Dan Carpenter
5038a66dad pinctrl: core: delete incorrect free in pinctrl_enable()
The "pctldev" struct is allocated in devm_pinctrl_register_and_init().
It's a devm_ managed pointer that is freed by devm_pinctrl_dev_release(),
so freeing it in pinctrl_enable() will lead to a double free.

The devm_pinctrl_dev_release() function frees the pindescs and destroys
the mutex as well.

Fixes: 6118714275 ("pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <578fbe56-44e9-487c-ae95-29b695650f7c@moroto.mountain>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-29 00:04:16 +01:00
Thomas Richard
85dfe45837 pinctrl: pinctrl-single: move suspend()/resume() callbacks to noirq
The goal is to extend the active period of pinctrl.
Some devices may need active pinctrl after suspend() and/or before
resume().
So move suspend()/resume() to suspend_noirq()/resume_noirq() in order to
have active pinctrl until suspend_noirq() (included), and from
resume_noirq() (included).

The deprecated API has been removed to use the new one (dev_pm_ops struct).

No need to check the pointer returned by dev_get_drvdata(), as
platform_set_drvdata() is called during the probe.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Message-ID: <20240102-j7200-pcie-s2r-v4-2-6f1f53390c85@bootlin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 22:05:31 +01:00
Jan Dakinevich
368a90e651 pinctrl/meson: fix typo in PDM's pin name
Other pins have _a or _x suffix, but this one doesn't have any. Most
likely this is a typo.

Fixes: dabad1ff85 ("pinctrl: meson: add pinctrl driver support for Meson-A1 SoC")
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Message-ID: <20240325113058.248022-1-jan.dakinevich@salutedevices.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 10:42:41 +01:00
Anjelique Melendez
b5658c7ab9 pinctrl: qcom: spmi-gpio: Add PMIH0108 and PMD8028 support
Add support for qcom,pmih0108-gpio and qcom,pmd8028-gpio.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Message-ID: <20240326220628.2392802-5-quic_amelende@quicinc.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 10:25:11 +01:00
Anjelique Melendez
e5c7b013cb pinctrl: qcom: spmi-gpio: Add PMXR2230 and PM6450 support
Add support for qcom,pmxr2230-gpio and qcom,pm6450-gpio.

Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Message-ID: <20240326220628.2392802-4-quic_amelende@quicinc.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 10:25:11 +01:00
Billy Tsai
c10cd03d69 pinctrl: pinctrl-aspeed-g6: Fix register offset for pinconf of GPIOR-T
The register offset to disable the internal pull-down of GPIOR~T is 0x630
instead of 0x620, as specified in the Ast2600 datasheet v15
The datasheet can download from the official Aspeed website.

Fixes: 15711ba6ff ("pinctrl: aspeed-g6: Add AST2600 pinconf support")
Reported-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Message-ID: <20240313092809.2596644-1-billy_tsai@aspeedtech.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 10:15:15 +01:00
Stefan Wahren
d54e4cda29 pinctrl: bcm2835: Implement bcm2711_pinconf_get
The BCM2711 allows to read the bias config. So implement pin_conf_get
accordingly. The pull resistor values has been taken from the
BCM2711/7211 datasheet.

This implementation assumes that BCM7211 behaves the same way.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Message-ID: <20240307070113.4888-3-wahrenst@gmx.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 09:52:25 +01:00
Stefan Wahren
85b02bc078 pinctrl: bcm2835: Implement bcm2835_pinconf_get
Even the driver already has implemented pin_dbg_show, it could
be helpful to implement pin_conf_get for a more generic behavior.
Contrary to the BCM2711, the BCM2835 SOC doesn't allow to read
the bias config, so the implementation is limited to the basics.

Keep ENOTSUPP here, because it's only used internally.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Message-ID: <20240307070113.4888-2-wahrenst@gmx.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 09:52:25 +01:00
Andy Shevchenko
76c22f0941 pinctrl: pxa2xx: Make use of struct pingroup
Since pin control provides a generic data type for the pin group,
use it in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Message-ID: <20240311142346.1261203-1-andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 09:44:20 +01:00
Andy Shevchenko
ea217fefef pinctrl: pxa2xx: Make use of struct pinfunction
Since pin control provides a generic data type for the pin function,
use it in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Message-ID: <20240311140833.1168742-1-andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-28 09:43:28 +01:00
Claudiu Beznea
aa43c15a79 pinctrl: renesas: rzg2l: Execute atomically the interrupt configuration
Lockdep detects a possible deadlock as listed below. This is because it
detects the IA55 interrupt controller .irq_eoi() API is called from
interrupt context while configuration-specific API (e.g., .irq_enable())
could be called from process context on resume path (by calling
rzg2l_gpio_irq_restore()). To avoid this, protect the call of
rzg2l_gpio_irq_enable() with spin_lock_irqsave()/spin_unlock_irqrestore().
With this the same approach that is available in __setup_irq() is mimicked
to pinctrl IRQ resume function.

Below is the lockdep report:

    WARNING: inconsistent lock state
    6.8.0-rc5-next-20240219-arm64-renesas-00030-gb17a289abf1f #90 Not tainted
    --------------------------------
    inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
    str_rwdt_t_001./159 [HC0[0]:SC0[0]:HE1:SE1] takes:
    ffff00000b001d70 (&rzg2l_irqc_data->lock){?...}-{2:2}, at: rzg2l_irqc_irq_enable+0x60/0xa4
    {IN-HARDIRQ-W} state was registered at:
    lock_acquire+0x1e0/0x310
    _raw_spin_lock+0x44/0x58
    rzg2l_irqc_eoi+0x2c/0x130
    irq_chip_eoi_parent+0x18/0x20
    rzg2l_gpio_irqc_eoi+0xc/0x14
    handle_fasteoi_irq+0x134/0x230
    generic_handle_domain_irq+0x28/0x3c
    gic_handle_irq+0x4c/0xbc
    call_on_irq_stack+0x24/0x34
    do_interrupt_handler+0x78/0x7c
    el1_interrupt+0x30/0x5c
    el1h_64_irq_handler+0x14/0x1c
    el1h_64_irq+0x64/0x68
    _raw_spin_unlock_irqrestore+0x34/0x70
    __setup_irq+0x4d4/0x6b8
    request_threaded_irq+0xe8/0x1a0
    request_any_context_irq+0x60/0xb8
    devm_request_any_context_irq+0x74/0x104
    gpio_keys_probe+0x374/0xb08
    platform_probe+0x64/0xcc
    really_probe+0x140/0x2ac
    __driver_probe_device+0x74/0x124
    driver_probe_device+0x3c/0x15c
    __driver_attach+0xec/0x1c4
    bus_for_each_dev+0x70/0xcc
    driver_attach+0x20/0x28
    bus_add_driver+0xdc/0x1d0
    driver_register+0x5c/0x118
    __platform_driver_register+0x24/0x2c
    gpio_keys_init+0x18/0x20
    do_one_initcall+0x70/0x290
    kernel_init_freeable+0x294/0x504
    kernel_init+0x20/0x1cc
    ret_from_fork+0x10/0x20
    irq event stamp: 69071
    hardirqs last enabled at (69071): [<ffff800080e0dafc>] _raw_spin_unlock_irqrestore+0x6c/0x70
    hardirqs last disabled at (69070): [<ffff800080e0cfec>] _raw_spin_lock_irqsave+0x7c/0x80
    softirqs last enabled at (67654): [<ffff800080010614>] __do_softirq+0x494/0x4dc
    softirqs last disabled at (67645): [<ffff800080015238>] ____do_softirq+0xc/0x14

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&rzg2l_irqc_data->lock);
    <Interrupt>
    lock(&rzg2l_irqc_data->lock);

    *** DEADLOCK ***

    4 locks held by str_rwdt_t_001./159:
    #0: ffff00000b10f3f0 (sb_writers#4){.+.+}-{0:0}, at: vfs_write+0x1a4/0x35c
    #1: ffff00000e43ba88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0xe8/0x1a8
    #2: ffff00000aa21dc8 (kn->active#40){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xf0/0x1a8
    #3: ffff80008179d970 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend+0x9c/0x278

    stack backtrace:
    CPU: 0 PID: 159 Comm: str_rwdt_t_001. Not tainted 6.8.0-rc5-next-20240219-arm64-renesas-00030-gb17a289abf1f #90
    Hardware name: Renesas SMARC EVK version 2 based on r9a08g045s33 (DT)
    Call trace:
    dump_backtrace+0x94/0xe8
    show_stack+0x14/0x1c
    dump_stack_lvl+0x88/0xc4
    dump_stack+0x14/0x1c
    print_usage_bug.part.0+0x294/0x348
    mark_lock+0x6b0/0x948
    __lock_acquire+0x750/0x20b0
    lock_acquire+0x1e0/0x310
    _raw_spin_lock+0x44/0x58
    rzg2l_irqc_irq_enable+0x60/0xa4
    irq_chip_enable_parent+0x1c/0x34
    rzg2l_gpio_irq_enable+0xc4/0xd8
    rzg2l_pinctrl_resume_noirq+0x4cc/0x520
    pm_generic_resume_noirq+0x28/0x3c
    genpd_finish_resume+0xc0/0xdc
    genpd_resume_noirq+0x14/0x1c
    dpm_run_callback+0x34/0x90
    device_resume_noirq+0xa8/0x268
    dpm_noirq_resume_devices+0x13c/0x160
    dpm_resume_noirq+0xc/0x1c
    suspend_devices_and_enter+0x2c8/0x570
    pm_suspend+0x1ac/0x278
    state_store+0x88/0x124
    kobj_attr_store+0x14/0x24
    sysfs_kf_write+0x48/0x6c
    kernfs_fop_write_iter+0x118/0x1a8
    vfs_write+0x270/0x35c
    ksys_write+0x64/0xec
    __arm64_sys_write+0x18/0x20
    invoke_syscall+0x44/0x108
    el0_svc_common.constprop.0+0xb4/0xd4
    do_el0_svc+0x18/0x20
    el0_svc+0x3c/0xb8
    el0t_64_sync_handler+0xb8/0xbc
    el0t_64_sync+0x14c/0x150

Fixes: 254203f9a9 ("pinctrl: renesas: rzg2l: Add suspend/resume 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/20240320104230.446400-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-03-26 09:42:37 +01:00
Rafael J. Wysocki
c2ddeb2961 genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd
There is a problem when a driver requests a shared interrupt line to run a
threaded handler on it without IRQF_ONESHOT set if that flag has been set
already for the IRQ in question by somebody else.  Namely, the request
fails which usually leads to a probe failure even though the driver might
have worked just fine with IRQF_ONESHOT, but it does not want to use it by
default.  Currently, the only way to handle this is to try to request the
IRQ without IRQF_ONESHOT, but with IRQF_PROBE_SHARED set and if this fails,
try again with IRQF_ONESHOT set.  However, this is a bit cumbersome and not
very clean.

When commit 7a36b901a6 ("ACPI: OSL: Use a threaded interrupt handler for
SCI") switched the ACPI subsystem over to using a threaded interrupt
handler for the SCI, it had to use IRQF_ONESHOT for it because that's
required due to the way the SCI handler works (it needs to walk all of the
enabled GPEs before the interrupt line can be unmasked). The SCI interrupt
line is not shared with other users very often due to the SCI handling
overhead, but on sone systems it is shared and when the other user of it
attempts to install a threaded handler, a flags mismatch related to
IRQF_ONESHOT may occur.

As it turned out, that happened to the pinctrl-amd driver and so commit
4451e8e841 ("pinctrl: amd: Add IRQF_ONESHOT to the interrupt request")
attempted to address the issue by adding IRQF_ONESHOT to the interrupt
flags in that driver, but this is now causing an IRQF_ONESHOT-related
mismatch to occur on another system which cannot boot as a result of it.

Clearly, pinctrl-amd can work with IRQF_ONESHOT if need be, but it should
not set that flag by default, so it needs a way to indicate that to the
interrupt subsystem.

To that end, introdcuce a new interrupt flag, IRQF_COND_ONESHOT, which will
only have effect when the IRQ line is shared and IRQF_ONESHOT has been set
for it already, in which case it will be promoted to the latter.

This is sufficient for drivers sharing the interrupt line with the SCI as
it is requested by the ACPI subsystem before any drivers are probed, so
they will always see IRQF_ONESHOT set for the interrupt in question.

Fixes: 4451e8e841 ("pinctrl: amd: Add IRQF_ONESHOT to the interrupt request")
Reported-by: Francisco Ayala Le Brun <francisco@videowindow.eu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: 6.8+ <stable@vger.kernel.org> # 6.8+
Closes: https://lore.kernel.org/lkml/CAN-StX1HqWqi+YW=t+V52-38Mfp5fAz7YHx4aH-CQjgyNiKx3g@mail.gmail.com/
Link: https://lore.kernel.org/r/12417336.O9o76ZdvQC@kreacher
2024-03-25 23:45:21 +01:00
Linus Torvalds
90a498f294 phy-for-6.9
- New Support
   - Qualcomm X1E80100 PCIe phy support, SM8550 PCIe1 PHY, SC7180 UFS PHY
     and SDM630 USBC support
   - Rockchip HDMI/eDP Combo PHY driver
   - Mediatek MT8365 CSI phy driver
 
 - Updates
   - Rework on Qualcomm phy PCS registers and type-c handling
   - Cadence torrent phy updates for multilink configuration
   - TI gmii resume support
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmX0JdwACgkQfBQHDyUj
 g0fFPxAAl0AqhOXKHLxxB7wihGGIm7V6djOrathoCteo8oxDNgY1uWmOELrM6ama
 KCv4wqPHf5m9ImFFXDwIb1qVBu+MadDdOl+kUmP8pPQt4WYT6hEJONX7G54VLmIZ
 W5iH3zBrZMvo6R5xSiOeySG+OyKgJjj8K1SMBxNA2/PST4Y+pslB1yZ9oUm57hTy
 YA3/pihiPwejQEk5WyrXN1LTIEDT0/fPZ70I7mvo+30CuSVaWK16fnPLVKWfKd99
 h6a9VDcYDywyFnUParYHCLhcenR/a1Sw09zsGRmG+eTUVSzz7kFI8T8hB4gsRf5i
 qi7lqyUWTmkaiUdLLRf5MFdhu2PoOwLzHppYlXaCne9IyHUtvc+P+hkS6D2sSlB9
 Pqc7Yyltxks8TBmechwqHV6dhA/odrlJKwh62MbOuGe83vaqrpkh6/Yx++l8kqFu
 0kn1TyQbw14Y/ugOK2Mpgw6ApUNKWZhXNyiDBfU1zV0wycwbFqHBMg7fUZn7egd2
 ohnOYqWyBc3t0eThxQQxa0wzfke5+yLzkTTch/qMPgkgkKzQuVkkYCiDodHP12BA
 xymlQB+5tFQT1NZTlqvHNmOqa0zaCbksPCZRBQX1HmZVt9bBY8m+fInd0iY2gCGo
 y666sKdVAW6bIj09zUtS2VqLg31+8uwInwycEFkIyEy8qyHuQqI=
 =WNGJ
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy

Pull phy updates from Vinod Koul:
 "New hardware support:

   - Qualcomm X1E80100 PCIe phy support, SM8550 PCIe1 PHY, SC7180 UFS
     PHY and SDM630 USBC support

   - Rockchip HDMI/eDP Combo PHY driver

   - Mediatek MT8365 CSI phy driver

  Updates:

   - Rework on Qualcomm phy PCS registers and type-c handling

   - Cadence torrent phy updates for multilink configuration

   - TI gmii resume support"

* tag 'phy-for-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (41 commits)
  phy: constify of_phandle_args in xlate
  phy: ti: tusb1210: Define device IDs
  phy: ti: tusb1210: Use temporary variable for struct device
  phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver
  dt-bindings: phy: Add Rockchip HDMI/eDP Combo PHY schema
  phy: ti: gmii-sel: add resume support
  phy: mtk-mipi-csi: add driver for CSI phy
  dt-bindings: phy: add mediatek MIPI CD-PHY module v0.5
  phy: cadence-torrent: Add USXGMII(156.25MHz) + SGMII/QSGMII(100MHz) multilink config for TI J7200
  dt-bindings: phy: cadence-torrent: Add a separate compatible for TI J7200
  phy: cadence-torrent: Add USXGMII(156.25MHz) + SGMII/QSGMII(100MHz) multilink configuration
  phy: cadence-torrent: Add PCIe(100MHz) + USXGMII(156.25MHz) multilink configuration
  dt-bindings: phy: cadence-torrent: Add optional input reference clock for PLL1
  phy: qcom-qmp-ufs: Switch to devm_clk_bulk_get_all() API
  dt-bindings: phy: qmp-ufs: Fix PHY clocks
  phy: qcom: sgmii-eth: move PCS registers to separate header
  phy: qcom: sgmii-eth: use existing register definitions
  phy: qcom: qmp-usbc: drop has_pwrdn_delay handling
  phy: qcom: qmp: move common bits definitions to common header
  phy: qcom: qmp: split DP PHY registers to separate headers
  ...
2024-03-16 11:24:51 -07:00
Linus Torvalds
a3df5d5422 Pin control changes for the v6.9 kernel cycle:
No core changes this time around.
 
 New drivers:
 
 - New driver for Renesas R8A779H0 also known as R-Car V4M.
 
 - New driver for the Awinic AW9523/B I2C GPIO expander.
   I found this living out-of-tree in OpenWrt as an upstream
   attempt had stalled on the finishing line, so I picked it
   up and finished the job.
 
 Improvements:
 
 - The Nomadik pin control driver was for years re-used out of
   tree for the ST STA chips, and now the IP was re-used in a
   MIPS automotive SoC called MobilEyeq5, so it has been split
   in pin control and GPIO drivers so the latter can be reused
   by MobilEyeq5. (Along with a long list of cleanups.)
 
 - A lot of overall cleanup and tidying up.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmXyJa8ACgkQQRCzN7AZ
 XXMQQw//aq+HJt4vtX4s9v+g/aYBDoasxOgryz96/yq+CqTBBiYh0ib7MJvy/rFs
 bBufH4DEvlpjzgsvaN14L6H+3hFDXKeN6VnAs3DPeBkda4bTS3VOpqNzSoOTeqG9
 4a1jTe3SHche80SNW1YskTAMT0lG6WqC4RvipQ8K14DqIioX0AmgF7nJ1cddKaTK
 tXCWkqKY3TW2Z4edi9ZJLL6vRSQ9tJP9AugjkPX3F91yqwGHb8PV7Ggb1EXzC/X0
 SW7F7Ke0lIvCYidDUpr04TOKdPTmzl2j6zoZfGU1WbypxG0LVhTKAMVk2DL2/v7T
 E8NNimVtGJtqxDfCVSbLc6jRgdYaLRa4dLhMCRWmevfEqFfrA79XFY6BS084T3oP
 619RqbOtxc21AzlJjy2Kp7v3YpmXi6pX5E23L/d8U+0poEiM5qPqdYZaTbGNcGsV
 Yg4xCtxtBfPUdE3SqUCbHDzpWdSDGFsT3LSAUionvYyoW4iF8AXg8SBV1QpfzLM8
 KTWTmsWG/15lCZyf7tq83EJjjVgYhGL4SMnkE8fT+smiXm95Muj1tzUjgapspMiU
 VpnhwtKj1hQrButWlN7+HXKseMrJ8zQJszcP5e3QdWOm7vzZGP3nXpgWosqGCImq
 ThjtyOKvc4+/AqgbIojDCz2BfxD8a7OPOkYHkLGJ96fA5JscBoU=
 =Pt9Y
 -----END PGP SIGNATURE-----

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

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

  New drivers:

   - New driver for Renesas R8A779H0 also known as R-Car V4M.

   - New driver for the Awinic AW9523/B I2C GPIO expander. I found this
     living out-of-tree in OpenWrt as an upstream attempt had stalled on
     the finishing line, so I picked it up and finished the job.

  Improvements:

   - The Nomadik pin control driver was for years re-used out of tree
     for the ST STA chips, and now the IP was re-used in a MIPS
     automotive SoC called MobilEyeq5, so it has been split in pin
     control and GPIO drivers so the latter can be reused by MobilEyeq5.
     (Along with a long list of cleanups)

   - A lot of overall cleanup and tidying up"

* tag 'pinctrl-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (87 commits)
  drivers/gpio/nomadik: move dummy nmk_gpio_dbg_show_one() to header
  gpio: nomadik: remove BUG_ON() in nmk_gpio_populate_chip()
  dt-bindings: pinctrl: qcom: update compatible name for match with driver
  pinctrl: aw9523: Make the driver tristate
  pinctrl: nomadik: fix dereference of error pointer
  gpio: nomadik: Back out some managed resources
  pinctrl: aw9523: Add proper terminator
  pinctrl: core: comment that pinctrl_add_gpio_range() is deprecated
  pinctrl: pinmux: Suppress error message for -EPROBE_DEFER
  pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander
  dt-bindings: pinctrl: Add bindings for Awinic AW9523/AW9523B
  gpio: nomadik: Finish conversion to use firmware node APIs
  gpio: nomadik: fix Kconfig dependencies inbetween pinctrl & GPIO
  pinctrl: da9062: Add OF table
  dt-bindings: pinctrl: at91: add sam9x7
  pinctrl: ocelot: remove redundant assignment to variable ret
  gpio: nomadik: grab optional reset control and deassert it at probe
  gpio: nomadik: support mobileye,eyeq5-gpio
  gpio: nomadik: handle variadic GPIO count
  gpio: nomadik: support shared GPIO IRQs
  ...
2024-03-14 10:22:26 -07:00
Linus Torvalds
aeb152910a pwm: Changes for v6.9-rc1
This contains the usual amount of driver and device tree changes.
 Additionally there is a big rework of how pwm lowlevel drivers are
 registered to prepare adding character device support.
 
 Thanks to Dharma Balasubiramani, Dong Aisheng, Duje Mihanović, Jerome
 Brunet, Raag Jadav and Rafał Miłecki for their contributions. And sorry
 for those who still need some patience because I didn't manage to empty
 my review queue.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmXuyf4ACgkQj4D7WH0S
 /k4Yugf+P7gMPuCQJqWLvOyuHjKt4tI3aVsr+jbSiAfbPWaXAQKZunnZ9K17bOI2
 JQkDuAi76teNRiVtNEx1ZEdfKe9KgY/Npq8BTmvXxvBktCand8sfhyyRaXYo9FWI
 B5qKdp1WIg7ZDMoGQtLRayly4FAsbB0L50SjWmkVIXC2xXp6t6KxxgnOgTM58Oo9
 0yYYetF3EOmDQ4J234/muaLbM+1rjajKdw+SgS2mry2WV60SOqo+PQfuK42XjWip
 cLDkEgYogwx1MAbFgobtquA7Hvkdb2WyCirTDNZiGIBtmM89kH4Oa8e4IDR6FRqn
 w35hJv7sxVjiqBrSMD/lWpJeQ8gPYg==
 =6Ixv
 -----END PGP SIGNATURE-----

Merge tag 'pwm/for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm updates from Uwe Kleine-König:
 "This contains the usual amount of driver and device tree changes.
  Additionally there is a big rework of how pwm lowlevel drivers are
  registered to prepare adding character device support.

  Thanks to Dharma Balasubiramani, Dong Aisheng, Duje Mihanović, Jerome
  Brunet, Raag Jadav and Rafał Miłecki for their contributions. And
  sorry for those who still need some patience because I didn't manage
  to empty my review queue"

* tag 'pwm/for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: (185 commits)
  pwm: imx-tpm: fix probe crash due to access registers without clock
  pwm: meson: generalize 4 inputs clock on meson8 pwm type
  dt-bindings: pwm: amlogic: Add a new binding for meson8 pwm types
  dt-bindings: pwm: amlogic: fix s4 bindings
  pwm: dwc: simplify error handling
  pwm: dwc: Add 16 channel support for Intel Elkhart Lake
  pwm: dwc: drop redundant error check
  staging: greybus: pwm: Make use of devm_pwmchip_alloc() function
  staging: greybus: pwm: Rework how the number of PWM lines is determined
  staging: greybus: pwm: Drop unused gb_connection_set_data()
  staging: greybus: pwm: Rely on pwm framework to pass a valid hwpwm
  staging: greybus: pwm: Make use of pwmchip_parent() accessor
  staging: greybus: pwm: Change prototype of helpers to prepare further changes
  leds: qcom-lpg: Make use of devm_pwmchip_alloc() function
  drm/bridge: ti-sn65dsi86: Make use of devm_pwmchip_alloc() function
  drm/bridge: ti-sn65dsi86: Make use of pwmchip_parent() accessor
  gpio: mvebu: Make use of devm_pwmchip_alloc() function
  pwm: xilinx: Make use of devm_pwmchip_alloc() function
  pwm: xilinx: Prepare removing pwm_chip from driver data
  pwm: vt8500: Make use of devm_pwmchip_alloc() function
  ...
2024-03-13 10:51:39 -07:00
Linus Walleij
d295ad7ef0 pinctrl: aw9523: Make the driver tristate
The AW9523 driver fails to build in some allmod configs since the
I2C core can be a module, but AW9523 can not. Fix it up by allowing
AW9523 to be a module (tristate).

Fixes: 576623d706 ("pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403050916.KBtE6eEj-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240305-fix-aw9523-v2-1-2dc50bab2b17@linaro.org
2024-03-07 23:09:01 +01:00
Linus Walleij
64df5ea971 Merge branch 'ib-nomadik-gpio' into devel 2024-03-07 09:08:57 +01:00
Théo Lebrun
a0c807b5b6 pinctrl: nomadik: fix dereference of error pointer
If nmk_gpio_populate_chip() returns an error, avoid deferencing its
return value.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-gpio/5ee722f8-7582-420d-8477-45be6acde90f@moroto.mountain/
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240306-mbly-gpio-err-fix-v1-1-a3605ba2336f@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-06 20:47:14 +01:00
Linus Walleij
52279c3d50 pinctrl: aw9523: Add proper terminator
The of_device_id array needs to be terminated with a NULL
entry.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403061147.85XYVsk3-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240306-fix-aw9523-terminator-v1-1-13f90f87a7f6@linaro.org
2024-03-06 08:56:24 +01:00
Dan Carpenter
3ded216936 pinctrl: core: comment that pinctrl_add_gpio_range() is deprecated
The pinctrl_add_gpio_range() function is deprecated add a comment so
people don't accidentally use it in new code.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/533a7a10-c6eb-4ebe-adf1-f8dc95ae8d33@moroto.mountain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-05 23:30:45 +01:00
Andre Przywara
4f74a3b307 pinctrl: pinmux: Suppress error message for -EPROBE_DEFER
EPROBE_DEFER error returns are not really critical, since they cancel
the probe process, but the kernel will return later and retry.
However, depending on the probe order, this might issue quite some
verbatim and scary, though pointless messages:

[    2.388731] 300b000.pinctrl: pin-224 (5000000.serial) status -517
[    2.397321] 300b000.pinctrl: could not request pin 224 (PH0) from group PH0  on device 300b000.pinctrl

Replace dev_err() with dev_err_probe(), which not only drops the
priority of the message from error to debug, but also puts some text
into debugfs' devices_deferred file, for later reference.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20240305143859.2449147-1-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-05 23:29:29 +01:00
AngeloGioacchino Del Regno
576623d706 pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander
The Awinic AW9523(B) is a multi-function I2C gpio expander in a
TQFN-24L package, featuring PWM (max 37mA per pin, or total max
power 3.2Watts) for LED driving capability.

It has two ports with 8 pins per port (for a total of 16 pins),
configurable as either PWM with 1/256 stepping or GPIO input/output,
1.8V logic input; each GPIO can be configured as input or output
independently from each other.

This IC also has an internal interrupt controller, which is capable
of generating an interrupt for each GPIO, depending on the
configuration, and will raise an interrupt on the INTN pin to
advertise this to an external interrupt controller.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
Link: https://lore.kernel.org/r/20210624214458.68716-2-mail@david-bauer.net
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240301-awinic-aw9523-v8-1-7ec572f5dfb4@linaro.org
2024-03-05 23:26:31 +01:00
Andy Shevchenko
caddc92c57 gpio: nomadik: Finish conversion to use firmware node APIs
Previously driver got a few updates in order to replace OF APIs by
respective firmware node, however it was not finished to the logical
end, e.g., some APIs that has been used are still require OF node
to be passed. Finish that job by converting leftovers to use firmware
node APIs.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240302173401.217830-1-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-03 09:43:10 +01:00
Théo Lebrun
b824f841a4 gpio: nomadik: fix Kconfig dependencies inbetween pinctrl & GPIO
PINCTRL_NOMADIK cannot select GPIO_NOMADIK without first selecting
GPIOLIB on which GPIO_NOMADIK depends. GPIO_NOMADIK depends on OF_GPIO,
it is a direct dependency.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403010917.pnDhdS1Y-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202403011102.v8w2zPOU-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202403011329.1VnABMRz-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202403011546.Hpt8sBTa-lkp@intel.com/
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240301-mbly-gpio-kconfig-fix-v1-1-2785cebd475d@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-01 14:30:28 +01:00
Biju Das
26fea220ad pinctrl: da9062: Add OF table
Add OF table as per the binding so that driver get instantiated and
bind automatically when the driver is built as a module.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20240226191607.397386-1-biju.das.jz@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 14:44:08 +01:00
Colin Ian King
170c96246f pinctrl: ocelot: remove redundant assignment to variable ret
The variable ret is being assigned a value that is never read, it
is being re-assigned a value in every case statement in the following
switch statement. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/pinctrl/pinctrl-ocelot.c:1404:3: warning: Value stored to 'ret'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240223162850.3914349-1-colin.i.king@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 14:38:09 +01:00
Bartosz Golaszewski
f6443e0177 pinctrl: don't put the reference to GPIO device in pinctrl_pins_show()
The call to gpiod_to_gpio_device() does not increase the reference count
of the GPIO device struct so it must not be decreased. Remove the buggy
__free() decorator.

Fixes: 524fc108b8 ("pinctrl: stop using gpiod_to_chip()")
Reported-by: David Arcari <darcari@redhat.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240223123214.288181-1-brgl@bgdev.pl
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 14:36:40 +01:00
Théo Lebrun
3c30cc26df gpio: nomadik: support mobileye,eyeq5-gpio
We create a custom compatible for the STA2X11 IP block as integrated
into the Mobileye EyeQ5 platform. Its wake and alternate functions have
been disabled, we want to avoid touching those registers.

We both do: (1) early return in functions that do not support the
platform, but with warnings, and (2) avoid calling those functions in
the first place.

We ensure that pinctrl-nomadik is not used with this STA2X11 variant.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-24-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:36:55 +01:00
Théo Lebrun
75d270fda6 gpio: nomadik: request dynamic ID allocation
Move away from statically allocated GPIO IDs. Switch to dynamic ID
allocation. Static IDs are deprecated because they cause issues when
multiple GPIO controllers are to be found on the same platform.

Add a bit of complexity to do pin number -> GPIO chip + offset.
Previously, bank number and offsets were retrieved using division and
remainder (bank size being constant 32). Now, to get the pin number
matching a bank base, we must know the sum of ngpios of previous banks.
This is done in find_nmk_gpio_from_pin() which also exposes the offset
inside the bank.

Also remove the assumption that bank sizes are constant. Instead of
using NMK_GPIO_PER_CHIP as bank size, use nmk_gpio_chips[i]->ngpio.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-19-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:32:39 +01:00
Théo Lebrun
cbb24db148 pinctrl: nomadik: follow conditional kernel coding conventions
Fix strict checkpatch warnings relative to if-else blocks and bool
expressions. Message types addressed:

   CHECK: Comparison to NULL could be written "!nmk_cfg_params[index].choice"
   CHECK: Unbalanced braces around else statement
   CHECK: Using comparison to false is error prone
   CHECK: Using comparison to true is error prone
   CHECK: braces {} should be used on all arms of this statement

Before: 0 errors, 1 warnings, 16 checks.
After:  0 errors, 1 warnings,  7 checks.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-13-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:28:21 +01:00
Théo Lebrun
8e48230d6d pinctrl: nomadik: follow whitespace kernel coding conventions
Fix strict checkpatch warnings relative to whitespace. Message types
addressed:

   ERROR: space required before the open parenthesis '('
   WARNING: quoted string split across lines
   CHECK: Alignment should match open parenthesis
   CHECK: Please don't use multiple blank lines
   CHECK: line length of 103 exceeds 100 columns
   CHECK: spaces preferred around that '+' (ctx:VxV)

Before: 1 errors, 2 warnings, 38 checks.
After:  0 errors, 1 warnings, 16 checks.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-12-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:27:39 +01:00
Théo Lebrun
1a656a80ea pinctrl: nomadik: follow type-system kernel coding conventions
Fix strict checkpatch warnings relative to types. Warning types
addressed:

   WARNING: do not add new typedefs
   WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
   WARNING: static const char * array should probably be static const
            char * const

Total messages before: 1 errors, 40 warnings, 39 checks.
Total messages after:  1 errors,  2 warnings, 38 checks.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-11-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:27:02 +01:00
Théo Lebrun
dfeaf5e7f3 pinctrl: nomadik: minimise indentation in probe
nmk_pinctrl_probe() iterates over each GPIO block. Use an early
conditional continue to skip to the next iteration rather than indent
all the loop code block.

Do not change code logic. The block is changed from:

	for (i = 0; i < NMK_MAX_BANKS; i++) {
		x = of_parse_phandle(...);
		if (x) {
			... do work ...
		}
	}

To:

	for (i = 0; i < NMK_MAX_BANKS; i++) {
		x = of_parse_phandle(...);
		if (!x)
			continue;

		... do work ...
	}

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-10-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:26:09 +01:00
Théo Lebrun
af76822683 pinctrl: nomadik: fix build warning (-Wpointer-to-int-cast)
Fix compiler warning found in the pinctrl-nomadik platform driver. GCC
message is as such:

drivers/pinctrl/nomadik/pinctrl-nomadik.c:1169:12: warning: cast from
pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-9-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:25:31 +01:00
Théo Lebrun
8a10b1a36d pinctrl: nomadik: fix build warning (-Wformat)
Fix compiler warning found in the pinctrl-nomadik platform driver. GCC
message is as such:

drivers/pinctrl/nomadik/pinctrl-nomadik.c:855:21: warning:
format ‘%u’ expects argument of type ‘unsigned int’, but argument 5
has type ‘size_t {aka const long unsigned int}’ [-Wformat=]

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-8-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:24:51 +01:00
Théo Lebrun
ae82f5d2b1 pinctrl: nomadik: Kconfig: allow building with COMPILE_TEST
PINCTRL_NOMADIK, PINCTRL_STN8815 and PINCTRL_DB8500 depend on ARCH_U8500
or ARCH_NOMADIK. Add COMPILE_TEST as an option to allow test building
the driver.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-7-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:24:16 +01:00
Théo Lebrun
966942ae49 gpio: nomadik: extract GPIO platform driver from drivers/pinctrl/nomadik/
Previously, drivers/pinctrl/nomadik/pinctrl-nomadik.c registered two
platform drivers: pinctrl & GPIO. Move the GPIO aspect to the
drivers/gpio/ folder, as would be expected.

Both drivers are intertwined for a reason; pinctrl requires access to
GPIO registers for pinmuxing, pull-disable, disabling interrupts while
setting the muxing and wakeup control. Information sharing is done
through a shared array containing GPIO chips and a few helper
functions. That shared array is not touched from gpio-nomadik when
CONFIG_PINCTRL_NOMADIK is not defined.

Make no change to the code that moved into gpio-nomadik; there should be
no behavior change following. A few functions are shared and header
comments are added. Checkpatch warnings are addressed. NUM_BANKS is
renamed to NMK_MAX_BANKS.

It is supported to compile gpio-nomadik without pinctrl-nomadik. The
opposite is not true.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-6-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:22:33 +01:00
Théo Lebrun
53cf6b72e0 gpio: nomadik: fix offset bug in nmk_pmx_set()
Previously, the statement looked like:

    slpm[x] &= ~BIT(g->grp.pins[i]);

Where:
 - slpm is a unsigned int pointer;
 - g->grp.pins[i] is a pin number. It can grow to more than 32.

The expected shift amount is a pin bank offset.

This bug does not occur on every group or pin: the altsetting must be
NMK_GPIO_ALT_C and the pin must be 32 or above. It might have occured.
For example, in pinctrl-nomadik-db8500.c, pin group i2c3_c_2 has the
right altsetting and pins 229 and 230.

Fixes: dbfe8ca259 ("pinctrl/nomadik: implement pin multiplexing")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-5-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 10:20:23 +01:00
Linus Walleij
4432d416ba pinctrl: renesas: Updates for v6.9 (take two)
- Add support for the R-Car V4M (R8A779H0) SoC,
   - Add support for suspend/resume on the RZ/G2L family,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZdh+5gAKCRCKwlD9ZEnx
 cKiIAP9/dNg+l+cgCuI24EKaIehYnjq54clsWycHBV8i41brPgEAutwuYNMG++Vd
 B/iDXOihVSvOhjpQluQMtoYaUBmOCQc=
 =N37y
 -----END PGP SIGNATURE-----

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

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

  - Add support for the R-Car V4M (R8A779H0) SoC,
  - Add support for suspend/resume on the RZ/G2L family,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-26 15:28:42 +01:00
Krzysztof Kozlowski
00ca8a15da phy: constify of_phandle_args in xlate
The xlate callbacks are supposed to translate of_phandle_args to proper
provider without modifying the of_phandle_args.  Make the argument
pointer to const for code safety and readability.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> #Broadcom
Link: https://lore.kernel.org/r/20240217093937.58234-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2024-02-23 17:43:14 +05:30
Krzysztof Kozlowski
47847b9bcd pinctrl: qcom: sm8650-lpass-lpi: correct Kconfig name
Use proper model name in SM8650 LPASS pin controller Kconfig entry.

Cc:  <stable@vger.kernel.org>
Fixes: c4e4767385 ("pinctrl: qcom: sm8650-lpass-lpi: add SM8650 LPASS")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240216102435.89867-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-21 23:00:57 +01:00
Geert Uytterhoeven
a6f06b909f pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm
The conversion to DEFINE_NOIRQ_DEV_PM_OPS() lost the ability of the
compiler to optimize away the struct dev_pm_ops object when it is not
needed.

Fix this by replacing the use of pm_sleep_ptr() by a custom wrapper.

Fixes: 727eb02eb7 ("pinctrl: renesas: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/6238a78e32fa21f0c795406b6cba7bce7af92577.1708513940.git.geert+renesas@glider.be
2024-02-21 16:34:33 +01:00
Claudiu Beznea
254203f9a9 pinctrl: renesas: rzg2l: Add suspend/resume support
pinctrl-rzg2l driver is used on RZ/G3S which support deep sleep states
where power to most of the SoC components is turned off.

For this add suspend/resume support. This involves saving and restoring
configured registers along with disabling clock in case there is no pin
configured as wakeup sources.

To save/restore registers 2 caches were allocated: one for GPIO pins and
one for dedicated pins.

On suspend path the pin controller registers are saved and if none of the
pins are configured as wakeup sources the pinctrl clock is disabled.
Otherwise it remains on.

On resume path the configuration is done as follows:
1/ setup PFCs by writing to registers on pin based accesses
2/ setup GPIOs by writing to registers on port based accesses and
   following configuration steps specified in hardware manual
3/ setup dedicated pins by writing to registers on port based accesses
4/ setup interrupts.

Because interrupt signals are routed to IA55 interrupt controller and
IA55 interrupt controller resumes before pin controller, patch restores
also the configured interrupts just after pin settings are restored to
avoid invalid interrupts while resuming.

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/20240215124112.2259103-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-02-21 16:34:32 +01:00
Claudiu Beznea
fda5edd7d6 pinctrl: renesas: rzg2l: Select GPIOLIB_IRQCHIP and IRQ_DOMAIN_HIERARCHY
The pinctrl-rzg2l driver accesses gpio_chip.irq, which is available only
if CONFIG_GPIOLIB_IRQCHIP=y, and uses APIs that are defined only if
CONFIG_IRQ_DOMAIN_HIERARCHY=y (irq_chip_*_parent() APIs).

On ARCH_RZG2L, CONFIG_IRQ_DOMAIN_HIERARCHY is selected anyway, e.g. by
CONFIG_ARM_GIC_V3, but CONFIG_GPIOLIB_IRQCHIP is not (it is on R-Car).
Make this explicit at the driver level for a clearer view of the
dependencies.

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/20240215124112.2259103-2-claudiu.beznea.uj@bp.renesas.com
[geert: select GPIOLIB_IRQCHIP, too]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-02-21 16:34:32 +01:00
Biju Das
1d2da79708 pinctrl: renesas: rzg2l: Avoid configuring ISEL in gpio_irq_{en,dis}able*(
Currently on irq_disable(), we are disabling gpio interrupt enable(ISEL).
That means the pin is just gpio input and not gpio input interrupt any
more.  So, move configuring ISEL in rzg2l_gpio_child_to_parent_hwirq()/
rzg2l_gpio_irq_domain_free() so that the pin will be gpioint always even
during irq_disable().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240206135318.165426-1-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-02-21 16:34:05 +01:00
Biju Das
d3c4929933 pinctrl: renesas: rzg2l: Simplify rzg2l_gpio_irq_{en,dis}able()
Simplify rzg2l_gpio_irq_{en,dis}able() by adding a helper function
rzg2l_gpio_irq_endisable().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240206135115.151218-3-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-02-21 16:33:55 +01:00
Biju Das
2fd4fe19d0 pinctrl: renesas: rzg2l: Configure interrupt input mode
Configure GPIO interrupt as input mode. Also if the bootloader sets
gpio interrupt pin as function, override it as gpio.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240206135115.151218-2-biju.das.jz@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-02-21 16:22:17 +01:00
Cong Dang
97191e536c pinctrl: renesas: r8a779h0: Add Audio pins, groups, functions
Add pins, groups and functions for Audio on the Renesas R-Car V4M
(R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/e7d5024c23929d2eccb02bb5daf44c914db07d80.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
1604b9788e pinctrl: renesas: r8a779h0: Add PCIe pins, groups, functions
Add pins, groups and functions for the PCIe Controller on the Renesas
R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/d32909f5197fa2df0ca6bd6e5fda7cae8863101e.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
2acf13cec9 pinctrl: renesas: r8a779h0: Add CANFD pins, groups, functions
Add pins, groups and functions for the CAN-FD interfaces on the Renesas
R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/fd380a402ec4c6238aa8cafc2e602d9e0f1c8cf2.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
4759b702d0 pinctrl: renesas: r8a779h0: Add PWM/TPU pins, groups, functions
Add pins, groups and functions for the PWM and 16-Bit Timer Pulse Units
(TPU) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/ddbd37b1815169a8b18c5026bc4fd957f0b25dde.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
b33c4b4b84 pinctrl: renesas: r8a779h0: Add MSIOF pins, groups, functions
Add pins, groups and functions for the Clock-Synchronized Serial
Interfaces with FIFO (MSIOF) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/cbfc61f0c02e9dbeec0ea689e10bdd5ebf5bf1e3.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
2a9d0273d1 pinctrl: renesas: r8a779h0: Add I2C pins, groups, functions
Add pins, groups and functions for the I2C Bus Interfaces on the Renesas
R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/23fc01c6e97e544abd23168439f5d45d3ac8fa5b.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
a0974d843d pinctrl: renesas: r8a779h0: Add HSCIF pins, groups, functions
Add pins, groups and functions for the High Speed Serial Communication
Interfaces with FIFO (HSCIF) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/27577af0042928e4b673a2774c68a14c4ea7c157.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:49 +01:00
Cong Dang
fbaff0364a pinctrl: renesas: r8a779h0: Add SCIF_CLK pins, groups, functions
Add pins, groups and functions for the baud rate generation clock pins
(SCIF_CLK) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/ee056d78d3a339bdbcca2cc5281f1fe01bbc3953.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Cong Dang
bc56b11cd7 pinctrl: renesas: r8a779h0: Add SCIF pins, groups, functions
Add pins, groups and functions for the Serial Communication Interfaces
with FIFO (SCIF) on the Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/4ad8127a54fb36044ae85db07ff30be05fa5d0f0.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Cong Dang
e79da260fc pinctrl: renesas: r8a779h0: Add QSPI pins, groups, functions
Add pins, groups and functions for the QSPI functionality proviced by
the SPI Multi I/O Bus Controller (RPC-IF) on the Renesas R-Car V4M
(R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/ebe123bca4888382bc76ccf1a3a9e85ced31f3f3.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Cong Dang
4ab1ee6f4f pinctrl: renesas: r8a779h0: Add SD/MMC pins, groups, functions
Add pins, groups and functions for the SD Card/MMC Interface on the
Renesas R-Car V4M (R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/c4c06f5be8ffeb32c48993c138f89c8f463751f4.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Cong Dang
73f35ebbf4 pinctrl: renesas: r8a779h0: Add Ethernet AVB pins, groups, functions
Add pins, groups and functions for Ethernet AVB on the Renesas R-Car V4M
(R8A779H0) SoC.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/f79d8f75582f44a7441faed550fb37e44a917558.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Cong Dang
291f7856fc pinctrl: renesas: Initial R8A779H0 (R-Car V4M) PFC support
Add initial pin control support for the R-Car V4M (R8A779H0) SoC,
including bias, drive strength and voltage control.

Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
[geert: Fixes and cleanups]
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/5f59263e75be713dc954007cfeb2c99274c9d761.1706264667.git.geert+renesas@glider.be
2024-02-20 11:43:48 +01:00
Uwe Kleine-König
05013062a8 pwm: lpss-*: Make use of devm_pwmchip_alloc() function
This prepares the pwm-lpss drivers to further changes of the pwm core
outlined in the commit introducing devm_pwmchip_alloc(). There is no
intended semantical change and the driver should behave as before.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/b567ab5dd992e361eb884fa6c2cac11be9c7dde3.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2024-02-19 11:04:11 +01:00
Antonio Borneo
cb4443f26b pinctrl: stm32: fix PM support for stm32mp257
The driver for stm32mp257 is missing the suspend callback in
struct dev_pm_ops.

Add the callback, using the common stm32_pinctrl_suspend()
function.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Fixes: 619f8ca4a7 ("pinctrl: stm32: add stm32mp257 pinctrl support")
Link: https://lore.kernel.org/r/20240207104604.174843-1-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-13 09:42:22 +01:00
Linus Walleij
fd141e173a pinctrl: renesas: Updates for v6.9
- Add pin groups for SCIF_CLK2 on R-Car V4H,
   - Add support for port pins P19 to P28 on RZ/Five,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZcZV0wAKCRCKwlD9ZEnx
 cAQ6AP9RPb5CW91132jjfoF/+dzAyEZj2YR8ndjrzN2QzOn4tQEAlfEOlavoTikB
 oXQsRHGaeV8HQr02OEZgNJWYDXQMrAY=
 =cnIJ
 -----END PGP SIGNATURE-----

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

pinctrl: renesas: Updates for v6.9

  - Add pin groups for SCIF_CLK2 on R-Car V4H,
  - Add support for port pins P19 to P28 on RZ/Five,
  - Miscellaneous fixes and improvements.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-13 09:40:55 +01:00
Arturas Moskvinas
2c0aafdf4a pinctrl: mcp23s08: Check only GPIOs which have interrupts enabled
GPINTEN register contains information about GPIOs with enabled
interrupts no need to check other GPIOs for changes.

Signed-off-by: Arturas Moskvinas <arturas.moskvinas@gmail.com>
Link: https://lore.kernel.org/r/20240201141406.32484-2-arturas.moskvinas@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-09 14:32:47 +01:00
Chen-Yu Tsai
e15ab05a6b pinctrl: mediatek: Drop bogus slew rate register range for MT8192
The MT8192 does not support configuring pin slew rate. This is evident
from both the datasheet, and the fact that the driver points the slew
rate register range at the GPIO direction register range.

Drop the bogus setting.

Fixes: d32f38f2a8 ("pinctrl: mediatek: Add pinctrl driver for mt8192")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240131071910.3950450-2-wenst@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-07 11:47:49 +01:00
Chen-Yu Tsai
3a29c87548 pinctrl: mediatek: Drop bogus slew rate register range for MT8186
The MT8186 does not support configuring pin slew rate. This is evident
from both the datasheet, and the fact that the driver points the slew
rate register range at the GPIO direction register range.

Drop the bogus setting.

Fixes: 8b483bda1e ("pinctrl: add pinctrl driver on mt8186")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240131071910.3950450-1-wenst@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-07 11:47:49 +01:00
Andy Shevchenko
1a7a7aa1e4 pinctrl: nuvoton: Constify wpcm450_groups
There is no modifications are assumed for wpcm450_groups. Constify it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231211154239.4190429-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-07 11:46:02 +01:00
Lad Prabhakar
fea58424e2 pinctrl: renesas: pinctrl-rzg2l: Add the missing port pins P19 to P28
Add the missing port pins P19 to P28 for RZ/Five SoC. These additional
pins provide expanded capabilities and are exclusive to the RZ/Five SoC.

Couple of port pins have different configuration and are not identical for
the complete port so introduce struct rzg2l_variable_pin_cfg to handle
such cases and introduce the PIN_CFG_VARIABLE macro. The actual pin config
is then assigned in rzg2l_pinctrl_get_variable_pin_cfg().

Add an additional check in rzg2l_gpio_get_gpioint() to only allow GPIO pins
which support interrupt facility.

While at define RZG2L_GPIO_PORT_PACK() using RZG2L_GPIO_PORT_SPARSE_PACK().

Update the gpio-ranges property in the RZ/Five SoC DTSI, as it must
match the driver.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240129135556.63466-4-prabhakar.mahadev-lad.rj@bp.renesas.com
Link: https://lore.kernel.org/r/20240129135556.63466-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-01-31 14:50:44 +01:00
Lad Prabhakar
15e4ae4f9a pinctrl: renesas: rzg2l: Include pinmap in RZG2L_GPIO_PORT_PACK() macro
Currently we assume all the port pins are sequential ie always PX_0 to
PX_n (n=1..7) exist, but on RZ/Five SoC we have additional pins P19_1 to
P28_5 which have holes in them, for example only one pin on port19 is
available and that is P19_1 and not P19_0. So to handle such cases
include pinmap for each port which would indicate the pin availability
on each port. As the pincount can be calculated based on pinmap drop this
from RZG2L_GPIO_PORT_PACK() macro.

Previously we had a max of 7 pins on each port but on RZ/Five Port-20
has 8 pins, so move the single pin configuration to BIT(63).

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240129135556.63466-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-01-31 11:28:56 +01:00
Lad Prabhakar
04d231b90e pinctrl: renesas: rzg2l: Improve code for readability
As the RZ/G2L pinctrl driver is extensively utilized by numerous SoCs and
has experienced substantial growth, enhance code readability by
incorporating FIELD_PREP_CONST/FIELD_GET macros wherever necessary.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240129135556.63466-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-01-31 11:28:54 +01:00
Geert Uytterhoeven
3803584a4e pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs
If the number of provided enum IDs in a variable width config register
description does not match the expected number, the checker uses the
expected number for validating the individual enum IDs.

However, this may cause out-of-bounds accesses on the array holding the
enum IDs, leading to bogus enum_id conflict warnings.  Worse, if the bug
is an incorrect bit field description (e.g. accidentally using "12"
instead of "-12" for a reserved field), thousands of warnings may be
printed, overflowing the kernel log buffer.

Fix this by limiting the enum ID check to the number of provided enum
IDs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/c7385f44f2faebb8856bcbb4e908d846fc1531fb.1705930809.git.geert+renesas@glider.be
2024-01-31 11:26:54 +01:00
Geert Uytterhoeven
68540257cd pinctrl: renesas: r8a779g0: Add missing SCIF_CLK2 pin group/function
R-Car V4H actually has two SCIF_CLK pins.
The second pin provides the SCIF_CLK signal for HSCIF2 and SCIF4.

Fixes: 050442ae4c ("pinctrl: renesas: r8a779g0: Add pins, groups and functions")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/6352ec9b63fdd38c2c70d8d203e46f21fbfeccdc.1705589612.git.geert+renesas@glider.be
2024-01-31 11:26:49 +01:00
Claudiu Beznea
bd433c25ca pinctrl: renesas: rzg2l: Fix locking in rzg2l_dt_subnode_to_map()
Commit d3aaa7203a ("pinctrl: renesas: rzg2l: Add pin configuration
support for pinmux groups") introduced the possibility to parse pin
configuration for pinmux groups. It did that by calling
rzg2l_map_add_config() at the end of rzg2l_dt_subnode_to_map() and
jumping to the remove_group label in case rzg2l_map_add_config() failed.
But if that happens, the mutex will already be unlocked, thus this it will
lead to double mutex unlock operation. To fix this move the
rzg2l_map_add_config() call just after all the name argument is ready and
before the mutex is locked. There is no harm in doing this, as this only
parses the data from device tree that will be further processed by
pinctrl core code.

Fixes: d3aaa7203a ("pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/f8c3a3a0-7c48-4e40-8af0-ed4e9d9b049f@moroto.mountain
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/20240115153453.99226-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
2024-01-31 11:26:38 +01:00
Mario Limonciello
4451e8e841 pinctrl: amd: Add IRQF_ONESHOT to the interrupt request
On some systems the interrupt is shared between GPIO controller
and ACPI SCI. When the interrupt is shared with the ACPI SCI the
flags need to be identical.

This should fix the GPIO controller failing to work after commit
7a36b901a6 ("ACPI: OSL: Use a threaded interrupt handler for SCI").
```
[    0.417335] genirq: Flags mismatch irq 9. 00000088 (pinctrl_amd) vs. 00002080 (acpi)
[    0.420073] amd_gpio: probe of AMDI0030:00 failed with error -16
```

Cc: Rafael J. Wysocki <rafael@kernel.org>
Reported-by: Christian Heusel <christian@heusel.eu>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218407
Fixes: 7a36b901a6 ("ACPI: OSL: Use a threaded interrupt handler for SCI")
Link: https://lore.kernel.org/linux-acpi/CAJZ5v0iRqUXeuKmC_+dAJtDBLWQ3x15n4gRH48y7MEaLoXF+UA@mail.gmail.com/T/#mc5506014141b61e472b24e095889535a04458083
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Tested-by: Christian Heusel <christian@heusel.eu>
Link: https://lore.kernel.org/r/20240123180818.3994-1-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-31 10:06:07 +01:00
Charles Keepax
b96e00a474 pinctrl: cs42l43: Use str_high_low()
Use str_high_low() rather than open coding.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240129153138.3221604-3-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-31 09:11:14 +01:00
Charles Keepax
ac98dd1cf0 pinctrl: cs42l43: Remove some needless inlines
Remove some pointless inline declarations, no reason not to let the
compiler decide.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240129153138.3221604-2-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-31 09:11:14 +01:00
Charles Keepax
6bdf332a08 pinctrl: cs42l43: Tidy up header includes
Fixup a couple of incorrect header includes.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240129153138.3221604-1-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-31 09:11:14 +01:00
Erick Archer
f6f62a9a93 pinctrl: pinctrl-zynqmp: Use devm_kcalloc() instead of devm_kzalloc()
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

So, use the purpose specific devm_kcalloc() function instead of the
argument size * count in the devm_kzalloc() function.

Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1]
Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Erick Archer <erick.archer@gmx.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20240119181909.7079-1-erick.archer@gmx.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-28 01:17:26 +01:00
Jean Thomas
8714b3414d pinctrl: mediatek: mt7981: add additional emmc groups
Add new emmc groups in the pinctrl driver for the
MediaTek MT7981 SoC:
* emmc reset, with pin 15.
* emmc 4-bit bus-width, with pins 16 to 19, and 24 to 25.
* emmc 8-bit bus-width, with pins 16 to 25.

The existing emmc_45 group is kept for legacy reasons, even
if this is the union of emmc_reset and emmc_8 groups.

Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/20240117145547.3354242-1-jean.thomas@wifirst.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-28 00:52:31 +01:00
Jean Thomas
398f914bf0 pinctrl: mediatek: mt7981: add additional uart group
Add uart1_3 (pins 26, 27) group to the pinctrl driver for the
MediaTek MT7981 SoC.

Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/20240117124234.3137050-1-jean.thomas@wifirst.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-28 00:52:08 +01:00
Randy Dunlap
13931e5d8f pinctrl: mt7986: excise kernel-doc warnings
Fix kernel-doc warnings for enum (anonymous): the enum values are not
documented, so don't indicate that the comment contains kernel-doc
notation.

pinctrl-mt7986.c:68: warning: Enum value 'GPIO_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_RT_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_RB_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_LT_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_LB_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_TR_BASE' not described in enum '(anonymous)'
pinctrl-mt7986.c:68: warning: Enum value 'IOCFG_TL_BASE' not described in enum '(anonymous)'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312110210.x3vxq42A-lkp@intel.com/
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc:  <linux-gpio@vger.kernel.org>
Cc: Sean Wang <sean.wang@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc:  <linux-mediatek@lists.infradead.org>
Cc:  <linux-arm-kernel@lists.infradead.org>
Link: https://lore.kernel.org/r/20240111045126.13768-1-rdunlap@infradead.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-28 00:36:50 +01:00
Chen Ni
2248bee3ea pinctrl: st: Return pinctrl_gpio_direction_output to transfer the error
Return pinctrl_gpio_direction_output() in order to transfer the error
if it fails.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240103085058.3771653-1-nichen@iscas.ac.cn
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-01-27 23:45:22 +01:00
Linus Torvalds
ed6c23b175 This is the main pin control pull request for the v6.8 kernel series.
Core changes:
 
 - A new PINCTRL_GROUP_DESC() infrastructure macro is added and
   used in different drivers, generic group description struct
   group_desc is now used all over the place.
 
 New drivers:
 
 - New driver for the Texas Instruments TPS6494 Power Management IC.
 
 - New driver for the Lantic PEF2256 framer pin multiplexer.
   This IC has some pins that can be reconfigured in different
   ways. The actual driver comes on an immutable branch with the
   net WAN parts, the IC is some latest-and-greatest serial line
   funnel for e.g. wireless access points.
 
 - New subdriver for the Samsung Exynos Auto V920 pin controller,
   used for automotive applications.
 
 - New subdriver for the Samsung "GS101" SoC pin controller, this
   is the Google "Tensor" SoC used in the Google Pixel 6.
 
 - New subdriver for the Intel Meteor Point SoC pin controller.
 
 - New subdriver for the Qualcomm SM8650 top level (TLMM) and LPASS pin
   controllers.
 
 - New subdriver for the Qualcomm X1E80100 top level (TLMM) pin
   controller.
 
 - New subdriver for the Qualcomm SM4450 top level (TLMM) pin
   controller.
 
 - The "single" pin controller now supports the Texas Instruments
   J7200 SoC.
 
 Improvements:
 
 - Intel has created a new (Intel-)generic pin controller driver that
   is now used by all contemporary Intel platforms.
 
 - Intel is now also making use of some cleanup helpers.
 
 - Enble 910 Ohm bias in the Intel Tangier driver.
 
 - The Samsung driver now suppors irq_set_affinity() in it's IRQ chip
   giving support for non wake up external gpio interrupts.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmWk3gEACgkQQRCzN7AZ
 XXMfaQ/+LyuPMFxRmVj27rbw/mxs9FS6fFvnipfsQq/jTjjt4DLiPj0491UL260z
 CD7T09g0rEJetWvGBbPdaxN2BE07x83E4+1d9CzszhOaIvPLnWfSPZCMRlKgHjJW
 gpMAeNtRXPOQW9mny4VRoxa6QKwbE4om9WgnfsOq9SM1JfkekjcGZQGYJkGincEC
 rb4efJMcaegsXo+J8nVItxp1CFV/4EbcZxaQuYwVHSGvd9WQR3aRMSnw444e9q8m
 SkOxOHAPsL/y6PkolLTZFvedT7mTjKo36MuYdS6nzAuW5TgoXPfDSI38pt3s18Tg
 KZb7gpqPIbbDEBd+4c93MWuOHYupNzYJnpUpCXJlDVzv0joEkQo3wnnCeoiMNjPt
 sSWbnKlssKuJKBjgMS3QM7kt2Jq67v1wfm3eeBOmp+yarAMiwdGSa2jW7mScHP9M
 P3pEQGFnYkwPthIM7N0SnQ0POehYHT8milOhWUtd1vEtI/hEtYVPbuh7XsBARe8P
 Dj0u6iKMK1X+dqGphnzfTvnbl6elvmmKu3Qwil4bG4MFr12ptjJhGpcCTuQwBfdp
 SgNJKMUKk4+4rEFwBAZQzrqiaNBifq3dcQ0DEbVMUPeQNkYSyqpflj8ROEQETf01
 bnoalD2hUT0HaFgOlZswFxsQN1EESwG6X0n938VRTijuKvfrdBI=
 =kj/d
 -----END PGP SIGNATURE-----

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

Pull pin control updates from Linus Walleij:
 "For this kernel cycle I managed an immutable branch for the PEF2256
  WAN framer that has some pin control portions. It already landed in
  your tree through the net pull request but here it is mentioned again.

  The most interesting is perhaps the Samsung Exynos subdrivers for the
  Tensor SoC used in Google Pixel 6 and the ExynosAuto subdriver for
  automotive. Along with the earlier merged Tesla FSD subdriver it shows
  some of the versatile uses of the Samsung Exynos silicon. It is also
  used in the latest version of Axis Communications ARTPEC chips so it
  is a very widely deployed SoC family.

  We also have the Intel Meteor Lake SoC which I think is for laptops.
  It's a pretty interesting chip with Xe graphics and integrated PCH.

  Core changes:

   - A new PINCTRL_GROUP_DESC() infrastructure macro is added and used
     in different drivers, generic group description struct group_desc
     is now used all over the place.

  New drivers:

   - New driver for the Texas Instruments TPS6494 Power Management IC.

   - New driver for the Lantic PEF2256 framer pin multiplexer. This IC
     has some pins that can be reconfigured in different ways. The
     actual driver comes on an immutable branch with the net WAN parts,
     the IC is some latest-and-greatest serial line funnel for e.g.
     wireless access points.

   - New subdriver for the Samsung Exynos Auto V920 pin controller, used
     for automotive applications.

   - New subdriver for the Samsung "GS101" SoC pin controller, this is
     the Google "Tensor" SoC used in the Google Pixel 6.

   - New subdriver for the Intel Meteor Point SoC pin controller.

   - New subdriver for the Qualcomm SM8650 top level (TLMM) and LPASS
     pin controllers.

   - New subdriver for the Qualcomm X1E80100 top level (TLMM) pin
     controller.

   - New subdriver for the Qualcomm SM4450 top level (TLMM) pin
     controller.

   - The "single" pin controller now supports the Texas Instruments
     J7200 SoC.

  Improvements:

   - Intel has created a new (Intel-)generic pin controller driver that
     is now used by all contemporary Intel platforms.

   - Intel is now also making use of some cleanup helpers.

   - Enble 910 Ohm bias in the Intel Tangier driver.

   - The Samsung driver now suppors irq_set_affinity() in it's IRQ chip
     giving support for non wake up external gpio interrupts"

* tag 'pinctrl-v6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (112 commits)
  pinctrl: samsung: constify iomem pointers
  pinctrl: cy8c95x0: Cache muxed registers
  dt-bindings: pinctrl: xilinx: Rename *gpio to *gpio-grp
  pinctrl: qcom: lpass-lpi: remove duplicated include
  dt-bindings: pinctrl: qcom: drop common properties and allow wakeup-parent
  dt-bindings: pinctrl: qcom: drop common properties
  dt-bindings: pinctrl: qcom,ipq5018-tlmm: use common TLMM bindings
  dt-bindings: pinctrl: qcom,x1e80100-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom,sm8650-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom,sm8550-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom,sdx75-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom,sa8775p-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom,qdu1000-tlmm: restrict number of interrupts
  dt-bindings: pinctrl: qcom: create common LPASS LPI schema
  pinctrl: qcom: sm4450: dd SM4450 pinctrl driver
  dt-bindings: pinctrl: qcom: Add SM4450 pinctrl
  dt-bindings: pinctrl: qcom,pmic-mpp: clean up example
  pinctrl: intel: Add Intel Meteor Point pin controller and GPIO support
  pinctrl: renesas: rzg2l: Add input enable to the Ethernet pins
  pinctrl: renesas: rzg2l: Add output enable support
  ...
2024-01-17 15:55:33 -08:00
Linus Torvalds
576db73424 gpio updates for v6.8
Core GPIOLIB:
 - protect the global list of GPIO devices with a read-write semaphore as
   it is rarely modified but can be traversed by multiple readers at once
 - remove GPIO devices from the global list when they are *unregistered*
   and not when they are *released* (which only happens when the last
   reference is dropped) as this may lead to a successful lookup of an
   unregistered device
 - remove the unnecessary "extra_checks" switch
 - rename functions that are called with a lock taken
 - remove duplicate includes
 
 Character device handling:
 - use locking guards to reduce the code size
 - allocate the big linereq structure using the more suitable kvzalloc()
 - redulce the size of critical sections
 - improve documentation
 - move the debounce_period_us field out of struct gpio_desc
 
 New drivers:
 - Nuvoton NPCM SGPIO driver for BMC NPCM7xx/NPCM8xx
 - Realtek DHC (Digital Home Center) SoC GPIO driver
 
 Driver improvements:
 - replace gpiochip_is_requested() with a safer alternative in the form of
   gpiochip_dup_line_label() as the former returns a pointer to a string that
   can be deleted
 - implement the dbg_show() callback in gpio-sim
 - improve the coding style for local variables by removing unnecessary tabs
 - use generic device properties instead of OF variants in gpio-mmio
 - use the preferred coding style for __free() in gpio-mockup
 - reuse PM ops from the gpio-tangier in gpio-elkhartlake
 - rework PM and use cleanup helpers in gpio-tangier
 - fix the EIC configuration in gpio-pmic-eic-sprd
 - remove the unneeded call to platform_set_drvdata() in gpio-sifive
 - use generic GPIO helpers for driver callbacks in gpio-dwapb
 - add clock support on certain pins of gpio-ixp4xx
 - don't use the core-specific DEBUG_GPIO switch in drivers
 - kerneldoc improvements
 
 DT bindings:
 - add bindings for the new Realtek and Nuvoton devices
 - allow gpio-ranges in gpio-dwapb
 - support GPIO hogs in gpio-rockchip
 - describe the label property in gpio-zynqmp-modepin
 
 Other:
 - header cleanups
 - forward declarations cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmWdlcgACgkQEacuoBRx
 13LUwQ//QG1RU5oEOe+mMw6qtsRl5CC4ufiQIbDFtDspitKvlJqx9wK3ZZpK8EOT
 xRQxitZn7wQMkCUmxsAY4g+EMf6k1hpeX9bb1aZHbDcJrznQy3Md4pkqvybk7TrH
 f6bIAdV97T+vgeXwrpCnwf41xpTuX6TJqXR7xFhw05r6n495WuCZUjm+DcjgROZu
 mignIGeHzDpBKThspw6EPaz4iMuKFjBJbdrIsoNwqUF6W0Oy+era9ATfyVl8LfxQ
 QDHLIa875Q5LMmBZoGZdMzpyIcNaplrt6POqi1/O7e7xSFSZeb2j85Z64ehPT32c
 VITkj2ZU+XAGylN5lII5LbJbm8Gmz7GCaIw300Ng1LqT/VP52EUG4jdpLh/x0Qff
 TlDS1095P4/1ATrJKzx1FJskVvfEmfGZ4/gOOjrrQp6NSG5jTPVjZ4TtC9LHWH0l
 qqEG3933ayM36ypxCiiEJYGztWdRI0GUwDyaCwYGDdBQbinKKsfdYEcFqwLm98C4
 9vmRKzJlvWjKBRhnU/hGn04wHoK6XeyvdHct53WAs5+o+ncxiF/zmURZganFnhhV
 KckqChmgIJ0LWu7ygg3Xcy/iSQjTpnG8sNJapjwSN0crF4cQFSC3yfOUC9BKu8k2
 sGyHoOWUfoj1/dRorPARc4xQaPQYR2LscswNrlxlKTavMuX+wqU=
 =bcXn
 -----END PGP SIGNATURE-----

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

Pull gpio updates from Bartosz Golaszewski:
 "We have two new drivers, an assortment of updates and cleanups to many
  others, and first part of the big rework of the core GPIOLIB that's
  currently underway.

  Add to that some code shrink in the character device module and
  updates to DT bindings and that's pretty much it.

  Core GPIOLIB:
   - protect the global list of GPIO devices with a read-write semaphore
     as it is rarely modified but can be traversed by multiple readers
     at once
   - remove GPIO devices from the global list when they are
     *unregistered* and not when they are *released* (which only happens
     when the last reference is dropped) as this may lead to a
     successful lookup of an unregistered device
   - remove the unnecessary "extra_checks" switch
   - rename functions that are called with a lock taken
   - remove duplicate includes

  Character device handling:
   - use locking guards to reduce the code size
   - allocate the big linereq structure using the more suitable
     kvzalloc()
   - redulce the size of critical sections
   - improve documentation
   - move the debounce_period_us field out of struct gpio_desc

  New drivers:
   - Nuvoton NPCM SGPIO driver for BMC NPCM7xx/NPCM8xx
   - Realtek DHC (Digital Home Center) SoC GPIO driver

  Driver improvements:
   - replace gpiochip_is_requested() with a safer alternative in the
     form of gpiochip_dup_line_label() as the former returns a pointer
     to a string that can be deleted
   - implement the dbg_show() callback in gpio-sim
   - improve the coding style for local variables by removing
     unnecessary tabs
   - use generic device properties instead of OF variants in gpio-mmio
   - use the preferred coding style for __free() in gpio-mockup
   - reuse PM ops from the gpio-tangier in gpio-elkhartlake
   - rework PM and use cleanup helpers in gpio-tangier
   - fix the EIC configuration in gpio-pmic-eic-sprd
   - remove the unneeded call to platform_set_drvdata() in gpio-sifive
   - use generic GPIO helpers for driver callbacks in gpio-dwapb
   - add clock support on certain pins of gpio-ixp4xx
   - don't use the core-specific DEBUG_GPIO switch in drivers
   - kerneldoc improvements

  DT bindings:
   - add bindings for the new Realtek and Nuvoton devices
   - allow gpio-ranges in gpio-dwapb
   - support GPIO hogs in gpio-rockchip
   - describe the label property in gpio-zynqmp-modepin

  Other:
   - header cleanups
   - forward declarations cleanups"

* tag 'gpio-updates-for-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (55 commits)
  gpiolib: replace the GPIO device mutex with a read-write semaphore
  gpiolib: remove the GPIO device from the list when it's unregistered
  gpio: nuvoton: Add Nuvoton NPCM sgpio driver
  dt-bindings: gpio: add NPCM sgpio driver bindings
  gpio: rtd: Add support for Realtek DHC(Digital Home Center) RTD SoCs
  dt-bindings: gpio: realtek: Add realtek,rtd-gpio
  gpio: pmic-eic-sprd: Configure the bit corresponding to the EIC through offset
  gpio: dwapb: Use generic request, free and set_config
  gpio: sysfs: drop tabs from local variable declarations
  gpiolib: drop tabs from local variable declarations
  gpiolib: remove extra_checks
  gpio: tps65219: don't use CONFIG_DEBUG_GPIO
  gpiolib: cdev: replace locking wrappers for gpio_device with guards
  gpiolib: cdev: replace locking wrappers for config_mutex with guards
  gpiolib: cdev: allocate linereq using kvzalloc()
  gpiolib: cdev: include overflow.h
  gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo()
  gpiolib: cdev: improve documentation of get/set values
  gpiolib: cdev: fully adopt guard() and scoped_guard()
  gpiolib: remove debounce_period_us from struct gpio_desc
  ...
2024-01-12 13:35:31 -08:00
Jakub Kicinski
e63c1822ac Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR.

Conflicts:

drivers/net/ethernet/broadcom/bnxt/bnxt.c
  e009b2efb7 ("bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters()")
  0f2b214779 ("bnxt_en: Fix compile error without CONFIG_RFS_ACCEL")
https://lore.kernel.org/all/20240105115509.225aa8a2@canb.auug.org.au/

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-01-04 18:06:46 -08:00
Krzysztof Kozlowski
1b09c2b8f8 pinctrl: samsung: constify iomem pointers
Constify few pointers to iomem, where the destination memory is not
modified, for code safety and readability.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Link: https://lore.kernel.org/r/20231223191902.22857-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-28 22:13:17 +01:00
Bartosz Golaszewski
4ccdaba5ab Linux 6.7-rc7
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmWHepQeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGm6YH/0b9hMQ1f2DbMjEq
 w8h0bIMkc+Jv9fLVgCMA8nTuAQsYNp+MJ8PKA9t8CCtG1BTs+lXr6DsN2GpoODEj
 fMCXzyHTlMgg5S0iXAXHcxX1t1gRDgxoOeBvUY8YZw1JZriNsO+dF3U7rRdrmg1n
 7jq6WFxJfuB2NMlmys7vk/0c3t193AKxkWyDFBmiim3MX0IYxGlD5DVadaxA6Vx7
 Pqjt9ljVG11jJWeQ9ZFLd5RmZkdmY/JVlPagEr5rPDsJrbL23sLUu4bRHGBWcipU
 BgBUdj7K6tahuwKeg2KENxCGjvQOaFIti1l1CvHMWKPgFFlhE30DD6x7nZldPSj6
 m52I1xE=
 =tLIr
 -----END PGP SIGNATURE-----

Merge tag 'v6.7-rc7' into gpio/for-next

Linux 6.7-rc7
2023-12-27 15:41:04 +01:00
Alexis Lothoré
14694179e5 pinctrl: at91-pio4: use dedicated lock class for IRQ
Trying to suspend to RAM on SAMA5D27 EVK leads to the following lockdep
warning:

 ============================================
 WARNING: possible recursive locking detected
 6.7.0-rc5-wt+ #532 Not tainted
 --------------------------------------------
 sh/92 is trying to acquire lock:
 c3cf306c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 but task is already holding lock:
 c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&irq_desc_lock_class);
   lock(&irq_desc_lock_class);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

 6 locks held by sh/92:
  #0: c3aa0258 (sb_writers#6){.+.+}-{0:0}, at: ksys_write+0xd8/0x178
  #1: c4c2df44 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x138/0x284
  #2: c32684a0 (kn->active){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x148/0x284
  #3: c232b6d4 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend+0x13c/0x4e8
  #4: c387b088 (&dev->mutex){....}-{3:3}, at: __device_suspend+0x1e8/0x91c
  #5: c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 stack backtrace:
 CPU: 0 PID: 92 Comm: sh Not tainted 6.7.0-rc5-wt+ #532
 Hardware name: Atmel SAMA5
  unwind_backtrace from show_stack+0x18/0x1c
  show_stack from dump_stack_lvl+0x34/0x48
  dump_stack_lvl from __lock_acquire+0x19ec/0x3a0c
  __lock_acquire from lock_acquire.part.0+0x124/0x2d0
  lock_acquire.part.0 from _raw_spin_lock_irqsave+0x5c/0x78
  _raw_spin_lock_irqsave from __irq_get_desc_lock+0xe8/0x100
  __irq_get_desc_lock from irq_set_irq_wake+0xa8/0x204
  irq_set_irq_wake from atmel_gpio_irq_set_wake+0x58/0xb4
  atmel_gpio_irq_set_wake from irq_set_irq_wake+0x100/0x204
  irq_set_irq_wake from gpio_keys_suspend+0xec/0x2b8
  gpio_keys_suspend from dpm_run_callback+0xe4/0x248
  dpm_run_callback from __device_suspend+0x234/0x91c
  __device_suspend from dpm_suspend+0x224/0x43c
  dpm_suspend from dpm_suspend_start+0x9c/0xa8
  dpm_suspend_start from suspend_devices_and_enter+0x1e0/0xa84
  suspend_devices_and_enter from pm_suspend+0x460/0x4e8
  pm_suspend from state_store+0x78/0xe4
  state_store from kernfs_fop_write_iter+0x1a0/0x284
  kernfs_fop_write_iter from vfs_write+0x38c/0x6f4
  vfs_write from ksys_write+0xd8/0x178
  ksys_write from ret_fast_syscall+0x0/0x1c
 Exception stack(0xc52b3fa8 to 0xc52b3ff0)
 3fa0:                   00000004 005a0ae8 00000001 005a0ae8 00000004 00000001
 3fc0: 00000004 005a0ae8 00000001 00000004 00000004 b6c616c0 00000020 0059d190
 3fe0: 00000004 b6c61678 aec5a041 aebf1a26

This warning is raised because pinctrl-at91-pio4 uses chained IRQ. Whenever
a wake up source configures an IRQ through irq_set_irq_wake, it will
lock the corresponding IRQ desc, and then call irq_set_irq_wake on "parent"
IRQ which will do the same on its own IRQ desc, but since those two locks
share the same class, lockdep reports this as an issue.

Fix lockdep false positive by setting a different class for parent and
children IRQ

Fixes: 776180848b ("pinctrl: introduce driver for Atmel PIO4 controller")
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20231215-lockdep_warning-v1-1-8137b2510ed5@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-21 09:05:02 +01:00
Patrick Rudolph
7d7cd22dc4 pinctrl: cy8c95x0: Cache muxed registers
Currently the port specific registers behind the PORTSEL mux aren't
cached in the regmap and thus the typical setup time for a single pin
on cy8c9560 is about 200msec on our system. The hotspot is the IRQ
(un)masking, which causes lots of R/W operations.

Introduce a separate regmap for muxed registers and helper functions
to use the newly introduced regmap for muxed register access under
the i2c lock.

With the new cache in place the typical pin setup time is reduced to
20msec, making it about 10 times faster. As a side effect the system
boot time is also reduced by 50%.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20231219125350.4031370-1-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 13:04:04 +01:00
Patrick Rudolph
94c71705cc pinctrl: cy8c95x0: Fix get_pincfg
Invert the register value for PIN_CONFIG_OUTPUT_ENABLE to return
the opposite of PIN_CONFIG_INPUT_ENABLE.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20231219125120.4028862-3-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 13:02:18 +01:00
Patrick Rudolph
04dfca968c pinctrl: cy8c95x0: Fix regression
Commit 1fa3df901f ("pinctrl: cy8c95x0: Remove custom ->set_config()")
removed support for PIN_CONFIG_INPUT_ENABLE and
PIN_CONFIG_OUTPUT.

Add the following options to restore functionality:
- PIN_CONFIG_INPUT_ENABLE
- PIN_CONFIG_OUTPUT_ENABLE

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20231219125120.4028862-2-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 13:02:18 +01:00
Patrick Rudolph
47b1fa4811 pinctrl: cy8c95x0: Fix typo
Fix typo to make pinctrl-cy8c95x compile again.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20231219125120.4028862-1-patrick.rudolph@9elements.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 13:02:18 +01:00
Wang Jinchao
ff629d3004 pinctrl: qcom: lpass-lpi: remove duplicated include
remove the second #include <linux/seq_file.h>

Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/202312151810+0800-wangjinchao@xfusion.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 12:30:09 +01:00
Tengfei Fan
fa7b1fe24e pinctrl: qcom: sm4450: dd SM4450 pinctrl driver
Add pinctrl driver for TLMM block found in SM4450 SoC.
Can Guo helped out in reviewing the driver.

Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
Link: https://lore.kernel.org/r/20231212094900.12615-3-quic_tengfan@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-20 12:03:03 +01:00
Linus Walleij
7085e4e2ff intel-pinctrl for v6.8-1
* New agnostic driver to support Lunar Lake and newer platforms
 * New driver for Intel Meteor Point-S (PCH for Meteor Lake-S)
 * Update drivers to use new PM helpers
 * Use RAII for locking in a few drivers (Raag, Andy)
 * Reduce locking scope in some functions (Raag)
 * Miscellaneous cleanups (Raag)
 
 The following is an automated git shortlog grouped by driver:
 
 alderlake:
  -  Switch to use Intel pin control PM ops
 
 baytrail:
  -  Simplify code with cleanup helpers
  -  Move default strength assignment to a switch-case
  -  Factor out byt_gpio_force_input_mode()
  -  Fix types of config value in byt_pin_config_set()
 
 broxton:
  -  Switch to use Intel pin control PM ops
 
 cannonlake:
  -  Switch to use Intel pin control PM ops
 
 cedarfork:
  -  Switch to use Intel pin control PM ops
 
 denverton:
  -  Switch to use Intel pin control PM ops
 
 elkhartlake:
  -  Switch to use Intel pin control PM ops
 
 emmitsburg:
  -  Switch to use Intel pin control PM ops
 
 geminilake:
  -  Switch to use Intel pin control PM ops
 
 icelake:
  -  Switch to use Intel pin control PM ops
 
 intel:
  -  Add Intel Meteor Point pin controller and GPIO support
  -  use the correct _PM_OPS() export macro
  -  Add a generic Intel pin control platform driver
  -  Revert "Unexport intel_pinctrl_probe()"
  -  allow independent COMPILE_TEST
  -  Refactor intel_pinctrl_get_soc_data()
  -  Move default strength assignment to a switch-case
  -  Make PM ops functions static
  -  Provide Intel pin control wide PM ops structure
 
 jasperlake:
  -  Switch to use Intel pin control PM ops
 
 lakefield:
  -  Switch to use Intel pin control PM ops
 
 lewisburg:
  -  Switch to use Intel pin control PM ops
 
 lynxpoint:
  -  Simplify code with cleanup helpers
 
 meteorlake:
  -  Switch to use Intel pin control PM ops
 
 sunrisepoint:
  -  Switch to use Intel pin control PM ops
 
 tangier:
  -  simplify locking using cleanup helpers
  -  Move default strength assignment to a switch-case
  -  Enable 910 Ohm bias
 
 tigerlake:
  -  Switch to use Intel pin control PM ops
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEqaflIX74DDDzMJJtb7wzTHR8rCgFAmWAKiUACgkQb7wzTHR8
 rCgi/A/8CBFdd32S5gp/BIymhXIeU8FTee9khST9eX4Zn3Ox5VUjdDzKIaSk432z
 cJW7ycbAT94YhGVqmHh05pO73qH5LtEGk79ccRWWrAqAT6WmmmYn1OOWPBLOyHdC
 2ekSwmYe64BTk0UoAvYz6/BRFy8o3onET+HYtZwiMNvqdBvdBfCiVtkJK5KmNyPV
 wbNOs1xfA9drH68T7k23UvmbjY84s6t/ftPwws+kh0YmkkR65GASNlS167xxXTbX
 M72mLeY+NJt8fFaawJahQTKhAMc6K7s3udgFh0Gmt1paWsJ6ABu+RIDOaPIWVtAC
 5hMlbYFVC2y3QpjXlW8SWGq2WzoN+hzM/e/KTo2/7QzY/pt95q/TDyE/RJfFWYhS
 PkCTcdzkDjyrOmfbNatumIZZEfoRg7Ddw9Cn1NwDJQrFHAMJhcqsPaxrZ0CtCJYn
 o/1kU7QvlQB3EGZiucQouy8b5yz/96I811htfqvEoNNrtz4g1AI5Wkfw3dusY0jB
 oQaYG2M7fxI4u9AzU5+yfhk2cdxU1dv7+GStSXzc8GcppID5ub8bmpU6mARFFglV
 NJwvS529sP3+XSqvSApS1uZR+fRJFX3Fpo5QMBJm12UOPFLc4EDCnalc48WCLD2q
 yn2uCvssiAEogCKKy8ZAEi8aWlT706eGg5G2+9KhaJ+lfLFGfiA=
 =72T1
 -----END PGP SIGNATURE-----

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

intel-pinctrl for v6.8-1

* New agnostic driver to support Lunar Lake and newer platforms
* New driver for Intel Meteor Point-S (PCH for Meteor Lake-S)
* Update drivers to use new PM helpers
* Use RAII for locking in a few drivers (Raag, Andy)
* Reduce locking scope in some functions (Raag)
* Miscellaneous cleanups (Raag)

The following is an automated git shortlog grouped by driver:

alderlake:
 -  Switch to use Intel pin control PM ops

baytrail:
 -  Simplify code with cleanup helpers
 -  Move default strength assignment to a switch-case
 -  Factor out byt_gpio_force_input_mode()
 -  Fix types of config value in byt_pin_config_set()

broxton:
 -  Switch to use Intel pin control PM ops

cannonlake:
 -  Switch to use Intel pin control PM ops

cedarfork:
 -  Switch to use Intel pin control PM ops

denverton:
 -  Switch to use Intel pin control PM ops

elkhartlake:
 -  Switch to use Intel pin control PM ops

emmitsburg:
 -  Switch to use Intel pin control PM ops

geminilake:
 -  Switch to use Intel pin control PM ops

icelake:
 -  Switch to use Intel pin control PM ops

intel:
 -  Add Intel Meteor Point pin controller and GPIO support
 -  use the correct _PM_OPS() export macro
 -  Add a generic Intel pin control platform driver
 -  Revert "Unexport intel_pinctrl_probe()"
 -  allow independent COMPILE_TEST
 -  Refactor intel_pinctrl_get_soc_data()
 -  Move default strength assignment to a switch-case
 -  Make PM ops functions static
 -  Provide Intel pin control wide PM ops structure

jasperlake:
 -  Switch to use Intel pin control PM ops

lakefield:
 -  Switch to use Intel pin control PM ops

lewisburg:
 -  Switch to use Intel pin control PM ops

lynxpoint:
 -  Simplify code with cleanup helpers

meteorlake:
 -  Switch to use Intel pin control PM ops

sunrisepoint:
 -  Switch to use Intel pin control PM ops

tangier:
 -  simplify locking using cleanup helpers
 -  Move default strength assignment to a switch-case
 -  Enable 910 Ohm bias

tigerlake:
 -  Switch to use Intel pin control PM ops

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-18 23:42:42 +01:00
Linus Walleij
915fdc94f1 Samsung pinctrl drivers changes for v6.8
1. New hardware: Add pin controllers for Samsung ExynosAutov920 and
    Google Tensor GS101.
 
 2. Few DT bindings cleanups: add specific compatibles for each device
    using generic compatible as fallback.  This affects only DTS, no
    driver changes are needed.
 
 3. Allow setting affinity on non wake-up external GPIO interrupts.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmWAFGcQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD1x7MD/0SOUjmSGFVzHTMv/+tjtjD+dhRneyc2YaV
 D+8d5HxYiKPda3P3flwwMJT/JWnxeI8YUhng3uB/3x48ftOhvR2mamfAnwox63/P
 gyH5tzhrLetmHswEEHWI+1V8mwdhtTDOsiPheo/76EIqCRTpoCTRCUUO25hmNEzf
 uuw8MxNyo7g94s36J7JrgPcTyC7aQQgIiZAnXw1c+0zI9AeaJUWHP16/1LflHV+b
 8eZEacFOCmlLWRUzvlFRb7cFlifHrH39w6eW+uZIJQM24hH4Mt2giq4trb0+ERx9
 fuGLBfBuX1/6ZnfAZGQLR8LdBouBQMuRxPW9gtuDTR+pWYTUk4RzC+C/yk+7KCon
 bGPyWOd55s9pUgLLicQ/0pqq6sn4x2+PddBFMeJzuYmxHewHwJ4ovkdKhLDISSP5
 TTknYRLXuK3MqzI/H/Bdwq9AULaUzp9mtKs5rbZzW46tJfGSQbu8Pokr+CHIlUtF
 1uLVQI2tkjQxRa4jll7Nl5OazNaPZrhrZlJMa1ja8rZPcTwWGYDgV9NgoWgDpz/m
 eLGM8+YTJfpAVlUNda/GX5YbFyfr4Okam2gUNiml/C/A7E0kIYqNnEg5YOsYwrEN
 lYJldOAK1++qeL+Hx/4oYsytfm7y2AhiU+N42ElEgntlCb5UYrzI6fv6QEzP6Sqp
 3iAhBkL/lg==
 =hlN6
 -----END PGP SIGNATURE-----

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

Samsung pinctrl drivers changes for v6.8

1. New hardware: Add pin controllers for Samsung ExynosAutov920 and
   Google Tensor GS101.

2. Few DT bindings cleanups: add specific compatibles for each device
   using generic compatible as fallback.  This affects only DTS, no
   driver changes are needed.

3. Allow setting affinity on non wake-up external GPIO interrupts.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-18 15:07:23 +01:00