mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
UPSTREAM: of: property: fw_devlink: Add support for "post-init-providers" property
Add support for this property so that dependency cycles can be broken and fw_devlink can do better probe/suspend/resume ordering between devices in a dependency cycle. Signed-off-by: Saravana Kannan <saravanak@google.com> Acked-by: "Rafael J. Wysocki" <rafael@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20240305050458.1400667-4-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 135116f3d01402b610e00dd54f3b059a3faf35de) Change-Id: I49e29a38ebc5b0a663d8d336512be1b56ca607c7 Bug: 347344057
This commit is contained in:
committed by
Treehugger Robot
parent
b865d3ed06
commit
fddf80a6ac
@@ -1095,7 +1095,8 @@ static struct device_node *of_get_compat_node_parent(struct device_node *np)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void of_link_to_phandle(struct device_node *con_np,
|
static void of_link_to_phandle(struct device_node *con_np,
|
||||||
struct device_node *sup_np)
|
struct device_node *sup_np,
|
||||||
|
u8 flags)
|
||||||
{
|
{
|
||||||
struct device_node *tmp_np = of_node_get(sup_np);
|
struct device_node *tmp_np = of_node_get(sup_np);
|
||||||
|
|
||||||
@@ -1114,7 +1115,7 @@ static void of_link_to_phandle(struct device_node *con_np,
|
|||||||
tmp_np = of_get_next_parent(tmp_np);
|
tmp_np = of_get_next_parent(tmp_np);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), 0);
|
fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1227,6 +1228,8 @@ static struct device_node *parse_##fname(struct device_node *np, \
|
|||||||
* @node_not_dev: The consumer node containing the property is never converted
|
* @node_not_dev: The consumer node containing the property is never converted
|
||||||
* to a struct device. Instead, parse ancestor nodes for the
|
* to a struct device. Instead, parse ancestor nodes for the
|
||||||
* compatible property to find a node corresponding to a device.
|
* compatible property to find a node corresponding to a device.
|
||||||
|
* @fwlink_flags: Optional fwnode link flags to use when creating a fwnode link
|
||||||
|
* for this property.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* parse_prop() return values are
|
* parse_prop() return values are
|
||||||
@@ -1239,6 +1242,7 @@ struct supplier_bindings {
|
|||||||
const char *prop_name, int index);
|
const char *prop_name, int index);
|
||||||
bool optional;
|
bool optional;
|
||||||
bool node_not_dev;
|
bool node_not_dev;
|
||||||
|
u8 fwlink_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
|
DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells")
|
||||||
@@ -1268,6 +1272,7 @@ DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
|
|||||||
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
|
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
|
||||||
DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
|
DEFINE_SIMPLE_PROP(backlight, "backlight", NULL)
|
||||||
DEFINE_SIMPLE_PROP(panel, "panel", NULL)
|
DEFINE_SIMPLE_PROP(panel, "panel", NULL)
|
||||||
|
DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
|
||||||
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
|
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
|
||||||
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
|
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
|
||||||
|
|
||||||
@@ -1373,6 +1378,10 @@ static const struct supplier_bindings of_supplier_bindings[] = {
|
|||||||
{ .parse_prop = parse_regulators, },
|
{ .parse_prop = parse_regulators, },
|
||||||
{ .parse_prop = parse_gpio, },
|
{ .parse_prop = parse_gpio, },
|
||||||
{ .parse_prop = parse_gpios, },
|
{ .parse_prop = parse_gpios, },
|
||||||
|
{
|
||||||
|
.parse_prop = parse_post_init_providers,
|
||||||
|
.fwlink_flags = FWLINK_FLAG_IGNORE,
|
||||||
|
},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1417,7 +1426,7 @@ static int of_link_property(struct device_node *con_np, const char *prop_name)
|
|||||||
: of_node_get(con_np);
|
: of_node_get(con_np);
|
||||||
matched = true;
|
matched = true;
|
||||||
i++;
|
i++;
|
||||||
of_link_to_phandle(con_dev_np, phandle);
|
of_link_to_phandle(con_dev_np, phandle, s->fwlink_flags);
|
||||||
of_node_put(phandle);
|
of_node_put(phandle);
|
||||||
of_node_put(con_dev_np);
|
of_node_put(con_dev_np);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user