Blame view

drivers/ide/aec62xx.c 9.19 KB
09c434b8a   Thomas Gleixner   treewide: Add SPD...
1
  // SPDX-License-Identifier: GPL-2.0-only
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
   * Copyright (C) 1999-2002	Andre Hedrick <andre@linux-ide.org>
826a1b650   Sergei Shtylyov   aec62xx: fix PIO/...
4
   * Copyright (C) 2007		MontaVista Software, Inc. <source@mvista.com>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
6
7
8
   *
   */
  
  #include <linux/module.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
10
  #include <linux/types.h>
  #include <linux/pci.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
14
  #include <linux/ide.h>
  #include <linux/init.h>
  
  #include <asm/io.h>
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
15
  #define DRV_NAME "aec62xx"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
17
18
19
20
  struct chipset_bus_clock_list_entry {
  	u8 xfer_speed;
  	u8 chipset_settings;
  	u8 ultra_settings;
  };
f201f5046   Alan Cox   [PATCH] ide: hous...
21
  static const struct chipset_bus_clock_list_entry aec6xxx_33_base [] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  	{	XFER_UDMA_6,	0x31,	0x07	},
  	{	XFER_UDMA_5,	0x31,	0x06	},
  	{	XFER_UDMA_4,	0x31,	0x05	},
  	{	XFER_UDMA_3,	0x31,	0x04	},
  	{	XFER_UDMA_2,	0x31,	0x03	},
  	{	XFER_UDMA_1,	0x31,	0x02	},
  	{	XFER_UDMA_0,	0x31,	0x01	},
  
  	{	XFER_MW_DMA_2,	0x31,	0x00	},
  	{	XFER_MW_DMA_1,	0x31,	0x00	},
  	{	XFER_MW_DMA_0,	0x0a,	0x00	},
  	{	XFER_PIO_4,	0x31,	0x00	},
  	{	XFER_PIO_3,	0x33,	0x00	},
  	{	XFER_PIO_2,	0x08,	0x00	},
  	{	XFER_PIO_1,	0x0a,	0x00	},
  	{	XFER_PIO_0,	0x00,	0x00	},
  	{	0,		0x00,	0x00	}
  };
f201f5046   Alan Cox   [PATCH] ide: hous...
40
  static const struct chipset_bus_clock_list_entry aec6xxx_34_base [] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  	{	XFER_UDMA_6,	0x41,	0x06	},
  	{	XFER_UDMA_5,	0x41,	0x05	},
  	{	XFER_UDMA_4,	0x41,	0x04	},
  	{	XFER_UDMA_3,	0x41,	0x03	},
  	{	XFER_UDMA_2,	0x41,	0x02	},
  	{	XFER_UDMA_1,	0x41,	0x01	},
  	{	XFER_UDMA_0,	0x41,	0x01	},
  
  	{	XFER_MW_DMA_2,	0x41,	0x00	},
  	{	XFER_MW_DMA_1,	0x42,	0x00	},
  	{	XFER_MW_DMA_0,	0x7a,	0x00	},
  	{	XFER_PIO_4,	0x41,	0x00	},
  	{	XFER_PIO_3,	0x43,	0x00	},
  	{	XFER_PIO_2,	0x78,	0x00	},
  	{	XFER_PIO_1,	0x7a,	0x00	},
  	{	XFER_PIO_0,	0x70,	0x00	},
  	{	0,		0x00,	0x00	}
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  /*
   * TO DO: active tuning and correction of cards without a bios.
   */
  static u8 pci_bus_clock_list (u8 speed, struct chipset_bus_clock_list_entry * chipset_table)
  {
  	for ( ; chipset_table->xfer_speed ; chipset_table++)
  		if (chipset_table->xfer_speed == speed) {
  			return chipset_table->chipset_settings;
  		}
  	return chipset_table->chipset_settings;
  }
  
  static u8 pci_bus_clock_list_ultra (u8 speed, struct chipset_bus_clock_list_entry * chipset_table)
  {
  	for ( ; chipset_table->xfer_speed ; chipset_table++)
  		if (chipset_table->xfer_speed == speed) {
  			return chipset_table->ultra_settings;
  		}
  	return chipset_table->ultra_settings;
  }
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
79
  static void aec6210_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
