mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Documentation:ledtrig-sol:Add led trig support
Added documentation for led trigger support with sol tri led wrt battery status. This will add trigger driver on top of QTI Tri-led driver Change-Id: I050a9f42f9b2b3af156d8c86cca28a0151385b74 Signed-off-by: Srihari Sathyanarayana <sriharis@motorola.com> Change-Id: I050a9f42f9b2b3af156d8c86cca28a0151385b74 Reviewed-on: https://gerrit.mot.com/2523300 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Perry White <awhite6@motorola.com> Reviewed-by: Vijayakumar Gn <vijaygn@motorola.com> Reviewed-by: Mahesh Med(CR) <maheshmk@motorola.com> Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
b37868629d
commit
dbdc900d3c
1 changed files with 90 additions and 0 deletions
90
Documentation/leds/ledtrig-sol.rst
Normal file
90
Documentation/leds/ledtrig-sol.rst
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
================================
|
||||
Sign-of-life LED trigger
|
||||
================================
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
This is a Sign-of-life LED trigger for QCOM Tri-led Driver.
|
||||
Refer -> kernel_platform/qcom/proprietary/devicetree/bindings/leds/leds-qti-tri-led.txt
|
||||
This trigger will register with LED core framework to individually
|
||||
get activated or deactivated.
|
||||
The trigger will be registered with the power_supply_class to get charging/discharging
|
||||
state and battery capacity.
|
||||
|
||||
Handle power-supply states for Charging/Discharging
|
||||
===================================================
|
||||
|
||||
Set blink/solid Led settings as below
|
||||
|
||||
LED Brighness depend on Device Charging State
|
||||
----------------------------------------------
|
||||
Full while Device Charging
|
||||
Half Brighness while not Charging
|
||||
|
||||
Led Functional Mode Depend on the Battery capacity
|
||||
--------------------------------------------------
|
||||
Battery Level < LOW_CAP_THRESHOLD_DEFAULT
|
||||
Fast Blink "charging_low" led node(s)
|
||||
|
||||
LOW_CAP_THRESHOLD_DEFAULT < Battery Level < BATT_CAP_THRESHOLD_HIGH
|
||||
Slow Blink "charging" led node(s) (If device charging)
|
||||
Enable Solid 50% brightness for "charging" led node(s) (If device not charging)
|
||||
|
||||
BATT_CAP_THRESHOLD_HIGH < Battery Level < BATT_CAP_THRESHOLD_FULL
|
||||
Slow Blink "charging_full" led node(s) (If device charging)
|
||||
Enable Solid 50% brightness for "charging_full" led node(s) (If device not charging)
|
||||
|
||||
Battery Level == BATT_CAP_THRESHOLD_FULL
|
||||
Enable Solid 100% brightness for "charging_full" led node(s)
|
||||
|
||||
Label each node with corresponding colour in device tree
|
||||
======================================================
|
||||
|
||||
Qcom Tri-Led will have settings for each Led (R,G,B).
|
||||
The trigger driver will control with blink or solid pattern via labels nodes like
|
||||
charging_low node: Charging/Discharging and Low battery state
|
||||
charging node: Charging/Discharging state with medium battery
|
||||
charging_full node: Charging/Discharging state while battery near to Full.
|
||||
|
||||
Example of device tree setting
|
||||
=============================
|
||||
|
||||
::
|
||||
|
||||
&pm8550_rgb {
|
||||
red {
|
||||
status = "ok";
|
||||
label = "charging_low";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
|
||||
green {
|
||||
status = "ok";
|
||||
label = "charging_full";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
|
||||
blue {
|
||||
status = "ok";
|
||||
label = "charging";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
};
|
||||
|
||||
List of Methods in Sol trigger driver
|
||||
====================================
|
||||
static int sol_trig_activate(struct led_classdev *led_cdev)
|
||||
{
|
||||
/* Set default sol data register with power_supply notifier */
|
||||
}
|
||||
|
||||
static void sol_trig_deactivate(struct led_classdev *led_cdev)
|
||||
{
|
||||
/* Unregister with power_supply notifier and Free sol data */
|
||||
}
|
||||
|
||||
static int sol_led_update_status(led_name, blink, brightness, sol_data)
|
||||
{
|
||||
/* API to set sol led colour, brightness etc based on battery status */
|
||||
}
|
||||
Loading…
Reference in a new issue