aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_hpt366.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_hpt366.c')
-rw-r--r--drivers/ata/pata_hpt366.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index e54a0c51681d..94bb1dfc3f19 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -168,7 +168,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, cons
168 168
169 while(list[i] != NULL) { 169 while(list[i] != NULL) {
170 if (!strncmp(list[i], s, len)) { 170 if (!strncmp(list[i], s, len)) {
171 printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", 171 printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n",
172 modestr, list[i]); 172 modestr, list[i]);
173 return 1; 173 return 1;
174 } 174 }
@@ -184,7 +184,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, cons
184 * 184 *
185 * Block UDMA on devices that cause trouble with this controller. 185 * Block UDMA on devices that cause trouble with this controller.
186 */ 186 */
187 187
188static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 188static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
189{ 189{
190 if (adev->class == ATA_DEV_ATA) { 190 if (adev->class == ATA_DEV_ATA) {
@@ -206,11 +206,11 @@ static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device
206 * Return the 32bit register programming information for this channel 206 * Return the 32bit register programming information for this channel
207 * that matches the speed provided. 207 * that matches the speed provided.
208 */ 208 */
209 209
210static u32 hpt36x_find_mode(struct ata_port *ap, int speed) 210static u32 hpt36x_find_mode(struct ata_port *ap, int speed)
211{ 211{
212 struct hpt_clock *clocks = ap->host->private_data; 212 struct hpt_clock *clocks = ap->host->private_data;
213 213
214 while(clocks->xfer_speed) { 214 while(clocks->xfer_speed) {
215 if (clocks->xfer_speed == speed) 215 if (clocks->xfer_speed == speed)
216 return clocks->timing; 216 return clocks->timing;
@@ -219,12 +219,12 @@ static u32 hpt36x_find_mode(struct ata_port *ap, int speed)
219 BUG(); 219 BUG();
220 return 0xffffffffU; /* silence compiler warning */ 220 return 0xffffffffU; /* silence compiler warning */
221} 221}
222 222
223static int hpt36x_pre_reset(struct ata_port *ap) 223static int hpt36x_pre_reset(struct ata_port *ap)
224{ 224{
225 u8 ata66; 225 u8 ata66;
226 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 226 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
227 227
228 pci_read_config_byte(pdev, 0x5A, &ata66); 228 pci_read_config_byte(pdev, 0x5A, &ata66);
229 if (ata66 & (1 << ap->port_no)) 229 if (ata66 & (1 << ap->port_no))
230 ap->cbl = ATA_CBL_PATA40; 230 ap->cbl = ATA_CBL_PATA40;
@@ -239,7 +239,7 @@ static int hpt36x_pre_reset(struct ata_port *ap)
239 * 239 *
240 * Perform the reset handling for the 366/368 240 * Perform the reset handling for the 366/368
241 */ 241 */
242 242
243static void hpt36x_error_handler(struct ata_port *ap) 243static void hpt36x_error_handler(struct ata_port *ap)
244{ 244{
245 ata_bmdma_drive_eh(ap, hpt36x_pre_reset, ata_std_softreset, NULL, ata_std_postreset); 245 ata_bmdma_drive_eh(ap, hpt36x_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
@@ -250,9 +250,9 @@ static void hpt36x_error_handler(struct ata_port *ap)
250 * @ap: ATA interface 250 * @ap: ATA interface
251 * @adev: device on the interface 251 * @adev: device on the interface
252 * 252 *
253 * Perform PIO mode setup. 253 * Perform PIO mode setup.
254 */ 254 */
255 255
256static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev) 256static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
257{ 257{
258 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 258 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -263,14 +263,14 @@ static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
263 263
264 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no); 264 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
265 addr2 = 0x51 + 4 * ap->port_no; 265 addr2 = 0x51 + 4 * ap->port_no;
266 266
267 /* Fast interrupt prediction disable, hold off interrupt disable */ 267 /* Fast interrupt prediction disable, hold off interrupt disable */
268 pci_read_config_byte(pdev, addr2, &fast); 268 pci_read_config_byte(pdev, addr2, &fast);
269 if (fast & 0x80) { 269 if (fast & 0x80) {
270 fast &= ~0x80; 270 fast &= ~0x80;
271 pci_write_config_byte(pdev, addr2, fast); 271 pci_write_config_byte(pdev, addr2, fast);
272 } 272 }
273 273
274 pci_read_config_dword(pdev, addr1, &reg); 274 pci_read_config_dword(pdev, addr1, &reg);
275 mode = hpt36x_find_mode(ap, adev->pio_mode); 275 mode = hpt36x_find_mode(ap, adev->pio_mode);
276 mode &= ~0x8000000; /* No FIFO in PIO */ 276 mode &= ~0x8000000; /* No FIFO in PIO */
@@ -287,7 +287,7 @@ static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
287 * Set up the channel for MWDMA or UDMA modes. Much the same as with 287 * Set up the channel for MWDMA or UDMA modes. Much the same as with
288 * PIO, load the mode number and then set MWDMA or UDMA flag. 288 * PIO, load the mode number and then set MWDMA or UDMA flag.
289 */ 289 */
290 290
291static void hpt366_set_dmamode(struct ata_port *ap, struct ata_device *adev) 291static void hpt366_set_dmamode(struct ata_port *ap, struct ata_device *adev)
292{ 292{
293 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 293 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
@@ -298,14 +298,14 @@ static void hpt366_set_dmamode(struct ata_port *ap, struct ata_device *adev)
298 298
299 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no); 299 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
300 addr2 = 0x51 + 4 * ap->port_no; 300 addr2 = 0x51 + 4 * ap->port_no;
301 301
302 /* Fast interrupt prediction disable, hold off interrupt disable */ 302 /* Fast interrupt prediction disable, hold off interrupt disable */
303 pci_read_config_byte(pdev, addr2, &fast); 303 pci_read_config_byte(pdev, addr2, &fast);
304 if (fast & 0x80) { 304 if (fast & 0x80) {
305 fast &= ~0x80; 305 fast &= ~0x80;
306 pci_write_config_byte(pdev, addr2, fast); 306 pci_write_config_byte(pdev, addr2, fast);
307 } 307 }
308 308
309 pci_read_config_dword(pdev, addr1, &reg); 309 pci_read_config_dword(pdev, addr1, &reg);
310 mode = hpt36x_find_mode(ap, adev->dma_mode); 310 mode = hpt36x_find_mode(ap, adev->dma_mode);
311 mode |= 0x8000000; /* FIFO in MWDMA or UDMA */ 311 mode |= 0x8000000; /* FIFO in MWDMA or UDMA */
@@ -335,13 +335,13 @@ static struct scsi_host_template hpt36x_sht = {
335/* 335/*
336 * Configuration for HPT366/68 336 * Configuration for HPT366/68
337 */ 337 */
338 338
339static struct ata_port_operations hpt366_port_ops = { 339static struct ata_port_operations hpt366_port_ops = {
340 .port_disable = ata_port_disable, 340 .port_disable = ata_port_disable,
341 .set_piomode = hpt366_set_piomode, 341 .set_piomode = hpt366_set_piomode,
342 .set_dmamode = hpt366_set_dmamode, 342 .set_dmamode = hpt366_set_dmamode,
343 .mode_filter = hpt366_filter, 343 .mode_filter = hpt366_filter,
344 344
345 .tf_load = ata_tf_load, 345 .tf_load = ata_tf_load,
346 .tf_read = ata_tf_read, 346 .tf_read = ata_tf_read,
347 .check_status = ata_check_status, 347 .check_status = ata_check_status,
@@ -369,7 +369,7 @@ static struct ata_port_operations hpt366_port_ops = {
369 .port_start = ata_port_start, 369 .port_start = ata_port_start,
370 .port_stop = ata_port_stop, 370 .port_stop = ata_port_stop,
371 .host_stop = ata_host_stop 371 .host_stop = ata_host_stop
372}; 372};
373 373
374/** 374/**
375 * hpt36x_init_one - Initialise an HPT366/368 375 * hpt36x_init_one - Initialise an HPT366/368
@@ -391,7 +391,7 @@ static struct ata_port_operations hpt366_port_ops = {
391 * HPT37x/30x 4 (HPT366) 3+ Other driver 391 * HPT37x/30x 4 (HPT366) 3+ Other driver
392 * 392 *
393 */ 393 */
394 394
395static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) 395static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
396{ 396{
397 static struct ata_port_info info_hpt366 = { 397 static struct ata_port_info info_hpt366 = {
@@ -410,7 +410,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
410 410
411 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); 411 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
412 class_rev &= 0xFF; 412 class_rev &= 0xFF;
413 413
414 /* May be a later chip in disguise. Check */ 414 /* May be a later chip in disguise. Check */
415 /* Newer chips are not in the HPT36x driver. Ignore them */ 415 /* Newer chips are not in the HPT36x driver. Ignore them */
416 if (class_rev > 2) 416 if (class_rev > 2)
@@ -426,7 +426,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
426 pci_write_config_byte(dev, 0x51, drive_fast & ~0x80); 426 pci_write_config_byte(dev, 0x51, drive_fast & ~0x80);
427 427
428 pci_read_config_dword(dev, 0x40, &reg1); 428 pci_read_config_dword(dev, 0x40, &reg1);
429 429
430 /* PCI clocking determines the ATA timing values to use */ 430 /* PCI clocking determines the ATA timing values to use */
431 /* info_hpt366 is safe against re-entry so we can scribble on it */ 431 /* info_hpt366 is safe against re-entry so we can scribble on it */
432 switch(reg1 & 0x700) { 432 switch(reg1 & 0x700) {