80
  {
36501650e   Bartlomiej Zolnierkiewicz   ide: keep pointer...
81
  	struct pci_dev *dev	= to_pci_dev(hwif->dev);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
82
83
  	struct ide_host *host	= pci_get_drvdata(dev);
  	struct chipset_bus_clock_list_entry *bus_clock = host->host_priv;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
84
  	u16 d_conf		= 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
85
86
  	u8 ultra = 0, ultra_conf = 0;
  	u8 tmp0 = 0, tmp1 = 0, tmp2 = 0;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
87
  	const u8 speed = drive->dma_mode;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
88
89
90
91
92
  	unsigned long flags;
  
  	local_irq_save(flags);
  	/* 0x40|(2*drive->dn): Active, 0x41|(2*drive->dn): Recovery */
  	pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
93
  	tmp0 = pci_bus_clock_list(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
94
95
96
97
98
99
100
  	d_conf = ((tmp0 & 0xf0) << 4) | (tmp0 & 0xf);
  	pci_write_config_word(dev, 0x40|(2*drive->dn), d_conf);
  
  	tmp1 = 0x00;
  	tmp2 = 0x00;
  	pci_read_config_byte(dev, 0x54, &ultra);
  	tmp1 = ((0x00 << (2*drive->dn)) | (ultra & ~(3 << (2*drive->dn))));
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
101
  	ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102
103
104
  	tmp2 = ((ultra_conf << (2*drive->dn)) | (tmp1 & ~(3 << (2*drive->dn))));
  	pci_write_config_byte(dev, 0x54, tmp2);
  	local_irq_restore(flags);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
105
  }
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
106
  static void aec6260_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
107
  {
36501650e   Bartlomiej Zolnierkiewicz   ide: keep pointer...
108
  	struct pci_dev *dev	= to_pci_dev(hwif->dev);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
109
110
  	struct ide_host *host	= pci_get_drvdata(dev);
  	struct chipset_bus_clock_list_entry *bus_clock = host->host_priv;
123995b97   Bartlomiej Zolnierkiewicz   ide: use 'drive->...
111
  	u8 unit			= drive->dn & 1;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
112
113
  	u8 tmp1 = 0, tmp2 = 0;
  	u8 ultra = 0, drive_conf = 0, ultra_conf = 0;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
114
  	const u8 speed = drive->dma_mode;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
115
116
117
118
119
  	unsigned long flags;
  
  	local_irq_save(flags);
  	/* high 4-bits: Active, low 4-bits: Recovery */
  	pci_read_config_byte(dev, 0x40|drive->dn, &drive_conf);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
120
  	drive_conf = pci_bus_clock_list(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
121
122
123
124
  	pci_write_config_byte(dev, 0x40|drive->dn, drive_conf);
  
  	pci_read_config_byte(dev, (0x44|hwif->channel), &ultra);
  	tmp1 = ((0x00 << (4*unit)) | (ultra & ~(7 << (4*unit))));
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
125
  	ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
126
127
128
  	tmp2 = ((ultra_conf << (4*unit)) | (tmp1 & ~(7 << (4*unit))));
  	pci_write_config_byte(dev, (0x44|hwif->channel), tmp2);
  	local_irq_restore(flags);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
129
  }
e085b3cae   Bartlomiej Zolnierkiewicz   ide: change ->set...
130
  static void aec_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
131
  {
e085b3cae   Bartlomiej Zolnierkiewicz   ide: change ->set...
132
  	drive->dma_mode = drive->pio_mode;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
133
  	hwif->port_ops->set_dma_mode(hwif, drive);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
134
  }
2ed0ef543   Bartlomiej Zolnierkiewicz   ide: fix ->init_c...
135
  static int init_chipset_aec62xx(struct pci_dev *dev)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
136
  {
d237bf492   Thibaut VARENE   [PATCH] ide: rest...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  	/* These are necessary to get AEC6280 Macintosh cards to work */
  	if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) ||
  	    (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R)) {
  		u8 reg49h = 0, reg4ah = 0;
  		/* Clear reset and test bits.  */
  		pci_read_config_byte(dev, 0x49, &reg49h);
  		pci_write_config_byte(dev, 0x49, reg49h & ~0x30);
  		/* Enable chip interrupt output.  */
  		pci_read_config_byte(dev, 0x4a, &reg4ah);
  		pci_write_config_byte(dev, 0x4a, reg4ah & ~0x01);
  		/* Enable burst mode. */
  		pci_read_config_byte(dev, 0x4a, &reg4ah);
  		pci_write_config_byte(dev, 0x4a, reg4ah | 0x80);
  	}
2ed0ef543   Bartlomiej Zolnierkiewicz   ide: fix ->init_c...
151
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
152
  }
