Hello. On 02-12-2010 17:10, Hao Wu wrote:
From: Jiebing Li<hao.wu@xxxxxxxxx>
This patch enables runtime pm support for langwell_udc controller driver.
Signed-off-by: Jiebing Li<jiebing.li@xxxxxxxxx> Signed-off-by: Hao Wu<hao.wu@xxxxxxxxx>
[...]
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c index e5d11e9..e3e689c 100644 --- a/drivers/usb/gadget/langwell_udc.c +++ b/drivers/usb/gadget/langwell_udc.c
[...]
@@ -3459,6 +3466,67 @@ static int langwell_udc_resume(struct pci_dev *pdev) } +#ifdef CONFIG_PM_RUNTIME +/* device controller runtime suspend */ +static int langwell_udc_runtime_suspend(struct device *device) +{ + struct langwell_udc *dev = the_controller; + struct pci_dev *pdev; + + dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); + + pdev = to_pci_dev(device); + + /* save PCI state */ + pci_save_state(pdev); + + /* disable PCI device */ + pci_disable_device(pdev); + + /* set device power state */ + pci_set_power_state(pdev, PCI_D3hot);
Is there really a need in such self-obvious comments? [...]
+/* device controller runtime resume */ +static int langwell_udc_runtime_resume(struct device *device) +{ + struct langwell_udc *dev = the_controller; + struct pci_dev *pdev; + + dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); + + pdev = to_pci_dev(device); + + /* set device D0 power state */ + pci_set_power_state(pdev, PCI_D0); + + /* restore PCI state */ + pci_restore_state(pdev); + + /* enable PCI device */ + if (pci_enable_device(pdev)< 0) + return -ENODEV;
Same question here... WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html