Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80b78266 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "minui: Allow devices to blank/unblank using LCD backlight" into cm-10.2

parents 110942f6 0929066e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -35,6 +35,10 @@ ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
  LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
endif

ifneq ($(TARGET_RECOVERY_LCD_BACKLIGHT_PATH),)
  LOCAL_CFLAGS += -DRECOVERY_LCD_BACKLIGHT_PATH=$(TARGET_RECOVERY_LCD_BACKLIGHT_PATH)
endif

# Some devices need kernel headers for graphics
ifeq ($(TARGET_PREBUILT_KERNEL),)
  LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+12 −0
Original line number Diff line number Diff line
@@ -426,9 +426,21 @@ gr_pixel *gr_fb_data(void)

void gr_fb_blank(bool blank)
{
#ifdef RECOVERY_LCD_BACKLIGHT_PATH
    int fd;

    fd = open(RECOVERY_LCD_BACKLIGHT_PATH, O_RDWR);
    if (fd < 0) {
        perror("cannot open LCD backlight");
        return;
    }
    write(fd, blank ? "000" : "127", 3);
    close(fd);
#else
    int ret;

    ret = ioctl(gr_fb_fd, FBIOBLANK, blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK);
    if (ret < 0)
        perror("ioctl(): blank");
#endif
}