#define BACKLIGHT_PATH "/sys/class/backlight/panel"
#endif
+#ifndef LCD_PATH
+#define LCD_PATH "/sys/class/lcd/panel"
+#endif
+
static int display_get_max_brightness(int *val)
{
static int max = -1;
return 0;
}
+static int display_get_state(enum display_state *state)
+{
+ int r, v;
+
+ r = sys_get_int(LCD_PATH"/lcd_power", &v);
+ if (r < 0) {
+ _E("fail to get state (errno:%d)", r);
+ return r;
+ }
+
+ //remap LCD state
+ switch (v) {
+ case 0:
+ *state = DISPLAY_ON;
+ break;
+ case 4:
+ *state = DISPLAY_OFF;
+ break;
+ default:
+ *state = -EINVAL;
+ break;
+ }
+
+ return 0;
+}
+
static int display_open(struct hw_info *info,
const char *id, struct hw_common **common)
{
display_dev->get_max_brightness = display_get_max_brightness;
display_dev->get_brightness = display_get_brightness;
display_dev->set_brightness = display_set_brightness;
+ display_dev->get_state = display_get_state;
*common = (struct hw_common *)display_dev;
return 0;