Merge "[REFACTOR] Buffer: move getting next queue element into separate function"
[kernel/swap-modules.git] / energy / lcd / lcd_base.h
1 #ifndef _LCD_BASE_H
2 #define _LCD_BASE_H
3
4 /*
5  *  Dynamic Binary Instrumentation Module based on KProbes
6  *  energy/lcd/lcd_base.h
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  * Copyright (C) Samsung Electronics, 2013
23  *
24  * 2013         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
25  *
26  */
27
28
29 #include <linux/errno.h>
30 #include <energy/rational_debugfs.h>
31
32
33 enum lcd_action_type {
34         LAT_BRIGHTNESS,
35         LAT_POWER
36 };
37
38 enum lcd_parameter_type {
39         LPD_MIN_BRIGHTNESS,
40         LPD_MAX_BRIGHTNESS,
41         LPD_BRIGHTNESS,
42
43         LPD_POWER
44 };
45
46 struct lcd_ops;
47
48 typedef int (*call_lcd)(struct lcd_ops *ops);
49 typedef int (*notifier_lcd)(struct lcd_ops *ops, enum lcd_action_type action,
50                             void *data);
51 typedef unsigned long (*get_parameter_lcd)(struct lcd_ops *ops,
52                                            enum lcd_parameter_type type);
53
54
55 struct lcd_ops {
56         char *name;
57         notifier_lcd notifier;
58         get_parameter_lcd get;
59
60         call_lcd check;
61         call_lcd set;
62         call_lcd unset;
63
64         /* for debugfs */
65         struct dentry *dentry;
66         struct rational min_coef;
67         struct rational max_coef;
68
69         void *priv;
70 };
71
72 size_t get_lcd_size_array(struct lcd_ops *ops);
73 void get_lcd_array_time(struct lcd_ops *ops, u64 *array_time);
74
75 int read_val(const char *path);
76
77 int lcd_set_energy(void);
78 void lcd_unset_energy(void);
79
80 int lcd_init(void);
81 void lcd_exit(void);
82
83 #endif /* _LCD_BASE_H */