Skip to content

Commit fb820b4

Browse files
Saravana Kannanrobherring
authored andcommitted
of: property: Add device link support for pinctrl-0 through pinctrl-8
Add support for pinctrl-0 through pinctrl-8 explicitly instead of trying to add support for pinctrl-%d properties. Of all the pinctrl-* properties in dts files (20322), only 47% (9531) are pinctrl-%d properties. Of all the pinctrl-%d properties, 99.5% (9486) are made up of pinctrl-[0-2]. 'pinctrl-8' is the current maximum found in dts files. Trying to parse all pinctrl-* properties and checking for pinctrl-%d is unnecessarily complicated. So, just add support for pinctrl-[0-8] for now. In the unlikely event we ever exceed pinctrl-8, we can come back and improve this. Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent 53e6a67 commit fb820b4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/of/property.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,15 @@ DEFINE_SIMPLE_PROP(interrupts_extended, "interrupts-extended",
12741274
DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
12751275
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
12761276
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
1277+
DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
1278+
DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL)
1279+
DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL)
1280+
DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL)
1281+
DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL)
1282+
DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
1283+
DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
1284+
DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
1285+
DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
12771286
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
12781287
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
12791288
DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells")
@@ -1303,6 +1312,15 @@ static const struct supplier_bindings of_supplier_bindings[] = {
13031312
{ .parse_prop = parse_nvmem_cells, },
13041313
{ .parse_prop = parse_phys, },
13051314
{ .parse_prop = parse_wakeup_parent, },
1315+
{ .parse_prop = parse_pinctrl0, },
1316+
{ .parse_prop = parse_pinctrl1, },
1317+
{ .parse_prop = parse_pinctrl2, },
1318+
{ .parse_prop = parse_pinctrl3, },
1319+
{ .parse_prop = parse_pinctrl4, },
1320+
{ .parse_prop = parse_pinctrl5, },
1321+
{ .parse_prop = parse_pinctrl6, },
1322+
{ .parse_prop = parse_pinctrl7, },
1323+
{ .parse_prop = parse_pinctrl8, },
13061324
{ .parse_prop = parse_regulators, },
13071325
{ .parse_prop = parse_gpio, },
13081326
{ .parse_prop = parse_gpios, },

0 commit comments

Comments
 (0)