1 /* include/linux/sbsuspend.h
3 * This software is licensed under the terms of the GNU General Public
4 * License version 2, as published by the Free Software Foundation, and
5 * may be copied, distributed, and modified under those terms.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
14 #ifndef _LINUX_SBSUSPEND_H
15 #define _LINUX_SBSUSPEND_H
17 #ifdef CONFIG_HAS_SBSUSPEND
18 #include <linux/list.h>
23 SB_LEVEL_DISABLE_TOUCH
= 50,
24 SB_LEVEL_DISABLE_KEYPAD
= 100,
25 SB_LEVEL_DISABLE_FB
= 150,
28 //smartbook handler structure
30 #ifdef CONFIG_HAS_SBSUSPEND
31 struct list_head link
;
34 void (*plug_in
)(struct sb_handler
*h
);
35 void (*plug_out
)(struct sb_handler
*h
);
36 void (*enable
)(struct sb_handler
*h
);
37 void (*disable
)(struct sb_handler
*h
);
38 void (*suspend
)(struct sb_handler
*h
);
39 void (*resume
)(struct sb_handler
*h
);
44 typedef int __bitwise sb_state_t
;
45 #define SB_STATE_DISABLE ((__force sb_state_t) 0)
46 #define SB_STATE_ENABLE ((__force sb_state_t) 1)
47 #define SB_STATE_SUSPEND ((__force sb_state_t) 2)
48 #define SB_STATE_RESUME ((__force sb_state_t) 3)
49 #define SB_STATE_MAX ((__force sb_state_t) 4)
52 typedef int __bitwise sb_event_t;
53 #define SB_EVENT_ENABLE ((__force sb_state_t) 0)
54 #define SB_EVENT_DISABLE ((__force sb_state_t) 1)
55 #define SB_EVENT_SUSPEND ((__force sb_state_t) 2)
56 #define SB_EVENT_RESUME ((__force sb_state_t) 3)
59 #ifdef CONFIG_HAS_SBSUSPEND
61 //for peripheral drivers who is smartbook aware to register handler (process context)
62 extern void register_sb_handler(struct sb_handler
*handler
);
63 extern void unregister_sb_handler(struct sb_handler
*handler
);
65 //for tester to execute callbacks directly (process context)
66 extern void sb_enable(void);
67 extern void sb_disable(void);
68 extern void sb_suspend(void);
69 extern void sb_resume(void);
71 //for hdmi driver to notify plug in/out event
72 extern void sb_plug_in(void);
73 extern void sb_plug_out(void);
77 #define register_sb_handler(handler) do { } while (0)
78 #define unregister_sb_handler(handler) do { } while (0)
79 #define sb_enable() do { } while (0)
80 #define sb_disable() do { } while (0)
81 #define sb_suspend() do { } while (0)
82 #define sb_resume() do { } while (0)
86 #endif //#ifndef _LINUX_SBSUSPEND_H