[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230107102231.23682-2-treapking@chromium.org>
Date: Sat, 7 Jan 2023 18:22:23 +0800
From: Pin-yen Lin <treapking@...omium.org>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <robert.foss@...aro.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Prashant Malani <pmalani@...omium.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>
Cc: Thomas Zimmermann <tzimmermann@...e.de>,
dri-devel@...ts.freedesktop.org, Lyude Paul <lyude@...hat.com>,
Javier Martinez Canillas <javierm@...hat.com>,
linux-kernel@...r.kernel.org, Xin Ji <xji@...logixsemi.com>,
Pin-yen Lin <treapking@...omium.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Allen Chen <allen.chen@....com.tw>,
Hsin-Yi Wang <hsinyi@...omium.org>,
chrome-platform@...ts.linux.dev,
NĂcolas F . R . A . Prado
<nfraprado@...labora.com>, devicetree@...r.kernel.org,
Marek Vasut <marex@...x.de>, linux-acpi@...r.kernel.org,
Stephen Boyd <swboyd@...omium.org>
Subject: [PATCH v8 1/9] device property: Add remote endpoint to devcon matcher
From: Prashant Malani <pmalani@...omium.org>
When searching the device graph for device matches, check the
remote-endpoint itself for a match.
Some drivers register devices for individual endpoints. This allows
the matcher code to evaluate those for a match too, instead
of only looking at the remote parent devices. This is required when a
device supports two mode switches in its endpoints, so we can't simply
register the mode switch with the parent node.
Signed-off-by: Prashant Malani <pmalani@...omium.org>
Signed-off-by: Pin-yen Lin <treapking@...omium.org>
---
(no changes since v6)
Changes in v6:
- New in v6
drivers/base/property.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 2a5a37fcd998..48877af4e444 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1223,6 +1223,21 @@ static unsigned int fwnode_graph_devcon_matches(struct fwnode_handle *fwnode,
break;
}
+ /*
+ * Some drivers may register devices for endpoints. Check
+ * the remote-endpoints for matches in addition to the remote
+ * port parent.
+ */
+ node = fwnode_graph_get_remote_endpoint(ep);
+ if (fwnode_device_is_available(node)) {
+ ret = match(node, con_id, data);
+ if (ret) {
+ if (matches)
+ matches[count] = ret;
+ count++;
+ }
+ }
+
node = fwnode_graph_get_remote_port_parent(ep);
if (!fwnode_device_is_available(node)) {
fwnode_handle_put(node);
--
2.39.0.314.g84b9a713c41-goog
Powered by blists - more mailing lists