[Elephone P8000] Stefan Gündhör:
The LED button brightness driver for our P8000 works like this:

if(pmic_type == MT65XX_LED_PMIC_NLED_ISINK0)
{
if((button_flag_isink0==0) && (first_time == true)) {//button flag ==0, means this ISINK is not for button backlight
if(button_flag_isink1==0)
pmic_set_register_value(PMIC_ISINK_CH1_EN,NLED_OFF); //sw workround for sync leds status
if(button_flag_isink2==0)
pmic_set_register_value(PMIC_ISINK_CH2_EN,NLED_OFF);
if(button_flag_isink3==0)
pmic_set_register_value(PMIC_ISINK_CH3_EN,NLED_OFF);
first_time = false;
}
pmic_set_register_value(PMIC_RG_DRV_32K_CK_PDN,0x0); // Disable power down
pmic_set_register_value(PMIC_RG_DRV_ISINK0_CK_PDN,0);
pmic_set_register_value(PMIC_RG_DRV_ISINK0_CK_CKSEL,0);
if (level == 128)
{
pmic_set_register_value(PMIC_ISINK_CH0_MODE,PMIC_PWM_1);
pmic_set_register_value(PMIC_ISINK_CH0_STEP,ISINK_4);//20mA
pmic_set_register_value(PMIC_ISINK_BREATH0_TR1_SEL,0x04);
pmic_set_register_value(PMIC_ISINK_BREATH0_TR2_SEL,0x08);
pmic_set_register_value(PMIC_ISINK_BREATH0_TF1_SEL,0x02);
pmic_set_register_value(PMIC_ISINK_BREATH0_TF2_SEL,0x08);
pmic_set_register_value(PMIC_ISINK_BREATH0_TON_SEL,0x01);
pmic_set_register_value(PMIC_ISINK_BREATH0_TOFF_SEL,0x01);
pmic_set_register_value(PMIC_ISINK_DIM0_DUTY,28);//90%
pmic_set_register_value(PMIC_ISINK_DIM0_FSEL,11);
}
else
{
pmic_set_register_value(PMIC_ISINK_CH0_MODE,PMIC_PWM_0);
pmic_set_register_value(PMIC_ISINK_CH0_STEP,ISINK_4);//20mA
if (level == 64) {
pmic_set_register_value(PMIC_ISINK_DIM0_DUTY,11);// (11/31)=35%
}
else if (level == 32) {
pmic_set_register_value(PMIC_ISINK_DIM0_DUTY,5);// (5/31)=16%
}
else {
pmic_set_register_value(PMIC_ISINK_DIM0_DUTY,28);// (28/31)=90%
}
pmic_set_register_value(PMIC_ISINK_DIM0_FSEL,ISINK_1KHZ);//1KHz
}
if (level)
{

pmic_set_register_value(PMIC_ISINK_CH0_EN,NLED_ON);

}
else
{
pmic_set_register_value(PMIC_ISINK_CH0_EN,NLED_OFF);
}
mutex_unlock(&leds_pmic_mutex);
return 0;
}

Explaination: There are the following valid values that can be set in

/sys/class/leds/button-backlight/brightness

:

128 -> pulsate once

64 -> 35% brightness

32 -> 16% brightness

Every other value greater than 0 -> 90% brightness

0 -> LED OFF

One could definitely modify the LED driver to allow other brightness levels. But currently the pone doesn't remember the setting - next time it turns on the led, it will use the 90% brightness again.

Maybe the setting

#ifdef IWLED_SUPPORT
// for backlight to remember the last backlight level status
static int last_level = 1;
#endif

in leds.c could help.

But anyway - the driver settings mean that your LED currently should be at 90% brightness. So it should be able to be 10% brighter.

The problem here is, that our button-LED at the same time is our notification LED (many phones have a separate notification LED) - this should be the reason why it has those pre-defined levels, also with the pulsation-level.

This means, if I change the driver to support more different LED levels and to remember the last set levels, I fear that the notification functionality of the button LED might stop working.

I could of course compromise and keep level 128 as the pulsation-level, so pulsation-notification would hopefully still work (but it might not stop pulsating, if remembering the LED levels is enabled). All the other levels would receive an appropriate brightness.

I think I will look into that during the next week.