Example #1
0
static int vbox_pm_poweroff(struct device *dev)
{
    struct pci_dev *pdev = to_pci_dev(dev);
    struct drm_device *ddev = pci_get_drvdata(pdev);

    return vbox_drm_freeze(ddev);
}
Example #2
0
static int vbox_pm_freeze(struct device *dev)
{
	struct pci_dev *pdev = to_pci_dev(dev);
	struct drm_device *ddev = pci_get_drvdata(pdev);

	if (!ddev || !ddev->dev_private)
		return -ENODEV;

	return vbox_drm_freeze(ddev);
}
Example #3
0
static int vbox_pm_suspend(struct device *dev)
{
    struct pci_dev *pdev = to_pci_dev(dev);
    struct drm_device *ddev = pci_get_drvdata(pdev);
    int error;

    error = vbox_drm_freeze(ddev);
    if (error)
        return error;

    pci_disable_device(pdev);
    pci_set_power_state(pdev, PCI_D3hot);
    return 0;
}