0001
0002
0003
0004
0005
0006 #ifndef __LINUX_ISA_H
0007 #define __LINUX_ISA_H
0008
0009 #include <linux/device.h>
0010 #include <linux/errno.h>
0011 #include <linux/kernel.h>
0012
0013 struct isa_driver {
0014 int (*match)(struct device *, unsigned int);
0015 int (*probe)(struct device *, unsigned int);
0016 void (*remove)(struct device *, unsigned int);
0017 void (*shutdown)(struct device *, unsigned int);
0018 int (*suspend)(struct device *, unsigned int, pm_message_t);
0019 int (*resume)(struct device *, unsigned int);
0020
0021 struct device_driver driver;
0022 struct device *devices;
0023 };
0024
0025 #define to_isa_driver(x) container_of((x), struct isa_driver, driver)
0026
0027 #ifdef CONFIG_ISA_BUS_API
0028 int isa_register_driver(struct isa_driver *, unsigned int);
0029 void isa_unregister_driver(struct isa_driver *);
0030 #else
0031 static inline int isa_register_driver(struct isa_driver *d, unsigned int i)
0032 {
0033 return -ENODEV;
0034 }
0035
0036 static inline void isa_unregister_driver(struct isa_driver *d)
0037 {
0038 }
0039 #endif
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #define module_isa_driver(__isa_driver, __num_isa_dev) \
0051 static int __init __isa_driver##_init(void) \
0052 { \
0053 return isa_register_driver(&(__isa_driver), __num_isa_dev); \
0054 } \
0055 module_init(__isa_driver##_init); \
0056 static void __exit __isa_driver##_exit(void) \
0057 { \
0058 isa_unregister_driver(&(__isa_driver)); \
0059 } \
0060 module_exit(__isa_driver##_exit);
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 #define max_num_isa_dev(__isa_dev_ext) (1024 / __isa_dev_ext)
0072
0073 #endif