1 // SPDX-License-Identifier: MIT
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 
6 #include <linux/debugfs.h>
7 
8 #include "intel_guc_debugfs.h"
9 #include "intel_huc_debugfs.h"
10 #include "intel_uc.h"
11 #include "intel_uc_debugfs.h"
12 
13 void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
14 {
15 	struct dentry *root;
16 
17 	if (!gt_root)
18 		return;
19 
20 	/* GuC and HuC go always in pair, no need to check both */
21 	if (!intel_uc_supports_guc(uc))
22 		return;
23 
24 	root = debugfs_create_dir("uc", gt_root);
25 	if (IS_ERR(root))
26 		return;
27 
28 	intel_guc_debugfs_register(&uc->guc, root);
29 	intel_huc_debugfs_register(&uc->huc, root);
30 }
31