diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/superhyway.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/include/linux/superhyway.h b/include/linux/superhyway.h index c906c5a0aaef..17ea468fa362 100644 --- a/include/linux/superhyway.h +++ b/include/linux/superhyway.h | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | #define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 | 20 | #define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 |
21 | 21 | ||
22 | struct vcr_info { | 22 | struct superhyway_vcr_info { |
23 | u8 perr_flags; /* P-port Error flags */ | 23 | u8 perr_flags; /* P-port Error flags */ |
24 | u8 merr_flags; /* Module Error flags */ | 24 | u8 merr_flags; /* Module Error flags */ |
25 | u16 mod_vers; /* Module Version */ | 25 | u16 mod_vers; /* Module Version */ |
@@ -28,6 +28,17 @@ struct vcr_info { | |||
28 | u8 top_mb; /* Top Memory block */ | 28 | u8 top_mb; /* Top Memory block */ |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct superhyway_ops { | ||
32 | int (*read_vcr)(unsigned long base, struct superhyway_vcr_info *vcr); | ||
33 | int (*write_vcr)(unsigned long base, struct superhyway_vcr_info vcr); | ||
34 | }; | ||
35 | |||
36 | struct superhyway_bus { | ||
37 | struct superhyway_ops *ops; | ||
38 | }; | ||
39 | |||
40 | extern struct superhyway_bus superhyway_channels[]; | ||
41 | |||
31 | struct superhyway_device_id { | 42 | struct superhyway_device_id { |
32 | unsigned int id; | 43 | unsigned int id; |
33 | unsigned long driver_data; | 44 | unsigned long driver_data; |
@@ -55,9 +66,11 @@ struct superhyway_device { | |||
55 | 66 | ||
56 | struct superhyway_device_id id; | 67 | struct superhyway_device_id id; |
57 | struct superhyway_driver *drv; | 68 | struct superhyway_driver *drv; |
69 | struct superhyway_bus *bus; | ||
58 | 70 | ||
59 | struct resource resource; | 71 | int num_resources; |
60 | struct vcr_info vcr; | 72 | struct resource *resource; |
73 | struct superhyway_vcr_info vcr; | ||
61 | }; | 74 | }; |
62 | 75 | ||
63 | #define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) | 76 | #define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) |
@@ -65,12 +78,27 @@ struct superhyway_device { | |||
65 | #define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) | 78 | #define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) |
66 | #define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) | 79 | #define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) |
67 | 80 | ||
68 | extern int superhyway_scan_bus(void); | 81 | static inline int |
82 | superhyway_read_vcr(struct superhyway_device *dev, unsigned long base, | ||
83 | struct superhyway_vcr_info *vcr) | ||
84 | { | ||
85 | return dev->bus->ops->read_vcr(base, vcr); | ||
86 | } | ||
87 | |||
88 | static inline int | ||
89 | superhyway_write_vcr(struct superhyway_device *dev, unsigned long base, | ||
90 | struct superhyway_vcr_info vcr) | ||
91 | { | ||
92 | return dev->bus->ops->write_vcr(base, vcr); | ||
93 | } | ||
94 | |||
95 | extern int superhyway_scan_bus(struct superhyway_bus *); | ||
69 | 96 | ||
70 | /* drivers/sh/superhyway/superhyway.c */ | 97 | /* drivers/sh/superhyway/superhyway.c */ |
71 | int superhyway_register_driver(struct superhyway_driver *); | 98 | int superhyway_register_driver(struct superhyway_driver *); |
72 | void superhyway_unregister_driver(struct superhyway_driver *); | 99 | void superhyway_unregister_driver(struct superhyway_driver *); |
73 | int superhyway_add_device(unsigned int, unsigned long, unsigned long long); | 100 | int superhyway_add_device(unsigned long base, struct superhyway_device *, struct superhyway_bus *); |
101 | int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices); | ||
74 | 102 | ||
75 | /* drivers/sh/superhyway/superhyway-sysfs.c */ | 103 | /* drivers/sh/superhyway/superhyway-sysfs.c */ |
76 | extern struct device_attribute superhyway_dev_attrs[]; | 104 | extern struct device_attribute superhyway_dev_attrs[]; |