[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 };
36
37 enum lcd_parameter_type {
38         LPD_MIN_BRIGHTNESS,
39         LPD_MAX_BRIGHTNESS,
40         LPD_BRIGHTNESS
41 };
42
43 struct lcd_ops;
44
45 typedef int (*call_lcd)(struct lcd_ops *ops);
46 typedef int (*notifier_lcd)(struct lcd_ops *ops, enum lcd_action_type action,
47                             void *data);
48 typedef unsigned long (*get_parameter_lcd)(struct lcd_ops *ops,
49                                            enum lcd_parameter_type type);
50
51
52 struct lcd_ops {
53         char *name;
54         notifier_lcd notifier;
55         get_parameter_lcd get;
56
57         call_lcd check;
58         call_lcd set;
59         call_lcd unset;
60
61         /* for debugfs */
62         struct dentry *dentry;
63         struct rational min_coef;
64         struct rational max_coef;
65
66         void *priv;
67 };
68
69 size_t get_lcd_size_array(struct lcd_ops *ops);
70 void get_lcd_array_time(struct lcd_ops *ops, u64 *array_time);
71
72 int read_val(const char *path);
73
74 int lcd_set_energy(void);
75 void lcd_unset_energy(void);
76
77 int lcd_init(void);
78 void lcd_exit(void);
79
80 #endif /* _LCD_BASE_H */