-
-#ifdef CONFIG_DEBUG_FS
-#include <linux/seq_file.h>
-
-static int vcodec_debugfs_init(void)
-{
- parent = debugfs_create_dir("vcodec", NULL);
- if (!parent)
- return -1;
-
- return 0;
-}
-
-static void vcodec_debugfs_exit(void)
-{
- debugfs_remove(parent);
-}
-
-static struct dentry *vcodec_debugfs_create_device_dir(
- char *dirname, struct dentry *parent)
-{
- return debugfs_create_dir(dirname, parent);
-}
-
-static int debug_vcodec_show(struct seq_file *s, void *unused)
-{
- struct vpu_subdev_data *data = s->private;
- struct vpu_service_info *pservice = data->pservice;
- unsigned int i, n;
- struct vpu_reg *reg, *reg_tmp;
- struct vpu_session *session, *session_tmp;
-
- mutex_lock(&pservice->lock);
- vpu_service_power_on(pservice);
- if (data->hw_info->hw_id != HEVC_ID) {
- seq_puts(s, "\nENC Registers:\n");
- n = data->enc_dev.iosize >> 2;
-
- for (i = 0; i < n; i++)
- seq_printf(s, "\tswreg%d = %08X\n", i,
- readl_relaxed(data->enc_dev.regs + i));
- }
-
- seq_puts(s, "\nDEC Registers:\n");
-
- n = data->dec_dev.iosize >> 2;
- for (i = 0; i < n; i++)
- seq_printf(s, "\tswreg%d = %08X\n", i,
- readl_relaxed(data->dec_dev.regs + i));
-
- seq_puts(s, "\nvpu service status:\n");
-
- list_for_each_entry_safe(session, session_tmp,
- &pservice->session, list_session) {
- seq_printf(s, "session pid %d type %d:\n",
- session->pid, session->type);
-
- list_for_each_entry_safe(reg, reg_tmp,
- &session->waiting, session_link) {
- seq_printf(s, "waiting register set %p\n", reg);
- }
- list_for_each_entry_safe(reg, reg_tmp,
- &session->running, session_link) {
- seq_printf(s, "running register set %p\n", reg);
- }
- list_for_each_entry_safe(reg, reg_tmp,
- &session->done, session_link) {
- seq_printf(s, "done register set %p\n", reg);
- }
- }
-
- seq_printf(s, "\npower counter: on %d off %d\n",
- atomic_read(&pservice->power_on_cnt),
- atomic_read(&pservice->power_off_cnt));
-
- mutex_unlock(&pservice->lock);
- vpu_service_power_off(pservice);
-
- return 0;
-}
-
-static int debug_vcodec_open(struct inode *inode, struct file *file)
-{
- return single_open(file, debug_vcodec_show, inode->i_private);
-}
-
-#endif
-