.. | .. |
---|
315 | 315 | seq_puts(s, "Unknown conversion\n"); |
---|
316 | 316 | } |
---|
317 | 317 | |
---|
318 | | -static int bdisp_dbg_last_nodes(struct seq_file *s, void *data) |
---|
| 318 | +static int last_nodes_show(struct seq_file *s, void *data) |
---|
319 | 319 | { |
---|
320 | 320 | /* Not dumping all fields, focusing on significant ones */ |
---|
321 | 321 | struct bdisp_dev *bdisp = s->private; |
---|
.. | .. |
---|
388 | 388 | return 0; |
---|
389 | 389 | } |
---|
390 | 390 | |
---|
391 | | -static int bdisp_dbg_last_nodes_raw(struct seq_file *s, void *data) |
---|
| 391 | +static int last_nodes_raw_show(struct seq_file *s, void *data) |
---|
392 | 392 | { |
---|
393 | 393 | struct bdisp_dev *bdisp = s->private; |
---|
394 | 394 | struct bdisp_node *node; |
---|
.. | .. |
---|
437 | 437 | } |
---|
438 | 438 | } |
---|
439 | 439 | |
---|
440 | | -static int bdisp_dbg_last_request(struct seq_file *s, void *data) |
---|
| 440 | +static int last_request_show(struct seq_file *s, void *data) |
---|
441 | 441 | { |
---|
442 | 442 | struct bdisp_dev *bdisp = s->private; |
---|
443 | 443 | struct bdisp_request *request = &bdisp->dbg.copy_request; |
---|
.. | .. |
---|
474 | 474 | |
---|
475 | 475 | #define DUMP(reg) seq_printf(s, #reg " \t0x%08X\n", readl(bdisp->regs + reg)) |
---|
476 | 476 | |
---|
477 | | -static int bdisp_dbg_regs(struct seq_file *s, void *data) |
---|
| 477 | +static int regs_show(struct seq_file *s, void *data) |
---|
478 | 478 | { |
---|
479 | 479 | struct bdisp_dev *bdisp = s->private; |
---|
480 | 480 | int ret; |
---|
481 | 481 | unsigned int i; |
---|
482 | 482 | |
---|
483 | | - ret = pm_runtime_get_sync(bdisp->dev); |
---|
| 483 | + ret = pm_runtime_resume_and_get(bdisp->dev); |
---|
484 | 484 | if (ret < 0) { |
---|
485 | 485 | seq_puts(s, "Cannot wake up IP\n"); |
---|
486 | 486 | return 0; |
---|
.. | .. |
---|
582 | 582 | |
---|
583 | 583 | #define SECOND 1000000 |
---|
584 | 584 | |
---|
585 | | -static int bdisp_dbg_perf(struct seq_file *s, void *data) |
---|
| 585 | +static int perf_show(struct seq_file *s, void *data) |
---|
586 | 586 | { |
---|
587 | 587 | struct bdisp_dev *bdisp = s->private; |
---|
588 | 588 | struct bdisp_request *request = &bdisp->dbg.copy_request; |
---|
.. | .. |
---|
627 | 627 | return 0; |
---|
628 | 628 | } |
---|
629 | 629 | |
---|
630 | | -#define bdisp_dbg_declare(name) \ |
---|
631 | | - static int bdisp_dbg_##name##_open(struct inode *i, struct file *f) \ |
---|
632 | | - { \ |
---|
633 | | - return single_open(f, bdisp_dbg_##name, i->i_private); \ |
---|
634 | | - } \ |
---|
635 | | - static const struct file_operations bdisp_dbg_##name##_fops = { \ |
---|
636 | | - .open = bdisp_dbg_##name##_open, \ |
---|
637 | | - .read = seq_read, \ |
---|
638 | | - .llseek = seq_lseek, \ |
---|
639 | | - .release = single_release, \ |
---|
640 | | - } |
---|
641 | | - |
---|
642 | 630 | #define bdisp_dbg_create_entry(name) \ |
---|
643 | 631 | debugfs_create_file(#name, S_IRUGO, bdisp->dbg.debugfs_entry, bdisp, \ |
---|
644 | | - &bdisp_dbg_##name##_fops) |
---|
| 632 | + &name##_fops) |
---|
645 | 633 | |
---|
646 | | -bdisp_dbg_declare(regs); |
---|
647 | | -bdisp_dbg_declare(last_nodes); |
---|
648 | | -bdisp_dbg_declare(last_nodes_raw); |
---|
649 | | -bdisp_dbg_declare(last_request); |
---|
650 | | -bdisp_dbg_declare(perf); |
---|
| 634 | +DEFINE_SHOW_ATTRIBUTE(regs); |
---|
| 635 | +DEFINE_SHOW_ATTRIBUTE(last_nodes); |
---|
| 636 | +DEFINE_SHOW_ATTRIBUTE(last_nodes_raw); |
---|
| 637 | +DEFINE_SHOW_ATTRIBUTE(last_request); |
---|
| 638 | +DEFINE_SHOW_ATTRIBUTE(perf); |
---|
651 | 639 | |
---|
652 | | -int bdisp_debugfs_create(struct bdisp_dev *bdisp) |
---|
| 640 | +void bdisp_debugfs_create(struct bdisp_dev *bdisp) |
---|
653 | 641 | { |
---|
654 | 642 | char dirname[16]; |
---|
655 | 643 | |
---|
656 | 644 | snprintf(dirname, sizeof(dirname), "%s%d", BDISP_NAME, bdisp->id); |
---|
657 | 645 | bdisp->dbg.debugfs_entry = debugfs_create_dir(dirname, NULL); |
---|
658 | | - if (!bdisp->dbg.debugfs_entry) |
---|
659 | | - goto err; |
---|
660 | 646 | |
---|
661 | | - if (!bdisp_dbg_create_entry(regs)) |
---|
662 | | - goto err; |
---|
663 | | - |
---|
664 | | - if (!bdisp_dbg_create_entry(last_nodes)) |
---|
665 | | - goto err; |
---|
666 | | - |
---|
667 | | - if (!bdisp_dbg_create_entry(last_nodes_raw)) |
---|
668 | | - goto err; |
---|
669 | | - |
---|
670 | | - if (!bdisp_dbg_create_entry(last_request)) |
---|
671 | | - goto err; |
---|
672 | | - |
---|
673 | | - if (!bdisp_dbg_create_entry(perf)) |
---|
674 | | - goto err; |
---|
675 | | - |
---|
676 | | - return 0; |
---|
677 | | - |
---|
678 | | -err: |
---|
679 | | - bdisp_debugfs_remove(bdisp); |
---|
680 | | - return -ENOMEM; |
---|
| 647 | + bdisp_dbg_create_entry(regs); |
---|
| 648 | + bdisp_dbg_create_entry(last_nodes); |
---|
| 649 | + bdisp_dbg_create_entry(last_nodes_raw); |
---|
| 650 | + bdisp_dbg_create_entry(last_request); |
---|
| 651 | + bdisp_dbg_create_entry(perf); |
---|
681 | 652 | } |
---|
682 | 653 | |
---|
683 | 654 | void bdisp_debugfs_remove(struct bdisp_dev *bdisp) |
---|