Re: [PATCH 2/3] pinctrl: ls2k0300: Support Loongson 2K0300 SoC

From: Yao Zi
Date: Wed Aug 13 2025 - 23:18:35 EST


On Mon, Aug 11, 2025 at 04:37:49PM +0000, Yao Zi wrote:
> Support pin multiplexing and drive-strength setting for Loongson 2K0300
> SoC. Pin multiplexing could be done separately for each pin, while
> drive-strength could be only configured on function basis. This differs
> a lot from the driver for previous generation of Loongson SoC, where
> pinmux setting is based on group.
>
> Pins are represented with pinmux properties in devicetrees, and we use
> the generic pinmux API for parsing. The common pinconf interface isn't
> used for drive-strength setting, since it handles pinconf settings at a
> unit of pin groups or smaller.
>
> Instead, the driver configures drive-strength settings just after
> parsing the devicetree. The devicetree's structure ensures no conflicts
> could happen in drive-strength settings.
>
> Signed-off-by: Yao Zi <ziyao@xxxxxxxxxxx>
> ---
> MAINTAINERS | 1 +
> drivers/pinctrl/Kconfig | 14 +
> drivers/pinctrl/Makefile | 1 +
> drivers/pinctrl/pinctrl-ls2k0300.c | 515 +++++++++++++++++++++++++++++
> 4 files changed, 531 insertions(+)
> create mode 100644 drivers/pinctrl/pinctrl-ls2k0300.c

...

> diff --git a/drivers/pinctrl/pinctrl-ls2k0300.c b/drivers/pinctrl/pinctrl-ls2k0300.c
> new file mode 100644
> index 000000000000..11d448ba333d
> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-ls2k0300.c

...

> +static const struct pinmux_ops ls2k0300_pmux_ops = {
> + .get_functions_count = ls2k0300_pinmux_get_functions_count,
> + .get_function_name = ls2k0300_pinmux_get_function_name,
> + .get_function_groups = ls2k0300_pinmux_get_function_groups,
> + .set_mux = ls2k0300_pinmux_set_mux,
> +};

I forgot to enable strict mode for the pinmux operations. Will correct
this in v2. I'll wait a few days for more comments before sending it,
thanks for your time.

Best regards,
Yao Zi