Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

montblanc: reenabled hdmi and liblights update

  • Loading branch information...
commit 40be8b856396d9f5c27c0b74ccd92f7964e8fefe 1 parent 96e2cca
jerpelea freexperia authored
4 BoardConfigCommon.mk
View
@@ -28,8 +28,12 @@ BOARD_FORCE_RAMDISK_ADDRESS := 0x41200000
# Bluetooth
BOARD_HAVE_BLUETOOTH := true
+
+#audio
BOARD_USES_GENERIC_AUDIO := false
BOARD_USES_ALSA_AUDIO := true
+#BOARD_HAVE_FM_RADIO_STERICSSON := true
+COMMON_GLOBAL_CFLAGS += -DSTE_AUDIO
#WIFI
BOARD_WLAN_DEVICE := cw1200
38 config/init.st-ericsson.rc
View
@@ -232,6 +232,7 @@ on boot
# Permissions for Liblights.
chown system system /sys/class/leds/lcd-backlight/brightness
+ chown system system /sys/class/leds/lcd-backlight/als_enable
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/red/brightness
@@ -246,6 +247,20 @@ on boot
chown system system /sys/bus/i2c/drivers/as3677/2-0040/pattern_data
chown system system /sys/bus/i2c/drivers/as3677/2-0040/pattern_delay
chown system system /sys/bus/i2c/drivers/as3677/2-0040/pattern_duration_secs
+ chmod 660 /sys/class/leds/lcd-backlight/brightness
+ chmod 660 /sys/class/leds/lcd-backlight/device/als_enable
+ chmod 660 /sys/class/leds/button-backlight/brightness
+ chmod 660 /sys/class/leds/keyboard-backlight/brightness
+ chmod 660 /sys/class/leds/red/brightness
+ chmod 660 /sys/class/leds/red/use_pattern
+ chmod 660 /sys/class/leds/green/brightness
+ chmod 660 /sys/class/leds/green/use_pattern
+ chmod 660 /sys/class/leds/blue/brightness
+ chmod 660 /sys/class/leds/blue/use_pattern
+ chmod 660 /sys/class/leds/so34-led0/brightness
+ chmod 660 /sys/class/leds/so34-led1/brightness
+ chmod 660 /sys/class/leds/so34-led2/brightness
+
# Permissions for Libals.
chown system system /sys/bus/i2c/devices/2-0040/als_on
@@ -520,6 +535,18 @@ service usbid_init /system/bin/usbid_init.sh
class main
oneshot
+service hdmid /system/bin/hdmid
+ class main
+ socket hdmid stream 0660 system graphics
+ oneshot
+
+service hdmiproxyd /system/bin/hdmiproxyd
+ class main
+ user system
+ group graphics
+ socket hdmid stream 0660 system system
+ socket hdmic stream 0660 system system
+
# Start suntrold
service suntrold /system/bin/suntrold
user system
@@ -534,14 +561,3 @@ service suntrold /system/bin/suntrold
# class main
# user root
-#service hdmid /system/bin/hdmid
-# class main
-# socket hdmid stream 0660 system graphics
-# oneshot
-
-#service hdmiproxyd /system/bin/hdmiproxyd
-# class main
-# user system
-# group graphics
-# socket hdmid stream 0660 system system
-# socket hdmic stream 0660 system system
20 liblights/lights.c
View
@@ -104,11 +104,16 @@ static int rgb_to_brightness (struct light_state_t const* state) {
/* The actual lights controlling section */
static int set_light_backlight (struct light_device_t *dev, struct light_state_t const *state) {
int err = 0;
+ int enable = 0;
int brightness = rgb_to_brightness(state);
+ if ((state->brightnessMode == BRIGHTNESS_MODE_SENSOR) && (brightness > 0))
+ enable = 1;
+
LOGV("%s brightness=%d", __func__, brightness);
pthread_mutex_lock(&g_lock);
- err = write_int (LCD_BACKLIGHT_FILE, brightness);
+ err = write_int (ALS_FILE, enable);
+ err |= write_int (LCD_BACKLIGHT_FILE, brightness);
pthread_mutex_unlock(&g_lock);
return err;
@@ -144,10 +149,12 @@ static void set_shared_light_locked (struct light_device_t *dev, struct light_st
g = (state->color >> 8) & 0xFF;
b = (state->color) & 0xFF;
- delayOn = state->flashOnMS;
+ delayOn = state->flashOnMS;
delayOff = state->flashOffMS;
- if (state->flashMode != LIGHT_FLASH_NONE) {
+ switch (state->flashMode) {
+ case LIGHT_FLASH_TIMED:
+ case LIGHT_FLASH_HARDWARE:
write_string (RED_LED_FILE_TRIGGER, "timer");
write_string (GREEN_LED_FILE_TRIGGER, "timer");
write_string (BLUE_LED_FILE_TRIGGER, "timer");
@@ -159,10 +166,13 @@ static void set_shared_light_locked (struct light_device_t *dev, struct light_st
write_int (RED_LED_FILE_DELAYOFF, delayOff);
write_int (GREEN_LED_FILE_DELAYOFF, delayOff);
write_int (BLUE_LED_FILE_DELAYOFF, delayOff);
- } else {
+ break;
+
+ case LIGHT_FLASH_NONE:
write_string (RED_LED_FILE_TRIGGER, "none");
write_string (GREEN_LED_FILE_TRIGGER, "none");
write_string (BLUE_LED_FILE_TRIGGER, "none");
+ break;
}
write_int (RED_LED_FILE, r);
@@ -232,7 +242,7 @@ static int open_lights (const struct hw_module_t* module, char const* name,
struct light_device_t *dev = malloc(sizeof (struct light_device_t));
memset(dev, 0, sizeof(*dev));
- dev->common.tag = HARDWARE_DEVICE_TAG;
+ dev->common.tag = HARDWARE_DEVICE_TAG;
dev->common.version = 0;
dev->common.module = (struct hw_module_t*)module;
dev->common.close = (int (*)(struct hw_device_t*))close_lights;
2  liblights/lights.h
View
@@ -23,4 +23,4 @@ char const*const BUTTON_BACKLIGHT_FILE[] = {
char const*const LCD_BACKLIGHT_FILE = "/sys/class/leds/lcd-backlight/brightness";
-//char const*const ALS_FILE = "/sys/class/leds/lcd-backlight/als/enable";
+char const*const ALS_FILE = "/sys/class/leds/lcd-backlight/device/als_enable";
Please sign in to comment.
Something went wrong with that request. Please try again.