1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Coresight system configuration driver - support for configfs.
4  */
5 
6 #ifndef CORESIGHT_SYSCFG_CONFIGFS_H
7 #define CORESIGHT_SYSCFG_CONFIGFS_H
8 
9 #include <linux/configfs.h>
10 #include "coresight-syscfg.h"
11 
12 #define CSCFG_FS_SUBSYS_NAME "cs-syscfg"
13 
14 /* container for configuration view */
15 struct cscfg_fs_config {
16 	struct cscfg_config_desc *config_desc;
17 	struct config_group group;
18 	bool active;
19 	int preset;
20 };
21 
22 /* container for feature view */
23 struct cscfg_fs_feature {
24 	struct cscfg_feature_desc *feat_desc;
25 	struct config_group group;
26 };
27 
28 /* container for parameter view */
29 struct cscfg_fs_param {
30 	int param_idx;
31 	struct cscfg_feature_desc *feat_desc;
32 	struct config_group group;
33 };
34 
35 /* container for preset view */
36 struct cscfg_fs_preset {
37 	int preset_num;
38 	struct cscfg_config_desc *config_desc;
39 	struct config_group group;
40 };
41 
42 int cscfg_configfs_init(struct cscfg_manager *cscfg_mgr);
43 void cscfg_configfs_release(struct cscfg_manager *cscfg_mgr);
44 int cscfg_configfs_add_config(struct cscfg_config_desc *config_desc);
45 int cscfg_configfs_add_feature(struct cscfg_feature_desc *feat_desc);
46 void cscfg_configfs_del_config(struct cscfg_config_desc *config_desc);
47 void cscfg_configfs_del_feature(struct cscfg_feature_desc *feat_desc);
48 
49 #endif /* CORESIGHT_SYSCFG_CONFIGFS_H */
50