| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2009 Simtec Electronics |
|---|
| 3 | 4 | * http://armlinux.simtec.co.uk/ |
|---|
| 4 | 5 | * Ben Dooks <ben@simtec.co.uk> |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * S3C24XX CPU Frequency scaling - debugfs status support |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 21 | 18 | #include <linux/seq_file.h> |
|---|
| 22 | 19 | #include <linux/err.h> |
|---|
| 23 | 20 | |
|---|
| 24 | | -#include <plat/cpu-freq-core.h> |
|---|
| 21 | +#include <linux/soc/samsung/s3c-cpufreq-core.h> |
|---|
| 25 | 22 | |
|---|
| 26 | 23 | static struct dentry *dbgfs_root; |
|---|
| 27 | 24 | static struct dentry *dbgfs_file_io; |
|---|
| .. | .. |
|---|
| 63 | 60 | return 0; |
|---|
| 64 | 61 | } |
|---|
| 65 | 62 | |
|---|
| 66 | | -static int fops_board_open(struct inode *inode, struct file *file) |
|---|
| 67 | | -{ |
|---|
| 68 | | - return single_open(file, board_show, NULL); |
|---|
| 69 | | -} |
|---|
| 70 | | - |
|---|
| 71 | | -static const struct file_operations fops_board = { |
|---|
| 72 | | - .open = fops_board_open, |
|---|
| 73 | | - .read = seq_read, |
|---|
| 74 | | - .llseek = seq_lseek, |
|---|
| 75 | | - .release = single_release, |
|---|
| 76 | | - .owner = THIS_MODULE, |
|---|
| 77 | | -}; |
|---|
| 63 | +DEFINE_SHOW_ATTRIBUTE(board); |
|---|
| 78 | 64 | |
|---|
| 79 | 65 | static int info_show(struct seq_file *seq, void *p) |
|---|
| 80 | 66 | { |
|---|
| .. | .. |
|---|
| 105 | 91 | return 0; |
|---|
| 106 | 92 | } |
|---|
| 107 | 93 | |
|---|
| 108 | | -static int fops_info_open(struct inode *inode, struct file *file) |
|---|
| 109 | | -{ |
|---|
| 110 | | - return single_open(file, info_show, NULL); |
|---|
| 111 | | -} |
|---|
| 112 | | - |
|---|
| 113 | | -static const struct file_operations fops_info = { |
|---|
| 114 | | - .open = fops_info_open, |
|---|
| 115 | | - .read = seq_read, |
|---|
| 116 | | - .llseek = seq_lseek, |
|---|
| 117 | | - .release = single_release, |
|---|
| 118 | | - .owner = THIS_MODULE, |
|---|
| 119 | | -}; |
|---|
| 94 | +DEFINE_SHOW_ATTRIBUTE(info); |
|---|
| 120 | 95 | |
|---|
| 121 | 96 | static int io_show(struct seq_file *seq, void *p) |
|---|
| 122 | 97 | { |
|---|
| .. | .. |
|---|
| 162 | 137 | return 0; |
|---|
| 163 | 138 | } |
|---|
| 164 | 139 | |
|---|
| 165 | | -static int fops_io_open(struct inode *inode, struct file *file) |
|---|
| 166 | | -{ |
|---|
| 167 | | - return single_open(file, io_show, NULL); |
|---|
| 168 | | -} |
|---|
| 169 | | - |
|---|
| 170 | | -static const struct file_operations fops_io = { |
|---|
| 171 | | - .open = fops_io_open, |
|---|
| 172 | | - .read = seq_read, |
|---|
| 173 | | - .llseek = seq_lseek, |
|---|
| 174 | | - .release = single_release, |
|---|
| 175 | | - .owner = THIS_MODULE, |
|---|
| 176 | | -}; |
|---|
| 177 | | - |
|---|
| 140 | +DEFINE_SHOW_ATTRIBUTE(io); |
|---|
| 178 | 141 | |
|---|
| 179 | 142 | static int __init s3c_freq_debugfs_init(void) |
|---|
| 180 | 143 | { |
|---|
| .. | .. |
|---|
| 185 | 148 | } |
|---|
| 186 | 149 | |
|---|
| 187 | 150 | dbgfs_file_io = debugfs_create_file("io-timing", S_IRUGO, dbgfs_root, |
|---|
| 188 | | - NULL, &fops_io); |
|---|
| 151 | + NULL, &io_fops); |
|---|
| 189 | 152 | |
|---|
| 190 | 153 | dbgfs_file_info = debugfs_create_file("info", S_IRUGO, dbgfs_root, |
|---|
| 191 | | - NULL, &fops_info); |
|---|
| 154 | + NULL, &info_fops); |
|---|
| 192 | 155 | |
|---|
| 193 | 156 | dbgfs_file_board = debugfs_create_file("board", S_IRUGO, dbgfs_root, |
|---|
| 194 | | - NULL, &fops_board); |
|---|
| 157 | + NULL, &board_fops); |
|---|
| 195 | 158 | |
|---|
| 196 | 159 | return 0; |
|---|
| 197 | 160 | } |
|---|