mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
[PATCH] leds: re-layout include/linux/leds.h
Lay out the structure definitions in include/linux/leds.h to be aligned as much as possible. Also minor updates to the comments to make them more concise. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
24f51e8174
commit
fb5035dbbe
@ -19,39 +19,38 @@ struct class_device;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
enum led_brightness {
|
enum led_brightness {
|
||||||
LED_OFF = 0,
|
LED_OFF = 0,
|
||||||
LED_HALF = 127,
|
LED_HALF = 127,
|
||||||
LED_FULL = 255,
|
LED_FULL = 255,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct led_classdev {
|
struct led_classdev {
|
||||||
const char *name;
|
const char *name;
|
||||||
int brightness;
|
int brightness;
|
||||||
int flags;
|
int flags;
|
||||||
#define LED_SUSPENDED (1 << 0)
|
|
||||||
|
|
||||||
/* A function to set the brightness of the led */
|
#define LED_SUSPENDED (1 << 0)
|
||||||
void (*brightness_set)(struct led_classdev *led_cdev,
|
|
||||||
enum led_brightness brightness);
|
|
||||||
|
|
||||||
struct class_device *class_dev;
|
/* Set LED brightness level */
|
||||||
/* LED Device linked list */
|
void (*brightness_set)(struct led_classdev *led_cdev,
|
||||||
struct list_head node;
|
enum led_brightness brightness);
|
||||||
|
|
||||||
|
struct class_device *class_dev;
|
||||||
|
struct list_head node; /* LED Device list */
|
||||||
|
char *default_trigger; /* Trigger to use */
|
||||||
|
|
||||||
/* Trigger data */
|
|
||||||
char *default_trigger;
|
|
||||||
#ifdef CONFIG_LEDS_TRIGGERS
|
#ifdef CONFIG_LEDS_TRIGGERS
|
||||||
rwlock_t trigger_lock;
|
|
||||||
/* Protects the trigger data below */
|
/* Protects the trigger data below */
|
||||||
|
rwlock_t trigger_lock;
|
||||||
|
|
||||||
struct led_trigger *trigger;
|
struct led_trigger *trigger;
|
||||||
struct list_head trig_list;
|
struct list_head trig_list;
|
||||||
void *trigger_data;
|
void *trigger_data;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int led_classdev_register(struct device *parent,
|
extern int led_classdev_register(struct device *parent,
|
||||||
struct led_classdev *led_cdev);
|
struct led_classdev *led_cdev);
|
||||||
extern void led_classdev_unregister(struct led_classdev *led_cdev);
|
extern void led_classdev_unregister(struct led_classdev *led_cdev);
|
||||||
extern void led_classdev_suspend(struct led_classdev *led_cdev);
|
extern void led_classdev_suspend(struct led_classdev *led_cdev);
|
||||||
extern void led_classdev_resume(struct led_classdev *led_cdev);
|
extern void led_classdev_resume(struct led_classdev *led_cdev);
|
||||||
@ -65,16 +64,16 @@ extern void led_classdev_resume(struct led_classdev *led_cdev);
|
|||||||
|
|
||||||
struct led_trigger {
|
struct led_trigger {
|
||||||
/* Trigger Properties */
|
/* Trigger Properties */
|
||||||
const char *name;
|
const char *name;
|
||||||
void (*activate)(struct led_classdev *led_cdev);
|
void (*activate)(struct led_classdev *led_cdev);
|
||||||
void (*deactivate)(struct led_classdev *led_cdev);
|
void (*deactivate)(struct led_classdev *led_cdev);
|
||||||
|
|
||||||
/* LEDs under control by this trigger (for simple triggers) */
|
/* LEDs under control by this trigger (for simple triggers) */
|
||||||
rwlock_t leddev_list_lock;
|
rwlock_t leddev_list_lock;
|
||||||
struct list_head led_cdevs;
|
struct list_head led_cdevs;
|
||||||
|
|
||||||
/* Link to next registered trigger */
|
/* Link to next registered trigger */
|
||||||
struct list_head next_trig;
|
struct list_head next_trig;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Registration functions for complex triggers */
|
/* Registration functions for complex triggers */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user