aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ali.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_ali.c')
-rw-r--r--drivers/ata/pata_ali.c74
1 files changed, 12 insertions, 62 deletions
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 11ea552a58ca..d40edebb510a 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -34,7 +34,7 @@
34#include <linux/dmi.h> 34#include <linux/dmi.h>
35 35
36#define DRV_NAME "pata_ali" 36#define DRV_NAME "pata_ali"
37#define DRV_VERSION "0.7.3" 37#define DRV_VERSION "0.7.4"
38 38
39/* 39/*
40 * Cable special cases 40 * Cable special cases
@@ -90,59 +90,6 @@ static int ali_c2_cable_detect(struct ata_port *ap)
90} 90}
91 91
92/** 92/**
93 * ali_early_error_handler - reset for eary chip
94 * @ap: ATA port
95 *
96 * Handle the reset callback for the later chips with cable detect
97 */
98
99static int ali_c2_pre_reset(struct ata_port *ap)
100{
101 ap->cbl = ali_c2_cable_detect(ap);
102 return ata_std_prereset(ap);
103}
104
105static void ali_c2_error_handler(struct ata_port *ap)
106{
107 ata_bmdma_drive_eh(ap, ali_c2_pre_reset,
108 ata_std_softreset, NULL,
109 ata_std_postreset);
110}
111
112/**
113 * ali_early_cable_detect - cable detection
114 * @ap: ATA port
115 *
116 * Perform cable detection for older chipsets. This turns out to be
117 * rather easy to implement
118 */
119
120static int ali_early_cable_detect(struct ata_port *ap)
121{
122 return ATA_CBL_PATA40;
123}
124
125/**
126 * ali_early_probe_init - reset for early chip
127 * @ap: ATA port
128 *
129 * Handle the reset callback for the early (pre cable detect) chips.
130 */
131
132static int ali_early_pre_reset(struct ata_port *ap)
133{
134 ap->cbl = ali_early_cable_detect(ap);
135 return ata_std_prereset(ap);
136}
137
138static void ali_early_error_handler(struct ata_port *ap)
139{
140 return ata_bmdma_drive_eh(ap, ali_early_pre_reset,
141 ata_std_softreset, NULL,
142 ata_std_postreset);
143}
144
145/**
146 * ali_20_filter - filter for earlier ALI DMA 93 * ali_20_filter - filter for earlier ALI DMA
147 * @ap: ALi ATA port 94 * @ap: ALi ATA port
148 * @adev: attached device 95 * @adev: attached device
@@ -151,7 +98,7 @@ static void ali_early_error_handler(struct ata_port *ap)
151 * fix that later on. Also ensure we do not do UDMA on WDC drives 98 * fix that later on. Also ensure we do not do UDMA on WDC drives
152 */ 99 */
153 100
154static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 101static unsigned long ali_20_filter(struct ata_device *adev, unsigned long mask)
155{ 102{
156 char model_num[ATA_ID_PROD_LEN + 1]; 103 char model_num[ATA_ID_PROD_LEN + 1];
157 /* No DMA on anything but a disk for now */ 104 /* No DMA on anything but a disk for now */
@@ -160,7 +107,7 @@ static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device
160 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 107 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
161 if (strstr(model_num, "WDC")) 108 if (strstr(model_num, "WDC"))
162 return mask &= ~ATA_MASK_UDMA; 109 return mask &= ~ATA_MASK_UDMA;
163 return ata_pci_default_filter(ap, adev, mask); 110 return ata_pci_default_filter(adev, mask);
164} 111}
165 112
166/** 113/**
@@ -314,7 +261,6 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
314 261
315/** 262/**
316 * ali_lock_sectors - Keep older devices to 255 sector mode 263 * ali_lock_sectors - Keep older devices to 255 sector mode
317 * @ap: ATA port
318 * @adev: Device 264 * @adev: Device
319 * 265 *
320 * Called during the bus probe for each device that is found. We use 266 * Called during the bus probe for each device that is found. We use
@@ -324,7 +270,7 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
324 * slower PIO methods 270 * slower PIO methods
325 */ 271 */
326 272
327static void ali_lock_sectors(struct ata_port *ap, struct ata_device *adev) 273static void ali_lock_sectors(struct ata_device *adev)
328{ 274{
329 adev->max_sectors = 255; 275 adev->max_sectors = 255;
330} 276}
@@ -366,8 +312,9 @@ static struct ata_port_operations ali_early_port_ops = {
366 312
367 .freeze = ata_bmdma_freeze, 313 .freeze = ata_bmdma_freeze,
368 .thaw = ata_bmdma_thaw, 314 .thaw = ata_bmdma_thaw,
369 .error_handler = ali_early_error_handler, 315 .error_handler = ata_bmdma_error_handler,
370 .post_internal_cmd = ata_bmdma_post_internal_cmd, 316 .post_internal_cmd = ata_bmdma_post_internal_cmd,
317 .cable_detect = ata_cable_40wire,
371 318
372 .qc_prep = ata_qc_prep, 319 .qc_prep = ata_qc_prep,
373 .qc_issue = ata_qc_issue_prot, 320 .qc_issue = ata_qc_issue_prot,
@@ -402,8 +349,9 @@ static struct ata_port_operations ali_20_port_ops = {
402 349
403 .freeze = ata_bmdma_freeze, 350 .freeze = ata_bmdma_freeze,
404 .thaw = ata_bmdma_thaw, 351 .thaw = ata_bmdma_thaw,
405 .error_handler = ali_early_error_handler, 352 .error_handler = ata_bmdma_error_handler,
406 .post_internal_cmd = ata_bmdma_post_internal_cmd, 353 .post_internal_cmd = ata_bmdma_post_internal_cmd,
354 .cable_detect = ata_cable_40wire,
407 355
408 .bmdma_setup = ata_bmdma_setup, 356 .bmdma_setup = ata_bmdma_setup,
409 .bmdma_start = ata_bmdma_start, 357 .bmdma_start = ata_bmdma_start,
@@ -440,8 +388,9 @@ static struct ata_port_operations ali_c2_port_ops = {
440 388
441 .freeze = ata_bmdma_freeze, 389 .freeze = ata_bmdma_freeze,
442 .thaw = ata_bmdma_thaw, 390 .thaw = ata_bmdma_thaw,
443 .error_handler = ali_c2_error_handler, 391 .error_handler = ata_bmdma_error_handler,
444 .post_internal_cmd = ata_bmdma_post_internal_cmd, 392 .post_internal_cmd = ata_bmdma_post_internal_cmd,
393 .cable_detect = ali_c2_cable_detect,
445 394
446 .bmdma_setup = ata_bmdma_setup, 395 .bmdma_setup = ata_bmdma_setup,
447 .bmdma_start = ata_bmdma_start, 396 .bmdma_start = ata_bmdma_start,
@@ -477,8 +426,9 @@ static struct ata_port_operations ali_c5_port_ops = {
477 426
478 .freeze = ata_bmdma_freeze, 427 .freeze = ata_bmdma_freeze,
479 .thaw = ata_bmdma_thaw, 428 .thaw = ata_bmdma_thaw,
480 .error_handler = ali_c2_error_handler, 429 .error_handler = ata_bmdma_error_handler,
481 .post_internal_cmd = ata_bmdma_post_internal_cmd, 430 .post_internal_cmd = ata_bmdma_post_internal_cmd,
431 .cable_detect = ali_c2_cable_detect,
482 432
483 .bmdma_setup = ata_bmdma_setup, 433 .bmdma_setup = ata_bmdma_setup,
484 .bmdma_start = ata_bmdma_start, 434 .bmdma_start = ata_bmdma_start,