Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 731f76b0 authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

coresight: add support for device names



Add support to read device names from device tree entries.
This allows using same names for CoreSight devices across different
targets.

Change-Id: I55e7437c9339b58d27377d09c7a1d0ec1ebff463
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent 844cb3e3
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012, 2019 The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -1317,12 +1317,16 @@ static inline int coresight_search_device_idx(struct coresight_dev_list *dict,
 * duplicate indices for the same device (e.g, if we defer probing of
 * a device due to dependencies), in case the index is requested again.
 */
char *coresight_alloc_device_name(struct coresight_dev_list *dict,
const char *coresight_alloc_device_name(struct coresight_dev_list *dict,
				  struct device *dev)
{
	int idx;
	char *name = NULL;
	const char *name = NULL;
	struct fwnode_handle **list;
	struct device_node *node = dev->of_node;

	if (!of_property_read_string(node, "coresight-name", &name))
		return name;

	mutex_lock(&coresight_mutex);

+2 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012, 2019 The Linux Foundation. All rights reserved.
 */

#ifndef _LINUX_CORESIGHT_H
@@ -283,7 +283,7 @@ extern int coresight_claim_device_unlocked(void __iomem *base);

extern void coresight_disclaim_device(void __iomem *base);
extern void coresight_disclaim_device_unlocked(void __iomem *base);
extern char *coresight_alloc_device_name(struct coresight_dev_list *devs,
extern const char *coresight_alloc_device_name(struct coresight_dev_list *devs,
					 struct device *dev);
#else
static inline struct coresight_device *