Blame view

drivers/ide/aec62xx.c 9.2 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
   * Copyright (C) 1999-2002	Andre Hedrick <andre@linux-ide.org>
826a1b650   Sergei Shtylyov   aec62xx: fix PIO/...
3
   * Copyright (C) 2007		MontaVista Software, Inc. <source@mvista.com>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
4
5
6
7
   *
   */
  
  #include <linux/module.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
8
9
  #include <linux/types.h>
  #include <linux/pci.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
11
12
13
  #include <linux/ide.h>
  #include <linux/init.h>
  
  #include <asm/io.h>
ced3ec8aa   Bartlomiej Zolnierkiewicz   ide: prefix messa...
14
  #define DRV_NAME "aec62xx"
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15
16
17
18
19
  struct chipset_bus_clock_list_entry {
  	u8 xfer_speed;
  	u8 chipset_settings;
  	u8 ultra_settings;
  };
f201f5046   Alan Cox   [PATCH] ide: hous...
20
  static const struct chipset_bus_clock_list_entry aec6xxx_33_base [] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  	{	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...
39
  static const struct chipset_bus_clock_list_entry aec6xxx_34_base [] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  	{	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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
  /*
   * 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...
78
  static void aec6210_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
79
  {
36501650e   Bartlomiej Zolnierkiewicz   ide: keep pointer...
80
  	struct pci_dev *dev	= to_pci_dev(hwif->dev);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
81
82
  	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
83
  	u16 d_conf		= 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
84
85
  	u8 ultra = 0, ultra_conf = 0;
  	u8 tmp0 = 0, tmp1 = 0, tmp2 = 0;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
86
  	const u8 speed = drive->dma_mode;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
87
88
89
90
91
  	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 ...
92
  	tmp0 = pci_bus_clock_list(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
93
94
95
96
97
98
99
  	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 ...
100
  	ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
101
102
103
  	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
104
  }
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
105
  static void aec6260_set_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
106
  {
36501650e   Bartlomiej Zolnierkiewicz   ide: keep pointer...
107
  	struct pci_dev *dev	= to_pci_dev(hwif->dev);
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
108
109
  	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->...
110
  	u8 unit			= drive->dn & 1;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
111
112
  	u8 tmp1 = 0, tmp2 = 0;
  	u8 ultra = 0, drive_conf = 0, ultra_conf = 0;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
113
  	const u8 speed = drive->dma_mode;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
114
115
116
117
118
  	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 ...
119
  	drive_conf = pci_bus_clock_list(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
120
121
122
123
  	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 ...
124
  	ultra_conf = pci_bus_clock_list_ultra(speed, bus_clock);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
125
126
127
  	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
128
  }
e085b3cae   Bartlomiej Zolnierkiewicz   ide: change ->set...
129
  static void aec_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
130
  {
e085b3cae   Bartlomiej Zolnierkiewicz   ide: change ->set...
131
  	drive->dma_mode = drive->pio_mode;
8776168ca   Bartlomiej Zolnierkiewicz   ide: change ->set...
132
  	hwif->port_ops->set_dma_mode(hwif, drive);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
133
  }
2ed0ef543   Bartlomiej Zolnierkiewicz   ide: fix ->init_c...
134
  static int init_chipset_aec62xx(struct pci_dev *dev)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
135
  {
d237bf492   Thibaut VARENE   [PATCH] ide: rest...
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  	/* 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...
150
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
151
  }
f454cbe8c   Bartlomiej Zolnierkiewicz   ide: ->cable_dete...
152
  static u8 atp86x_cable_detect(ide_hwif_t *hwif)
bfa14b42a   Bartlomiej Zolnierkiewicz   ide: add ->cable_...
153
154
155
156
157
158
159
160
  {
  	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...
161
162
163
164
  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
165

ac95beedf   Bartlomiej Zolnierkiewicz   ide: add struct i...
166
167
168
169
170
  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
171

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

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
242
243
  static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
  {
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
244
  	const struct chipset_bus_clock_list_entry *bus_clock;
039788e15   Bartlomiej Zolnierkiewicz   ide: replace ide_...
245
  	struct ide_port_info d;
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
246
  	u8 idx = id->driver_data;
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
247
  	int bus_speed = ide_pci_clk ? ide_pci_clk : 33;
b48d08177   Aleksandar Radovanovic   aec62xx: Fix kern...
248
  	int err;
60e57ed7c   Bartlomiej Zolnierkiewicz   aec62xx: convert ...
249
250
251
252
  	if (bus_speed <= 33)
  		bus_clock = aec6xxx_33_base;
  	else
  		bus_clock = aec6xxx_34_base;
b48d08177   Aleksandar Radovanovic   aec62xx: Fix kern...
253
254
255
  	err = pci_enable_device(dev);
  	if (err)
  		return err;
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
256
257
258
259
260
261
262
  
  	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...
263
264
265
  			printk(KERN_INFO DRV_NAME " %s: AEC6880%s card detected"
  				"
  ", pci_name(dev), (idx == 4) ? "R" : "");
df95f5ab5   Bartlomiej Zolnierkiewicz   aec62xx: remove -...
266
267
268
  			d.udma_mask = ATA_UDMA6;
  		}
  	}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
269

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