2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __PM_X_LCD_ONOFF_C__
19 #define __PM_X_LCD_ONOFF_C__
25 #include "pm_device_plugin.h"
27 #define CMD_STANDBY "standby"
30 static int pm_x_set_lcd_backlight(struct _PMSys *p, int onoff)
36 LOGDBG("Backlight onoff=%d", onoff);
37 if (onoff == STATUS_ON)
38 snprintf(cmd_line, sizeof(cmd_line), "%s", CMD_STANDBY);
40 snprintf(cmd_line, sizeof(cmd_line), "%s", CMD_OFF);
42 signal(SIGCHLD, SIG_DFL);
46 LOGERR("[1] Failed to fork child process for LCD On/Off");
51 LOGINFO("[1] Child proccess for LCD %s was created (%s)",
52 ((onoff == STATUS_ON) ? "ON" : "OFF"), cmd_line);
53 execl("/usr/bin/xset", "/usr/bin/xset", "dpms", "force",
56 } else if (pid != (ret = waitpid(pid, NULL, 0))) {
58 ("[1] Waiting failed for the child process pid: %d, ret: %d, errno: %d",
62 signal(SIGCHLD, SIG_IGN);
66 #endif /*__PM_X_LCD_ONOFF_C__ */