blob: 7f6d9219711e675a632fab68948e809712bd836e [file] [log] [blame]
Nick Forbes060856c2008-04-25 00:06:52 +01001/*
2 * LED Kernel Default ON Trigger
3 *
4 * Copyright 2008 Nick Forbes <nick.forbes@incepta.com>
5 *
6 * Based on Richard Purdie's ledtrig-timer.c.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
Nick Forbes060856c2008-04-25 00:06:52 +010011 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/leds.h>
Kim, Milof07fb522013-02-20 00:36:01 -080017#include "../leds.h"
Nick Forbes060856c2008-04-25 00:06:52 +010018
Uwe Kleine-König2282e1252018-07-02 22:05:21 +020019static int defon_trig_activate(struct led_classdev *led_cdev)
Nick Forbes060856c2008-04-25 00:06:52 +010020{
Jacek Anaszewski81fe8e52015-10-07 11:10:41 +020021 led_set_brightness_nosleep(led_cdev, led_cdev->max_brightness);
Uwe Kleine-König2282e1252018-07-02 22:05:21 +020022 return 0;
Nick Forbes060856c2008-04-25 00:06:52 +010023}
24
25static struct led_trigger defon_led_trigger = {
26 .name = "default-on",
27 .activate = defon_trig_activate,
28};
Uwe Kleine-König5cccc552018-07-02 22:05:31 +020029module_led_trigger(defon_led_trigger);
Nick Forbes060856c2008-04-25 00:06:52 +010030
31MODULE_AUTHOR("Nick Forbes <nick.forbes@incepta.com>");
32MODULE_DESCRIPTION("Default-ON LED trigger");
Uwe Kleine-König033692e2018-07-02 22:05:20 +020033MODULE_LICENSE("GPL v2");