38 #include <linux/module.h>
39 #include <linux/types.h>
40 #include <linux/kernel.h>
51 #define DRV_NAME "ali14xx"
54 #define ALI_NUM_PORTS 4
56 { 0x074, 0x0f4, 0x034, 0x0e4 };
62 {0x01, 0x0f}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00},
63 {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x2b}, {0x0a, 0x0f},
64 {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00},
65 {0x29, 0x00}, {0x2a, 0x00}, {0x2f, 0x00}, {0x2b, 0x00},
66 {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x30, 0x00},
67 {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0xff},
68 {0x35, 0x03}, {0x00, 0x00}
73 {0x03, 0x26, 0x04, 0x27},
74 {0x05, 0x28, 0x06, 0x29},
75 {0x2b, 0x30, 0x2c, 0x31},
76 {0x2d, 0x32, 0x2e, 0x33},
125 param3 = param1 = (time2 * bus_speed + 999) / 1000;
126 param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1;
131 printk(
KERN_DEBUG "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
132 drive->
name, pio, time1, time2, param1, param2, param3, param4);
135 driveNum = (drive->
hwif->index << 1) + (drive->
dn & 1);
138 outReg(param1, regTab[driveNum].
reg1);
139 outReg(param2, regTab[driveNum].
reg2);
140 outReg(param3, regTab[driveNum].
reg3);
141 outReg(param4, regTab[driveNum].
reg4);
143 spin_unlock_irqrestore(&ali14xx_lock, flags);
149 static int __init findPort(
void)
158 regOff =
inb(basePort);
159 for (regOn = 0x30; regOn <= 0x33; ++regOn) {
161 if (
inb(basePort) == regOn) {
162 regPort = basePort + 4;
163 dataPort = basePort + 8;
181 static int __init initRegisters(
void)
189 for (p = initData; p->
reg != 0; ++
p)
192 t =
inb(regPort) & 0x01;
199 .set_pio_mode = ali14xx_set_pio_mode,
205 .port_ops = &ali14xx_port_ops,
210 static int __init ali14xx_probe(
void)
216 if (!initRegisters()) {
224 static bool probe_ali14xx;
229 static int __init ali14xx_init(
void)
231 if (probe_ali14xx == 0)