Skip to content

Commit

Permalink
pata_atp867x: add Power Management support
Browse files Browse the repository at this point in the history
Cc: Jung-Ik (John) Lee <jilee@google.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Oct 7, 2009
1 parent c59bcc3 commit 7affb32
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions drivers/ata/pata_atp867x.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,23 @@ static int atp867x_init_one(struct pci_dev *pdev,
return rc;
}

#ifdef CONFIG_PM
static int atp867x_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;

atp867x_fixup(host);

ata_host_resume(host);
return 0;
}
#endif

static struct pci_device_id atp867x_pci_tbl[] = {
{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP867A), 0 },
{ PCI_VDEVICE(ARTOP, PCI_DEVICE_ID_ARTOP_ATP867B), 0 },
Expand All @@ -544,6 +561,10 @@ static struct pci_driver atp867x_driver = {
.id_table = atp867x_pci_tbl,
.probe = atp867x_init_one,
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
.resume = atp867x_reinit_one,
#endif
};

static int __init atp867x_init(void)
Expand Down

0 comments on commit 7affb32

Please sign in to comment.