Full support for Ginger Console
[linux-ginger.git] / arch / arm / plat-omap / psp-version.c
blobb13021a85e380ad81946c62b3fb44a0a29fe0035
1 /*
2 * linux/arch/arm/mach-omap2/ti-psp-version.c
4 * Create a proc entry for showing PSP version.
6 * Copyright (C) 2008 Texas Instruments Incorporated.
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.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <linux/module.h>
24 #include <linux/kernel.h>
25 #include <linux/init.h>
26 #include <linux/proc_fs.h>
27 #include <asm/uaccess.h>
29 #include "psp-version.h"
31 static int init_psp_module(void);
32 static void exit_psp_module(void);
35 static struct proc_dir_entry *vers_file;
37 static int show_version(char *page, char **start,
38 off_t off, int count,
39 int *eof, void *data)
41 int len;
43 len = sprintf(page, TI_PSP_DEVICE \
44 " Linux PSP version " TI_PSP_VERSION \
45 " (" TI_PSP_PLATFORM ")\n");
47 return len;
50 static int __init init_psp_module(void)
52 int result = 0;
55 * Create the file "/proc/ti-psp-version"
57 vers_file = create_proc_read_entry(
58 TI_PSP_ENTRY,
59 0444,
60 NULL,
61 show_version,
62 NULL);
64 if (vers_file != NULL) {
66 printk (KERN_INFO TI_PSP_DEVICE \
67 " Linux PSP version " TI_PSP_VERSION \
68 " (" TI_PSP_PLATFORM ")\n");
70 else {
71 result = -ENOMEM;
74 return result;
77 static void __exit exit_psp_module(void)
79 remove_proc_entry(TI_PSP_ENTRY, NULL);
82 module_init(init_psp_module);
83 module_exit(exit_psp_module);
85 MODULE_LICENSE("GPLv2");
86 MODULE_AUTHOR("Texas Instruments Incorporated");
87 MODULE_DESCRIPTION("Contains version of the Linux PSP release.");