aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-03 14:32:12 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 16:08:30 -0500
commita809c68752e63312c20fb027cf33da4a5ac384a5 (patch)
tree825cc871d7b1b456a29ffcb52b7e2248a3c82436
parent2a2beac928dd5a3a04eb9495e3ab09519f2516f2 (diff)
pata_ns87415: Power Management fix
Fix ->resume method to do chipset specific setup. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/pata_ns87415.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c
index 773b1590b492..061aa1c41a48 100644
--- a/drivers/ata/pata_ns87415.c
+++ b/drivers/ata/pata_ns87415.c
@@ -325,6 +325,13 @@ static struct scsi_host_template ns87415_sht = {
325 ATA_BMDMA_SHT(DRV_NAME), 325 ATA_BMDMA_SHT(DRV_NAME),
326}; 326};
327 327
328static void ns87415_fixup(struct pci_dev *pdev)
329{
330 /* Select 512 byte sectors */
331 pci_write_config_byte(pdev, 0x55, 0xEE);
332 /* Select PIO0 8bit clocking */
333 pci_write_config_byte(pdev, 0x54, 0xB7);
334}
328 335
329/** 336/**
330 * ns87415_init_one - Register 87415 ATA PCI device with kernel services 337 * ns87415_init_one - Register 87415 ATA PCI device with kernel services
@@ -371,10 +378,8 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
371 if (rc) 378 if (rc)
372 return rc; 379 return rc;
373 380
374 /* Select 512 byte sectors */ 381 ns87415_fixup(pdev);
375 pci_write_config_byte(pdev, 0x55, 0xEE); 382
376 /* Select PIO0 8bit clocking */
377 pci_write_config_byte(pdev, 0x54, 0xB7);
378 return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL); 383 return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL);
379} 384}
380 385
@@ -384,6 +389,23 @@ static const struct pci_device_id ns87415_pci_tbl[] = {
384 { } /* terminate list */ 389 { } /* terminate list */
385}; 390};
386 391
392#ifdef CONFIG_PM
393static int ns87415_reinit_one(struct pci_dev *pdev)
394{
395 struct ata_host *host = dev_get_drvdata(&pdev->dev);
396 int rc;
397
398 rc = ata_pci_device_do_resume(pdev);
399 if (rc)
400 return rc;
401
402 ns87415_fixup(pdev);
403
404 ata_host_resume(host);
405 return 0;
406}
407#endif
408
387static struct pci_driver ns87415_pci_driver = { 409static struct pci_driver ns87415_pci_driver = {
388 .name = DRV_NAME, 410 .name = DRV_NAME,
389 .id_table = ns87415_pci_tbl, 411 .id_table = ns87415_pci_tbl,
@@ -391,7 +413,7 @@ static struct pci_driver ns87415_pci_driver = {
391 .remove = ata_pci_remove_one, 413 .remove = ata_pci_remove_one,
392#ifdef CONFIG_PM 414#ifdef CONFIG_PM
393 .suspend = ata_pci_device_suspend, 415 .suspend = ata_pci_device_suspend,
394 .resume = ata_pci_device_resume, 416 .resume = ns87415_reinit_one,
395#endif 417#endif
396}; 418};
397 419