mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Oberon : SOL LED: Added module_params
Added module_param support to led-trig.ko module to set during init. This can be set to enable tri-led path in driver. multi_led_enable = 0 : This is default setting only one led module will be controlled. multi_led_enable = 1 : Enable tri-led calls so individual brightness or blink can be set for all (R,G,B) leds. Change-Id: I552fa0cd707f0a9de45d9f3392cb3fb32ea33a17 Signed-off-by: maheshmk <maheshmk@motorola.com> Change-Id: I552fa0cd707f0a9de45d9f3392cb3fb32ea33a17 Reviewed-on: https://gerrit.mot.com/2505770 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Qing Chang <qing@motorola.com> Reviewed-by: Vijayakumar Gn <vijaygn@motorola.com> Reviewed-by: Perry White <awhite6@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
2d2ff4b594
commit
5a1c5d012f
1 changed files with 7 additions and 2 deletions
|
|
@ -23,12 +23,14 @@
|
|||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/power_supply.h>
|
||||
#include <linux/device/class.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/moduleparam.h>
|
||||
|
||||
#define CHARGING_DELAY_ON_DEFAULT (700)
|
||||
#define CHARGING_DELAY_OFF_DEFAULT (700)
|
||||
|
|
@ -52,6 +54,9 @@ struct sol_trig_data {
|
|||
bool battery_psy_present;
|
||||
};
|
||||
|
||||
static int multi_led_enable = 0;
|
||||
module_param(multi_led_enable, int, 0644);
|
||||
|
||||
static ssize_t charging_delay_on_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
|
|
@ -212,10 +217,9 @@ static struct led_trigger sol_led_trigger = {
|
|||
};
|
||||
|
||||
static int is_multi_led_enabled () {
|
||||
return 0x01;
|
||||
return multi_led_enable;
|
||||
}
|
||||
|
||||
|
||||
/* API to set sol led colour, brightness etc based on battery status */
|
||||
static int sol_led_update_status(const char *led_name, bool blink, unsigned int brightness, struct sol_trig_data *sol_data)
|
||||
{
|
||||
|
|
@ -424,6 +428,7 @@ static void sol_trig_deactivate(struct led_classdev *led_cdev)
|
|||
|
||||
static int __init sol_trig_init(void)
|
||||
{
|
||||
pr_err("multiled: multi_led_enable = %d\n",multi_led_enable);
|
||||
return led_trigger_register(&sol_led_trigger);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue