Source
448
448
"SKECLK ",
449
449
"RESERVED ",
450
450
"3DCLK ",
451
451
"PCLKMSP3 ",
452
452
"MSPCLK3 ",
453
453
"MSHCCLK ",
454
454
"USBMCLK ",
455
455
"RNGCCLK ",
456
456
};
457
457
458
-
static int nomadik_src_clk_show(struct seq_file *s, void *what)
458
+
static int nomadik_src_clk_debugfs_show(struct seq_file *s, void *what)
459
459
{
460
460
int i;
461
461
u32 src_pcksr0 = readl(src_base + SRC_PCKSR0);
462
462
u32 src_pcksr1 = readl(src_base + SRC_PCKSR1);
463
463
u32 src_pckensr0 = readl(src_base + SRC_PCKENSR0);
464
464
u32 src_pckensr1 = readl(src_base + SRC_PCKENSR1);
465
465
466
466
seq_puts(s, "Clock: Boot: Now: Request: ASKED:\n");
467
467
for (i = 0; i < ARRAY_SIZE(src_clk_names); i++) {
468
468
u32 pcksrb = (i < 0x20) ? src_pcksr0_boot : src_pcksr1_boot;
472
472
473
473
seq_printf(s, "%s %s %s %s\n",
474
474
src_clk_names[i],
475
475
(pcksrb & mask) ? "on " : "off",
476
476
(pcksr & mask) ? "on " : "off",
477
477
(pckreq & mask) ? "on " : "off");
478
478
}
479
479
return 0;
480
480
}
481
481
482
-
static int nomadik_src_clk_open(struct inode *inode, struct file *file)
483
-
{
484
-
return single_open(file, nomadik_src_clk_show, NULL);
485
-
}
486
-
487
-
static const struct file_operations nomadik_src_clk_debugfs_ops = {
488
-
.open = nomadik_src_clk_open,
489
-
.read = seq_read,
490
-
.llseek = seq_lseek,
491
-
.release = single_release,
492
-
};
482
+
DEFINE_SHOW_ATTRIBUTE(nomadik_src_clk_debugfs);
493
483
494
484
static int __init nomadik_src_clk_init_debugfs(void)
495
485
{
496
486
/* Vital for multiplatform */
497
487
if (!src_base)
498
488
return -ENODEV;
499
489
src_pcksr0_boot = readl(src_base + SRC_PCKSR0);
500
490
src_pcksr1_boot = readl(src_base + SRC_PCKSR1);
501
491
debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,
502
-
NULL, NULL, &nomadik_src_clk_debugfs_ops);
492
+
NULL, NULL, &nomadik_src_clk_debugfs_fops);
503
493
return 0;
504
494
}
505
495
device_initcall(nomadik_src_clk_init_debugfs);
506
496
507
497
#endif
508
498
509
499
static void __init of_nomadik_pll_setup(struct device_node *np)
510
500
{
511
501
struct clk_hw *hw;
512
502
const char *clk_name = np->name;