Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354601
b: refs/heads/master
c: d766802
h: refs/heads/master
i:
  354599: a1c3fc8
v: v3
  • Loading branch information
Felipe Balbi committed Jan 18, 2013
1 parent 8fc947b commit fe84c23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7dbdf4e4b37766a2389680c460b9dab278a5444c
refs/heads/master: d7668024b3b5f9563eab8dad66cb9a4b80f36ebf
1 change: 1 addition & 0 deletions trunk/drivers/usb/dwc3/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ struct dwc3 {

struct dwc3_hwparams hwparams;
struct dentry *root;
struct debugfs_regset32 *regset;

u8 test_mode;
u8 test_mode_nr;
Expand Down
36 changes: 12 additions & 24 deletions trunk/drivers/usb/dwc3/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
.offset = DWC3_ ##nm - DWC3_GLOBALS_REGS_START, \
}

static const struct debugfs_reg32 dwc3_regs[] = {
static struct debugfs_reg32 dwc3_regs[] = {
dump_register(GSBUSCFG0),
dump_register(GSBUSCFG1),
dump_register(GTXTHRCFG),
Expand Down Expand Up @@ -376,27 +376,6 @@ static const struct debugfs_reg32 dwc3_regs[] = {
dump_register(OSTS),
};

static int dwc3_regdump_show(struct seq_file *s, void *unused)
{
struct dwc3 *dwc = s->private;

seq_printf(s, "DesignWare USB3 Core Register Dump\n");
debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs),
dwc->regs, "");
return 0;
}

static int dwc3_regdump_open(struct inode *inode, struct file *file)
{
return single_open(file, dwc3_regdump_show, inode->i_private);
}

static const struct file_operations dwc3_regdump_fops = {
.open = dwc3_regdump_open,
.read = seq_read,
.release = single_release,
};

static int dwc3_mode_show(struct seq_file *s, void *unused)
{
struct dwc3 *dwc = s->private;
Expand Down Expand Up @@ -666,8 +645,17 @@ int dwc3_debugfs_init(struct dwc3 *dwc)

dwc->root = root;

file = debugfs_create_file("regdump", S_IRUGO, root, dwc,
&dwc3_regdump_fops);
dwc->regset = kzalloc(sizeof(*dwc->regset), GFP_KERNEL);
if (!dwc->regset) {
ret = -ENOMEM;
goto err1;
}

dwc->regset->regs = dwc3_regs;
dwc->regset->nregs = ARRAY_SIZE(dwc3_regs);
dwc->regset->base = dwc->regs;

file = debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset);
if (!file) {
ret = -ENOMEM;
goto err1;
Expand Down

0 comments on commit fe84c23

Please sign in to comment.