2 File: include/asm-i386/sl811-hw.h
5 Use Kernel 2.4.20 and this source from 2.4.22
6 Splitt hardware depens into file sl811-x86.h and sl811-arm.h.
9 Handle multi instances. For two controller on one board.
10 "hc->data_io" not used for x86 arch.
13 Alternate IO-Base for second Controller (CF/USB1).
16 Move Hardware depend header sl811-x86.h into include/asm-i386/sl811-hw.h.
19 Low level only for port io into hardware-include.
22 #ifndef __LINUX_SL811_HW_H
23 #define __LINUX_SL811_HW_H
25 #define MAX_CONTROLERS 2 /* Max number of SL811 controllers per module */
27 static int io[MAX_CONTROLERS] = { 0x220, 0x222 }; /* IO ports for controllers */
28 static int irq[MAX_CONTROLERS] = { 12, 12 }; /* Interrupt list */
30 MODULE_PARM(io, "1-" __MODULE_STRING(MAX_CONTROLERS) "i");
31 MODULE_PARM_DESC(io, "I/O base address(es), 0x220,0x222 default");
32 MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_CONTROLERS) "i");
33 MODULE_PARM_DESC(irq, "IRQ number(s), 12,12 default");
35 #define OFFSET_DATA_REG 1 /* Offset from ADDR_IO to DATA_IO */
36 /* Do not change this! */
37 #define SIZEOF_IO_REGION 2 /* Size for request/release region */
40 * Low level: Read from Data port [x86]
42 static __u8 inline sl811_read_data (struct sl811_hc *hc)
44 return ((__u8) inb (hc->addr_io+OFFSET_DATA_REG));
48 * Low level: Write to index register [x86]
50 static void inline sl811_write_index (struct sl811_hc *hc, __u8 index)
52 outb (index, hc->addr_io);
56 * Low level: Write to Data port [x86]
58 static void inline sl811_write_data (struct sl811_hc *hc, __u8 data)
60 outb (data, hc->addr_io+OFFSET_DATA_REG);
64 * Low level: Write to index register and data port [x86]
66 static void inline sl811_write_index_data (struct sl811_hc *hc, __u8 index, __u8 data)
68 outw (index|(((__u16)data) << 8), hc->addr_io);
72 * This function is board specific. It sets up the interrupt to
73 * be an edge trigger and trigger on the rising edge
75 static void inline sl811_init_irq(void)
81 /*****************************************************************
83 * Function Name: release_regions [x86]
85 * This function is board specific. It release all io address
86 * from memory (if can).
88 * Input: struct sl811_hc * *
90 * Return value : 0 = OK
92 *****************************************************************/
93 static void inline sl811_release_regions(struct sl811_hc *hc)
96 release_region(hc->addr_io, SIZEOF_IO_REGION);
99 /* data_io unused for x86 */
102 release_region(hc->data_io, SIZEOF_IO_REGION);
107 /*****************************************************************
109 * Function Name: request_regions [x86]
111 * This function is board specific. It request all io address and
112 * maps into memory (if can).
114 * Input: struct sl811_hc *
116 * Return value : 0 = OK
118 *****************************************************************/
119 static int inline sl811_request_regions (struct sl811_hc *hc, int addr_io, int data_io, const char *name)
121 if (!request_region(addr_io, SIZEOF_IO_REGION, name)) {
122 PDEBUG(3, "request address %d failed", addr_io);
125 hc->addr_io = addr_io;
127 /* data_io unused for x86 */
128 /* hc->data_io = data_io; */
133 #endif // __LINUX_SL811_HW_H