| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/video/omap2/dss/core.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Some code and ideas taken from drivers/video/omap/ driver |
|---|
| 8 | 9 | * by Imre Deak. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 11 | | - * under the terms of the GNU General Public License version 2 as published by |
|---|
| 12 | | - * the Free Software Foundation. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 15 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 16 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 17 | | - * more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 20 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 21 | 10 | */ |
|---|
| 22 | 11 | |
|---|
| 23 | 12 | #define DSS_SUBSYS_NAME "CORE" |
|---|
| .. | .. |
|---|
| 99 | 88 | } |
|---|
| 100 | 89 | |
|---|
| 101 | 90 | #if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS) |
|---|
| 102 | | -static int dss_debug_show(struct seq_file *s, void *unused) |
|---|
| 91 | +static int dss_show(struct seq_file *s, void *unused) |
|---|
| 103 | 92 | { |
|---|
| 104 | 93 | void (*func)(struct seq_file *) = s->private; |
|---|
| 105 | 94 | func(s); |
|---|
| 106 | 95 | return 0; |
|---|
| 107 | 96 | } |
|---|
| 108 | 97 | |
|---|
| 109 | | -static int dss_debug_open(struct inode *inode, struct file *file) |
|---|
| 110 | | -{ |
|---|
| 111 | | - return single_open(file, dss_debug_show, inode->i_private); |
|---|
| 112 | | -} |
|---|
| 113 | | - |
|---|
| 114 | | -static const struct file_operations dss_debug_fops = { |
|---|
| 115 | | - .open = dss_debug_open, |
|---|
| 116 | | - .read = seq_read, |
|---|
| 117 | | - .llseek = seq_lseek, |
|---|
| 118 | | - .release = single_release, |
|---|
| 119 | | -}; |
|---|
| 98 | +DEFINE_SHOW_ATTRIBUTE(dss); |
|---|
| 120 | 99 | |
|---|
| 121 | 100 | static struct dentry *dss_debugfs_dir; |
|---|
| 122 | 101 | |
|---|
| 123 | | -static int dss_initialize_debugfs(void) |
|---|
| 102 | +static void dss_initialize_debugfs(void) |
|---|
| 124 | 103 | { |
|---|
| 125 | 104 | dss_debugfs_dir = debugfs_create_dir("omapdss", NULL); |
|---|
| 126 | | - if (IS_ERR(dss_debugfs_dir)) { |
|---|
| 127 | | - int err = PTR_ERR(dss_debugfs_dir); |
|---|
| 128 | | - dss_debugfs_dir = NULL; |
|---|
| 129 | | - return err; |
|---|
| 130 | | - } |
|---|
| 131 | 105 | |
|---|
| 132 | 106 | debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir, |
|---|
| 133 | | - &dss_debug_dump_clocks, &dss_debug_fops); |
|---|
| 134 | | - |
|---|
| 135 | | - return 0; |
|---|
| 107 | + &dss_debug_dump_clocks, &dss_fops); |
|---|
| 136 | 108 | } |
|---|
| 137 | 109 | |
|---|
| 138 | 110 | static void dss_uninitialize_debugfs(void) |
|---|
| .. | .. |
|---|
| 140 | 112 | debugfs_remove_recursive(dss_debugfs_dir); |
|---|
| 141 | 113 | } |
|---|
| 142 | 114 | |
|---|
| 143 | | -int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) |
|---|
| 115 | +void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) |
|---|
| 144 | 116 | { |
|---|
| 145 | | - struct dentry *d; |
|---|
| 146 | | - |
|---|
| 147 | | - d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, |
|---|
| 148 | | - write, &dss_debug_fops); |
|---|
| 149 | | - |
|---|
| 150 | | - return PTR_ERR_OR_ZERO(d); |
|---|
| 117 | + debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, write, &dss_fops); |
|---|
| 151 | 118 | } |
|---|
| 152 | 119 | #else /* CONFIG_FB_OMAP2_DSS_DEBUGFS */ |
|---|
| 153 | | -static inline int dss_initialize_debugfs(void) |
|---|
| 120 | +static inline void dss_initialize_debugfs(void) |
|---|
| 154 | 121 | { |
|---|
| 155 | | - return 0; |
|---|
| 156 | 122 | } |
|---|
| 157 | 123 | static inline void dss_uninitialize_debugfs(void) |
|---|
| 158 | 124 | { |
|---|
| 159 | 125 | } |
|---|
| 160 | | -int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) |
|---|
| 126 | +void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) |
|---|
| 161 | 127 | { |
|---|
| 162 | | - return 0; |
|---|
| 163 | 128 | } |
|---|
| 164 | 129 | #endif /* CONFIG_FB_OMAP2_DSS_DEBUGFS */ |
|---|
| 165 | 130 | |
|---|
| .. | .. |
|---|
| 192 | 157 | |
|---|
| 193 | 158 | static int __init omap_dss_probe(struct platform_device *pdev) |
|---|
| 194 | 159 | { |
|---|
| 195 | | - int r; |
|---|
| 196 | | - |
|---|
| 197 | 160 | core.pdev = pdev; |
|---|
| 198 | 161 | |
|---|
| 199 | 162 | dss_features_init(omapdss_get_version()); |
|---|
| 200 | 163 | |
|---|
| 201 | | - r = dss_initialize_debugfs(); |
|---|
| 202 | | - if (r) |
|---|
| 203 | | - goto err_debugfs; |
|---|
| 164 | + dss_initialize_debugfs(); |
|---|
| 204 | 165 | |
|---|
| 205 | 166 | if (def_disp_name) |
|---|
| 206 | 167 | core.default_display_name = def_disp_name; |
|---|
| .. | .. |
|---|
| 208 | 169 | register_pm_notifier(&omap_dss_pm_notif_block); |
|---|
| 209 | 170 | |
|---|
| 210 | 171 | return 0; |
|---|
| 211 | | - |
|---|
| 212 | | -err_debugfs: |
|---|
| 213 | | - |
|---|
| 214 | | - return r; |
|---|
| 215 | 172 | } |
|---|
| 216 | 173 | |
|---|
| 217 | 174 | static int omap_dss_remove(struct platform_device *pdev) |
|---|
| .. | .. |
|---|
| 250 | 207 | #ifdef CONFIG_FB_OMAP2_DSS_SDI |
|---|
| 251 | 208 | sdi_init_platform_driver, |
|---|
| 252 | 209 | #endif |
|---|
| 253 | | -#ifdef CONFIG_FB_OMAP2_DSS_RFBI |
|---|
| 254 | | - rfbi_init_platform_driver, |
|---|
| 255 | | -#endif |
|---|
| 256 | 210 | #ifdef CONFIG_FB_OMAP2_DSS_VENC |
|---|
| 257 | 211 | venc_init_platform_driver, |
|---|
| 258 | 212 | #endif |
|---|
| .. | .. |
|---|
| 273 | 227 | #endif |
|---|
| 274 | 228 | #ifdef CONFIG_FB_OMAP2_DSS_VENC |
|---|
| 275 | 229 | venc_uninit_platform_driver, |
|---|
| 276 | | -#endif |
|---|
| 277 | | -#ifdef CONFIG_FB_OMAP2_DSS_RFBI |
|---|
| 278 | | - rfbi_uninit_platform_driver, |
|---|
| 279 | 230 | #endif |
|---|
| 280 | 231 | #ifdef CONFIG_FB_OMAP2_DSS_SDI |
|---|
| 281 | 232 | sdi_uninit_platform_driver, |
|---|