2 * Copyright © 2017 Broadcom
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #include <linux/amba/clcd-regs.h>
10 #include <linux/seq_file.h>
11 #include <drm/drm_debugfs.h>
13 #include "pl111_drm.h"
15 #define REGDEF(reg) { reg, #reg }
19 } pl111_reg_defs[] = {
25 REGDEF(CLCD_PL111_CNTL),
26 REGDEF(CLCD_PL111_IENB),
29 int pl111_debugfs_regs(struct seq_file *m, void *unused)
31 struct drm_info_node *node = (struct drm_info_node *)m->private;
32 struct drm_device *dev = node->minor->dev;
33 struct pl111_drm_dev_private *priv = dev->dev_private;
36 for (i = 0; i < ARRAY_SIZE(pl111_reg_defs); i++) {
37 seq_printf(m, "%s (0x%04x): 0x%08x\n",
38 pl111_reg_defs[i].name, pl111_reg_defs[i].reg,
39 readl(priv->regs + pl111_reg_defs[i].reg));
45 static const struct drm_info_list pl111_debugfs_list[] = {
46 {"regs", pl111_debugfs_regs, 0},
50 pl111_debugfs_init(struct drm_minor *minor)
52 return drm_debugfs_create_files(pl111_debugfs_list,
53 ARRAY_SIZE(pl111_debugfs_list),
54 minor->debugfs_root, minor);