4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * @file device-interface.h
22 * @brief backlight, touch, power devices interface module header
24 #ifndef __DEVICE_INTERFACE_H__
25 #define __DEVICE_INTERFACE_H__
28 #include "core/devices.h"
30 #define FLAG_X_DPMS 0x2
32 #define DEFAULT_DISPLAY 0
34 #define PM_MAX_BRIGHTNESS 100
35 #define PM_MIN_BRIGHTNESS 1
36 #define PM_DEFAULT_BRIGHTNESS 60
38 #define PM_LCD_POWER_ON 0
39 #define PM_LCD_POWER_OFF 4
41 #define PM_LCD_RETRY_CNT 3
42 #define STATUS_STANDBY (STATUS_ON + 1)
44 #define DISP_INDEX_SHIFT 16
45 #define DISP_CMD(prop, index) ((index << DISP_INDEX_SHIFT) | prop)
48 * Event type enumeration
51 EVENT_TIMEOUT = 0, /*< time out event from timer */
52 EVENT_DEVICE = EVENT_TIMEOUT, /*< wake up by devices except input devices */
53 EVENT_INPUT, /*< input event from noti service */
57 extern int init_sysfs(unsigned int);
58 extern int exit_sysfs(void);
60 struct _backlight_ops {
61 int (*off)(enum device_flags);
63 int (*on)(enum device_flags);
67 int (*set_default_brt)(int level);
68 int (*get_lcd_power)(void);
69 int (*set_custom_status)(bool on);
70 bool (*get_custom_status)(void);
71 int (*save_custom_brightness)(void);
72 int (*custom_update)(void);
73 int (*set_force_brightness)(int level);
78 int (*pre_suspend)(void);
79 int (*post_resume)(void);
80 int (*power_lock)(void);
81 int (*power_unlock)(void);
82 int (*get_power_lock_support)(void);
83 int (*check_wakeup_src)(void);
86 extern struct _backlight_ops backlight_ops;
87 extern struct _power_ops power_ops;