aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/superhyway/superhyway-sysfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/sh/superhyway/superhyway-sysfs.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/sh/superhyway/superhyway-sysfs.c')
-rw-r--r--drivers/sh/superhyway/superhyway-sysfs.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/sh/superhyway/superhyway-sysfs.c b/drivers/sh/superhyway/superhyway-sysfs.c
new file mode 100644
index 000000000000..39ab6a12da76
--- /dev/null
+++ b/drivers/sh/superhyway/superhyway-sysfs.c
@@ -0,0 +1,45 @@
1/*
2 * drivers/sh/superhyway/superhyway-sysfs.c
3 *
4 * SuperHyway Bus sysfs interface
5 *
6 * Copyright (C) 2004, 2005 Paul Mundt <lethal@linux-sh.org>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/kernel.h>
13#include <linux/device.h>
14#include <linux/types.h>
15#include <linux/superhyway.h>
16
17#define superhyway_ro_attr(name, fmt, field) \
18static ssize_t name##_show(struct device *dev, char *buf) \
19{ \
20 struct superhyway_device *s = to_superhyway_device(dev); \
21 return sprintf(buf, fmt, s->field); \
22}
23
24/* VCR flags */
25superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags);
26superhyway_ro_attr(merr_flags, "0x%02x\n", vcr.merr_flags);
27superhyway_ro_attr(mod_vers, "0x%04x\n", vcr.mod_vers);
28superhyway_ro_attr(mod_id, "0x%04x\n", vcr.mod_id);
29superhyway_ro_attr(bot_mb, "0x%02x\n", vcr.bot_mb);
30superhyway_ro_attr(top_mb, "0x%02x\n", vcr.top_mb);
31
32/* Misc */
33superhyway_ro_attr(resource, "0x%08lx\n", resource.start);
34
35struct device_attribute superhyway_dev_attrs[] = {
36 __ATTR_RO(perr_flags),
37 __ATTR_RO(merr_flags),
38 __ATTR_RO(mod_vers),
39 __ATTR_RO(mod_id),
40 __ATTR_RO(bot_mb),
41 __ATTR_RO(top_mb),
42 __ATTR_RO(resource),
43 __ATTR_NULL,
44};
45