2 * linux/arch/arm/plat-omap/component-version.c
4 * Copyright (C) 2005 Nokia Corporation
5 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/init.h>
13 #include <linux/module.h>
14 #include <linux/err.h>
15 #include <linux/proc_fs.h>
16 #include <mach/board.h>
17 #include <mach/board-nokia.h>
19 static int component_version_read_proc(char *page, char **start, off_t off,
20 int count, int *eof, void *data)
23 const struct omap_version_config *ver;
28 while ((ver = omap_get_nr_config(OMAP_TAG_VERSION_STR,
29 struct omap_version_config, i)) != NULL) {
30 p += sprintf(p, "%-12s%s\n", ver->component, ver->version);
34 len = (p - page) - off;
38 *eof = (len <= count) ? 1 : 0;
44 static int __init component_version_init(void)
46 if (omap_get_config(OMAP_TAG_VERSION_STR, struct omap_version_config) == NULL)
48 if (!create_proc_read_entry("component_version", S_IRUGO, NULL,
49 component_version_read_proc, NULL))
55 static void __exit component_version_exit(void)
57 remove_proc_entry("component_version", NULL);
60 late_initcall(component_version_init);
61 module_exit(component_version_exit);
63 MODULE_AUTHOR("Juha Yrjölä <juha.yrjola@nokia.com>");
64 MODULE_DESCRIPTION("Component version driver");
65 MODULE_LICENSE("GPL");