1 /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
17 #include <linux/debugfs.h>
18 #include <linux/list.h>
20 enum dpu_dbg_dump_flag {
21 DPU_DBG_DUMP_IN_LOG = BIT(0),
22 DPU_DBG_DUMP_IN_MEM = BIT(1),
25 #if defined(CONFIG_DEBUG_FS)
28 * dpu_dbg_init_dbg_buses - initialize debug bus dumping support for the chipset
29 * @hwversion: Chipset revision
31 void dpu_dbg_init_dbg_buses(u32 hwversion);
34 * dpu_dbg_init - initialize global dpu debug facilities: regdump
36 * Returns: 0 or -ERROR
38 int dpu_dbg_init(struct device *dev);
41 * dpu_dbg_debugfs_register - register entries at the given debugfs dir
42 * @debugfs_root: debugfs root in which to create dpu debug entries
43 * Returns: 0 or -ERROR
45 int dpu_dbg_debugfs_register(struct dentry *debugfs_root);
48 * dpu_dbg_destroy - destroy the global dpu debug facilities
51 void dpu_dbg_destroy(void);
54 * dpu_dbg_dump - trigger dumping of all dpu_dbg facilities
55 * @queue_work: whether to queue the dumping work to the work_struct
56 * @name: string indicating origin of dump
57 * @dump_dbgbus: dump the dpu debug bus
58 * @dump_vbif_rt: dump the vbif rt bus
61 void dpu_dbg_dump(bool queue_work, const char *name, bool dump_dbgbus_dpu,
62 bool dump_dbgbus_vbif_rt);
65 * dpu_dbg_set_dpu_top_offset - set the target specific offset from mdss base
66 * address of the top registers. Used for accessing debug bus controls.
67 * @blk_off: offset from mdss base of the top block
69 void dpu_dbg_set_dpu_top_offset(u32 blk_off);
73 static inline void dpu_dbg_init_dbg_buses(u32 hwversion)
77 static inline int dpu_dbg_init(struct device *dev)
82 static inline int dpu_dbg_debugfs_register(struct dentry *debugfs_root)
87 static inline void dpu_dbg_destroy(void)
91 static inline void dpu_dbg_dump(bool queue_work, const char *name,
92 bool dump_dbgbus_dpu, bool dump_dbgbus_vbif_rt)
96 static inline void dpu_dbg_set_dpu_top_offset(u32 blk_off)
100 #endif /* defined(CONFIG_DEBUG_FS) */
103 #endif /* DPU_DBG_H_ */