Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153898
b: refs/heads/master
c: dc77ad4
h: refs/heads/master
v: v3
  • Loading branch information
Dave Liu authored and Jeff Garzik committed Jun 23, 2009
1 parent 85914a7 commit 3a81bb4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 918d7b7c330f8afe18cb1b8692fc5f45a798634e
refs/heads/master: dc77ad4c8727d3a1c23eadcb287501dab480d634
35 changes: 35 additions & 0 deletions trunk/drivers/ata/sata_fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,37 @@ static int sata_fsl_remove(struct of_device *ofdev)
return 0;
}

#ifdef CONFIG_PM
static int sata_fsl_suspend(struct of_device *op, pm_message_t state)
{
struct ata_host *host = dev_get_drvdata(&op->dev);
return ata_host_suspend(host, state);
}

static int sata_fsl_resume(struct of_device *op)
{
struct ata_host *host = dev_get_drvdata(&op->dev);
struct sata_fsl_host_priv *host_priv = host->private_data;
int ret;
void __iomem *hcr_base = host_priv->hcr_base;
struct ata_port *ap = host->ports[0];
struct sata_fsl_port_priv *pp = ap->private_data;

ret = sata_fsl_init_controller(host);
if (ret) {
dev_printk(KERN_ERR, &op->dev,
"Error initialize hardware\n");
return ret;
}

/* Recovery the CHBA register in host controller cmd register set */
iowrite32(pp->cmdslot_paddr & 0xffffffff, hcr_base + CHBA);

ata_host_resume(host);
return 0;
}
#endif

static struct of_device_id fsl_sata_match[] = {
{
.compatible = "fsl,pq-sata",
Expand All @@ -1392,6 +1423,10 @@ static struct of_platform_driver fsl_sata_driver = {
.match_table = fsl_sata_match,
.probe = sata_fsl_probe,
.remove = sata_fsl_remove,
#ifdef CONFIG_PM
.suspend = sata_fsl_suspend,
.resume = sata_fsl_resume,
#endif
};

static int __init sata_fsl_init(void)
Expand Down

0 comments on commit 3a81bb4

Please sign in to comment.