#include "display-plugin.h"
#include "display-signal.h"
#include "display-state-transition.h"
+#include "display-util.h"
#include "led/touch-key.h"
#define MAX_WHITE_BALANCE_GAIN 2047
void display_panel_lcd_on_procedure(int state, enum device_flags flag)
{
unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
+ display_util_get_device_flags(&flags);
flags |= flag;
if (display_plugin_lcd_on_procedure(state, flag) == 0)
void display_panel_lcd_off_procedure(enum device_flags flag)
{
unsigned long flags = NORMAL_MODE;
- display_plugin_get_device_flags(&flags);
+ display_util_get_device_flags(&flags);
flags |= flag;
if (display_plugin_lcd_off_procedure(flag) == 0)
*/
#include <errno.h>
-#include "display-misc.h"
#include "display-plugin.h"
#include "shared/log-macro.h"
if (!device_flags)
return -EINVAL;
- if (g_display_plugin.get_device_flags)
- return g_display_plugin.get_device_flags(device_flags);
-
- *device_flags = NORMAL_MODE;
- bool lcd_paneloff_mode = false;
- bool stay_touchscreen_off = false;
- display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
- display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
-
- if (lcd_paneloff_mode)
- *device_flags |= LCD_PANEL_OFF_MODE;
-
- if (stay_touchscreen_off)
- *device_flags |= TOUCH_SCREEN_OFF_MODE;
+ if (!g_display_plugin.get_device_flags)
+ return -EOPNOTSUPP;
- return 0;
+ return g_display_plugin.get_device_flags(device_flags);
}
\ No newline at end of file
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "display-misc.h"
+#include "display-plugin.h"
#include "display-util.h"
int display_util_get_device_flags_name(enum device_flags flags, const char **flag_name)
*flag_name = UNKNOWN_STR;
return 0;
-}
\ No newline at end of file
+}
+
+int display_util_get_device_flags(unsigned long *device_flags)
+{
+ bool lcd_paneloff_mode = false;
+ bool stay_touchscreen_off = false;
+
+ if (!device_flags)
+ return -EINVAL;
+
+ if (g_display_plugin.get_device_flags)
+ return display_plugin_get_device_flags(device_flags);
+
+ *device_flags = NORMAL_MODE;
+ display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
+ display_misc_get_stay_touchscreen_off(&stay_touchscreen_off);
+
+ if (lcd_paneloff_mode)
+ *device_flags |= LCD_PANEL_OFF_MODE;
+
+ if (stay_touchscreen_off)
+ *device_flags |= TOUCH_SCREEN_OFF_MODE;
+
+ return 0;
+}
#define NSEC_TO_SEC(x) ((x)/1000000000.0)
int display_util_get_device_flags_name(enum device_flags flags, const char **flag_name);
+int display_util_get_device_flags(unsigned long *device_flags);
#endif /* __DISPLAY_UTIL_H__ */
\ No newline at end of file