6 #include <linux/types.h>
7 #include <linux/module.h>
8 #include <linux/kernel.h>
13 #define DRV_NAME "atiixp"
15 #define ATIIXP_IDE_PIO_TIMING 0x40
16 #define ATIIXP_IDE_MDMA_TIMING 0x44
17 #define ATIIXP_IDE_PIO_CONTROL 0x48
18 #define ATIIXP_IDE_PIO_MODE 0x4a
19 #define ATIIXP_IDE_UDMA_CONTROL 0x54
20 #define ATIIXP_IDE_UDMA_MODE 0x56
55 int timing_shift = (drive->
dn ^ 1) * 8;
63 pio_mode_data &= ~(0x07 << (drive->
dn * 4));
64 pio_mode_data |= (pio << (drive->
dn * 4));
68 pio_timing_data &= ~(0xff << timing_shift);
70 (pio_timing[pio].command_width << (timing_shift + 4));
73 spin_unlock_irqrestore(&atiixp_lock, flags);
89 int timing_shift = (drive->
dn ^ 1) * 8;
101 tmp16 &= ~(0x07 << (drive->
dn * 4));
102 tmp16 |= ((speed & 0x07) << (drive->
dn * 4));
105 udma_ctl |= (1 << drive->
dn);
110 tmp32 &= ~(0xff << timing_shift);
112 (mdma_timing[i].command_width << (timing_shift + 4));
115 udma_ctl &= ~(1 << drive->
dn);
120 spin_unlock_irqrestore(&atiixp_lock, flags);
130 if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
137 .set_pio_mode = atiixp_set_pio_mode,
138 .set_dma_mode = atiixp_set_dma_mode,
139 .cable_detect = atiixp_cable_detect,
145 .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
146 .port_ops = &atiixp_port_ops,
153 .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
154 .port_ops = &atiixp_port_ops,
187 static struct pci_driver atiixp_pci_driver = {
188 .name =
"ATIIXP_IDE",
189 .id_table = atiixp_pci_tbl,
190 .probe = atiixp_init_one,
196 static int __init atiixp_ide_init(
void)
201 static void __exit atiixp_ide_exit(
void)