mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-19 08:11:52 +00:00
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>
This commit is contained in:
parent
06c77e21ae
commit
3c4108c82f
@ -1217,25 +1217,38 @@ static struct uart_driver serial_hsu_reg = {
|
|||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int serial_hsu_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int serial_hsu_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
{
|
{
|
||||||
|
void *priv = pci_get_drvdata(pdev);
|
||||||
struct uart_hsu_port *up;
|
struct uart_hsu_port *up;
|
||||||
|
|
||||||
up = pci_get_drvdata(pdev);
|
/* Make sure this is not the internal dma controller */
|
||||||
if (!up)
|
if (priv && (pdev->device != 0x081E)) {
|
||||||
return 0;
|
up = priv;
|
||||||
|
uart_suspend_port(&serial_hsu_reg, &up->port);
|
||||||
uart_suspend_port(&serial_hsu_reg, &up->port);
|
}
|
||||||
|
|
||||||
|
pci_save_state(pdev);
|
||||||
|
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int serial_hsu_resume(struct pci_dev *pdev)
|
static int serial_hsu_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
void *priv = pci_get_drvdata(pdev);
|
||||||
struct uart_hsu_port *up;
|
struct uart_hsu_port *up;
|
||||||
|
int ret;
|
||||||
|
|
||||||
up = pci_get_drvdata(pdev);
|
pci_set_power_state(pdev, PCI_D0);
|
||||||
if (!up)
|
pci_restore_state(pdev);
|
||||||
return 0;
|
|
||||||
uart_resume_port(&serial_hsu_reg, &up->port);
|
ret = pci_enable_device(pdev);
|
||||||
|
if (ret)
|
||||||
|
dev_warn(&pdev->dev,
|
||||||
|
"HSU: can't re-enable device, try to continue\n");
|
||||||
|
|
||||||
|
if (priv && (pdev->device != 0x081E)) {
|
||||||
|
up = priv;
|
||||||
|
uart_resume_port(&serial_hsu_reg, &up->port);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user