| 1 |
|
| 2 | #ifndef _LINUX_EISA_H
|
| 3 | #define _LINUX_EISA_H
|
| 4 |
|
| 5 | #include <linux/ioport.h>
|
| 6 | #include <linux/device.h>
|
| 7 | #include <linux/device-id/eisa.h>
|
| 8 |
|
| 9 | #define EISA_MAX_SLOTS 8
|
| 10 |
|
| 11 | #define EISA_MAX_RESOURCES 4
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 | #define EISA_DMA1_STATUS 8
|
| 16 | #define EISA_INT1_CTRL 0x20
|
| 17 | #define EISA_INT1_MASK 0x21
|
| 18 | #define EISA_INT2_CTRL 0xA0
|
| 19 | #define EISA_INT2_MASK 0xA1
|
| 20 | #define EISA_DMA2_STATUS 0xD0
|
| 21 | #define EISA_DMA2_WRITE_SINGLE 0xD4
|
| 22 | #define EISA_EXT_NMI_RESET_CTRL 0x461
|
| 23 | #define EISA_INT1_EDGE_LEVEL 0x4D0
|
| 24 | #define EISA_INT2_EDGE_LEVEL 0x4D1
|
| 25 | #define EISA_VENDOR_ID_OFFSET 0xC80
|
| 26 | #define EISA_CONFIG_OFFSET 0xC84
|
| 27 |
|
| 28 | #define EISA_CONFIG_ENABLED 1
|
| 29 | #define EISA_CONFIG_FORCED 2
|
| 30 |
|
| 31 |
|
| 32 | #define EISA_DEVICE_INFO_NAME_SIZE 74
|
| 33 |
|
| 34 | |
| 35 | * signature, slot number, and base address. dma_mask is set by
|
| 36 | * default to parent device mask..
|
| 37 |
|
| 38 | struct eisa_device {
|
| 39 | struct eisa_device_id id;
|
| 40 | int slot;
|
| 41 | int state;
|
| 42 | unsigned long base_addr;
|
| 43 | struct resource res[EISA_MAX_RESOURCES];
|
| 44 | u64 dma_mask;
|
| 45 | struct device dev;
|
| 46 | #ifdef CONFIG_EISA_NAMES
|
| 47 | char pretty_name[EISA_DEVICE_INFO_NAME_SIZE];
|
| 48 | #endif
|
| 49 | };
|
| 50 |
|
| 51 | #define to_eisa_device(n) container_of(n, struct eisa_device, dev)
|
| 52 |
|
| 53 | static inline int eisa_get_region_index (void *addr)
|
| 54 | {
|
| 55 | unsigned long x = (unsigned long) addr;
|
| 56 |
|
| 57 | x &= 0xc00;
|
| 58 | return (x >> 12);
|
| 59 | }
|
| 60 |
|
| 61 | struct eisa_driver {
|
| 62 | const struct eisa_device_id *id_table;
|
| 63 | struct device_driver driver;
|
| 64 | };
|
| 65 |
|
| 66 | #define to_eisa_driver(drv) container_of_const(drv,struct eisa_driver, driver)
|
| 67 |
|
| 68 |
|
| 69 | #ifdef CONFIG_EISA
|
| 70 |
|
| 71 | extern const struct bus_type eisa_bus_type;
|
| 72 | int eisa_driver_register (struct eisa_driver *edrv);
|
| 73 | void eisa_driver_unregister (struct eisa_driver *edrv);
|
| 74 |
|
| 75 | #else
|
| 76 |
|
| 77 | static inline int eisa_driver_register (struct eisa_driver *edrv) { return 0; }
|
| 78 | static inline void eisa_driver_unregister (struct eisa_driver *edrv) { }
|
| 79 |
|
| 80 | #endif
|
| 81 |
|
| 82 |
|
| 83 | static inline void *eisa_get_drvdata (struct eisa_device *edev)
|
| 84 | {
|
| 85 | return dev_get_drvdata(&edev->dev);
|
| 86 | }
|
| 87 |
|
| 88 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data)
|
| 89 | {
|
| 90 | dev_set_drvdata(&edev->dev, data);
|
| 91 | }
|
| 92 |
|
| 93 | |
| 94 | * busses (PA-RISC ?), so we try to handle that.
|
| 95 |
|
| 96 | struct eisa_root_device {
|
| 97 | struct device *dev;
|
| 98 | struct resource *res;
|
| 99 | unsigned long bus_base_addr;
|
| 100 | int slots;
|
| 101 | int force_probe;
|
| 102 | u64 dma_mask;
|
| 103 | int bus_nr;
|
| 104 | struct resource eisa_root_res;
|
| 105 | };
|
| 106 |
|
| 107 | int eisa_root_register (struct eisa_root_device *root);
|
| 108 |
|
| 109 | #ifdef CONFIG_EISA
|
| 110 | extern int EISA_bus;
|
| 111 | #else
|
| 112 | # define EISA_bus 0
|
| 113 | #endif
|
| 114 |
|
| 115 | #endif
|