davinci: lights: Remove LCD backlight handling

Since composer HAL is now able to handle display brightness,
this can be removed from the lights HAL.

Change-Id: Ic10cead638382d448a94205bcec3543177d387f6
This commit is contained in:
Bruno Martins 2020-12-27 19:48:05 +00:00 committed by Arian
parent 8f53f7de33
commit 89e12ed874
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9
2 changed files with 1 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2019 The LineageOS Project
* Copyright (C) 2018-2020 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,7 +22,6 @@
#include <fstream>
#define PANEL_LED "/sys/class/backlight/panel0-backlight/"
#define NOTIFICATION_LED "/sys/class/leds/left/"
#define BREATH "breath"
@ -97,11 +96,6 @@ static inline uint32_t getScaledBrightness(const LightState& state, uint32_t max
return scaleBrightness(getBrightness(state), maxBrightness);
}
static void handleBacklight(const LightState& state) {
uint32_t brightness = getScaledBrightness(state, getMaxBrightness(PANEL_LED MAX_BRIGHTNESS));
set(PANEL_LED BRIGHTNESS, brightness);
}
static void handleNotification(const LightState& state) {
uint32_t notificationBrightness = getScaledBrightness(state, getMaxBrightness(NOTIFICATION_LED MAX_BRIGHTNESS));
@ -145,7 +139,6 @@ static std::vector<LightBackend> backends = {
{ Type::ATTENTION, handleNotification },
{ Type::NOTIFICATIONS, handleNotification },
{ Type::BATTERY, handleNotification },
{ Type::BACKLIGHT, handleBacklight },
};
static LightStateHandler findHandler(Type type) {

View File

@ -1,13 +1,9 @@
on boot
chown system system /sys/class/backlight/panel0-backlight/brightness
chown system system /sys/class/backlight/panel0-backlight/max_brightness
chown system system /sys/class/leds/left/brightness
chown system system /sys/class/leds/left/breath
chown system system /sys/class/leds/right/brightness
chown system system /sys/class/leds/right/breath
chmod 0644 /sys/class/backlight/panel0-backlight/brightness
chmod 0644 /sys/class/backlight/panel0-backlight/max_brightness
chmod 0644 /sys/class/leds/left/brightness
chmod 0644 /sys/class/leds/left/breath
chmod 0644 /sys/class/leds/right/brightness