#define __DEVICE_INTERFACE_H__
#include <stdbool.h>
-#include "core/devices.h"
+#include <hal/device/hal-display.h>
+#include "shared/devices.h"
#define FLAG_X_DPMS 0x2
#define PM_MAX_BRIGHTNESS 100
#define PM_MIN_BRIGHTNESS 1
-#define PM_DEFAULT_BRIGHTNESS 60
#define PM_DIM_BRIGHTNESS 0
-#define PM_LCD_RETRY_CNT 3
-
#define DISP_INDEX_SHIFT 16
#define DISP_CMD(prop, index) ((index << DISP_INDEX_SHIFT) | prop)
#define DEFAULT_DISPLAY_COUNT 1
#define DEFAULT_DISPLAY_MAX_BRIGHTNESS 100
+#define DEFAULT_DISPLAY_MAX_DIM_BRIGHTNESS 50
+
+#define DPMS_SETTING_DONE -1
/*
* Event type enumeration
int display_service_free(void);
struct _backlight_ops {
- int (*off)(enum device_flags);
- int (*dim)(void);
- int (*on)(enum device_flags);
- int (*update)(void);
- int (*standby)(int);
- int (*set_default_brt)(int level);
int (*get_lcd_power)(void);
- int (*set_custom_status)(bool on);
- bool (*get_custom_status)(void);
- int (*save_custom_brightness)(void);
- int (*custom_update)(void);
- int (*set_force_brightness)(int level);
int (*set_brightness)(int val);
int (*get_brightness)(int *val);
- int (*get_brightness_by_light_sensor)(float lmax, float lmin, float light, int *brt);
-};
-
-struct _power_ops {
- int (*suspend)(void);
- int (*enable_autosleep)(void);
- int (*power_lock)(void);
- int (*power_unlock)(void);
- int (*get_power_lock_support)(void);
- int (*check_wakeup_src)(void);
- int (*get_wakeup_count)(int *cnt);
- int (*set_wakeup_count)(int cnt);
+ int (*get_brightness_raw)(int *val);
+ void (*restore_brightness_func)(void);
+ int (*transit_state)(int state);
+ void (*transit_brt)(int start, int end, int step);
};
-extern struct _backlight_ops backlight_ops;
-extern struct _power_ops power_ops;
+struct _backlight_ops *get_var_backlight_ops(void);
enum dpms_state {
DPMS_ON, /* In use */
DPMS_STANDBY, /* Blanked, low power */
DPMS_SUSPEND, /* Blanked, lower power */
DPMS_OFF, /* Shut off, awaiting activity */
+ DPMS_FORCE_OFF,/* Force Shut off */
+ DPMS_DETACH, /* Display detached */
};
-int dpms_set_power(enum dpms_state state);
-int dpms_get_power(enum dpms_state *state);
+bool display_dev_ready(void);
+bool display_dimstay_check(void);
+void dpms_set_running_state(int val);
+
+enum lcdon_block_state {
+ LCDON_BLOCK_NONE = 0,
+ LCDON_BLOCK_WHEN_DISPLAY_DETACHED,
+ LCDON_BLOCK_DURING_SILENT_BOOT,
+};
+int is_lcdon_blocked(void);
#endif