Merge pull request #12508 from CTCaer/unix-bl-bri-fix
plat: unix: correct backlight max_brightness path
This commit is contained in:
commit
32ed7ed1d7
|
@ -1349,15 +1349,15 @@ static void frontend_unix_set_screen_brightness(int value)
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
char svalue[16] = {0};
|
char svalue[16] = {0};
|
||||||
unsigned int max_brightness = 100;
|
unsigned int max_brightness = 100;
|
||||||
#if !defined(HAVE_LAKKA_SWITCH)
|
|
||||||
filestream_read_file("/sys/devices/platform/backlight/backlight/backlight/max_brightness",
|
/* Device tree should have 'label = "backlight";' if control is desirable */
|
||||||
|
filestream_read_file("/sys/class/backlight/backlight/max_brightness",
|
||||||
&buffer, NULL);
|
&buffer, NULL);
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
sscanf(buffer, "%u", &max_brightness);
|
sscanf(buffer, "%u", &max_brightness);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Calculate the brightness */
|
/* Calculate the brightness */
|
||||||
value = (value * max_brightness) / 100;
|
value = (value * max_brightness) / 100;
|
||||||
|
@ -2827,7 +2827,7 @@ frontend_ctx_driver_t frontend_ctx_unix = {
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_LAKKA_SWITCH) || (defined(HAVE_LAKKA) && defined(HAVE_ODROIDGO2))
|
#if defined(HAVE_LAKKA_SWITCH) || (defined(HAVE_LAKKA) && defined(HAVE_ODROIDGO2))
|
||||||
frontend_unix_set_screen_brightness,/* set_screen_brightness */
|
frontend_unix_set_screen_brightness,/* set_screen_brightness */
|
||||||
#else
|
#else
|
||||||
NULL, /* set_screen_brightness */
|
NULL, /* set_screen_brightness */
|
||||||
#endif
|
#endif
|
||||||
frontend_unix_watch_path_for_changes,
|
frontend_unix_watch_path_for_changes,
|
||||||
|
|
Loading…
Reference in New Issue