File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 * The user should refer to the vendor technical documentation to get details
1717 * about the supported events.
1818 *
19- * Copyright (c) 2022-2023 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
19+ * Copyright (c) 2022-2026 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2020 *
2121 */
2222
@@ -1132,6 +1132,23 @@ static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
11321132
11331133 return 0 ;
11341134}
1135+
1136+ struct acpi_device * arm_cspmu_acpi_dev_get (const struct arm_cspmu * cspmu )
1137+ {
1138+ char hid [16 ] = {};
1139+ char uid [16 ] = {};
1140+ const struct acpi_apmt_node * apmt_node ;
1141+
1142+ apmt_node = arm_cspmu_apmt_node (cspmu -> dev );
1143+ if (!apmt_node || apmt_node -> type != ACPI_APMT_NODE_TYPE_ACPI )
1144+ return NULL ;
1145+
1146+ memcpy (hid , & apmt_node -> inst_primary , sizeof (apmt_node -> inst_primary ));
1147+ snprintf (uid , sizeof (uid ), "%u" , apmt_node -> inst_secondary );
1148+
1149+ return acpi_dev_get_first_match_dev (hid , uid , -1 );
1150+ }
1151+ EXPORT_SYMBOL_GPL (arm_cspmu_acpi_dev_get );
11351152#else
11361153static int arm_cspmu_acpi_get_cpus (struct arm_cspmu * cspmu )
11371154{
Original file line number Diff line number Diff line change 11/* SPDX-License-Identifier: GPL-2.0
22 *
33 * ARM CoreSight Architecture PMU driver.
4- * Copyright (c) 2022-2023 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+ * Copyright (c) 2022-2026 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
55 *
66 */
77
88#ifndef __ARM_CSPMU_H__
99#define __ARM_CSPMU_H__
1010
11+ #include <linux/acpi.h>
1112#include <linux/bitfield.h>
1213#include <linux/cpumask.h>
1314#include <linux/device.h>
@@ -255,4 +256,18 @@ int arm_cspmu_impl_register(const struct arm_cspmu_impl_match *impl_match);
255256/* Unregister vendor backend. */
256257void arm_cspmu_impl_unregister (const struct arm_cspmu_impl_match * impl_match );
257258
259+ #if defined(CONFIG_ACPI ) && defined(CONFIG_ARM64 )
260+ /**
261+ * Get ACPI device associated with the PMU.
262+ * The caller is responsible for calling acpi_dev_put() on the returned device.
263+ */
264+ struct acpi_device * arm_cspmu_acpi_dev_get (const struct arm_cspmu * cspmu );
265+ #else
266+ static inline struct acpi_device *
267+ arm_cspmu_acpi_dev_get (const struct arm_cspmu * cspmu )
268+ {
269+ return NULL ;
270+ }
271+ #endif
272+
258273#endif /* __ARM_CSPMU_H__ */
You can’t perform that action at this time.
0 commit comments