diff options
author | Feng Tang <feng.tang@intel.com> | 2010-07-27 03:20:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:46 -0400 |
commit | 3c4108c82f7769fcd265dc77a5bb0c6d8bcea25f (patch) | |
tree | 9b5c09318f884a7ba279d4da63551098ecba69a2 /drivers/serial/mfd.c | |
parent | 06c77e21ae7c199435097116b8212b0761fc8ba8 (diff) |
hsu: call PCI pm hooks in suspend/resume function
Also add check for dma controller or the uart ports.
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/mfd.c')
-rw-r--r-- | drivers/serial/mfd.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c index f5e7569c1773..bc9af503907f 100644 --- a/drivers/serial/mfd.c +++ b/drivers/serial/mfd.c | |||
@@ -1217,25 +1217,38 @@ static struct uart_driver serial_hsu_reg = { | |||
1217 | #ifdef CONFIG_PM | 1217 | #ifdef CONFIG_PM |
1218 | static int serial_hsu_suspend(struct pci_dev *pdev, pm_message_t state) | 1218 | static int serial_hsu_suspend(struct pci_dev *pdev, pm_message_t state) |
1219 | { | 1219 | { |
1220 | void *priv = pci_get_drvdata(pdev); | ||
1220 | struct uart_hsu_port *up; | 1221 | struct uart_hsu_port *up; |
1221 | 1222 | ||
1222 | up = pci_get_drvdata(pdev); | 1223 | /* Make sure this is not the internal dma controller */ |
1223 | if (!up) | 1224 | if (priv && (pdev->device != 0x081E)) { |
1224 | return 0; | 1225 | up = priv; |
1225 | 1226 | uart_suspend_port(&serial_hsu_reg, &up->port); | |
1226 | uart_suspend_port(&serial_hsu_reg, &up->port); | 1227 | } |
1227 | 1228 | ||
1229 | pci_save_state(pdev); | ||
1230 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
1228 | return 0; | 1231 | return 0; |
1229 | } | 1232 | } |
1230 | 1233 | ||
1231 | static int serial_hsu_resume(struct pci_dev *pdev) | 1234 | static int serial_hsu_resume(struct pci_dev *pdev) |
1232 | { | 1235 | { |
1236 | void *priv = pci_get_drvdata(pdev); | ||
1233 | struct uart_hsu_port *up; | 1237 | struct uart_hsu_port *up; |
1238 | int ret; | ||
1234 | 1239 | ||
1235 | up = pci_get_drvdata(pdev); | 1240 | pci_set_power_state(pdev, PCI_D0); |
1236 | if (!up) | 1241 | pci_restore_state(pdev); |
1237 | return 0; | 1242 | |
1238 | uart_resume_port(&serial_hsu_reg, &up->port); | 1243 | ret = pci_enable_device(pdev); |
1244 | if (ret) | ||
1245 | dev_warn(&pdev->dev, | ||
1246 | "HSU: can't re-enable device, try to continue\n"); | ||
1247 | |||
1248 | if (priv && (pdev->device != 0x081E)) { | ||
1249 | up = priv; | ||
1250 | uart_resume_port(&serial_hsu_reg, &up->port); | ||
1251 | } | ||
1239 | return 0; | 1252 | return 0; |
1240 | } | 1253 | } |
1241 | #else | 1254 | #else |