diff mbox series

[v4,07/15] include: fwnode.h: Define format macros for ports and endpoints

Message ID 20210103231235.792999-8-djrscally@gmail.com
State Accepted
Commit 529b56a854c5a8bd5e6f045cdcbbcd21a1616fbd
Headers show
Series Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows | expand

Commit Message

Daniel Scally Jan. 3, 2021, 11:12 p.m. UTC
OF, ACPI and software_nodes all implement graphs including nodes for ports
and endpoints. These are all intended to be named with a common schema,
as "port@n" and "endpoint@n" where n is an unsigned int representing the
index of the node. To ensure commonality across the subsystems, provide a
set of macros to define the format.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
Changes in v4:

	- FORMAT -> FMT
	- Dropped the *_LEN macros, since we settled on using
	  strlen("port@") instead

 include/linux/fwnode.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Andy Shevchenko Jan. 4, 2021, 2:24 p.m. UTC | #1
On Sun, Jan 03, 2021 at 11:12:27PM +0000, Daniel Scally wrote:
> OF, ACPI and software_nodes all implement graphs including nodes for ports
> and endpoints. These are all intended to be named with a common schema,
> as "port@n" and "endpoint@n" where n is an unsigned int representing the
> index of the node. To ensure commonality across the subsystems, provide a
> set of macros to define the format.

Since v5, can you modify subject prefix to be "device property: "?
Same for patches 3 and 4, please.
Daniel Scally Jan. 4, 2021, 2:25 p.m. UTC | #2
On 04/01/2021 14:24, Andy Shevchenko wrote:
> On Sun, Jan 03, 2021 at 11:12:27PM +0000, Daniel Scally wrote:

>> OF, ACPI and software_nodes all implement graphs including nodes for ports

>> and endpoints. These are all intended to be named with a common schema,

>> as "port@n" and "endpoint@n" where n is an unsigned int representing the

>> index of the node. To ensure commonality across the subsystems, provide a

>> set of macros to define the format.

> Since v5, can you modify subject prefix to be "device property: "?

> Same for patches 3 and 4, please.

>

Will do, and for your last email too.
diff mbox series

Patch

diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 9506f8ec0974..72d36d46287d 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -32,6 +32,13 @@  struct fwnode_endpoint {
 	const struct fwnode_handle *local_fwnode;
 };
 
+/*
+ * ports and endpoints defined as software_nodes should all follow a common
+ * naming scheme; use these macros to ensure commonality.
+ */
+#define SWNODE_GRAPH_PORT_NAME_FMT		"port@%u"
+#define SWNODE_GRAPH_ENDPOINT_NAME_FMT		"endpoint@%u"
+
 #define NR_FWNODE_REFERENCE_ARGS	8
 
 /**