2 * pata_amd.c - AMD PATA for new ATA layer
3 * (C) 2005-2006 Red Hat Inc
4 * Alan Cox <alan@redhat.com>
6 * Based on pata-sil680. Errata information is taken from data sheets
7 * and the amd74xx.c driver by Vojtech Pavlik. Nvidia SATA devices are
8 * claimed by sata-nv.c.
11 * Variable system clock when/if it makes sense
12 * Power management on ports
15 * Documentation publically available.
18 #include <linux/kernel.h>
19 #include <linux/module.h>
20 #include <linux/pci.h>
21 #include <linux/init.h>
22 #include <linux/blkdev.h>
23 #include <linux/delay.h>
24 #include <scsi/scsi_host.h>
25 #include <linux/libata.h>
27 #define DRV_NAME "pata_amd"
28 #define DRV_VERSION "0.3.8"
31 * timing_setup - shared timing computation and load
32 * @ap: ATA port being set up
33 * @adev: drive being configured
34 * @offset: port offset
35 * @speed: target speed
36 * @clock: clock multiplier (number of times 33MHz for this part)
38 * Perform the actual timing set up for Nvidia or AMD PATA devices.
39 * The actual devices vary so they all call into this helper function
40 * providing the clock multipler and offset (because AMD and Nvidia put
41 * the ports at different locations).
44 static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offset, int speed, int clock)
46 static const unsigned char amd_cyc2udma[] = {
47 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7
50 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
51 struct ata_device *peer = ata_dev_pair(adev);
52 int dn = ap->port_no * 2 + adev->devno;
53 struct ata_timing at, apeer;
55 const int amd_clock = 33333; /* KHz. */
58 T = 1000000000 / amd_clock;
59 UT = T / min_t(int, max_t(int, clock, 1), 2);
61 if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
62 dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed);
67 /* This may be over conservative */
69 ata_timing_compute(peer, peer->dma_mode, &apeer, T, UT);
70 ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT);
72 ata_timing_compute(peer, peer->pio_mode, &apeer, T, UT);
73 ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT);
76 if (speed == XFER_UDMA_5 && amd_clock <= 33333) at.udma = 1;
77 if (speed == XFER_UDMA_6 && amd_clock <= 33333) at.udma = 15;
80 * Now do the setup work
83 /* Configure the address set up timing */
84 pci_read_config_byte(pdev, offset + 0x0C, &t);
85 t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(at.setup, 1, 4) - 1) << ((3 - dn) << 1));
86 pci_write_config_byte(pdev, offset + 0x0C , t);
88 /* Configure the 8bit I/O timing */
89 pci_write_config_byte(pdev, offset + 0x0E + (1 - (dn >> 1)),
90 ((FIT(at.act8b, 1, 16) - 1) << 4) | (FIT(at.rec8b, 1, 16) - 1));
93 pci_write_config_byte(pdev, offset + 0x08 + (3 - dn),
94 ((FIT(at.active, 1, 16) - 1) << 4) | (FIT(at.recover, 1, 16) - 1));
98 t = at.udma ? (0xc0 | (FIT(at.udma, 2, 5) - 2)) : 0x03;
102 t = at.udma ? (0xc0 | amd_cyc2udma[FIT(at.udma, 2, 10)]) : 0x03;
106 t = at.udma ? (0xc0 | amd_cyc2udma[FIT(at.udma, 1, 10)]) : 0x03;
110 t = at.udma ? (0xc0 | amd_cyc2udma[FIT(at.udma, 1, 15)]) : 0x03;
118 pci_write_config_byte(pdev, offset + 0x10 + (3 - dn), t);
122 * amd_probe_init - perform reset handling
124 * @deadline: deadline jiffies for the operation
126 * Reset sequence checking enable bits to see which ports are
130 static int amd_pre_reset(struct ata_port *ap, unsigned long deadline)
132 static const struct pci_bits amd_enable_bits[] = {
133 { 0x40, 1, 0x02, 0x02 },
134 { 0x40, 1, 0x01, 0x01 }
137 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
139 if (!pci_test_config_bits(pdev, &amd_enable_bits[ap->port_no]))
142 return ata_std_prereset(ap, deadline);
145 static void amd_error_handler(struct ata_port *ap)
147 return ata_bmdma_drive_eh(ap, amd_pre_reset,
148 ata_std_softreset, NULL,
152 static int amd_cable_detect(struct ata_port *ap)
154 static const u32 bitmask[2] = {0x03, 0x0C};
155 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
158 pci_read_config_byte(pdev, 0x42, &ata66);
159 if (ata66 & bitmask[ap->port_no])
160 return ATA_CBL_PATA80;
161 return ATA_CBL_PATA40;
165 * amd33_set_piomode - set initial PIO mode data
169 * Program the AMD registers for PIO mode.
172 static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev)
174 timing_setup(ap, adev, 0x40, adev->pio_mode, 1);
177 static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev)
179 timing_setup(ap, adev, 0x40, adev->pio_mode, 2);
182 static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev)
184 timing_setup(ap, adev, 0x40, adev->pio_mode, 3);
187 static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev)
189 timing_setup(ap, adev, 0x40, adev->pio_mode, 4);
193 * amd33_set_dmamode - set initial DMA mode data
197 * Program the MWDMA/UDMA modes for the AMD and Nvidia
201 static void amd33_set_dmamode(struct ata_port *ap, struct ata_device *adev)
203 timing_setup(ap, adev, 0x40, adev->dma_mode, 1);
206 static void amd66_set_dmamode(struct ata_port *ap, struct ata_device *adev)
208 timing_setup(ap, adev, 0x40, adev->dma_mode, 2);
211 static void amd100_set_dmamode(struct ata_port *ap, struct ata_device *adev)
213 timing_setup(ap, adev, 0x40, adev->dma_mode, 3);
216 static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
218 timing_setup(ap, adev, 0x40, adev->dma_mode, 4);
223 * nv_probe_init - cable detection
226 * Perform cable detection. The BIOS stores this in PCI config
230 static int nv_pre_reset(struct ata_port *ap, unsigned long deadline)
232 static const struct pci_bits nv_enable_bits[] = {
233 { 0x50, 1, 0x02, 0x02 },
234 { 0x50, 1, 0x01, 0x01 }
237 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
239 if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no]))
242 return ata_std_prereset(ap, deadline);
245 static void nv_error_handler(struct ata_port *ap)
247 ata_bmdma_drive_eh(ap, nv_pre_reset,
248 ata_std_softreset, NULL,
252 static int nv_cable_detect(struct ata_port *ap)
254 static const u8 bitmask[2] = {0x03, 0x0C};
255 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
260 pci_read_config_byte(pdev, 0x52, &ata66);
261 if (ata66 & bitmask[ap->port_no])
262 cbl = ATA_CBL_PATA80;
264 cbl = ATA_CBL_PATA40;
266 /* We now have to double check because the Nvidia boxes BIOS
267 doesn't always set the cable bits but does set mode bits */
268 pci_read_config_word(pdev, 0x62 - 2 * ap->port_no, &udma);
269 if ((udma & 0xC4) == 0xC4 || (udma & 0xC400) == 0xC400)
270 cbl = ATA_CBL_PATA80;
275 * nv100_set_piomode - set initial PIO mode data
279 * Program the AMD registers for PIO mode.
282 static void nv100_set_piomode(struct ata_port *ap, struct ata_device *adev)
284 timing_setup(ap, adev, 0x50, adev->pio_mode, 3);
287 static void nv133_set_piomode(struct ata_port *ap, struct ata_device *adev)
289 timing_setup(ap, adev, 0x50, adev->pio_mode, 4);
293 * nv100_set_dmamode - set initial DMA mode data
297 * Program the MWDMA/UDMA modes for the AMD and Nvidia
301 static void nv100_set_dmamode(struct ata_port *ap, struct ata_device *adev)
303 timing_setup(ap, adev, 0x50, adev->dma_mode, 3);
306 static void nv133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
308 timing_setup(ap, adev, 0x50, adev->dma_mode, 4);
311 static struct scsi_host_template amd_sht = {
312 .module = THIS_MODULE,
314 .ioctl = ata_scsi_ioctl,
315 .queuecommand = ata_scsi_queuecmd,
316 .can_queue = ATA_DEF_QUEUE,
317 .this_id = ATA_SHT_THIS_ID,
318 .sg_tablesize = LIBATA_MAX_PRD,
319 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
320 .emulated = ATA_SHT_EMULATED,
321 .use_clustering = ATA_SHT_USE_CLUSTERING,
322 .proc_name = DRV_NAME,
323 .dma_boundary = ATA_DMA_BOUNDARY,
324 .slave_configure = ata_scsi_slave_config,
325 .slave_destroy = ata_scsi_slave_destroy,
326 .bios_param = ata_std_bios_param,
328 .resume = ata_scsi_device_resume,
329 .suspend = ata_scsi_device_suspend,
333 static struct ata_port_operations amd33_port_ops = {
334 .port_disable = ata_port_disable,
335 .set_piomode = amd33_set_piomode,
336 .set_dmamode = amd33_set_dmamode,
337 .mode_filter = ata_pci_default_filter,
338 .tf_load = ata_tf_load,
339 .tf_read = ata_tf_read,
340 .check_status = ata_check_status,
341 .exec_command = ata_exec_command,
342 .dev_select = ata_std_dev_select,
344 .freeze = ata_bmdma_freeze,
345 .thaw = ata_bmdma_thaw,
346 .error_handler = amd_error_handler,
347 .post_internal_cmd = ata_bmdma_post_internal_cmd,
348 .cable_detect = ata_cable_40wire,
350 .bmdma_setup = ata_bmdma_setup,
351 .bmdma_start = ata_bmdma_start,
352 .bmdma_stop = ata_bmdma_stop,
353 .bmdma_status = ata_bmdma_status,
355 .qc_prep = ata_qc_prep,
356 .qc_issue = ata_qc_issue_prot,
358 .data_xfer = ata_data_xfer,
360 .irq_handler = ata_interrupt,
361 .irq_clear = ata_bmdma_irq_clear,
362 .irq_on = ata_irq_on,
363 .irq_ack = ata_irq_ack,
365 .port_start = ata_port_start,
368 static struct ata_port_operations amd66_port_ops = {
369 .port_disable = ata_port_disable,
370 .set_piomode = amd66_set_piomode,
371 .set_dmamode = amd66_set_dmamode,
372 .mode_filter = ata_pci_default_filter,
373 .tf_load = ata_tf_load,
374 .tf_read = ata_tf_read,
375 .check_status = ata_check_status,
376 .exec_command = ata_exec_command,
377 .dev_select = ata_std_dev_select,
379 .freeze = ata_bmdma_freeze,
380 .thaw = ata_bmdma_thaw,
381 .error_handler = amd_error_handler,
382 .post_internal_cmd = ata_bmdma_post_internal_cmd,
383 .cable_detect = ata_cable_unknown,
385 .bmdma_setup = ata_bmdma_setup,
386 .bmdma_start = ata_bmdma_start,
387 .bmdma_stop = ata_bmdma_stop,
388 .bmdma_status = ata_bmdma_status,
390 .qc_prep = ata_qc_prep,
391 .qc_issue = ata_qc_issue_prot,
393 .data_xfer = ata_data_xfer,
395 .irq_handler = ata_interrupt,
396 .irq_clear = ata_bmdma_irq_clear,
397 .irq_on = ata_irq_on,
398 .irq_ack = ata_irq_ack,
400 .port_start = ata_port_start,
403 static struct ata_port_operations amd100_port_ops = {
404 .port_disable = ata_port_disable,
405 .set_piomode = amd100_set_piomode,
406 .set_dmamode = amd100_set_dmamode,
407 .mode_filter = ata_pci_default_filter,
408 .tf_load = ata_tf_load,
409 .tf_read = ata_tf_read,
410 .check_status = ata_check_status,
411 .exec_command = ata_exec_command,
412 .dev_select = ata_std_dev_select,
414 .freeze = ata_bmdma_freeze,
415 .thaw = ata_bmdma_thaw,
416 .error_handler = amd_error_handler,
417 .post_internal_cmd = ata_bmdma_post_internal_cmd,
418 .cable_detect = ata_cable_unknown,
420 .bmdma_setup = ata_bmdma_setup,
421 .bmdma_start = ata_bmdma_start,
422 .bmdma_stop = ata_bmdma_stop,
423 .bmdma_status = ata_bmdma_status,
425 .qc_prep = ata_qc_prep,
426 .qc_issue = ata_qc_issue_prot,
428 .data_xfer = ata_data_xfer,
430 .irq_handler = ata_interrupt,
431 .irq_clear = ata_bmdma_irq_clear,
432 .irq_on = ata_irq_on,
433 .irq_ack = ata_irq_ack,
435 .port_start = ata_port_start,
438 static struct ata_port_operations amd133_port_ops = {
439 .port_disable = ata_port_disable,
440 .set_piomode = amd133_set_piomode,
441 .set_dmamode = amd133_set_dmamode,
442 .mode_filter = ata_pci_default_filter,
443 .tf_load = ata_tf_load,
444 .tf_read = ata_tf_read,
445 .check_status = ata_check_status,
446 .exec_command = ata_exec_command,
447 .dev_select = ata_std_dev_select,
449 .freeze = ata_bmdma_freeze,
450 .thaw = ata_bmdma_thaw,
451 .error_handler = amd_error_handler,
452 .post_internal_cmd = ata_bmdma_post_internal_cmd,
453 .cable_detect = amd_cable_detect,
455 .bmdma_setup = ata_bmdma_setup,
456 .bmdma_start = ata_bmdma_start,
457 .bmdma_stop = ata_bmdma_stop,
458 .bmdma_status = ata_bmdma_status,
460 .qc_prep = ata_qc_prep,
461 .qc_issue = ata_qc_issue_prot,
463 .data_xfer = ata_data_xfer,
465 .irq_handler = ata_interrupt,
466 .irq_clear = ata_bmdma_irq_clear,
467 .irq_on = ata_irq_on,
468 .irq_ack = ata_irq_ack,
470 .port_start = ata_port_start,
473 static struct ata_port_operations nv100_port_ops = {
474 .port_disable = ata_port_disable,
475 .set_piomode = nv100_set_piomode,
476 .set_dmamode = nv100_set_dmamode,
477 .mode_filter = ata_pci_default_filter,
478 .tf_load = ata_tf_load,
479 .tf_read = ata_tf_read,
480 .check_status = ata_check_status,
481 .exec_command = ata_exec_command,
482 .dev_select = ata_std_dev_select,
484 .freeze = ata_bmdma_freeze,
485 .thaw = ata_bmdma_thaw,
486 .error_handler = nv_error_handler,
487 .post_internal_cmd = ata_bmdma_post_internal_cmd,
488 .cable_detect = nv_cable_detect,
490 .bmdma_setup = ata_bmdma_setup,
491 .bmdma_start = ata_bmdma_start,
492 .bmdma_stop = ata_bmdma_stop,
493 .bmdma_status = ata_bmdma_status,
495 .qc_prep = ata_qc_prep,
496 .qc_issue = ata_qc_issue_prot,
498 .data_xfer = ata_data_xfer,
500 .irq_handler = ata_interrupt,
501 .irq_clear = ata_bmdma_irq_clear,
502 .irq_on = ata_irq_on,
503 .irq_ack = ata_irq_ack,
505 .port_start = ata_port_start,
508 static struct ata_port_operations nv133_port_ops = {
509 .port_disable = ata_port_disable,
510 .set_piomode = nv133_set_piomode,
511 .set_dmamode = nv133_set_dmamode,
512 .mode_filter = ata_pci_default_filter,
513 .tf_load = ata_tf_load,
514 .tf_read = ata_tf_read,
515 .check_status = ata_check_status,
516 .exec_command = ata_exec_command,
517 .dev_select = ata_std_dev_select,
519 .freeze = ata_bmdma_freeze,
520 .thaw = ata_bmdma_thaw,
521 .error_handler = nv_error_handler,
522 .post_internal_cmd = ata_bmdma_post_internal_cmd,
523 .cable_detect = nv_cable_detect,
525 .bmdma_setup = ata_bmdma_setup,
526 .bmdma_start = ata_bmdma_start,
527 .bmdma_stop = ata_bmdma_stop,
528 .bmdma_status = ata_bmdma_status,
530 .qc_prep = ata_qc_prep,
531 .qc_issue = ata_qc_issue_prot,
533 .data_xfer = ata_data_xfer,
535 .irq_handler = ata_interrupt,
536 .irq_clear = ata_bmdma_irq_clear,
537 .irq_on = ata_irq_on,
538 .irq_ack = ata_irq_ack,
540 .port_start = ata_port_start,
543 static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
545 static struct ata_port_info info[10] = {
548 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
550 .mwdma_mask = 0x07, /* No SWDMA */
551 .udma_mask = 0x07, /* UDMA 33 */
552 .port_ops = &amd33_port_ops
554 { /* 1: Early AMD7409 - no swdma */
556 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
559 .udma_mask = 0x1f, /* UDMA 66 */
560 .port_ops = &amd66_port_ops
562 { /* 2: AMD 7409, no swdma errata */
564 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
567 .udma_mask = 0x1f, /* UDMA 66 */
568 .port_ops = &amd66_port_ops
572 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
575 .udma_mask = 0x3f, /* UDMA 100 */
576 .port_ops = &amd100_port_ops
580 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
583 .udma_mask = 0x3f, /* UDMA 100 */
584 .port_ops = &amd100_port_ops
588 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
591 .udma_mask = 0x7f, /* UDMA 133, no swdma */
592 .port_ops = &amd133_port_ops
594 { /* 6: AMD 8111 UDMA 100 (Serenade) */
596 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
599 .udma_mask = 0x3f, /* UDMA 100, no swdma */
600 .port_ops = &amd133_port_ops
602 { /* 7: Nvidia Nforce */
604 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
607 .udma_mask = 0x3f, /* UDMA 100 */
608 .port_ops = &nv100_port_ops
610 { /* 8: Nvidia Nforce2 and later */
612 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
615 .udma_mask = 0x7f, /* UDMA 133, no swdma */
616 .port_ops = &nv133_port_ops
618 { /* 9: AMD CS5536 (Geode companion) */
620 .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST,
623 .udma_mask = 0x3f, /* UDMA 100 */
624 .port_ops = &amd100_port_ops
627 static struct ata_port_info *port_info[2];
628 static int printed_version;
629 int type = id->driver_data;
633 if (!printed_version++)
634 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
636 pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
637 pci_read_config_byte(pdev, 0x41, &fifo);
639 /* Check for AMD7409 without swdma errata and if found adjust type */
640 if (type == 1 && rev > 0x7)
643 /* Check for AMD7411 */
646 pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
648 pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
651 if (type == 5 && pdev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
652 pdev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
653 type = 6; /* UDMA 100 only */
656 ata_pci_clear_simplex(pdev);
660 port_info[0] = port_info[1] = &info[type];
661 return ata_pci_init_one(pdev, port_info, 2);
665 static int amd_reinit_one(struct pci_dev *pdev)
667 if (pdev->vendor == PCI_VENDOR_ID_AMD) {
669 pci_read_config_byte(pdev, 0x41, &fifo);
670 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
672 pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
674 pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
675 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
676 pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
677 ata_pci_clear_simplex(pdev);
679 return ata_pci_device_resume(pdev);
683 static const struct pci_device_id amd[] = {
684 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
685 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
686 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 3 },
687 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 4 },
688 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 5 },
689 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 7 },
690 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 8 },
691 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 8 },
692 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 8 },
693 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 8 },
694 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 8 },
695 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 8 },
696 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 8 },
697 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 8 },
698 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 8 },
699 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 8 },
700 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 8 },
701 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 9 },
706 static struct pci_driver amd_pci_driver = {
709 .probe = amd_init_one,
710 .remove = ata_pci_remove_one,
712 .suspend = ata_pci_device_suspend,
713 .resume = amd_reinit_one,
717 static int __init amd_init(void)
719 return pci_register_driver(&amd_pci_driver);
722 static void __exit amd_exit(void)
724 pci_unregister_driver(&amd_pci_driver);
727 MODULE_AUTHOR("Alan Cox");
728 MODULE_DESCRIPTION("low-level driver for AMD PATA IDE");
729 MODULE_LICENSE("GPL");
730 MODULE_DEVICE_TABLE(pci, amd);
731 MODULE_VERSION(DRV_VERSION);
733 module_init(amd_init);
734 module_exit(amd_exit);