Re: Question about hibernation

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

 



On Thursday, October 14, 2010, Raj Kumar wrote:
> 
> Hi Rafael,

Hi,

> Thanks for your quick reply.  
>  
> 1) I already implemented this with dev_pm_ops. I used suspend and resume callbacks
> whose prototype is like
>  
> struct dev_pm_ops power_mgmt_ops
> {
>    .suspend =  powermanagement_suspend,
>    .resume =  powermanagement_resume
>  
> }
>  
> int powermanagement_suspend(device *dev)
> {
>  
> }
>  
> In normal suspend to ram mode it will work. But will it work in case of hibernation also?

It may be sufficient to point hibernate-specific callback pointers to your
suspend/resume routines:
  
 struct dev_pm_ops power_mgmt_ops
 {
    .suspend =  powermanagement_suspend,
    .resume =  powermanagement_resume,
    .freeze =  powermanagement_suspend,
    .thaw =  powermanagement_resume,
    .poweroff =  powermanagement_suspend,
    .restore =  powermanagement_resume,
 }

depending on the particular needs of your driver.

> if yes, since in suspend and resume call backs, only the device structure is provided, so how can
> then person can identify it is suspend to ram or hibernation?

See above.

> or for hibernation, poweroff  and restore function should be implemented which is similar
> to suspend and resume call backs in case of suspend to ram?

Yes.

Thanks,
Rafael
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux