1 /* SPDX-License-Identifier: GPL-2.0 */
3 * System Trace Module (STM) infrastructure
4 * Copyright (c) 2014, Intel Corporation.
6 * STM class implements generic infrastructure for System Trace Module devices
7 * as defined in MIPI STPv2 specification.
14 struct stp_policy_node
;
16 struct stp_policy_node
*
17 stp_policy_node_lookup(struct stm_device
*stm
, char *s
);
18 void stp_policy_node_put(struct stp_policy_node
*policy_node
);
19 void stp_policy_unbind(struct stp_policy
*policy
);
21 void stp_policy_node_get_ranges(struct stp_policy_node
*policy_node
,
22 unsigned int *mstart
, unsigned int *mend
,
23 unsigned int *cstart
, unsigned int *cend
);
24 int stp_configfs_init(void);
25 void stp_configfs_exit(void);
29 unsigned long chan_map
[0];
35 struct stp_policy
*policy
;
36 struct mutex policy_mutex
;
38 unsigned int sw_nmasters
;
39 struct stm_data
*data
;
40 struct mutex link_mutex
;
42 struct list_head link_list
;
43 /* master allocation */
45 struct stp_master
*masters
[0];
48 #define to_stm_device(_d) \
49 container_of((_d), struct stm_device, dev)
55 unsigned int nr_chans
;
59 struct stm_device
*stm
;
60 struct stp_policy_node
*policy_node
;
61 struct stm_output output
;
64 struct stm_device
*stm_find_device(const char *name
);
65 void stm_put_device(struct stm_device
*stm
);
67 struct stm_source_device
{
69 struct stm_source_data
*data
;
71 struct stm_device __rcu
*link
;
72 struct list_head link_entry
;
73 /* one output per stm_source device */
74 struct stp_policy_node
*policy_node
;
75 struct stm_output output
;
78 #define to_stm_source_device(_d) \
79 container_of((_d), struct stm_source_device, dev)
81 #endif /* _STM_STM_H_ */