Any char device example for runtime PM ?

Ran Shalit ranshalit at gmail.com
Sat Sep 13 03:50:31 EDT 2014


On Sat, Sep 13, 2014 at 4:14 AM, Peter Teoh <htmldeveloper at gmail.com> wrote:
> please elaborate your requirements.   char dev is for I/O to hardware.   but
> runtime PM is for hibernating machine.   what is the connection u trying to
> achieve?
>
> On Mon, Sep 8, 2014 at 1:22 PM, Ran Shalit <ranshalit at gmail.com> wrote:
>>
>> Hello,
>>
>> Is there any character device example using runtime PM available ?
>> It is most helpful,
>>
Hi,

Some of the drivers I'm using are char devices, while I only saw
platform device registration for runtime PM, so my question stem from
this.

As to the system requirement I have, it is as following:
1. make everything as automatic as possible , so that there won't be
any need to add any userspace application for the matter.
2. wakeup from all relevant wakeup sources
3. should not use sysfs (it should be disabled from kernel)
4. platform is OMAP3530.

Now, As I understand this far, I have the following options (
requirement 3 above I will ignore, don't know how to handle it yet,
and assume for meanwhile that I have sysfs) :
1. use suspend scheme (no runtime PM)
    1.a. create some kernel periodic thread who check cpu load and will decide
to disable system only if its below some minimum threshold (which
should indicate no activity)
    1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
    with this scheme only this thread is responsible for the suspend,
and there is no use of the runtime PM, right ?

2. use runtime PM scheme :
    With this scheme I don't understand how some device will wake the
system , or doesn't it need to  ? If a driver wakes up maybe it need
to deliver some info to system    ?

Thanks for any ideas,
Ran



More information about the Kernelnewbies mailing list