diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-06-17 08:11:01 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-06-17 14:25:53 -0400 |
commit | d6ecf158148883be1588859c46d6d424513e2e0d (patch) | |
tree | 83428d4d11b732c65c3c98dc82705c9180b8edca /drivers/ata/ahci_mvebu.c | |
parent | 34c56932ce5278b8bbae13936f9df05cd59e3193 (diff) |
ata: ahci_mvebu: add suspend/resume support
This commit adds suspend/resume support to the ahci_mvebu driver. The
suspend hook doesn't do anything special despite calling the generic
ahci_platform_suspend_host() function. However, the resume hook has to
restore the MBus windows configuration, as well as the regret option.
Tested on Marvell Armada 388 GP.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/ahci_mvebu.c')
-rw-r--r-- | drivers/ata/ahci_mvebu.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 23716dd8a7ec..8cbbedebadbb 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c | |||
@@ -62,6 +62,26 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv) | |||
62 | writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA); | 62 | writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA); |
63 | } | 63 | } |
64 | 64 | ||
65 | static int ahci_mvebu_suspend(struct platform_device *pdev, pm_message_t state) | ||
66 | { | ||
67 | return ahci_platform_suspend_host(&pdev->dev); | ||
68 | } | ||
69 | |||
70 | static int ahci_mvebu_resume(struct platform_device *pdev) | ||
71 | { | ||
72 | struct ata_host *host = platform_get_drvdata(pdev); | ||
73 | struct ahci_host_priv *hpriv = host->private_data; | ||
74 | const struct mbus_dram_target_info *dram; | ||
75 | |||
76 | dram = mv_mbus_dram_info(); | ||
77 | if (dram) | ||
78 | ahci_mvebu_mbus_config(hpriv, dram); | ||
79 | |||
80 | ahci_mvebu_regret_option(hpriv); | ||
81 | |||
82 | return ahci_platform_resume_host(&pdev->dev); | ||
83 | } | ||
84 | |||
65 | static const struct ata_port_info ahci_mvebu_port_info = { | 85 | static const struct ata_port_info ahci_mvebu_port_info = { |
66 | .flags = AHCI_FLAG_COMMON, | 86 | .flags = AHCI_FLAG_COMMON, |
67 | .pio_mask = ATA_PIO4, | 87 | .pio_mask = ATA_PIO4, |
@@ -120,6 +140,8 @@ MODULE_DEVICE_TABLE(of, ahci_mvebu_of_match); | |||
120 | static struct platform_driver ahci_mvebu_driver = { | 140 | static struct platform_driver ahci_mvebu_driver = { |
121 | .probe = ahci_mvebu_probe, | 141 | .probe = ahci_mvebu_probe, |
122 | .remove = ata_platform_remove_one, | 142 | .remove = ata_platform_remove_one, |
143 | .suspend = ahci_mvebu_suspend, | ||
144 | .resume = ahci_mvebu_resume, | ||
123 | .driver = { | 145 | .driver = { |
124 | .name = DRV_NAME, | 146 | .name = DRV_NAME, |
125 | .of_match_table = ahci_mvebu_of_match, | 147 | .of_match_table = ahci_mvebu_of_match, |