[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD++jLn4z9KFTRoROZ8aKnK-1v=_magjgSq7JJJYt0=CO=gH4A@mail.gmail.com>
Date: Tue, 25 Nov 2025 01:31:49 +0100
From: Linus Walleij <linusw@...nel.org>
To: Conor Dooley <conor@...nel.org>
Cc: Linus Walleij <linus.walleij@...aro.org>, Conor Dooley <conor.dooley@...rochip.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
Valentina.FernandezAlanis@...rochip.com, Bartosz Golaszewski <brgl@...ev.pl>
Subject: Re: [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver
On Mon, Nov 24, 2025 at 6:16 PM Conor Dooley <conor@...nel.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
Powered by blists - more mailing lists