summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/backlight-unix.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-01 08:36:05 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-01 12:49:39 +0000
commit0a7b23097ad033fb6f27fbbfd69e351c6acddef2 (patch)
tree9d87f43f468cd1fb7dc901be9259b67826cfa216 /firmware/target/hosted/backlight-unix.c
parentcb9b5d3b50425dd298e48d7d31cfff17be9f3c96 (diff)
downloadrockbox-0a7b23097ad033fb6f27fbbfd69e351c6acddef2.tar.gz
rockbox-0a7b23097ad033fb6f27fbbfd69e351c6acddef2.zip
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
Diffstat (limited to 'firmware/target/hosted/backlight-unix.c')
-rw-r--r--firmware/target/hosted/backlight-unix.c8
1 files changed, 8 insertions, 0 deletions
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 @@
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * 8 *
9 * Copyright (C) 2017 Marcin Bukat 9 * Copyright (C) 2017 Marcin Bukat
10 * Copyright (C) 2019 by Roman Stolyarov
10 * 11 *
11 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
@@ -28,6 +29,7 @@
28#include "backlight-target.h" 29#include "backlight-target.h"
29#include "sysfs.h" 30#include "sysfs.h"
30#include "panic.h" 31#include "panic.h"
32#include "lcd.h"
31 33
32static const char * const sysfs_bl_brightness = 34static const char * const sysfs_bl_brightness =
33 "/sys/class/backlight/pwm-backlight.0/brightness"; 35 "/sys/class/backlight/pwm-backlight.0/brightness";
@@ -44,12 +46,18 @@ bool backlight_hw_init(void)
44 46
45void backlight_hw_on(void) 47void backlight_hw_on(void)
46{ 48{
49#ifdef HAVE_LCD_ENABLE
50 lcd_enable(true);
51#endif
47 sysfs_set_int(sysfs_bl_power, 0); 52 sysfs_set_int(sysfs_bl_power, 0);
48} 53}
49 54
50void backlight_hw_off(void) 55void backlight_hw_off(void)
51{ 56{
52 sysfs_set_int(sysfs_bl_power, 1); 57 sysfs_set_int(sysfs_bl_power, 1);
58#ifdef HAVE_LCD_ENABLE
59 lcd_enable(false);
60#endif
53} 61}
54 62
55void backlight_hw_brightness(int brightness) 63void backlight_hw_brightness(int brightness)