blob: b5352ebecef93a9cf047b5f6cdb3cd4dc1a10c50 [file] [log] [blame]
Jeff Garzik669a5db2006-08-29 18:12:40 -04001/*
2 * pata_artop.c - ARTOP ATA controller driver
3 *
4 * (C) 2006 Red Hat <alan@redhat.com>
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +02005 * (C) 2007 Bartlomiej Zolnierkiewicz
Jeff Garzik669a5db2006-08-29 18:12:40 -04006 *
7 * Based in part on drivers/ide/pci/aec62xx.c
8 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
9 * 865/865R fixes for Macintosh card version from a patch to the old
10 * driver by Thibaut VARENE <varenet@parisc-linux.org>
11 * When setting the PCI latency we must set 0x80 or higher for burst
12 * performance Alessandro Zummo <alessandro.zummo@towertech.it>
13 *
14 * TODO
15 * 850 serialization once the core supports it
16 * Investigate no_dsc on 850R
17 * Clock detect
18 */
19
20#include <linux/kernel.h>
21#include <linux/module.h>
22#include <linux/pci.h>
23#include <linux/init.h>
24#include <linux/blkdev.h>
25#include <linux/delay.h>
26#include <linux/device.h>
27#include <scsi/scsi_host.h>
28#include <linux/libata.h>
29#include <linux/ata.h>
30
31#define DRV_NAME "pata_artop"
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +020032#define DRV_VERSION "0.4.4"
Jeff Garzik669a5db2006-08-29 18:12:40 -040033
34/*
35 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
36 * get PCI bus speed functionality we leave this as 0. Its a variable
37 * for when we get the functionality and also for folks wanting to
38 * test stuff.
39 */
40
41static int clock = 0;
42
Tejun Heod4b2bab2007-02-02 16:50:52 +090043static int artop6210_pre_reset(struct ata_port *ap, unsigned long deadline)
Jeff Garzik669a5db2006-08-29 18:12:40 -040044{
45 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
46 const struct pci_bits artop_enable_bits[] = {
47 { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */
48 { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */
49 };
50
Alan Coxc9619222006-09-26 17:53:38 +010051 if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
52 return -ENOENT;
Tejun Heod4b2bab2007-02-02 16:50:52 +090053
54 return ata_std_prereset(ap, deadline);
Jeff Garzik669a5db2006-08-29 18:12:40 -040055}
56
57/**
58 * artop6210_error_handler - Probe specified port on PATA host controller
59 * @ap: Port to probe
60 *
61 * LOCKING:
62 * None (inherited from caller).
63 */
64
65static void artop6210_error_handler(struct ata_port *ap)
66{
67 ata_bmdma_drive_eh(ap, artop6210_pre_reset,
68 ata_std_softreset, NULL,
69 ata_std_postreset);
70}
71
72/**
73 * artop6260_pre_reset - check for 40/80 pin
74 * @ap: Port
Tejun Heod4b2bab2007-02-02 16:50:52 +090075 * @deadline: deadline jiffies for the operation
Jeff Garzik669a5db2006-08-29 18:12:40 -040076 *
77 * The ARTOP hardware reports the cable detect bits in register 0x49.
78 * Nothing complicated needed here.
79 */
80
Tejun Heod4b2bab2007-02-02 16:50:52 +090081static int artop6260_pre_reset(struct ata_port *ap, unsigned long deadline)
Jeff Garzik669a5db2006-08-29 18:12:40 -040082{
83 static const struct pci_bits artop_enable_bits[] = {
84 { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */
85 { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */
86 };
87
88 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
Jeff Garzik669a5db2006-08-29 18:12:40 -040089
90 /* Odd numbered device ids are the units with enable bits (the -R cards) */
Alan Coxc9619222006-09-26 17:53:38 +010091 if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no]))
92 return -ENOENT;
Jeff Garzik27c78b32007-03-09 09:41:19 -050093
94 return ata_std_prereset(ap, deadline);
Jeff Garzika73984a2007-03-09 08:37:46 -050095}
Alan Coxc9619222006-09-26 17:53:38 +010096
Jeff Garzika73984a2007-03-09 08:37:46 -050097/**
98 * artop6260_cable_detect - identify cable type
99 * @ap: Port
100 *
Alan Coxc343a832007-05-25 20:39:30 +0100101 * Identify the cable type for the ARTOP interface in question
Jeff Garzika73984a2007-03-09 08:37:46 -0500102 */
Jeff Garzika617c092007-05-21 20:14:23 -0400103
Jeff Garzika73984a2007-03-09 08:37:46 -0500104static int artop6260_cable_detect(struct ata_port *ap)
105{
106 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
107 u8 tmp;
Jeff Garzik669a5db2006-08-29 18:12:40 -0400108 pci_read_config_byte(pdev, 0x49, &tmp);
Alexey Dobriyan3f9dd272006-11-10 22:52:46 +0300109 if (tmp & (1 << ap->port_no))
Jeff Garzika73984a2007-03-09 08:37:46 -0500110 return ATA_CBL_PATA40;
111 return ATA_CBL_PATA80;
Jeff Garzik669a5db2006-08-29 18:12:40 -0400112}
113
114/**
115 * artop6260_error_handler - Probe specified port on PATA host controller
116 * @ap: Port to probe
117 *
118 * LOCKING:
119 * None (inherited from caller).
120 */
121
122static void artop6260_error_handler(struct ata_port *ap)
123{
124 ata_bmdma_drive_eh(ap, artop6260_pre_reset,
125 ata_std_softreset, NULL,
126 ata_std_postreset);
127}
128
129/**
130 * artop6210_load_piomode - Load a set of PATA PIO timings
131 * @ap: Port whose timings we are configuring
132 * @adev: Device
133 * @pio: PIO mode
134 *
135 * Set PIO mode for device, in host controller PCI config space. This
136 * is used both to set PIO timings in PIO mode and also to set the
137 * matching PIO clocking for UDMA, as well as the MWDMA timings.
138 *
139 * LOCKING:
140 * None (inherited from caller).
141 */
142
143static void artop6210_load_piomode(struct ata_port *ap, struct ata_device *adev, unsigned int pio)
144{
145 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
146 int dn = adev->devno + 2 * ap->port_no;
147 const u16 timing[2][5] = {
148 { 0x0000, 0x000A, 0x0008, 0x0303, 0x0301 },
149 { 0x0700, 0x070A, 0x0708, 0x0403, 0x0401 }
150
151 };
152 /* Load the PIO timing active/recovery bits */
153 pci_write_config_word(pdev, 0x40 + 2 * dn, timing[clock][pio]);
154}
155
156/**
157 * artop6210_set_piomode - Initialize host controller PATA PIO timings
158 * @ap: Port whose timings we are configuring
159 * @adev: Device we are configuring
160 *
161 * Set PIO mode for device, in host controller PCI config space. For
162 * ARTOP we must also clear the UDMA bits if we are not doing UDMA. In
163 * the event UDMA is used the later call to set_dmamode will set the
164 * bits as required.
165 *
166 * LOCKING:
167 * None (inherited from caller).
168 */
169
170static void artop6210_set_piomode(struct ata_port *ap, struct ata_device *adev)
171{
172 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
173 int dn = adev->devno + 2 * ap->port_no;
174 u8 ultra;
175
176 artop6210_load_piomode(ap, adev, adev->pio_mode - XFER_PIO_0);
177
178 /* Clear the UDMA mode bits (set_dmamode will redo this if needed) */
179 pci_read_config_byte(pdev, 0x54, &ultra);
180 ultra &= ~(3 << (2 * dn));
181 pci_write_config_byte(pdev, 0x54, ultra);
182}
183
184/**
185 * artop6260_load_piomode - Initialize host controller PATA PIO timings
186 * @ap: Port whose timings we are configuring
187 * @adev: Device we are configuring
188 * @pio: PIO mode
189 *
190 * Set PIO mode for device, in host controller PCI config space. The
191 * ARTOP6260 and relatives store the timing data differently.
192 *
193 * LOCKING:
194 * None (inherited from caller).
195 */
196
197static void artop6260_load_piomode (struct ata_port *ap, struct ata_device *adev, unsigned int pio)
198{
199 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
200 int dn = adev->devno + 2 * ap->port_no;
201 const u8 timing[2][5] = {
202 { 0x00, 0x0A, 0x08, 0x33, 0x31 },
203 { 0x70, 0x7A, 0x78, 0x43, 0x41 }
204
205 };
206 /* Load the PIO timing active/recovery bits */
207 pci_write_config_byte(pdev, 0x40 + dn, timing[clock][pio]);
208}
209
210/**
211 * artop6260_set_piomode - Initialize host controller PATA PIO timings
212 * @ap: Port whose timings we are configuring
213 * @adev: Device we are configuring
214 *
215 * Set PIO mode for device, in host controller PCI config space. For
216 * ARTOP we must also clear the UDMA bits if we are not doing UDMA. In
217 * the event UDMA is used the later call to set_dmamode will set the
218 * bits as required.
219 *
220 * LOCKING:
221 * None (inherited from caller).
222 */
223
224static void artop6260_set_piomode(struct ata_port *ap, struct ata_device *adev)
225{
226 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
227 u8 ultra;
228
229 artop6260_load_piomode(ap, adev, adev->pio_mode - XFER_PIO_0);
230
231 /* Clear the UDMA mode bits (set_dmamode will redo this if needed) */
232 pci_read_config_byte(pdev, 0x44 + ap->port_no, &ultra);
233 ultra &= ~(7 << (4 * adev->devno)); /* One nibble per drive */
234 pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra);
235}
236
237/**
238 * artop6210_set_dmamode - Initialize host controller PATA PIO timings
239 * @ap: Port whose timings we are configuring
Jeff Garzika73984a2007-03-09 08:37:46 -0500240 * @adev: Device whose timings we are configuring
Jeff Garzik669a5db2006-08-29 18:12:40 -0400241 *
242 * Set DMA mode for device, in host controller PCI config space.
243 *
244 * LOCKING:
245 * None (inherited from caller).
246 */
247
248static void artop6210_set_dmamode (struct ata_port *ap, struct ata_device *adev)
249{
250 unsigned int pio;
251 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
252 int dn = adev->devno + 2 * ap->port_no;
253 u8 ultra;
254
255 if (adev->dma_mode == XFER_MW_DMA_0)
256 pio = 1;
257 else
258 pio = 4;
259
260 /* Load the PIO timing active/recovery bits */
261 artop6210_load_piomode(ap, adev, pio);
262
263 pci_read_config_byte(pdev, 0x54, &ultra);
264 ultra &= ~(3 << (2 * dn));
265
266 /* Add ultra DMA bits if in UDMA mode */
267 if (adev->dma_mode >= XFER_UDMA_0) {
268 u8 mode = (adev->dma_mode - XFER_UDMA_0) + 1 - clock;
269 if (mode == 0)
270 mode = 1;
271 ultra |= (mode << (2 * dn));
272 }
273 pci_write_config_byte(pdev, 0x54, ultra);
274}
275
276/**
277 * artop6260_set_dmamode - Initialize host controller PATA PIO timings
278 * @ap: Port whose timings we are configuring
279 * @adev: Device we are configuring
280 *
281 * Set DMA mode for device, in host controller PCI config space. The
282 * ARTOP6260 and relatives store the timing data differently.
283 *
284 * LOCKING:
285 * None (inherited from caller).
286 */
287
288static void artop6260_set_dmamode (struct ata_port *ap, struct ata_device *adev)
289{
290 unsigned int pio = adev->pio_mode - XFER_PIO_0;
291 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
292 u8 ultra;
293
294 if (adev->dma_mode == XFER_MW_DMA_0)
295 pio = 1;
296 else
297 pio = 4;
298
299 /* Load the PIO timing active/recovery bits */
300 artop6260_load_piomode(ap, adev, pio);
301
302 /* Add ultra DMA bits if in UDMA mode */
303 pci_read_config_byte(pdev, 0x44 + ap->port_no, &ultra);
304 ultra &= ~(7 << (4 * adev->devno)); /* One nibble per drive */
305 if (adev->dma_mode >= XFER_UDMA_0) {
306 u8 mode = adev->dma_mode - XFER_UDMA_0 + 1 - clock;
307 if (mode == 0)
308 mode = 1;
309 ultra |= (mode << (4 * adev->devno));
310 }
311 pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra);
312}
313
314static struct scsi_host_template artop_sht = {
315 .module = THIS_MODULE,
316 .name = DRV_NAME,
317 .ioctl = ata_scsi_ioctl,
318 .queuecommand = ata_scsi_queuecmd,
319 .can_queue = ATA_DEF_QUEUE,
320 .this_id = ATA_SHT_THIS_ID,
321 .sg_tablesize = LIBATA_MAX_PRD,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400322 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
323 .emulated = ATA_SHT_EMULATED,
324 .use_clustering = ATA_SHT_USE_CLUSTERING,
325 .proc_name = DRV_NAME,
326 .dma_boundary = ATA_DMA_BOUNDARY,
327 .slave_configure = ata_scsi_slave_config,
Tejun Heoafdfe892006-11-29 11:26:47 +0900328 .slave_destroy = ata_scsi_slave_destroy,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400329 .bios_param = ata_std_bios_param,
330};
331
332static const struct ata_port_operations artop6210_ops = {
333 .port_disable = ata_port_disable,
334 .set_piomode = artop6210_set_piomode,
335 .set_dmamode = artop6210_set_dmamode,
336 .mode_filter = ata_pci_default_filter,
337
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,
343
344 .freeze = ata_bmdma_freeze,
345 .thaw = ata_bmdma_thaw,
346 .error_handler = artop6210_error_handler,
347 .post_internal_cmd = ata_bmdma_post_internal_cmd,
Jeff Garzika73984a2007-03-09 08:37:46 -0500348 .cable_detect = ata_cable_40wire,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400349
350 .bmdma_setup = ata_bmdma_setup,
351 .bmdma_start = ata_bmdma_start,
352 .bmdma_stop = ata_bmdma_stop,
353 .bmdma_status = ata_bmdma_status,
354 .qc_prep = ata_qc_prep,
355 .qc_issue = ata_qc_issue_prot,
Jeff Garzikbda30282006-09-27 05:41:13 -0400356
Tejun Heo0d5ff562007-02-01 15:06:36 +0900357 .data_xfer = ata_data_xfer,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400358
359 .irq_handler = ata_interrupt,
360 .irq_clear = ata_bmdma_irq_clear,
Akira Iguchi246ce3b2007-01-26 16:27:58 +0900361 .irq_on = ata_irq_on,
362 .irq_ack = ata_irq_ack,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400363
364 .port_start = ata_port_start,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400365};
366
367static const struct ata_port_operations artop6260_ops = {
368 .port_disable = ata_port_disable,
369 .set_piomode = artop6260_set_piomode,
370 .set_dmamode = artop6260_set_dmamode,
371
372 .tf_load = ata_tf_load,
373 .tf_read = ata_tf_read,
374 .check_status = ata_check_status,
375 .exec_command = ata_exec_command,
376 .dev_select = ata_std_dev_select,
377
378 .freeze = ata_bmdma_freeze,
379 .thaw = ata_bmdma_thaw,
380 .error_handler = artop6260_error_handler,
381 .post_internal_cmd = ata_bmdma_post_internal_cmd,
Jeff Garzika73984a2007-03-09 08:37:46 -0500382 .cable_detect = artop6260_cable_detect,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400383
384 .bmdma_setup = ata_bmdma_setup,
385 .bmdma_start = ata_bmdma_start,
386 .bmdma_stop = ata_bmdma_stop,
387 .bmdma_status = ata_bmdma_status,
388 .qc_prep = ata_qc_prep,
389 .qc_issue = ata_qc_issue_prot,
Tejun Heo0d5ff562007-02-01 15:06:36 +0900390 .data_xfer = ata_data_xfer,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400391
Jeff Garzik669a5db2006-08-29 18:12:40 -0400392 .irq_handler = ata_interrupt,
393 .irq_clear = ata_bmdma_irq_clear,
Akira Iguchi246ce3b2007-01-26 16:27:58 +0900394 .irq_on = ata_irq_on,
395 .irq_ack = ata_irq_ack,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400396
397 .port_start = ata_port_start,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400398};
399
400
401/**
402 * artop_init_one - Register ARTOP ATA PCI device with kernel services
403 * @pdev: PCI device to register
404 * @ent: Entry in artop_pci_tbl matching with @pdev
405 *
406 * Called from kernel PCI layer.
407 *
408 * LOCKING:
409 * Inherited from PCI layer (may sleep).
410 *
411 * RETURNS:
412 * Zero on success, or -ERRNO value.
413 */
414
415static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
416{
417 static int printed_version;
Tejun Heo1626aeb2007-05-04 12:43:58 +0200418 static const struct ata_port_info info_6210 = {
Jeff Garzik669a5db2006-08-29 18:12:40 -0400419 .sht = &artop_sht,
Jeff Garzik1d2808f2007-05-28 06:59:48 -0400420 .flags = ATA_FLAG_SLAVE_POSS,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400421 .pio_mask = 0x1f, /* pio0-4 */
422 .mwdma_mask = 0x07, /* mwdma0-2 */
423 .udma_mask = ATA_UDMA2,
424 .port_ops = &artop6210_ops,
425 };
Tejun Heo1626aeb2007-05-04 12:43:58 +0200426 static const struct ata_port_info info_626x = {
Jeff Garzik669a5db2006-08-29 18:12:40 -0400427 .sht = &artop_sht,
Jeff Garzik1d2808f2007-05-28 06:59:48 -0400428 .flags = ATA_FLAG_SLAVE_POSS,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400429 .pio_mask = 0x1f, /* pio0-4 */
430 .mwdma_mask = 0x07, /* mwdma0-2 */
431 .udma_mask = ATA_UDMA4,
432 .port_ops = &artop6260_ops,
433 };
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +0200434 static const struct ata_port_info info_628x = {
Jeff Garzik669a5db2006-08-29 18:12:40 -0400435 .sht = &artop_sht,
Jeff Garzik1d2808f2007-05-28 06:59:48 -0400436 .flags = ATA_FLAG_SLAVE_POSS,
Jeff Garzik669a5db2006-08-29 18:12:40 -0400437 .pio_mask = 0x1f, /* pio0-4 */
438 .mwdma_mask = 0x07, /* mwdma0-2 */
439 .udma_mask = ATA_UDMA5,
440 .port_ops = &artop6260_ops,
441 };
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +0200442 static const struct ata_port_info info_628x_fast = {
443 .sht = &artop_sht,
444 .flags = ATA_FLAG_SLAVE_POSS,
445 .pio_mask = 0x1f, /* pio0-4 */
446 .mwdma_mask = 0x07, /* mwdma0-2 */
447 .udma_mask = ATA_UDMA6,
448 .port_ops = &artop6260_ops,
449 };
Tejun Heo1626aeb2007-05-04 12:43:58 +0200450 const struct ata_port_info *ppi[] = { NULL, NULL };
Jeff Garzik669a5db2006-08-29 18:12:40 -0400451
452 if (!printed_version++)
453 dev_printk(KERN_DEBUG, &pdev->dev,
454 "version " DRV_VERSION "\n");
455
456 if (id->driver_data == 0) { /* 6210 variant */
Tejun Heo1626aeb2007-05-04 12:43:58 +0200457 ppi[0] = &info_6210;
458 ppi[1] = &ata_dummy_port_info;
Jeff Garzik669a5db2006-08-29 18:12:40 -0400459 /* BIOS may have left us in UDMA, clear it before libata probe */
460 pci_write_config_byte(pdev, 0x54, 0);
461 /* For the moment (also lacks dsc) */
462 printk(KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n");
463 printk(KERN_WARNING "Secondary ATA ports will not be activated.\n");
Jeff Garzik669a5db2006-08-29 18:12:40 -0400464 }
465 else if (id->driver_data == 1) /* 6260 */
Tejun Heo1626aeb2007-05-04 12:43:58 +0200466 ppi[0] = &info_626x;
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +0200467 else if (id->driver_data == 2) { /* 6280 or 6280 + fast */
Jeff Garzik669a5db2006-08-29 18:12:40 -0400468 unsigned long io = pci_resource_start(pdev, 4);
469 u8 reg;
470
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +0200471 ppi[0] = &info_628x;
Jeff Garzik669a5db2006-08-29 18:12:40 -0400472 if (inb(io) & 0x10)
Bartlomiej Zolnierkiewiczbe456b72007-08-09 23:19:34 +0200473 ppi[0] = &info_628x_fast;
Jeff Garzik669a5db2006-08-29 18:12:40 -0400474 /* Mac systems come up with some registers not set as we
475 will need them */
476
477 /* Clear reset & test bits */
478 pci_read_config_byte(pdev, 0x49, &reg);
479 pci_write_config_byte(pdev, 0x49, reg & ~ 0x30);
480
481 /* PCI latency must be > 0x80 for burst mode, tweak it
482 * if required.
483 */
484 pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &reg);
485 if (reg <= 0x80)
486 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x90);
487
488 /* Enable IRQ output and burst mode */
489 pci_read_config_byte(pdev, 0x4a, &reg);
490 pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80);
491
492 }
Jeff Garzik15a7c3b2006-10-01 10:38:22 -0400493
Tejun Heo1626aeb2007-05-04 12:43:58 +0200494 BUG_ON(ppi[0] == NULL);
Jeff Garzik15a7c3b2006-10-01 10:38:22 -0400495
Tejun Heo1626aeb2007-05-04 12:43:58 +0200496 return ata_pci_init_one(pdev, ppi);
Jeff Garzik669a5db2006-08-29 18:12:40 -0400497}
498
499static const struct pci_device_id artop_pci_tbl[] = {
Jeff Garzik2d2744f2006-09-28 20:21:59 -0400500 { PCI_VDEVICE(ARTOP, 0x0005), 0 },
501 { PCI_VDEVICE(ARTOP, 0x0006), 1 },
502 { PCI_VDEVICE(ARTOP, 0x0007), 1 },
503 { PCI_VDEVICE(ARTOP, 0x0008), 2 },
504 { PCI_VDEVICE(ARTOP, 0x0009), 2 },
505
Jeff Garzik669a5db2006-08-29 18:12:40 -0400506 { } /* terminate list */
507};
508
509static struct pci_driver artop_pci_driver = {
510 .name = DRV_NAME,
511 .id_table = artop_pci_tbl,
512 .probe = artop_init_one,
513 .remove = ata_pci_remove_one,
514};
515
516static int __init artop_init(void)
517{
518 return pci_register_driver(&artop_pci_driver);
519}
520
521static void __exit artop_exit(void)
522{
523 pci_unregister_driver(&artop_pci_driver);
524}
525
Jeff Garzik669a5db2006-08-29 18:12:40 -0400526module_init(artop_init);
527module_exit(artop_exit);
528
529MODULE_AUTHOR("Alan Cox");
530MODULE_DESCRIPTION("SCSI low-level driver for ARTOP PATA");
531MODULE_LICENSE("GPL");
532MODULE_DEVICE_TABLE(pci, artop_pci_tbl);
533MODULE_VERSION(DRV_VERSION);
534