linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linusw@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Conor Dooley <conor.dooley@microchip.com>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	linux-kernel@vger.kernel.org,  linux-gpio@vger.kernel.org,
	devicetree@vger.kernel.org,
	 Valentina.FernandezAlanis@microchip.com,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver
Date: Tue, 25 Nov 2025 01:31:49 +0100	[thread overview]
Message-ID: <CAD++jLn4z9KFTRoROZ8aKnK-1v=_magjgSq7JJJYt0=CO=gH4A@mail.gmail.com> (raw)
In-Reply-To: <20251124-operative-elephant-16c2c18aebde@spud>

On Mon, Nov 24, 2025 at 6:16 PM Conor Dooley <conor@kernel.org> wrote:

> I was looking at the kernel part of this today, trying to figure out
> where it would make sense to actually check this, but I'm not super keen
> on what has to be done. I think doing it in parse_dt_cfg() makes the
> most sense, setting flags if the property is one we care about during
> the loop and then checking mutual exclusion at the end based on the
> flags? The gpio example you gave has it easy, since they already appear
> to have these things stored in flag properties.
> Is there somewhere else, in addition to creating the config from dt that
> this would have to be checked?


We are right now parsing with an array of
struct pinconf_generic_params:

static const struct pinconf_generic_params dt_params[] = {
    { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
    (...)
};

(Sorry for not using C99 .initializers on the above array)

Struct looks like so:

struct pinconf_generic_params {
        const char * const property;
        enum pin_config_param param;
        u32 default_value;
        const char * const *values;
        size_t num_values;
};

Can't we add a
    const enum pin_config_param *conflicts;
    size_t num_conflicts;

And rewrite the parsing table to be more explicit:

static const char * const input_disable_conflicts[] = {
    "input-enable",
};

static const struct pinconf_generic_params dt_params[] = {
    {
        .property = "input-disable",
        .param = PIN_CONFIG_INPUT_ENABLE,
        .default_value = 0,
        .conflicting_properties = input_disable_conflicts,
        .num_conflicting_properties = ARRAY_SIZE(input_disable_conflicts),
     },
    (...)
};

Then in the loop we can use of_property_present(np, ...) to check for
conflicting properties when we encounter something.

Yours,
Linus Walleij

  reply	other threads:[~2025-11-25  0:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 14:31 [RFC v1 0/4] Microchip mpfs/pic64gx pinctrl part 2 Conor Dooley
2025-11-12 14:31 ` [RFC v1 1/4] dt-bindings: pinctrl: document polarfire soc mssio pin controller Conor Dooley
2025-11-19  9:13   ` Linus Walleij
2025-11-12 14:31 ` [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver Conor Dooley
2025-11-19 12:08   ` Linus Walleij
2025-11-19 18:23     ` Conor Dooley
2025-11-19 21:48       ` Linus Walleij
2025-11-20  0:26         ` Conor Dooley
2025-11-20 23:13           ` Linus Walleij
2025-11-21 10:46             ` Conor Dooley
2025-11-21 11:21               ` Conor Dooley
2025-11-24 17:16                 ` Conor Dooley
2025-11-25  0:31                   ` Linus Walleij [this message]
2025-11-25  1:03                     ` Conor Dooley
2025-11-25 16:09                       ` Linus Walleij
2025-11-25  0:10                 ` Linus Walleij
2025-11-25  0:24                   ` Conor Dooley
2025-11-24 19:14     ` Conor Dooley
2025-11-25 13:24       ` Linus Walleij
2025-11-25 17:47         ` Conor Dooley
2025-11-25 19:28           ` Linus Walleij
2025-11-25 19:55             ` Conor Dooley
2025-11-25 19:59               ` Linus Walleij
2025-11-12 14:31 ` [RFC v1 3/4] MAINTAINERS: add Microchip mpfs mssio driver/bindings to entry Conor Dooley
2025-11-12 14:31 ` [RFC v1 4/4] riscv: dts: microchip: add pinctrl nodes for mpfs/icicle kit Conor Dooley
2025-11-19 12:16 ` [RFC v1 0/4] Microchip mpfs/pic64gx pinctrl part 2 Linus Walleij
2025-11-19 18:06   ` Conor Dooley
2025-11-19 21:31     ` Linus Walleij
2025-11-20  0:25       ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD++jLn4z9KFTRoROZ8aKnK-1v=_magjgSq7JJJYt0=CO=gH4A@mail.gmail.com' \
    --to=linusw@kernel.org \
    --cc=Valentina.FernandezAlanis@microchip.com \
    --cc=brgl@bgdev.pl \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).