2 #include <linux/module.h>
13 #define CLEVO_MAIL_LED_OFF 0x0084
14 #define CLEVO_MAIL_LED_BLINK_1HZ 0x008A
15 #define CLEVO_MAIL_LED_BLINK_0_5HZ 0x0083
44 .callback = clevo_mail_led_dmi_callback,
45 .ident =
"Clevo D410J",
53 .callback = clevo_mail_led_dmi_callback,
54 .ident =
"Clevo M5x0N",
61 .callback = clevo_mail_led_dmi_callback,
62 .ident =
"Clevo M5x0V",
70 .callback = clevo_mail_led_dmi_callback,
71 .ident =
"Clevo D400P",
80 .callback = clevo_mail_led_dmi_callback,
81 .ident =
"Clevo D410V",
93 static void clevo_mail_led_set(
struct led_classdev *led_cdev,
109 static int clevo_mail_led_blink(
struct led_classdev *led_cdev,
110 unsigned long *delay_on,
111 unsigned long *delay_off)
117 if (*delay_on == 0 && *delay_off == 0 ) {
127 }
else if (*delay_on == 500 && *delay_off == 500 ) {
132 }
else if (*delay_on == 1000 && *delay_off == 1000 ) {
139 ": clevo_mail_led_blink(..., %lu, %lu),"
140 " returning -EINVAL (unsupported)\n",
141 *delay_on, *delay_off);
150 .name =
"clevo::mail",
151 .brightness_set = clevo_mail_led_set,
152 .blink_set = clevo_mail_led_blink,
168 .probe = clevo_mail_led_probe,
169 .remove = clevo_mail_led_remove,
171 .name = KBUILD_MODNAME,
176 static int __init clevo_mail_led_init(
void)
187 "If the driver works on your hardware please "
188 "report model and the output of dmidecode in tracker "
189 "at http://sourceforge.net/projects/clevo-mailled/\n");
195 pdev = platform_device_register_simple(KBUILD_MODNAME, -1,
NULL, 0);
198 clevo_mail_led_probe);
201 ": Can't probe platform driver\n");
205 error = PTR_ERR(pdev);
210 static void __exit clevo_mail_led_exit(
void)