2019-06-04 16:11:33 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2008-04-25 07:06:52 +08:00
|
|
|
/*
|
|
|
|
* LED Kernel Default ON Trigger
|
|
|
|
*
|
|
|
|
* Copyright 2008 Nick Forbes <nick.forbes@incepta.com>
|
|
|
|
*
|
|
|
|
* Based on Richard Purdie's ledtrig-timer.c.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/leds.h>
|
2013-02-20 16:36:01 +08:00
|
|
|
#include "../leds.h"
|
2008-04-25 07:06:52 +08:00
|
|
|
|
2018-07-03 04:05:21 +08:00
|
|
|
static int defon_trig_activate(struct led_classdev *led_cdev)
|
2008-04-25 07:06:52 +08:00
|
|
|
{
|
2015-10-07 17:10:41 +08:00
|
|
|
led_set_brightness_nosleep(led_cdev, led_cdev->max_brightness);
|
2018-07-03 04:05:21 +08:00
|
|
|
return 0;
|
2008-04-25 07:06:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct led_trigger defon_led_trigger = {
|
|
|
|
.name = "default-on",
|
|
|
|
.activate = defon_trig_activate,
|
|
|
|
};
|
2018-07-03 04:05:31 +08:00
|
|
|
module_led_trigger(defon_led_trigger);
|
2008-04-25 07:06:52 +08:00
|
|
|
|
|
|
|
MODULE_AUTHOR("Nick Forbes <nick.forbes@incepta.com>");
|
|
|
|
MODULE_DESCRIPTION("Default-ON LED trigger");
|
2018-07-03 04:05:20 +08:00
|
|
|
MODULE_LICENSE("GPL v2");
|