aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ata_piix.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-02-15 01:01:42 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-20 06:19:53 -0500
commit573db6b8f93b5e359abd9a05e620fd9a589b0209 (patch)
treed54f6e6907f30c8efcd3dc089b87af172746751e /drivers/scsi/ata_piix.c
parent56497bd5f1340cb97d94cab953b050be6f729790 (diff)
[PATCH] ata_piix: convert pata to new reset mechanism
Convert ata_piix pata ->phy_reset to new reset mechanism. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/ata_piix.c')
-rw-r--r--drivers/scsi/ata_piix.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 4cc1108f721a..d79c252a3f60 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -131,7 +131,7 @@ enum {
131static int piix_init_one (struct pci_dev *pdev, 131static int piix_init_one (struct pci_dev *pdev,
132 const struct pci_device_id *ent); 132 const struct pci_device_id *ent);
133 133
134static void piix_pata_phy_reset(struct ata_port *ap); 134static int piix_pata_probe_reset(struct ata_port *ap, unsigned int *classes);
135static void piix_sata_phy_reset(struct ata_port *ap); 135static void piix_sata_phy_reset(struct ata_port *ap);
136static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev); 136static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
137static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev); 137static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
@@ -207,7 +207,7 @@ static const struct ata_port_operations piix_pata_ops = {
207 .exec_command = ata_exec_command, 207 .exec_command = ata_exec_command,
208 .dev_select = ata_std_dev_select, 208 .dev_select = ata_std_dev_select,
209 209
210 .phy_reset = piix_pata_phy_reset, 210 .probe_reset = piix_pata_probe_reset,
211 211
212 .bmdma_setup = ata_bmdma_setup, 212 .bmdma_setup = ata_bmdma_setup,
213 .bmdma_start = ata_bmdma_start, 213 .bmdma_start = ata_bmdma_start,
@@ -258,8 +258,7 @@ static struct ata_port_info piix_port_info[] = {
258 /* ich5_pata */ 258 /* ich5_pata */
259 { 259 {
260 .sht = &piix_sht, 260 .sht = &piix_sht,
261 .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | 261 .host_flags = ATA_FLAG_SLAVE_POSS | PIIX_FLAG_CHECKINTR,
262 PIIX_FLAG_CHECKINTR,
263 .pio_mask = 0x1f, /* pio0-4 */ 262 .pio_mask = 0x1f, /* pio0-4 */
264#if 0 263#if 0
265 .mwdma_mask = 0x06, /* mwdma1-2 */ 264 .mwdma_mask = 0x06, /* mwdma1-2 */
@@ -284,7 +283,7 @@ static struct ata_port_info piix_port_info[] = {
284 /* piix4_pata */ 283 /* piix4_pata */
285 { 284 {
286 .sht = &piix_sht, 285 .sht = &piix_sht,
287 .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, 286 .host_flags = ATA_FLAG_SLAVE_POSS,
288 .pio_mask = 0x1f, /* pio0-4 */ 287 .pio_mask = 0x1f, /* pio0-4 */
289#if 0 288#if 0
290 .mwdma_mask = 0x06, /* mwdma1-2 */ 289 .mwdma_mask = 0x06, /* mwdma1-2 */
@@ -366,30 +365,42 @@ cbl40:
366} 365}
367 366
368/** 367/**
369 * piix_pata_phy_reset - Probe specified port on PATA host controller 368 * piix_pata_probeinit - probeinit for PATA host controller
370 * @ap: Port to probe 369 * @ap: Target port
371 * 370 *
372 * Probe PATA phy. 371 * Probeinit including cable detection.
373 * 372 *
374 * LOCKING: 373 * LOCKING:
375 * None (inherited from caller). 374 * None (inherited from caller).
376 */ 375 */
376static void piix_pata_probeinit(struct ata_port *ap)
377{
378 piix_pata_cbl_detect(ap);
379 ata_std_probeinit(ap);
380}
377 381
378static void piix_pata_phy_reset(struct ata_port *ap) 382/**
383 * piix_pata_probe_reset - Perform reset on PATA port and classify
384 * @ap: Port to reset
385 * @classes: Resulting classes of attached devices
386 *
387 * Reset PATA phy and classify attached devices.
388 *
389 * LOCKING:
390 * None (inherited from caller).
391 */
392static int piix_pata_probe_reset(struct ata_port *ap, unsigned int *classes)
379{ 393{
380 struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); 394 struct pci_dev *pdev = to_pci_dev(ap->host_set->dev);
381 395
382 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->hard_port_no])) { 396 if (!pci_test_config_bits(pdev, &piix_enable_bits[ap->hard_port_no])) {
383 ata_port_disable(ap);
384 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); 397 printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
385 return; 398 return 0;
386 } 399 }
387 400
388 piix_pata_cbl_detect(ap); 401 return ata_drive_probe_reset(ap, piix_pata_probeinit,
389 402 ata_std_softreset, NULL,
390 ata_port_probe(ap); 403 ata_std_postreset, classes);
391
392 ata_bus_reset(ap);
393} 404}
394 405
395/** 406/**