RE: [PATCH 19/21] usb: langwell_udc: add runtime pm support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> @@ -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?

Thanks for the comments, will remove them in second version submission.

>
>[...]
>
>> +/* 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...

Same as above.

Thanks
Hao
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux