msm: qdss: add support for qdss_get/put and qdss_enable/disable
Implement qdss_get/put and qdss_enable/disable external apis. Add
qdss platform virtual device and platform data to support the
implementation. Also split the QDSS driver initcall to allow early
init of data structures required to support qdss_get calls made by
other trace source drivers that want to use the services of the
qdss driver.
QDSS source drivers will use these apis to setup QDSS to collect
the trace data that they will generate. QDSS logical driver will
internally call the apis for the etb, funnel and tpiu device
drivers.
Change-Id: I06ece3fba110398b346c86f8b479153c60777540
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
diff --git a/arch/arm/mach-msm/include/mach/qdss.h b/arch/arm/mach-msm/include/mach/qdss.h
index 530bcb2..3b236b8 100644
--- a/arch/arm/mach-msm/include/mach/qdss.h
+++ b/arch/arm/mach-msm/include/mach/qdss.h
@@ -13,10 +13,30 @@
#ifndef __MACH_QDSS_H
#define __MACH_QDSS_H
+struct qdss_source {
+ struct list_head link;
+ const char *name;
+ uint32_t fport_mask;
+};
+
+struct msm_qdss_platform_data {
+ struct qdss_source *src_table;
+ size_t size;
+ uint8_t afamily;
+};
+
#ifdef CONFIG_MSM_QDSS
+extern struct qdss_source *qdss_get(const char *name);
+extern void qdss_put(struct qdss_source *src);
+extern int qdss_enable(struct qdss_source *src);
+extern void qdss_disable(struct qdss_source *src);
extern int qdss_clk_enable(void);
extern void qdss_clk_disable(void);
#else
+static inline struct qdss_source *qdss_get(const char *name) { return NULL; }
+static inline void qdss_put(struct qdss_source *src) {}
+static inline int qdss_enable(struct qdss_source *src) { return -ENOSYS; }
+static inline void qdss_disable(struct qdss_source *src) {}
static inline int qdss_clk_enable(void) { return -ENOSYS; }
static inline void qdss_clk_disable(void) {}
#endif