Root/
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) \ |
18 | static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \ |
19 | { \ |
20 | struct superhyway_device *s = to_superhyway_device(dev); \ |
21 | return sprintf(buf, fmt, s->field); \ |
22 | } |
23 | |
24 | /* VCR flags */ |
25 | superhyway_ro_attr(perr_flags, "0x%02x\n", vcr.perr_flags); |
26 | superhyway_ro_attr(merr_flags, "0x%02x\n", vcr.merr_flags); |
27 | superhyway_ro_attr(mod_vers, "0x%04x\n", vcr.mod_vers); |
28 | superhyway_ro_attr(mod_id, "0x%04x\n", vcr.mod_id); |
29 | superhyway_ro_attr(bot_mb, "0x%02x\n", vcr.bot_mb); |
30 | superhyway_ro_attr(top_mb, "0x%02x\n", vcr.top_mb); |
31 | |
32 | /* Misc */ |
33 | superhyway_ro_attr(resource, "0x%08lx\n", resource[0].start); |
34 | |
35 | struct 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 | |
46 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9