forked from enlightenment/enlightenment
fix up wheel issue with bl module
should make bl work on archos on anchient kernel now... missed support code from e_backlight.c SVN revision: 61277
This commit is contained in:
parent
a2ac69cd09
commit
ad7ad9a092
|
@ -285,6 +285,20 @@ _bl_sys_find(void)
|
||||||
free(file);
|
free(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (maxval <= 0)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
tryfile = "/sys/class/leds/lcd-backlight/brightness";
|
||||||
|
if (stat(tryfile, &st) == 0)
|
||||||
|
{
|
||||||
|
tryfile = "/sys/class/leds/lcd-backlight/max_brightness";
|
||||||
|
bl_sysval = eina_stringshare_add(tryfile);
|
||||||
|
maxval = _bl_sys_num_get(tryfile);
|
||||||
|
if (maxval <= 0) maxval = 255;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,12 +318,12 @@ _bl_sys_level_get(void)
|
||||||
strcat(p, "brightness");
|
strcat(p, "brightness");
|
||||||
}
|
}
|
||||||
maxval = _bl_sys_num_get(maxfile);
|
maxval = _bl_sys_num_get(maxfile);
|
||||||
if (maxval > 0)
|
if (maxval < 0) maxval = 255;
|
||||||
{
|
val = _bl_sys_num_get(valfile);
|
||||||
val = _bl_sys_num_get(valfile);
|
if ((val >= 0) && (val <= maxval))
|
||||||
if ((val >= 0) && (val <= maxval))
|
bl_val = (double)val / (double)maxval;
|
||||||
bl_val = (double)val / (double)maxval;
|
printf("GET: %i/%i (%1.3f)\n", val, maxval, bl_val);
|
||||||
}
|
free(valfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -343,6 +357,7 @@ _bl_sys_level_set(double val)
|
||||||
bl_sys_pending_set = EINA_TRUE;
|
bl_sys_pending_set = EINA_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
printf("SET: %1.3f\n", val);
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s/enlightenment/utils/enlightenment_backlight %i",
|
"%s/enlightenment/utils/enlightenment_backlight %i",
|
||||||
e_prefix_lib_get(), (int)(val * 1000.0));
|
e_prefix_lib_get(), (int)(val * 1000.0));
|
||||||
|
|
|
@ -154,7 +154,7 @@ main(int argc,
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
snprintf(file, sizeof(file), "/sys/class/leds/lcd-backlight/brightness");
|
snprintf(file, sizeof(file), "/sys/class/leds/lcd-backlight/brightness");
|
||||||
if (stat(file, &st) >= 0)
|
if (stat(file, &st) == 0)
|
||||||
{
|
{
|
||||||
maxlevel = 255;
|
maxlevel = 255;
|
||||||
maxstr = read_file("/sys/devices/leds/lcd-backlight/max_brightness");
|
maxstr = read_file("/sys/devices/leds/lcd-backlight/max_brightness");
|
||||||
|
@ -162,6 +162,7 @@ main(int argc,
|
||||||
{
|
{
|
||||||
maxlevel = atoi(maxstr);
|
maxlevel = atoi(maxstr);
|
||||||
free(maxstr);
|
free(maxstr);
|
||||||
|
if (maxlevel <= 0) maxlevel = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,7 +350,6 @@ _backlight_cb_mouse_wheel(void *data, Evas *evas __UNUSED__, Evas_Object *obj __
|
||||||
double v;
|
double v;
|
||||||
Instance *inst = data;
|
Instance *inst = data;
|
||||||
|
|
||||||
e_backlight_update();
|
|
||||||
inst->val = e_backlight_level_get(inst->gcc->gadcon->zone);
|
inst->val = e_backlight_level_get(inst->gcc->gadcon->zone);
|
||||||
if (ev->z > 0)
|
if (ev->z > 0)
|
||||||
_backlight_level_decrease(inst);
|
_backlight_level_decrease(inst);
|
||||||
|
|
Loading…
Reference in New Issue