5 * @file energy/lcd/lcd_base.h
6 * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * Copyright (C) Samsung Electronics, 2013
26 * @section DESCRIPTION
27 * Description of the interface for interacting with LСD
31 #include <linux/errno.h>
32 #include <energy/rational_debugfs.h>
35 /** Description of actions */
36 enum lcd_action_type {
37 LAT_BRIGHTNESS, /**< LCD brightness */
38 LAT_POWER /**< LCD power */
42 /** Description of parameters */
43 enum lcd_parameter_type {
44 LPD_MIN_BRIGHTNESS, /**< minimum brightness value */
45 LPD_MAX_BRIGHTNESS, /**< maximum brightness value */
46 LPD_BRIGHTNESS, /**< current brightness value */
48 LPD_POWER /**< current power value */
54 * @brief LCD callback type
56 * @param ops LCD operations
59 typedef int (*call_lcd)(struct lcd_ops *ops);
62 * @brief LCD notifier type
64 * @param ops LCD operations
65 * @param action Event type
69 typedef int (*notifier_lcd)(struct lcd_ops *ops, enum lcd_action_type action,
73 * @brief LCD parameter type
75 * @param ops LCD operations
76 * @param type Requested parameter type
77 * @return Requested parameter value
80 typedef unsigned long (*get_parameter_lcd)(struct lcd_ops *ops,
81 enum lcd_parameter_type type);
86 * @breaf set of operations available for LСD
89 char *name; /**< LCD driver name */
90 notifier_lcd notifier; /**< Notifier */
91 get_parameter_lcd get; /**< Method to obtain the parameters */
93 call_lcd check; /**< LCD check on device */
94 call_lcd set; /**< LCD initialization */
95 call_lcd unset; /**< LCD deinitialization */
98 struct dentry *dentry; /**< Dentry of debugfs for this LCD */
99 struct rational min_coef; /**< Minimum coefficient */
100 struct rational max_coef; /**< Maximum coefficient */
102 void *priv; /**< Private data */
105 size_t get_lcd_size_array(struct lcd_ops *ops);
106 void get_lcd_array_time(struct lcd_ops *ops, u64 *array_time);
108 int read_val(const char *path);
110 int lcd_set_energy(void);
111 void lcd_unset_energy(void);
116 #endif /* _LCD_BASE_H */