aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ali.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2007-03-27 01:43:37 -0400
committerJeff Garzik <jeff@garzik.org>2007-04-28 14:16:00 -0400
commitb723d1448cbefc9fd591798d229d1dafb358bc66 (patch)
treea8fcc2a0ea913424917d0a114b28594fae177b6c /drivers/ata/pata_ali.c
parentf2fb344beadf79f9d265c3fc60e8399bbf917a4d (diff)
pata_ali: remove all the crap again and switch to cable_detect method
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_ali.c')
-rw-r--r--drivers/ata/pata_ali.c68
1 files changed, 9 insertions, 59 deletions
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 047f636e258d..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
@@ -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
@@ -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,