f454cbe8c   Bartlomiej Zolnierkiewicz   ide: ->cable_dete...
153
  static u8 atp86x_cable_detect(ide_hwif_t *hwif)
bfa14b42a   Bartlomiej Zolnierkiewicz   ide: add ->cable_...
154
155
156
157
158
159
160
161
  {
  	struct pci_dev *dev = to_pci_dev(hwif->dev);
  	u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
  
  	pci_read_config_byte(dev, 0x49, &ata66);
  
  	return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
  }
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
162
163
164
165
  static const struct ide_port_ops atp850_port_ops = {
  	.set_pio_mode		= aec_set_pio_mode,
  	.set_dma_mode		= aec6210_set_mode,
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
166

ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
167
168
169
170
171
  static const struct ide_port_ops atp86x_port_ops = {
  	.set_pio_mode		= aec_set_pio_mode,
  	.set_dma_mode		= aec6260_set_mode,
  	.cable_detect		= atp86x_cable_detect,
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
172

fe31edc8a   Greg Kroah-Hartman   Drivers: ide: rem...
173
  static const struct ide_port_info aec62xx_chipsets[] = {
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
174
175
  	{	/* 0: AEC6210 */
  		.name		= DRV_NAME,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
176
  		.init_chipset	= init_chipset_aec62xx,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
177
  		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
178
  		.port_ops	= &atp850_port_ops,
1c51361a9   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
179
180
  		.host_flags	= IDE_HFLAG_SERIALIZE |
  				  IDE_HFLAG_NO_ATAPI_DMA |
4166c1993   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
181
  				  IDE_HFLAG_NO_DSC |
1c51361a9   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
182
  				  IDE_HFLAG_OFF_BOARD,
4099d1432   Bartlomiej Zolnierkiewicz   ide: add PIO masks
183
  		.pio_mask	= ATA_PIO4,
5f8b6c348   Bartlomiej Zolnierkiewicz   ide: add ->mwdma_...
184
185
  		.mwdma_mask	= ATA_MWDMA2,
  		.udma_mask	= ATA_UDMA2,
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
186
187
188
  	},
  	{	/* 1: AEC6260 */
  		.name		= DRV_NAME,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
189
  		.init_chipset	= init_chipset_aec62xx,
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
190
  		.port_ops	= &atp86x_port_ops,
47b687882   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
191
192
  		.host_flags	= IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
  				  IDE_HFLAG_OFF_BOARD,
4099d1432   Bartlomiej Zolnierkiewicz   ide: add PIO masks
193
  		.pio_mask	= ATA_PIO4,
5f8b6c348   Bartlomiej Zolnierkiewicz   ide: add ->mwdma_...
194
195
  		.mwdma_mask	= ATA_MWDMA2,
  		.udma_mask	= ATA_UDMA4,
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
196
197
198
  	},
  	{	/* 2: AEC6260R */
  		.name		= DRV_NAME,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
199
  		.init_chipset	= init_chipset_aec62xx,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
200
  		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
201
  		.port_ops	= &atp86x_port_ops,
4db90a145   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
202
  		.host_flags	= IDE_HFLAG_NO_ATAPI_DMA |
5e71d9c5a   Bartlomiej Zolnierkiewicz   ide: IDE_HFLAG_BO...
203
  				  IDE_HFLAG_NON_BOOTABLE,
4099d1432   Bartlomiej Zolnierkiewicz   ide: add PIO masks
204
  		.pio_mask	= ATA_PIO4,
5f8b6c348   Bartlomiej Zolnierkiewicz   ide: add ->mwdma_...
205
206
  		.mwdma_mask	= ATA_MWDMA2,
  		.udma_mask	= ATA_UDMA4,
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
207
208
209
  	},
  	{	/* 3: AEC6280 */
  		.name		= DRV_NAME,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
210
  		.init_chipset	= init_chipset_aec62xx,
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
211
  		.port_ops	= &atp86x_port_ops,
4db90a145   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
212
  		.host_flags	= IDE_HFLAG_NO_ATAPI_DMA |
4db90a145   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
213
  				  IDE_HFLAG_OFF_BOARD,
4099d1432   Bartlomiej Zolnierkiewicz   ide: add PIO masks
214
  		.pio_mask	= ATA_PIO4,
5f8b6c348   Bartlomiej Zolnierkiewicz   ide: add ->mwdma_...
215
216
  		.mwdma_mask	= ATA_MWDMA2,
  		.udma_mask	= ATA_UDMA5,
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
217
218
219
  	},
  	{	/* 4: AEC6280R */
  		.name		= DRV_NAME,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
220
  		.init_chipset	= init_chipset_aec62xx,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
221
  		.enablebits	= {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
222
  		.port_ops	= &atp86x_port_ops,
4db90a145   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
223
  		.host_flags	= IDE_HFLAG_NO_ATAPI_DMA |
4db90a145   Bartlomiej Zolnierkiewicz   ide: add IDE_HFLA...
224
  				  IDE_HFLAG_OFF_BOARD,
4099d1432   Bartlomiej Zolnierkiewicz   ide: add PIO masks
225
  		.pio_mask	= ATA_PIO4,
5f8b6c348   Bartlomiej Zolnierkiewicz   ide: add ->mwdma_...
226
227
  		.mwdma_mask	= ATA_MWDMA2,
  		.udma_mask	= ATA_UDMA5,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
228
229
230
231
232
233
234
235
236
237
  	}
  };
  
  /**
   *	aec62xx_init_one	-	called when a AEC is found
   *	@dev: the aec62xx device
   *	@id: the matching pci id
   *
   *	Called when the PCI registration layer (or the IDE initialization)
   *	finds a device matching our IDE device tables.
b1d19db4e   Sergei Shtylyov   aec62xx: rework i...
238
239
   *
   *	NOTE: since we're going to modify the 'name' field for AEC-6[26]80[R]
039788e15   Bartlomiej Zolnierkiewicz   ide: replace ide_...
240
   *	chips, pass a local copy of 'struct ide_port_info' down the call chain.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
241
   */
039788e15   Bartlomiej Zolnierkiewicz   ide: replace ide_...
242

fe31edc8a   Greg Kroah-Hartman   Drivers: ide: rem...
243
  static int aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
244
  {
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
245
  	const struct chipset_bus_clock_list_entry *bus_clock;
039788e15   Bartlomiej Zolnierkiewicz   ide: replace ide_...
246
  	struct ide_port_info d;
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
247
  	u8 idx = id->driver_data;
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
248
  	int bus_speed = ide_pci_clk ? ide_pci_clk : 33;
b48d08177   Aleksandar Radovanovic   aec62xx: Fix kern...
249
  	int err;
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
250
251
252
253
  	if (bus_speed <= 33)
  		bus_clock = aec6xxx_33_base;
  	else
  		bus_clock = aec6xxx_34_base;
b48d08177   Aleksandar Radovanovic   aec62xx: Fix kern...
254
255
256
  	err = pci_enable_device(dev);
  	if (err)
  		return err;
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
257
258
259
260
261
262
263
  
  	d = aec62xx_chipsets[idx];
  
  	if (idx == 3 || idx == 4) {
  		unsigned long dma_base = pci_resource_start(dev, 4);
  
  		if (inb(dma_base + 2) & 0x10) {
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
264
265
266
  			printk(KERN_INFO DRV_NAME " %s: AEC6880%s card detected"
  				"
  ", pci_name(dev), (idx == 4) ? "R" : "");
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
267
268
269
  			d.udma_mask = ATA_UDMA6;
  		}
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
270

60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
271
  	err = ide_pci_init_one(dev, &d, (void *)bus_clock);
b48d08177   Aleksandar Radovanovic   aec62xx: Fix kern...
272
273
274
275
  	if (err)
  		pci_disable_device(dev);
  
  	return err;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
276
  }
fe31edc8a   Greg Kroah-Hartman   Drivers: ide: rem...
277
  static void aec62xx_remove(struct pci_dev *dev)
eb7cb98b1   Bartlomiej Zolnierkiewicz   aec62xx: add ->re...
278
279
280
281
  {
  	ide_pci_remove(dev);
  	pci_disable_device(dev);
  }
9cbcc5e3c   Bartlomiej Zolnierkiewicz   ide: use PCI_VDEV...
282
283
284
285
286
287
  static const struct pci_device_id aec62xx_pci_tbl[] = {
  	{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF), 0 },
  	{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP860),   1 },
  	{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R),  2 },
  	{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP865),   3 },
  	{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R),  4 },
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
288
289
290
  	{ 0, },
  };
  MODULE_DEVICE_TABLE(pci, aec62xx_pci_tbl);
