1. Modify the following two files:
Alps/mediatek/custom/common/kernel/leds/inc/cust_leds.h
-----------------------------------------------------------
Enum mt65xx_led_type
{
MT65XX_LED_TYPE_RED = 0,
......
MT65XX_LED_TYPE_ LCD,
MT65XX_LED_TYPE_ABC, // Add a new LED type
MT65XX_LED_TYPE_TOTAL,
};
Alps/mediatek/custom/YOUR_PRJ/kernel/leds/mt65xx/cust_leds.c
----------------------------------------------------------------
Static struct cust_mt65xx_led cust_led_list [MT65XX_LED_TYPE_TOTAL] = {
{"Red", MT65XX_LED_MODE_NONE,-1, {0 }},
......
{"LCD-backlight", MT65XX_LED_MODE_CUST, (int) Cust_SetBacklight, {0 }},
// Set LED params, Please refer to <Driver all in One>
{"Abc-backlight", MT65XX_LED_MODE_CUST, (int) Cust_SetBacklight_abc, {0 }},
};
Www.2cto.com
2. After re-compilation, the following information is displayed in the Kernel log:
--------------------------------------------------------------------
<7> [1, 1.021967] (0) Registered led device: button-backlight
<7> [2, 1.022013] (0) Registered led device: LCD-backlight
<7> [1.022072] (0) Registered led device: abc-backlight // <-------!
3. Run the following command to view the sysfs node of the new LED:
Adb shell ls/sys/devices/platform/leds-mt65xx/leds/
------------------------------------------------------------------------
Abc-backlight
Button-backlight
LCD-backlight