tizen beta release
authorKibum Kim <kb0929.kim@samsung.com>
Mon, 27 Feb 2012 12:16:23 +0000 (21:16 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Mon, 27 Feb 2012 12:16:23 +0000 (21:16 +0900)
33 files changed:
AUTHORS [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
SLP_pm_PG.h [new file with mode: 0644]
TC/build.sh [new file with mode: 0755]
TC/execute.sh [new file with mode: 0755]
TC/tet_code [new file with mode: 0755]
TC/tet_scen [new file with mode: 0755]
TC/tetbuild.cfg [new file with mode: 0755]
TC/tetclean.cfg [new file with mode: 0755]
TC/tetexec.cfg [new file with mode: 0755]
TC/unit/Makefile [new file with mode: 0644]
TC/unit/tc_gen.sh [new file with mode: 0755]
TC/unit/tslist [new file with mode: 0644]
TC/unit/utc_MODULE_API_func.c.in [new file with mode: 0644]
TC/unit/utc_SystemFW_pm_change_state_func.c [new file with mode: 0644]
TC/unit/utc_SystemFW_pm_lock_state_func.c [new file with mode: 0644]
TC/unit/utc_SystemFW_pm_unlock_state_func.c [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/libslp-pm-0.install.in [new file with mode: 0644]
debian/libslp-pm-dev.install.in [new file with mode: 0644]
debian/rules [new file with mode: 0755]
image/SLP_pm_PG_architecture.png [new file with mode: 0755]
image/SLP_pm_PG_state_diagram.png [new file with mode: 0755]
packaging/libslp-pm.spec [new file with mode: 0644]
pm.c [new file with mode: 0644]
pm.h [new file with mode: 0644]
pmapi.h [new file with mode: 0644]
pmapi.pc.in [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..67e6bd9
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+Jinkun Jang <jinkun.jang@samsung.com>\r
+DongGi Jang <dg0402.jang@samsung.com>\r
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0875ff4
--- /dev/null
@@ -0,0 +1,37 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(pmapi C)
+
+
+SET(SRCS pm.c)
+SET(HEADERS pmapi.h SLP_pm_PG.h)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR "\${prefix}/lib")
+SET(INCLUDEDIR "\${prefix}/include")
+SET(VERSION 1.2)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+
+FOREACH(flag ${pkg_CFLAGS})
+        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkg_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
+
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+
+FOREACH(hfile ${HEADERS})
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include)
+ENDFOREACH(hfile)
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..9c13a9b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,204 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
diff --git a/SLP_pm_PG.h b/SLP_pm_PG.h
new file mode 100644 (file)
index 0000000..2dfd57c
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ *  libslp-pm
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: DongGi Jang <dg0402.jang@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/ 
+
+
+/**
+ *
+ * @ingroup SLP_PG
+ * @defgroup SLP_PG_PM Power Manager
+ * @{
+<h1 class="pg">Introduction</h1>
+
+<h2 class="pg">Purpose</h2>
+The purpose of this document is to describe how applications can use Power Manager APIs to save system power consumption. 
+This document gives programming guidelines to application engineers. 
+
+<h2 class="pg">Scope</h2>
+The scope of this document is limited to Power Manager API usage.
+
+<br>
+<h1 class="pg">Power Manager Architecture</h1>
+The Power Manager (PM) consists of a client API library and a Power Manager daemon.
+
+<h3 class="pg" align="center">Power Manager Architecture</h3>
+@image html SLP_pm_PG_architecture.png
+<br>
+Power Manager daemon controls a kernel power management module and peripheral device drivers to save system power consumption. 
+It manages the system power states and makes state transitions according to the events. <br>
+There are four power states ? Normal (i.e. LCD on), LCD dimming, LCD off and Sleep.
+
+<h3 class="pg" align="center">Power Manager State Diagram</h3>
+@image html SLP_pm_PG_state_diagram.png
+
+Applications can put conditions on specific state transitions. For example, Video Player applications do not want the Power Manager 
+to allow the LCD to be in a dimming state or to turn off the LCD backlight. 
+For this purpose, Video Player applications can use Power Manager APIs to send the condition to Power Manager.
+
+<h1 class="pg">Power Manager Features</h1>
+- There are four power states, Normal(i.e. LCD on), LCD dimming, LCD off and Sleep.
+- If there is no user input for a certain time, PM changes the state of PM to a state that has lower power consumption.
+- When user input or another system interrupt occurs, PM rolls the state back immediately.
+- However, some applications may want PM not to change the state, for example music players that do not want to suspend, 
+can sustain PM in the state required by using the pm_lock_power_state() API.
+
+<h1 class="pg">Power Manager Funtions</h1>
+
+<h2 class="pg">Power Manager API Introduction</h2>
+<i><b>API : pm_lock_state</b></i>
+<br><b>Parameter In :</b> unsigned int state, unsigned int flag, unsigned int timeout
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to lock a particular power-state as the current power-state.<br>
+The parameter state specifies the power state which you want to lock LCD_NORMAL, LCD_DIM, LCD_OFF. \n
+The second parameter Flag is set if you want to go the requested lock state directly.\n
+The third parameter timeout specifies lock-timeout in milliseconds. 
+If the value 0 is selected, the power state remains locked until pm_unlock_state is called.<br>
+This function returns 0 on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : pm_unlock_state</b></i>
+<br><b>Parameter In :</b> unsigned int state, unsigned int flag 
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to Unlock the power state.<br>
+The parameter state specifies the power state which you want to unlock .Some examples are LCD_NORMAL, LCD_DIM, LCD_OFF.<br>
+The second parameter flag is set if you want to go to the requested state directly after unlocking. <br>
+PM_SLEEP_MARGIN - If the current status is lcd off, power-manager reset timer to 5 second. If the current status is not lcd off, power-manager uses the existing timer. <br>
+PM_RESET_TIMER - Power-manager resets timer. (lcd normal : reset timer to predfined value which is set in setting module,  lcd dim or off : reset timer to 5 seconds)<br>
+PM_KEEP_TIMER - Power-manager uses the existing timer (if timer is already expired, pwoer-manager changes the status) <br>
+This is valid only when the current state transition was blocked by the locking and this function call releases the blocking.<br>
+This function returns 0 on success and a negative value (-1) on failure.
+<br><br>
+<i><b>API : pm_change_state</b></i>
+<br><b>Parameter In :</b> unsigned int (power state)
+<br><b>Return :</b> int
+<br><b>Functionality :</b> This API is used to change the power manager state by force.<br>
+This function returns 0 on success, -1 if failed.
+
+<b>Power state:</b>
+@code
+// POWER STATES 
+#define LCD_NORMAL     0x1     // NORMAL state 
+#define LCD_DIM                0x2     // LCD dimming state 
+#define LCD_OFF                0x4     // LCD off state 
+#define SUSPEND                0x8     // Sleep state 
+@endcode
+
+<h2 class="pg">Sample Code</h2>
+@code
+#include <pmapi.h>
+int main()
+{
+       int result;
+
+       // Lock current state as LCD_NORMAL 
+       result = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0); 
+       if( result < 0 ) {
+               printf("[ERROR] return value result =%d, \n",result);
+       }
+       else
+               printf("[SUCCESS]return value result =%d \n",result);
+
+       // Do something here  
+
+       //Un-lock NORMAL state so that power state change can occur with system-events 
+
+       result = pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER); 
+       if( result < 0 ) {
+               printf("[ERROR] return value result =%d, \n",result);
+       }
+       else
+               printf("[SUCCESS]return value result =%d \n",result);
+
+       // change the state into LCD ON
+       result = pm_change_state(LCD_NORMAL);
+       if( result < 0 ) 
+               printf("[ERROR] return value result =%d, \n",result);
+       else
+               printf("[SUCCESS]return value result =%d \n",result);
+
+       return 0;
+}
+@endcode
+
+ @}
+**/
diff --git a/TC/build.sh b/TC/build.sh
new file mode 100755 (executable)
index 0000000..98ebeff
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+export TET_INSTALL_PATH=/scratchbox/tetware  # local tetware path
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -c -p ./
+tcc -b -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/execute.sh b/TC/execute.sh
new file mode 100755 (executable)
index 0000000..6720da0
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+export TET_INSTALL_PATH=/mnt/nfs/tetware
+export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
+export PATH=$TET_TARGET_PATH/bin:$PATH
+export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
+
+export TET_ROOT=$TET_TARGET_PATH
+
+export TET_SUITE_ROOT=`pwd`
+FILE_NAME_EXTENSION=`date +%s`
+
+RESULT_DIR=results
+HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
+JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
+
+mkdir -p $RESULT_DIR
+
+tcc -e -j $JOURNAL_RESULT -p ./
+grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/tet_code b/TC/tet_code
new file mode 100755 (executable)
index 0000000..a2cf6c1
--- /dev/null
@@ -0,0 +1,12 @@
+# TET reserved codes
+0 "PASS"
+1 "FAIL"
+2 "UNRESOLVED"
+3 "NOTINUSE"
+4 "UNSUPPORTED"
+5 "UNTESTED"
+6 "UNINITIATED"
+7 "NORESULT"
+
+# Test suite additional codes
+33 "INSPECT"
diff --git a/TC/tet_scen b/TC/tet_scen
new file mode 100755 (executable)
index 0000000..43cbc9b
--- /dev/null
@@ -0,0 +1,7 @@
+all
+       ^TEST
+##### Scenarios for TEST #####
+
+# Test scenario
+TEST
+       :include:/unit/tslist
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
new file mode 100755 (executable)
index 0000000..6192c78
--- /dev/null
@@ -0,0 +1,3 @@
+TET_OUTPUT_CAPTURE=False
+TET_BUILD_TOOL=make
+TET_PASS_TC_NAME=True
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
new file mode 100755 (executable)
index 0000000..c66eda4
--- /dev/null
@@ -0,0 +1,2 @@
+TET_OUTPUT_CAPTURE=False
+TET_CLEAN_TOOL=make clean
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
new file mode 100755 (executable)
index 0000000..0d9d39a
--- /dev/null
@@ -0,0 +1 @@
+TET_OUTPUT_CAPTURE=False
diff --git a/TC/unit/Makefile b/TC/unit/Makefile
new file mode 100644 (file)
index 0000000..8474034
--- /dev/null
@@ -0,0 +1,24 @@
+CC ?= gcc
+
+TARGETS = utc_SystemFW_pm_change_state_func    \
+         utc_SystemFW_pm_lock_state_func       \
+         utc_SystemFW_pm_unlock_state_func     \
+
+PKGS = pmapi
+
+LDFLAGS = `pkg-config --libs $(PKGS)`
+LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+
+CFLAGS = -I. `pkg-config --cflags $(PKGS)`
+CFLAGS += -I$(TET_ROOT)/inc/tet3
+CFLAGS += -Wall
+
+all: $(TARGETS)
+
+$(TARGETS): %: %.c
+       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
+
+clean:
+       rm -f $(TARGETS)
diff --git a/TC/unit/tc_gen.sh b/TC/unit/tc_gen.sh
new file mode 100755 (executable)
index 0000000..54f482d
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+TMPSTR=$0
+SCRIPT=${TMPSTR##*/}
+
+if [ $# -lt 2 ]; then
+       echo "Usage) $SCRIPT module_name api_name"
+       exit 1
+fi
+
+MODULE=$1
+API=$2
+TEMPLATE=utc_MODULE_API_func.c.in
+TESTCASE=utc_${MODULE}_${API}_func
+
+sed -e '
+       s^@API@^'"$API"'^g
+       s^@MODULE@^'"$MODULE"'^g
+       ' $TEMPLATE > $TESTCASE.c
+
+if [ ! -e "$TESTCASE.c" ]; then
+       echo "Failed"
+       exit 1
+fi
+echo "Testcase file is $TESTCASE.c"
+echo "Done"
+echo "please put \"$TESTCASE\" as Target in Makefile"
+echo "please put \"/unit/$TESTCASE\" in tslist"
diff --git a/TC/unit/tslist b/TC/unit/tslist
new file mode 100644 (file)
index 0000000..4b93156
--- /dev/null
@@ -0,0 +1,3 @@
+/unit/utc_SystemFW_pm_change_state_func
+/unit/utc_SystemFW_pm_lock_state_func
+/unit/utc_SystemFW_pm_unlock_state_func
diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in
new file mode 100644 (file)
index 0000000..b235fa3
--- /dev/null
@@ -0,0 +1,64 @@
+#include <tet_api.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_@MODULE@_@API@_func_01(void);
+static void utc_@MODULE@_@API@_func_02(void);
+
+enum {
+       POSITIVE_TC_IDX = 0x01,
+       NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+       { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX },
+       { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of @API@()
+ */
+static void utc_@MODULE@_@API@_func_01(void)
+{
+       int r = 0;
+
+/*
+       r = @API@(...);
+*/
+       if (r) {
+               tet_infoline("@API@() failed in positive test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init @API@()
+ */
+static void utc_@MODULE@_@API@_func_02(void)
+{
+       int r = 0;
+
+/*
+       r = @API@(...);
+*/
+       if (r) {
+               tet_infoline("@API@() failed in negative test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SystemFW_pm_change_state_func.c b/TC/unit/utc_SystemFW_pm_change_state_func.c
new file mode 100644 (file)
index 0000000..ebdcedc
--- /dev/null
@@ -0,0 +1,63 @@
+#include <tet_api.h>
+#include <pmapi.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_pm_change_state_func_01(void);
+static void utc_SystemFW_pm_change_state_func_02(void);
+
+enum {
+       POSITIVE_TC_IDX = 0x01,
+       NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+       { utc_SystemFW_pm_change_state_func_01, POSITIVE_TC_IDX },
+       { utc_SystemFW_pm_change_state_func_02, NEGATIVE_TC_IDX },
+       { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of pm_change_state()
+ */
+static void utc_SystemFW_pm_change_state_func_01(void)
+{
+       int ret_val = 0;
+
+       ret_val = pm_change_state(LCD_NORMAL);
+       if(ret_val < 0) {
+               tet_infoline("pm_change_state() failed in positive test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init pm_change_state()
+ */
+static void utc_SystemFW_pm_change_state_func_02(void)
+{
+       int r = 0;
+
+       r = pm_change_state(-1);
+
+       if (r>=0) {
+               tet_infoline("pm_change_state() failed in negative test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SystemFW_pm_lock_state_func.c b/TC/unit/utc_SystemFW_pm_lock_state_func.c
new file mode 100644 (file)
index 0000000..cdf5edf
--- /dev/null
@@ -0,0 +1,65 @@
+#include <tet_api.h>
+#include <pmapi.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_pm_lock_state_func_01(void);
+static void utc_SystemFW_pm_lock_state_func_02(void);
+
+enum {
+       POSITIVE_TC_IDX = 0x01,
+       NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+       { utc_SystemFW_pm_lock_state_func_01, POSITIVE_TC_IDX },
+       { utc_SystemFW_pm_lock_state_func_02, NEGATIVE_TC_IDX },
+       { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of pm_lock_state()
+ */
+static void utc_SystemFW_pm_lock_state_func_01(void)
+{
+       int ret_val = 0;
+
+       //Lock State as LCD_DIM for infinite time
+       ret_val = pm_lock_state(LCD_DIM, GOTO_STATE_NOW, 0);
+       pm_unlock_state (LCD_DIM ,GOTO_STATE_NOW);
+       if(ret_val < 0) {
+               tet_infoline("pm_lock_state() failed in positive test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init pm_lock_state()
+ */
+static void utc_SystemFW_pm_lock_state_func_02(void)
+{
+       int r = 0;
+
+       r = pm_lock_state(-1, GOTO_STATE_NOW, 0);
+
+       if (r>=0) {
+               tet_infoline("pm_lock_state() failed in negative test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
diff --git a/TC/unit/utc_SystemFW_pm_unlock_state_func.c b/TC/unit/utc_SystemFW_pm_unlock_state_func.c
new file mode 100644 (file)
index 0000000..3dc187a
--- /dev/null
@@ -0,0 +1,72 @@
+#include <tet_api.h>
+#include <pmapi.h>
+
+static void startup(void);
+static void cleanup(void);
+
+void (*tet_startup)(void) = startup;
+void (*tet_cleanup)(void) = cleanup;
+
+static void utc_SystemFW_pm_unlock_state_func_01(void);
+static void utc_SystemFW_pm_unlock_state_func_02(void);
+
+enum {
+       POSITIVE_TC_IDX = 0x01,
+       NEGATIVE_TC_IDX,
+};
+
+struct tet_testlist tet_testlist[] = {
+       { utc_SystemFW_pm_unlock_state_func_01, POSITIVE_TC_IDX },
+       { utc_SystemFW_pm_unlock_state_func_02, NEGATIVE_TC_IDX },
+       { NULL, 0 },
+};
+
+static void startup(void)
+{
+}
+
+static void cleanup(void)
+{
+}
+
+/**
+ * @brief Positive test case of pm_unlock_state()
+ */
+static void utc_SystemFW_pm_unlock_state_func_01(void)
+{
+       int ret_val = 0;
+
+       //Lock State as LCD_DIM for infinite time
+       ret_val = pm_lock_state(LCD_DIM, GOTO_STATE_NOW, 0);
+       if(ret_val < 0)
+       {
+               tet_infoline("\nSystem Fwk : call to pm_lock_state for unlock failed \n");
+       }
+
+
+       //Unlock previously locked state
+       ret_val = pm_unlock_state(LCD_DIM,GOTO_STATE_NOW);
+       if(ret_val < 0) {
+               tet_infoline("pm_unlock_state() failed in positive test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
+
+/**
+ * @brief Negative test case of ug_init pm_unlock_state()
+ */
+static void utc_SystemFW_pm_unlock_state_func_02(void)
+{
+       int r = 0;
+
+       r = pm_unlock_state(-1 ,GOTO_STATE_NOW);
+
+       if (r>=0) {
+               tet_infoline("pm_unlock_state() failed in negative test case");
+               tet_result(TET_FAIL);
+               return;
+       }
+       tet_result(TET_PASS);
+}
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..b1d608f
--- /dev/null
@@ -0,0 +1,364 @@
+libslp-pm (1.2.4-20) unstable; urgency=low
+
+  * source clean up (remove unnecessary comments, and so on)
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-20
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Tue, 06 Dec 2011 16:39:27 +0900
+
+libslp-pm (1.2.4-19) unstable; urgency=low
+
+  * remove unnecessary API for DVFS (move DVFS APIs to system-server)
+  * change boiler plate 
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-19
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Mon, 05 Dec 2011 12:29:27 +0900
+libslp-pm (1.2.4-18) unstable; urgency=low
+
+  * Modify Makefile of TC units
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-18
+
+ -- DongGi Jang <dg0402.jang@samsung.com>  Thu, 06 Oct 2011 13:29:27 +0900
+
+libslp-pm (1.2.4-17) unstable; urgency=low
+
+  * code cleaup(indent)
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-17
+
+ -- Jinkun.Jang <jinkun.jang@samsung.com>  Tue, 02 Jul 2011 12:18:08 +0900
+libslp-pm (1.2.4-16) unstable; urgency=low
+
+  * add new defined values for pm_unlock_state()
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-16
+
+ -- Jinkun.Jang <jinkun.jang@samsung.com>  Wed, 02 Mar 2011 12:18:08 +0900
+
+libslp-pm (1.2.4-15) unstable; urgency=low
+
+  * update TC
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-15
+
+ -- Jinkun.Jang <jinkun.jang@samsung.com>  Tue, 04 Jan 2011 16:48:08 +0900
+
+libslp-pm (1.2.4-14) unstable; urgency=low
+
+  * update TC
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-14
+
+ -- Jinkun.Jang <jinkun.jang@samsung.com>  Tue, 21 Dec 2010 20:48:08 +0900
+
+libslp-pm (1.2.4-13) unstable; urgency=low
+
+  * add checking parameter
+  * Git: 165.213.180.234:slp/pkgs/l/libslp-pm
+  * Tag: libslp-pm_1.2.4-13 
+
+ -- Jinkun.Jang <jinkun.jang@samsung.com>  Wed, 08 Dec 2010 20:48:08 +0900
+
+libslp-pm (1.2.4-12) unstable; urgency=low
+
+  * update TC
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-12 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Thu, 02 Dec 2010 10:26:27 +0900
+
+libslp-pm (1.2.4-11) unstable; urgency=low
+
+  * update PG
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-11 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Thu, 18 Nov 2010 15:51:59 +0900
+
+libslp-pm (1.2.4-10) unstable; urgency=low
+
+  * add power off state  same with sleep 
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-10
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Wed, 03 Nov 2010 19:26:01 +0900
+
+libslp-pm (1.2.4-9) unstable; urgency=low
+
+  * add copyright
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-9 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Wed, 27 Oct 2010 13:52:42 +0900
+
+libslp-pm (1.2.4-8) unstable; urgency=low
+
+  * add programming guide
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-8
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Wed, 13 Oct 2010 15:47:22 +0900
+
+libslp-pm (1.2.4-7) unstable; urgency=low
+
+  * add TC
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-7
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Tue, 05 Oct 2010 23:23:48 +0900
+
+libslp-pm (1.2.4-6) unstable; urgency=low
+
+  * update doxigen for pm_unlock_state()
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-6 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Mon, 13 Sep 2010 11:59:24 +0900
+
+libslp-pm (1.2.4-5) unstable; urgency=low
+
+  * modify header files for doxygen
+  * Git: 165.213.180.234:/git/slp/pkgs/libslp-pm
+  * Tag: libslp-pm_1.2.4-5 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Wed, 01 Sep 2010 17:03:03 +0900
+
+libslp-pm (1.2.4-4) unstable; urgency=low
+
+  * change maintainer
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.4-4 
+
+ -- Jinkun Jang <jinkun.jang@samsung.com>  Thu, 08 Jul 2010 15:45:06 +0900
+
+libslp-pm (1.2.4-3) unstable; urgency=low
+
+  * add get/attach/detach function on pm state (changed)
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.4-3
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 24 Jun 2010 20:39:49 +0900
+
+libslp-pm (1.2.4-2) unstable; urgency=low
+
+  * change printing logs
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.4-2
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 15 Jun 2010 21:05:51 +0900
+
+libslp-pm (1.2.4-1) unstable; urgency=low
+
+  * remove deprecated APIs
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.4-1
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 03 Jun 2010 19:58:26 +0900
+
+libslp-pm (1.2.3-2) unstable; urgency=low
+
+  * remove a script file for DAC
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.3-2
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Wed, 12 May 2010 15:52:38 +0900
+
+libslp-pm (1.2.3-1) unstable; urgency=low
+
+  * add deprecate warnings to pm_control()
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm_1.2.3-1
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 06 May 2010 09:02:41 +0900
+
+libslp-pm (1.2.2-4) unstable; urgency=low
+
+  * add a script file for DAC
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm-0_1.2.2-4
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Mon, 19 Apr 2010 18:17:57 +0900
+
+libslp-pm (1.2.2-3) unstable; urgency=low
+
+  * increasing package version
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm-0_1.2.2-3
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Wed, 14 Apr 2010 19:16:32 +0900
+
+libslp-pm (1.2.2-2) unstable; urgency=low
+
+  * remove applog in the .pc file
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm-0_1.2.2-2
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Wed, 14 Apr 2010 10:39:31 +0900
+
+libslp-pm (1.2.2-1) unstable; urgency=low
+
+  * remove applog.h
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/libslp-pm-0
+  * Tag: libslp-pm-0_1.2.2-1
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 13 Apr 2010 18:07:22 +0900
+
+libslp-pm (1.2.1-2) unstable; urgency=low
+
+  * corrected wrong comments
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Mon, 29 Mar 2010 11:41:28 +0900
+
+libslp-pm (1.2.1-1) unstable; urgency=low
+
+  * remove unused (deprecated) codes
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 25 Mar 2010 16:43:19 +0900
+
+libslp-pm (1.2.0-8) unstable; urgency=low
+
+  * Toolchain Upgrade
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 25 Mar 2010 16:39:22 +0900
+
+libslp-pm (1.2.0-7) unstable; urgency=low
+
+  * add dbg pkg
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 02 Mar 2010 20:35:09 +0900
+
+libslp-pm (1.2.0-6) unstable; urgency=low
+
+  * remove a copy for old so
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 02 Mar 2010 18:53:59 +0900
+
+libslp-pm (1.2.0-5) unstable; urgency=low
+
+  * modified doxygen comments
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Fri, 19 Feb 2010 16:48:39 +0900
+
+libslp-pm (1.2.0-4) unstable; urgency=low
+
+  * fix i686 build break
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 18 Feb 2010 13:30:29 +0900
+
+libslp-pm (1.2.0-2) unstable; urgency=low
+
+  * so.1.1 temporary added 
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Thu, 18 Feb 2010 13:09:50 +0900
+
+libslp-pm (1.2.0-1) unstable; urgency=low
+
+  * modified API name and parameter
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Wed, 17 Feb 2010 17:15:40 +0900
+
+libslp-pm (1.1.1-2) unstable; urgency=low
+
+  * add the so version to the library extention
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Mon, 01 Feb 2010 10:12:59 +0900
+
+libslp-pm (1.1.1-1) unstable; urgency=low
+
+  * add old pmcontrol() for SDK
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Sat, 30 Jan 2010 13:44:45 +0900
+
+libslp-pm (1.1.0-2) unstable; urgency=low
+
+  * add pmcontrol.h to dev pkg
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Fri, 29 Jan 2010 16:03:28 +0900
+
+libslp-pm (1.1.0-1) unstable; urgency=low
+
+  * change names - remove SLP
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 26 Jan 2010 17:54:13 +0900
+
+libslp-pm (1.0.4-4) unstable; urgency=low
+
+  * update doxygen tags for SDK
+
+ -- root <wonil22.choi@samsung.com>  Sat, 23 Jan 2010 23:51:34 +0900
+
+libslp-pm (1.0.4-3) unstable; urgency=low
+
+  * add doxygen tags for SDK
+
+ -- root <wonil22.choi@samsung.com>  Sat, 23 Jan 2010 21:47:57 +0900
+
+libslp-pm (1.0.4-2) unstable; urgency=low
+
+  * update debug pkg
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Fri, 22 Jan 2010 12:18:24 +0900
+
+libslp-pm (1.0.4-1) unstable; urgency=low
+
+  * i686 bug fix
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Fri, 08 Jan 2010 11:07:45 +0900
+
+libslp-pm (1.0.3-1) unstable; urgency=low
+
+  * added dvfs condition
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 05 Jan 2010 20:45:48 +0900
+
+libslp-pm (1.0.2-1) unstable; urgency=low
+
+  * implemented SLP_pm_state_change() function
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Tue, 22 Dec 2009 19:25:54 +0900
+
+libslp-pm (1.0.1-1) unstable; urgency=low
+
+  * Bug fix - return value is 0 for success. And add new function.
+
+ -- Wonil Choi <wonil22.choi@samsung.com>  Fri, 18 Dec 2009 20:25:03 +0900
+
+libslp-pm (1.0-6) unstable; urgency=low
+
+  * fix build script
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Mon, 30 Nov 2009 20:20:08 +0900
+
+libslp-pm (1.0-5) unstable; urgency=low
+
+  * remove project name(X1)
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Fri, 20 Nov 2009 17:17:17 +0900
+
+libslp-pm (1.0-4) unstable; urgency=low
+
+  * rename prefix 
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Fri, 20 Nov 2009 16:20:30 +0900
+
+libslp-pm (1.0-3) unstable; urgency=low
+
+  * change copyright
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Tue, 17 Nov 2009 15:49:17 +0900
+
+libslp-pm (1.0-2) unstable; urgency=low
+
+  * uncomment dh_makeshlibs
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Mon, 16 Nov 2009 11:06:21 +0900
+
+libslp-pm (1.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Suchang Woo <suchang.woo@samsung.com>  Thu, 12 Nov 2009 22:19:58 +0900
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..f0d7b8f
--- /dev/null
@@ -0,0 +1,28 @@
+Source: libslp-pm
+Section: libs
+Priority: extra
+Maintainer: Jonghoon Han <jonghoon.han@samsung.com> Jinkun Jang <jinkun.jang@samsung.com> DongGi Jang <dg0402.jang@samsung.com>
+Uploaders: Jinkun Jang <jinkun.jang@samsung.com>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: libslp-pm-dev
+Section: libs
+Architecture: any
+Depends: libslp-pm-0 (= ${Source-Version})
+Description: Samsung Linux platform power manager client library
+ Samsung Linux platform power manager client library
+
+Package: libslp-pm-0
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Samsung Linux platform power manager client library
+ Samsung Linux platform power manager client library
+
+Package: libslp-pm-0-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libslp-pm-0 (= ${Source-Version})
+Description: Samsung Linux platform power manager client library (unstripped)
+ Samsung Linux platform power manager client library (unstripped)
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..ca882bb
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..a0f0008
--- /dev/null
@@ -0,0 +1 @@
+CMakeLists.txt
diff --git a/debian/libslp-pm-0.install.in b/debian/libslp-pm-0.install.in
new file mode 100644 (file)
index 0000000..daeeae9
--- /dev/null
@@ -0,0 +1 @@
+@PREFIX@/lib/lib*.so*
diff --git a/debian/libslp-pm-dev.install.in b/debian/libslp-pm-dev.install.in
new file mode 100644 (file)
index 0000000..37b3bd4
--- /dev/null
@@ -0,0 +1,2 @@
+@PREFIX@/include/*.h
+@PREFIX@/lib/pkgconfig/*.pc
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..8b10ede
--- /dev/null
@@ -0,0 +1,128 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+CXXFLAGS ?=  -Wall -g
+LDFLAGS ?= 
+PREFIX ?= /usr
+DATADIR ?= /opt
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+       CXXFLAGS += -O0
+else
+       CFLAGS += -O2
+       CXXFLAGS += -O2
+endif
+
+LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
+
+CMAKE_TMP_DIR = $(CURDIR)/cmake_tmp
+
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+       mkdir -p $(CMAKE_TMP_DIR);
+       cd $(CMAKE_TMP_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
+
+       touch configure-stamp
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+       cd $(CMAKE_TMP_DIR) && $(MAKE)
+       #docbook-to-man debian/wavplayer.sgml > wavplayer.1
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               cat $$f > $${f%.in}; \
+               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
+       done
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       -cd $(CMAKE_TMP_DIR) && $(MAKE) clean
+       rm -rf $(CMAKE_TMP_DIR)
+
+       rm -rf CMakeCache.txt
+       rm -rf CMakeFiles
+       rm -rf cmake_install.cmake
+       rm -rf Makefile
+       rm -rf install_manifest.txt
+       rm -rf *.so
+       rm -rf debian/libpmapi-0-dbg
+
+       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+               rm -f $${f%.in}; \
+       done
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/wavplayer.
+       cd $(CMAKE_TMP_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+       # cp $(CMAKE_TMP_DIR)/libpmapi.so.1.2 $(CURDIR)/debian/tmp/usr/lib/libpmapi.so.1.1
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs 
+#      dh_installdocs
+       dh_installexamples
+       dh_install --sourcedir=debian/tmp
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+#      dh_strip
+       dh_strip --dbg-package=libslp-pm-0-dbg
+       dh_compress
+       dh_fixperms
+#      dh_perl
+       dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/image/SLP_pm_PG_architecture.png b/image/SLP_pm_PG_architecture.png
new file mode 100755 (executable)
index 0000000..046c121
Binary files /dev/null and b/image/SLP_pm_PG_architecture.png differ
diff --git a/image/SLP_pm_PG_state_diagram.png b/image/SLP_pm_PG_state_diagram.png
new file mode 100755 (executable)
index 0000000..bf07b79
Binary files /dev/null and b/image/SLP_pm_PG_state_diagram.png differ
diff --git a/packaging/libslp-pm.spec b/packaging/libslp-pm.spec
new file mode 100644 (file)
index 0000000..b6e46a2
--- /dev/null
@@ -0,0 +1,68 @@
+
+Name:       libslp-pm
+Summary:    Power manager library
+Version:    1.2.4
+Release:    2.1
+Group:      TO_BE/FILLED_IN
+License:    TO BE FILLED IN
+Source0:    libslp-pm-%{version}.tar.bz2
+Patch0:     remove_tests.patch
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires:  cmake
+
+
+%description
+Samsung Linux platform power manager client library
+
+
+
+%package devel
+Summary:    SLP power manager client (devel)
+Group:      Development/Libraries
+Requires:   %{name} = %{version}-%{release}
+Requires:   libslp-pm
+
+%description devel
+SLP power manager client library (devel)
+
+
+%prep
+%setup -q 
+%patch0 -p1
+
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING
+%{_libdir}/libpmapi.so.1.2
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/pmapi.h
+%{_includedir}/SLP_pm_PG.h
+%{_libdir}/pkgconfig/pmapi.pc
+%{_libdir}/libpmapi.so
+
diff --git a/pm.c b/pm.c
new file mode 100644 (file)
index 0000000..32cfe59
--- /dev/null
+++ b/pm.c
@@ -0,0 +1,134 @@
+/*
+ *  libslp-pm
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: DongGi Jang <dg0402.jang@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/ 
+
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <linux/limits.h>
+
+#include "pmapi.h"
+#include "pm.h"
+
+#define SOCK_PATH                      "/tmp/pm_sock"
+#define SHIFT_UNLOCK                   4
+#define SHIFT_UNLOCK_PARAMETER         12
+#define SHIFT_CHANGE_STATE             8
+#define TIMEOUT_RESET_BIT              0x80
+
+struct pwr_msg {
+       pid_t pid;
+       unsigned int cond;
+       unsigned int timeout;
+};
+
+static int send_msg(unsigned int s_bits, unsigned int timeout)
+{
+       int rc = 0;
+       int sock;
+       struct pwr_msg p;
+       struct sockaddr_un remote;
+
+       p.pid = getpid();
+       p.cond = s_bits;
+       p.timeout = timeout;
+
+       sock = socket(AF_UNIX, SOCK_DGRAM, 0);
+       if (sock == -1) {
+               ERR("pm socket() failed");
+               return -1;
+       }
+
+       remote.sun_family = AF_UNIX;
+       if(strlen(SOCK_PATH) >= sizeof(remote.sun_path)) {
+               ERR("socket path is vey long");
+               return -1;
+       }
+       strncpy(remote.sun_path, SOCK_PATH, sizeof(remote.sun_path));
+
+       rc = sendto(sock, (void *)&p, sizeof(p), 0, (struct sockaddr *)&remote,
+                   sizeof(struct sockaddr_un));
+       if (rc == -1) {
+               ERR("pm socket sendto() failed");
+       } else
+               rc = 0;
+
+       close(sock);
+       return rc;
+}
+
+API int pm_change_state(unsigned int s_bits)
+{
+       /* s_bits is LCD_NORMAL 0x1, LCD_DIM 0x2, LCD_OFF 0x4, SUSPEND 0x8
+        * Stage change to NORMAL       0x100
+        * Stage change to LCDDIM       0x200
+        * Stage change to LCDOFF       0x400
+        * Stage change to SLEEP        0x800
+        * */
+       switch (s_bits) {
+       case LCD_NORMAL:
+       case LCD_DIM:
+       case LCD_OFF:
+       case SUSPEND:
+       case POWER_OFF:
+               break;
+       default:
+               return -1;
+       }
+       return send_msg(s_bits << SHIFT_CHANGE_STATE, 0);
+}
+
+API int pm_lock_state(unsigned int s_bits, unsigned int flag,
+                     unsigned int timeout)
+{
+       switch (s_bits) {
+       case LCD_NORMAL:
+       case LCD_DIM:
+       case LCD_OFF:
+               break;
+       default:
+               return -1;
+       }
+       if (flag & GOTO_STATE_NOW)
+               /* if the flag is true, go to the locking state directly */
+               s_bits = s_bits | (s_bits << SHIFT_CHANGE_STATE);
+       return send_msg(s_bits, timeout);
+}
+
+API int pm_unlock_state(unsigned int s_bits, unsigned int flag)
+{
+       switch (s_bits) {
+       case LCD_NORMAL:
+       case LCD_DIM:
+       case LCD_OFF:
+               break;
+       default:
+               return -1;
+       }
+
+       s_bits = (s_bits << SHIFT_UNLOCK);
+       s_bits = (s_bits | (flag << SHIFT_UNLOCK_PARAMETER));
+       return send_msg(s_bits, 0);
+}
+
diff --git a/pm.h b/pm.h
new file mode 100644 (file)
index 0000000..77d5ab5
--- /dev/null
+++ b/pm.h
@@ -0,0 +1,38 @@
+/*
+ *  libslp-pm
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: DongGi Jang <dg0402.jang@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/ 
+
+
+#ifndef __POWER_MANAGER_LIBRARY_I_H__
+#define __POWER_MANAGER_LIBRARY_I_H__
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#if defined(ENABLE_DLOG_OUT)
+#  define LOG_TAG      "PMAPI"
+#  include <dlog.h>
+#  define ERR  SLOGE
+#else
+#  define ERR  perror
+#endif
+
+#endif                         /* __POWER_MANAGER_LIBRARY_I_H__ */
diff --git a/pmapi.h b/pmapi.h
new file mode 100644 (file)
index 0000000..fbd9c6c
--- /dev/null
+++ b/pmapi.h
@@ -0,0 +1,197 @@
+/*
+ *  libslp-pm
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: DongGi Jang <dg0402.jang@samsung.com>
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/ 
+
+
+#ifndef __POWER_MANAGER_LIBRARY_H__
+#define __POWER_MANAGER_LIBRARY_H__
+
+/**
+ * @defgroup POWER_MANAGER Power manager library 
+ * @ingroup SYSTEM_FRAMEWORK
+ * @brief Power manager control API library
+ *
+ * @open
+ * @addtogroup POWER_MANAGER
+ * @{
+ * This library provides APIs to lock/unlock the power state of the system.
+ * Power Manager controls the power state as following.
+ * @image html power-manager-fsm.bmp "Fig. 1 State Diagram of Power Manager
+ * <br> If there is no user input for a certain time, PM changes the power state 
+ *  that has lower power consumption. <br> When the user input or other system interrupt occurs,
+ *  PM rolls the state back immediately.<br> If applications or other frameworks want to stop 
+ *  enter the specific state of power manager, use pm_lock_state() and pm_unlock_state()
+ *  <br> Be careful! A caller process should unlock the power state after locking without timeout.
+ *  <br> If you want to stay the LCD normal state, you can use 
+ *  @li @c pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, 0)
+ *  <p><br> After finishing your job with locking, call 
+ *  @li @c pm_unlock_state(LCD_NORMAL, PM_RESET_TIMER)
+ *  <p><br> Additionally, you can use the timeout for lock the state. 
+ *  If timeout is set, caller process doesn't need to call the unlock API. 
+ *  But the process should be alive.
+ *  If caller process is dead, lock condition would be drop by the power manager.
+ *  <p><br> Here is sample codes  
+ * @code
+
+#include "pmapi.h"
+int main(int argc, char** argv)
+{
+       int result;
+
+       printf("=========================================\n");
+       printf("=  Lock / Unlock to transit a power manager state   =\n");
+       printf("=========================================\n");
+
+       result = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW,0); //Lock on lcd-off until explicit unlock.
+       if (!result)
+               printf("SUCCESS");
+       else
+               printf("FAILED");
+
+       // DO something.
+
+       result = pm_unlock_state(LCD_NORMAL,PM_RESET_TIMER); //Unlock
+       if (!result)
+               printf("SUCCESS");
+       else
+               printf("FAILED");
+
+       result = pm_lock_state(LCD_OFF,STAY_CUR_STATE, 5000); // Lock on lcd-off during 5 seconds.
+       if (!result)
+               printf("SUCCESS");
+       else
+               printf("FAILED");
+
+       // DO something.
+       sleep(10);
+       
+       return 0;
+}
+ * @endcode 
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LCD_NORMAL     0x1   /**< NORMAL state */
+#define LCD_DIM                0x2  /**< LCD dimming state */
+#define LCD_OFF                0x4  /**< LCD off state */
+#define SUSPEND                0x8  /**< Sleep state */
+#define POWER_OFF      0x16  /**< Sleep state */
+#define SETALL (LCD_DIM | LCD_OFF | LCD_NORMAL)        /*< select all state - not supported yet */
+
+/* parameters for pm_lock_state() */
+#define GOTO_STATE_NOW 0x1
+#define STAY_CUR_STATE 0x0
+
+/* paramters for pm_unlcok_state() - details are described at 162 line */
+#define PM_SLEEP_MARGIN        0x0     /**< keep guard time for unlock */
+#define PM_RESET_TIMER 0x1     /**< reset timer for unlock */
+#define PM_KEEP_TIMER  0x2     /**< keep timer for unlock */
+
+/**
+ * @fn int pm_lock_state       (unsigned int state, 
+ *                                                      unsigned int flag, 
+ *                                                      unsigned int timeout);
+ * @brief This API is used to lock a particular power-state as the current power-state.\n
+ *             The parameter state specifies the power state which you want to lock LCD_NORMAL, LCD_DIM, LCD_OFF. \n
+ *             The second parameter Flag is set if you want to go the requested lock state directly.\n
+ *             The third parameter timeout specifies lock-timeout in milliseconds. 
+ *             If the value 0 is selected, the power state remains locked until pm_unlock_state is called.
+ * @param[in] state target power state which you want to lock - LCD_NORMAL, LCD_DIM, LCD_OFF
+ * @param[in] flag set if you want to go the lock state directly - GOTO_STATE_NOW, STAY_CUR_STATE
+ * @param[in] timeout lock-timeout in miliseconds. 
+ *                                       0 is always lock until calling pm_unlock_state
+ *                                       If you call this function with same state in duplicate, 
+ *                                       only last one will be processed and others are ignored.
+ * @return 0 on success, -1 if failed
+ * @see pm_unlock_state(), pm_change_state()
+ * @par Example
+ * @code
+ *     ...
+ *     // Lock current state as LCD_NORMAL 
+ *     result = pm_lock_state(LCD_NORMAL, GOTO_STATE_NOW, SET_TIMEOUT); 
+ *     if( result < 0 )
+ *             printf("[ERROR] return value result =%d, \n",result);
+ *     else
+ *             printf("[SUCCESS]return value result =%d \n",result);
+ *     ...
+ * @endcode 
+ */
+       int pm_lock_state(unsigned int, unsigned int, unsigned int);
+
+/**
+ * @fn int pm_unlock_state     (unsigned int state,
+ *                                                      unsigned int flag)
+ * @brief This API is used to Unlock the power state. \n
+ *             The parameter state specifies the power state which you want to unlock .
+ *             Some examples are LCD_NORMAL, LCD_DIM, LCD_OFF.\n
+ *             The second parameter flag is set if you want to go to the requested state directly after unlocking. (NOT SUPPOERTED YET) 
+ *             This is valid only when the current state transition was blocked by the locking and this function call releases the blocking.
+ * @param[in] state target power state which you want to unlock
+ * @param[in] flag set timer which is going to the next state after unlocking
+ *             PM_SLEEP_MARGIN - If the current status is lcd off, pm reset timer to 5 second. If the current status is not lcd off, pm pm uses the existing timer.
+ *             PM_RESET_TIMER - Power-manager resets timer. (lcd normal : reset timer to predfined value which is set in setting module,  lcd dim or off : reset timer to 5 seconds)
+ *             PM_KEEP_TIMER - Power-manager uses the existing timer (if timer is already expired, pm changes the status) <br>
+ * @return 0 on success, -1 if failed
+ * @see pn_lock_state(), pm_change_state()
+ * @par Example
+ * @code
+ *     ...
+ *     //Un-lock NORMAL state so that power state change can occur with system-events 
+ *     result = pm_unlock_state(LCD_NORMAL,PM_RESET_TIMER); 
+ *     if( result < 0 ) 
+ *             printf("[ERROR] return value result =%d, \n",result);
+ *     else
+ *             printf("[SUCCESS]return value result =%d \n",result);
+ *     ...
+ * @endcode
+ */
+       int pm_unlock_state(unsigned int, unsigned int);
+
+/**
+ * @fn int pm_change_state(unsigned int state);
+ * @brief This API is used to change the power manager state by force.
+ * @param[in] state power manager state - LCD_NORMAL, LCD_DIM, LCD_OFF
+ * @return 0 on success, -1 if failed.
+ * @see pm_lock_state(), pm_unlock_state()
+ * @pat Example
+ * @code
+ *     ...
+ *     result = pm_change_state(LCD_OFF);
+ *     if( result < 0 ) 
+ *              printf("[ERROR] return value result =%d, \n",result);
+ *      else
+ *              printf("[SUCCESS]return value result =%d \n",result);
+ *      ...
+ * @endcode
+ */
+       int pm_change_state(unsigned int);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __POWER_MANAGER_LIBRARY_H__ */
diff --git a/pmapi.pc.in b/pmapi.pc.in
new file mode 100644 (file)
index 0000000..f32c72f
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: libpmapi
+Description: power manager library
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -lpmapi
+Cflags: -I${includedir}