lkml.org 
[lkml]   [2020]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] of: property: Add device link support for interrupts
From
Add support for creating device links out of interrupts property.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
Rob/Greg,

This might need to go into driver-core to avoid conflict
due to fw_devlink refactor series that merged there.

Thanks,
Saravana


drivers/of/property.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 5f9eed79a8aa..e56a5eae0a0b 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1271,6 +1271,22 @@ static struct device_node *parse_iommu_maps(struct device_node *np,
return of_parse_phandle(np, prop_name, (index * 4) + 1);
}

+static struct device_node *parse_interrupts(struct device_node *np,
+ const char *prop_name, int index)
+{
+ struct device_node *sup;
+
+ if (strcmp(prop_name, "interrupts") || index)
+ return NULL;
+
+ of_node_get(np);
+ while (np && !(sup = of_parse_phandle(np, "interrupt-parent", 0)))
+ np = of_get_next_parent(np);
+ of_node_put(np);
+
+ return sup;
+}
+
static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_clocks, },
{ .parse_prop = parse_interconnects, },
@@ -1296,6 +1312,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_pinctrl6, },
{ .parse_prop = parse_pinctrl7, },
{ .parse_prop = parse_pinctrl8, },
+ { .parse_prop = parse_interrupts, },
{ .parse_prop = parse_regulators, },
{ .parse_prop = parse_gpio, },
{ .parse_prop = parse_gpios, },
--
2.29.2.684.gfbc64c5ab5-goog
\
 
 \ /
  Last update: 2020-12-18 22:10    [W:0.082 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site