Hi Raj.

Any luck on this?
I am trying to trace the full process of how things get shut down when
the phone is suspended.
Where I am at right now is that when the phone is suspended or resumed
the earlysuspend.c
file executes a function and places a earlysuspend struct on a
work_queue.
I'm trying to find the specific android power management that get's
applied over top of the linux PM. (see graph in link below)
Feeling like that graph may be slightly out of date and things moved
around, but I may be missing something.
I wish those writing Android Docs would time stamp everything.


Power

http://source.android.com/porting/power_management.html
----- Attempting to trace the tree above ----

PowerManager
http://developer.android.com/reference/android/os/PowerManager.html

PowerManagerService.java
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/java/com/android/server/PowerManagerService.java;h=966ecb0bf5e34c61c54a73b22ade873b7e564b23;hb=HEAD

* Not finding /lib/hardware/power.c or /drivers/android/power.c *

spos...@mobiprog:~/android-source/donut$ find . power.c | grep power.c
./hardware/libhardware_legacy/power/power.c
./msm/arch/mips/au1000/common/power.c
./msm/arch/powerpc/platforms/pseries/power.c
./msm/arch/sparc64/kernel/power.c
./msm/drivers/acpi/power.c      ---- Mabey this? ACPI Bus Power
Management, but doesn't look Android Specific. 2002. See link below
./msm/drivers/parisc/power.c     -- HP PARISC soft power switch
support drive
./msm/drivers/power/apm_power.c
./msm/drivers/power/pda_power.c
./msm/drivers/input/apm-power.c
./msm/drivers/net/wireless/iwlwifi/iwl-power.c


/*
 * acpi_power.c - ACPI Bus Power Management
 * ACPI power-managed devices may be controlled in two ways:
 * 1. via "Device Specific (D-State) Control"
 * 2. via "Power Resource Control".
 * This module is used to manage devices relying on Power Resource
Control.
 *
 * An ACPI "power resource object" describes a software controllable
power
 * plane, clock plane, or other resource used by a power managed
device.
 * A device may rely on multiple power resources, and a power resource
 * may be shared by multiple devices.
 */
http://android.git.kernel.org/?p=kernel/msm.git;a=blob;f=drivers/acpi/power.c;h=c926e7d4a0d619fd5b16a3b8d4806b05bba5aeeb;hb=android-msm-2.6.29-donut


---- Additional NDK Files. These are Android Specific, but on top of
the kernel ----

com_android_server_BatteryService.cpp
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/jni/com_android_server_BatteryService.cpp;h=8e7cadc6b680fc420d341faa094c71922946fdab;hb=HEAD

com_android_server_HardwareService.cpp
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/jni/com_android_server_HardwareService.cpp;h=253e6558de36f943dc324415a9c41e6eb23cd308;hb=HEAD


GlobalActions.java was PowerDialog.java
http://android.git.kernel.org/?p=platform/frameworks/policies/base.git;a=blob;f=mid/com/android/internal/policy/impl/GlobalActions.java;h=c7d4b14bb7def6d47f32bc5efaacd91056d51be1;hb=HEAD

Sleep and wake up as shown in dmesg
<6>[16337.332275] request_suspend_state: wakeup (3->0) at
16331561233285 (2010-06-15 01:00:37.811553944 UTC)
<4>[16337.527679] init sharp panel
<6>[16343.192291] request_suspend_state: sleep (0->3) at
16337421218656 (2010-06-15 01:00:43.671569832 UTC)
<4>[16343.234863] deinit sharp panel

/*
 * prints "request_suspend_state" above
 * all is seems to do is create an earlysuspend struct
 * and place it on the work_queue
 */
earlysuspend.c
http://android.git.kernel.org/?p=kernel/msm.git;a=blob;f=kernel/power/earlysuspend.c;h=84bed51dcdce79503d718186775e690560d4637b;hb=HEAD


/* The early_suspend structure defines suspend and resume hooks to be
called
 * when the user visible sleep state of the system changes, and a
level to
 * control the order. They can be used to turn off the screen and
input
 * devices that are not used for wakeup.
 * Suspend handlers are called in low to high level order, resume
handlers are
 * called in the opposite order. If, when calling
register_early_suspend,
 * the suspend handlers have already been called without a matching
call to the
 * resume handlers, the suspend handler will be called directly from
 * register_early_suspend. This direct call can violate the normal
level order.
 */
earlysuspend.h
http://randomtechinfo.com/sdx/include/earlysuspend.h

power.h
http://android.git.kernel.org/?p=kernel/msm.git;a=blob;f=kernel/power/power.h;h=96cab35c3d22a3f1e337c141439c768dc4e4f4b3;hb=HEAD





On Jun 1, 7:33 am, Raj Kumar <rajkumar...@gmail.com> wrote:
> Hi all,
>
> I have question regardingpowermanagement in kernel. What APIs are
> available in linux kernel
> forpowermanagement are available for device drivers? e.g. Driver is
> interested in knowing the systempowerstartes. Which APIs the driver should 
> register for which it will
> get notifications ofpowerstates
> in system?
>
> Previously in linux kernel pm_register was used which is obselete now.
> There are other things as well
> like APM and ACPI. But for embedded devices, if the driver is
> interested in getting the systempower
> states from kernel, which APIs are used?
>
> /r

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to