summaryrefslogtreecommitdiffstats
path: root/include/linux/coresight.h
diff options
context:
space:
mode:
authorJames Clark <james.clark@arm.com>2023-04-25 15:35:33 +0100
committerSuzuki K Poulose <suzuki.poulose@arm.com>2023-06-05 15:46:46 +0100
commit3d4ff657e454f8dba3e5e268e731e6e28c6031c1 (patch)
tree8a6d2dd0018e92b46d44d2668841e12b70aa9b88 /include/linux/coresight.h
parentd49c9cf15f89cdd77f3ce3f0187fa1cfbdea28f5 (diff)
downloadlinux-3d4ff657e454f8dba3e5e268e731e6e28c6031c1.tar.gz
linux-3d4ff657e454f8dba3e5e268e731e6e28c6031c1.tar.bz2
linux-3d4ff657e454f8dba3e5e268e731e6e28c6031c1.zip
coresight: Dynamically add connections
Add a function for adding connections dynamically. This also removes the 1:1 mapping between port number and the index into the connections array. The only place this mapping was used was in the warning for duplicate output ports, which has been replaced by a search. Other uses of the port number already use the port member variable. Being able to dynamically add connections will allow other devices like CTI to re-use the connection mechanism despite not having explicit connections described in the DT. The connections array is now no longer sparse, so child_fwnode doesn't need to be checked as all connections have a target node. Because the array is no longer sparse, the high in and out port numbers are required for the refcount arrays. But these will also be removed in a later commit when the refcount is made a property of the connection. Reviewed-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: James Clark <james.clark@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20230425143542.2305069-7-james.clark@arm.com
Diffstat (limited to 'include/linux/coresight.h')
-rw-r--r--include/linux/coresight.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index b6f444804bf3..12fdbd03e2f7 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -104,9 +104,11 @@ union coresight_dev_subtype {
*
* @nr_inconns: Number of elements for the input connections.
* @nr_outconns: Number of elements for the output connections.
- * @out_conns: Sparse array of nr_outconns connections from this component.
+ * @out_conns: Array of nr_outconns connections from this component.
*/
struct coresight_platform_data {
+ int high_inport;
+ int high_outport;
int nr_inconns;
int nr_outconns;
struct coresight_connection *out_conns;
@@ -609,5 +611,9 @@ static inline void coresight_write64(struct coresight_device *csdev, u64 val, u3
extern int coresight_get_cpu(struct device *dev);
struct coresight_platform_data *coresight_get_platform_data(struct device *dev);
+struct coresight_connection *
+coresight_add_out_conn(struct device *dev,
+ struct coresight_platform_data *pdata,
+ const struct coresight_connection *new_conn);
#endif /* _LINUX_COREISGHT_H */