a9ab09e26   Bartlomiej Zolnierkiewicz   ide: use unique n...
291
  static struct pci_driver aec62xx_pci_driver = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
292
293
294
  	.name		= "AEC62xx_IDE",
  	.id_table	= aec62xx_pci_tbl,
  	.probe		= aec62xx_init_one,
fe31edc8a   Greg Kroah-Hartman   Drivers: ide: rem...
295
  	.remove		= aec62xx_remove,
feb22b7f8   Bartlomiej Zolnierkiewicz   ide: add proper P...
296
297
  	.suspend	= ide_pci_suspend,
  	.resume		= ide_pci_resume,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
298
  };
82ab1eece   Bartlomiej Zolnierkiewicz   ide: add missing ...
299
  static int __init aec62xx_ide_init(void)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
300
  {
a9ab09e26   Bartlomiej Zolnierkiewicz   ide: use unique n...
301
  	return ide_pci_register_driver(&aec62xx_pci_driver);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
302
  }
eb7cb98b1   Bartlomiej Zolnierkiewicz   aec62xx: add ->re...
303
304
  static void __exit aec62xx_ide_exit(void)
  {
a9ab09e26   Bartlomiej Zolnierkiewicz   ide: use unique n...
305
  	pci_unregister_driver(&aec62xx_pci_driver);
eb7cb98b1   Bartlomiej Zolnierkiewicz   aec62xx: add ->re...
306
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
307
  module_init(aec62xx_ide_init);
eb7cb98b1   Bartlomiej Zolnierkiewicz   aec62xx: add ->re...
308
  module_exit(aec62xx_ide_exit);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
309
310
311
312
  
  MODULE_AUTHOR("Andre Hedrick");
  MODULE_DESCRIPTION("PCI driver module for ARTOP AEC62xx IDE");
  MODULE_LICENSE("GPL");