From 5af8701925f99477e79e85d7d31fb15be4d1a7a2 Mon Sep 17 00:00:00 2001 From: Arian Date: Fri, 8 May 2020 14:59:57 +0200 Subject: [PATCH] davinci: lights: Adjust for davincis LEDs Change-Id: If9e5afe292b023a8aa4d5ba509e206f9a4ff371f --- light/Light.cpp | 18 +++++++++--------- ...droid.hardware.light@2.0-service.davinci.rc | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/light/Light.cpp b/light/Light.cpp index 54d05b3..a9b58f4 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -22,11 +22,11 @@ #include -#define LCD_LED "/sys/class/backlight/panel0-backlight/" -#define WHITE_LED "/sys/class/leds/white/" +#define PANEL_LED "/sys/class/backlight/panel0-backlight/" +#define NOTIFICATION_LED "/sys/class/leds/green/" -#define BREATH "breath" -#define BRIGHTNESS "brightness" +#define BREATH "breath" +#define BRIGHTNESS "brightness" #define MAX_LED_BRIGHTNESS 255 #define MAX_LCD_BRIGHTNESS 4095 @@ -83,24 +83,24 @@ static inline uint32_t getScaledBrightness(const LightState& state, uint32_t max static void handleBacklight(const LightState& state) { uint32_t brightness = getScaledBrightness(state, MAX_LCD_BRIGHTNESS); - set(LCD_LED BRIGHTNESS, brightness); + set(PANEL_LED BRIGHTNESS, brightness); } static void handleNotification(const LightState& state) { - uint32_t whiteBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); + uint32_t notificationBrightness = getScaledBrightness(state, MAX_LED_BRIGHTNESS); /* Disable breathing or blinking */ - set(WHITE_LED BREATH, 0); + set(NOTIFICATION_LED BREATH, 0); switch (state.flashMode) { case Flash::HARDWARE: case Flash::TIMED: /* Breathing */ - set(WHITE_LED BREATH, 1); + set(NOTIFICATION_LED BREATH, 1); break; case Flash::NONE: default: - set(WHITE_LED BRIGHTNESS, whiteBrightness); + set(NOTIFICATION_LED BRIGHTNESS, notificationBrightness); } } diff --git a/light/android.hardware.light@2.0-service.davinci.rc b/light/android.hardware.light@2.0-service.davinci.rc index 9bd6ad6..c550d82 100644 --- a/light/android.hardware.light@2.0-service.davinci.rc +++ b/light/android.hardware.light@2.0-service.davinci.rc @@ -1,13 +1,13 @@ 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/white/brightness - chown system system /sys/class/leds/white/breath + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/green/breath chmod 0644 /sys/class/backlight/panel0-backlight/brightness chmod 0644 /sys/class/backlight/panel0-backlight/max_brightness - chmod 0644 /sys/class/leds/white/brightness - chmod 0644 /sys/class/leds/white/breath + chmod 0644 /sys/class/leds/green/brightness + chmod 0644 /sys/class/leds/green/breath service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.davinci interface android.hardware.light@2.0::ILight default