Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172886
b: refs/heads/master
c: a809c68
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Dec 3, 2009
1 parent 0375502 commit 4fd60b3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a2beac928dd5a3a04eb9495e3ab09519f2516f2
refs/heads/master: a809c68752e63312c20fb027cf33da4a5ac384a5
32 changes: 27 additions & 5 deletions trunk/drivers/ata/pata_ns87415.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ static struct scsi_host_template ns87415_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};

static void ns87415_fixup(struct pci_dev *pdev)
{
/* Select 512 byte sectors */
pci_write_config_byte(pdev, 0x55, 0xEE);
/* Select PIO0 8bit clocking */
pci_write_config_byte(pdev, 0x54, 0xB7);
}

/**
* ns87415_init_one - Register 87415 ATA PCI device with kernel services
Expand Down Expand Up @@ -371,10 +378,8 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
if (rc)
return rc;

/* Select 512 byte sectors */
pci_write_config_byte(pdev, 0x55, 0xEE);
/* Select PIO0 8bit clocking */
pci_write_config_byte(pdev, 0x54, 0xB7);
ns87415_fixup(pdev);

return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL);
}

Expand All @@ -384,14 +389,31 @@ static const struct pci_device_id ns87415_pci_tbl[] = {
{ } /* terminate list */
};

#ifdef CONFIG_PM
static int ns87415_reinit_one(struct pci_dev *pdev)
{
struct ata_host *host = dev_get_drvdata(&pdev->dev);
int rc;

rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;

ns87415_fixup(pdev);

ata_host_resume(host);
return 0;
}
#endif

static struct pci_driver ns87415_pci_driver = {
.name = DRV_NAME,
.id_table = ns87415_pci_tbl,
.probe = ns87415_init_one,
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
.resume = ns87415_reinit_one,
#endif
};

Expand Down

0 comments on commit 4fd60b3

Please sign in to comment.