<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 13, 2014 at 3:50 PM, Ran Shalit <span dir="ltr"><<a href="mailto:ranshalit@gmail.com" target="_blank">ranshalit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Sep 13, 2014 at 4:14 AM, Peter Teoh <<a href="mailto:htmldeveloper@gmail.com">htmldeveloper@gmail.com</a>> wrote:<br>
> please elaborate your requirements. char dev is for I/O to hardware. but<br>
> runtime PM is for hibernating machine. what is the connection u trying to<br>
> achieve?<br>
><br>
> On Mon, Sep 8, 2014 at 1:22 PM, Ran Shalit <<a href="mailto:ranshalit@gmail.com">ranshalit@gmail.com</a>> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> Is there any character device example using runtime PM available ?<br>
>> It is most helpful,<br>
>><br>
</span>Hi,<br>
<br>
Some of the drivers I'm using are char devices, while I only saw<br>
platform device registration for runtime PM, so my question stem from<br>
this.<br>
<br>
As to the system requirement I have, it is as following:<br>
1. make everything as automatic as possible , so that there won't be<br>
any need to add any userspace application for the matter.<br>
2. wakeup from all relevant wakeup sources<br>
3. should not use sysfs (it should be disabled from kernel)<br>
4. platform is OMAP3530.<br>
<br>
Now, As I understand this far, I have the following options (<br>
requirement 3 above I will ignore, don't know how to handle it yet,<br>
and assume for meanwhile that I have sysfs) :<br>
1. use suspend scheme (no runtime PM)<br>
1.a. create some kernel periodic thread who check cpu load and will decide<br>
to disable system only if its below some minimum threshold (which<br>
should indicate no activity)<br>
1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources<br>
with this scheme only this thread is responsible for the suspend,<br>
and there is no use of the runtime PM, right ?<br>
<br>
2. use runtime PM scheme :<br>
With this scheme I don't understand how some device will wake the<br>
system , or doesn't it need to ? If a driver wakes up maybe it need<br>
to deliver some info to system ?<br>
<br></blockquote><div><br></div><div>as a general comment, your requirement for PM sounds weird.</div><div><br></div><div>a. normally, the linux kernel has its own PM protocol....and it governs which devices to saves states, and restore it later.....there is a hierarchy of calls to be made. and it is a complex daisy chain from devices to higher logical level. but yours never seem to mention or plan to integrate to this infrastructure?</div><div><br></div><div>b. hardware PM (sorry, i am a software guy...may be wrong) for microcontroller/CPU normally means different states resulting in different external PINs being disable, and for the least powered state only one or two pins are available to wake up the CP/microcontroller. but when u mentioned so many pins are potential wake up source......then it is not powered down at all. </div><div><br></div><div>i am being vague and brief, not to waste time, as this is a big topic, sorry.</div><div><br></div><div><br></div></div><div><br></div>-- <br>Regards,<br>Peter Teoh
</div></div>