From 0a7b23097ad033fb6f27fbbfd69e351c6acddef2 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 1 Oct 2020 08:36:05 -0400 Subject: Hosted: Improvements in the LCD code. (Roman Stolyarov) * Kill LCD when turning off the backlight * Fix logic errors in lcd_enable() calls * Use ioctls instead of sysfs to twiddle lcd enable Change-Id: I6864ff63d87b747ac48719b0f4ba2de00333a1d3 --- firmware/target/hosted/backlight-unix.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'firmware/target/hosted/backlight-unix.c') diff --git a/firmware/target/hosted/backlight-unix.c b/firmware/target/hosted/backlight-unix.c index 2f00787f72..28bda52b20 100644 --- a/firmware/target/hosted/backlight-unix.c +++ b/firmware/target/hosted/backlight-unix.c @@ -7,6 +7,7 @@ * \/ \/ \/ \/ \/ * * Copyright (C) 2017 Marcin Bukat + * Copyright (C) 2019 by Roman Stolyarov * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -28,6 +29,7 @@ #include "backlight-target.h" #include "sysfs.h" #include "panic.h" +#include "lcd.h" static const char * const sysfs_bl_brightness = "/sys/class/backlight/pwm-backlight.0/brightness"; @@ -44,12 +46,18 @@ bool backlight_hw_init(void) void backlight_hw_on(void) { +#ifdef HAVE_LCD_ENABLE + lcd_enable(true); +#endif sysfs_set_int(sysfs_bl_power, 0); } void backlight_hw_off(void) { sysfs_set_int(sysfs_bl_power, 1); +#ifdef HAVE_LCD_ENABLE + lcd_enable(false); +#endif } void backlight_hw_brightness(int brightness) -- cgit v1.2.3