Richard Purdie | c72a1d6 | 2006-03-31 02:31:04 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Driver model for leds and led triggers |
| 3 | * |
| 4 | * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu> |
| 5 | * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | */ |
| 12 | #ifndef __LINUX_LEDS_H_INCLUDED |
| 13 | #define __LINUX_LEDS_H_INCLUDED |
| 14 | |
| 15 | struct device; |
| 16 | struct class_device; |
| 17 | /* |
| 18 | * LED Core |
| 19 | */ |
| 20 | |
| 21 | enum led_brightness { |
| 22 | LED_OFF = 0, |
| 23 | LED_HALF = 127, |
| 24 | LED_FULL = 255, |
| 25 | }; |
| 26 | |
| 27 | struct led_classdev { |
| 28 | const char *name; |
| 29 | int brightness; |
| 30 | int flags; |
| 31 | #define LED_SUSPENDED (1 << 0) |
| 32 | |
| 33 | /* A function to set the brightness of the led */ |
| 34 | void (*brightness_set)(struct led_classdev *led_cdev, |
| 35 | enum led_brightness brightness); |
| 36 | |
| 37 | struct class_device *class_dev; |
| 38 | /* LED Device linked list */ |
| 39 | struct list_head node; |
| 40 | |
| 41 | /* Trigger data */ |
| 42 | char *default_trigger; |
| 43 | }; |
| 44 | |
| 45 | extern int led_classdev_register(struct device *parent, |
| 46 | struct led_classdev *led_cdev); |
| 47 | extern void led_classdev_unregister(struct led_classdev *led_cdev); |
| 48 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
| 49 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
| 50 | |
| 51 | #endif /* __LINUX_LEDS_H_INCLUDED */ |