Re: [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver
From: Linus Walleij
Date: Mon Nov 24 2025 - 19:32:09 EST
On Mon, Nov 24, 2025 at 6:16 PM Conor Dooley <conor@xxxxxxxxxx> 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