netfilter: nf_conntrack: support conntrack templates
[safe/jmp/linux-2.6] / include / linux / leds.h
index e7a5e89..d8bf966 100644 (file)
@@ -30,9 +30,13 @@ enum led_brightness {
 struct led_classdev {
        const char              *name;
        int                      brightness;
+       int                      max_brightness;
        int                      flags;
 
+       /* Lower 16 bits reflect status */
 #define LED_SUSPENDED          (1 << 0)
+       /* Upper 16 bits reflect control information */
+#define LED_CORE_SUSPENDRESUME (1 << 16)
 
        /* Set LED brightness level */
        /* Must not sleep, use a workqueue if needed */
@@ -41,7 +45,10 @@ struct led_classdev {
        /* Get LED brightness level */
        enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);
 
-       /* Activate hardware accelerated blink */
+       /* Activate hardware accelerated blink, delays are in
+        * miliseconds and if none is provided then a sensible default
+        * should be chosen. The call can adjust the timings if it can't
+        * match the values specified exactly. */
        int             (*blink_set)(struct led_classdev *led_cdev,
                                     unsigned long *delay_on,
                                     unsigned long *delay_off);
@@ -62,7 +69,7 @@ struct led_classdev {
 
 extern int led_classdev_register(struct device *parent,
                                 struct led_classdev *led_cdev);
-extern void led_classdev_unregister(struct led_classdev *lcd);
+extern void led_classdev_unregister(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);
 
@@ -118,13 +125,33 @@ extern void ledtrig_ide_activity(void);
 #define ledtrig_ide_activity() do {} while(0)
 #endif
 
+/*
+ * Generic LED platform data for describing LED names and default triggers.
+ */
+struct led_info {
+       const char      *name;
+       const char      *default_trigger;
+       int             flags;
+};
+
+struct led_platform_data {
+       int             num_leds;
+       struct led_info *leds;
+};
+
 /* For the leds-gpio driver */
 struct gpio_led {
        const char *name;
-       char *default_trigger;
+       const char *default_trigger;
        unsigned        gpio;
-       u8              active_low;
+       unsigned        active_low : 1;
+       unsigned        retain_state_suspended : 1;
+       unsigned        default_state : 2;
+       /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
 };
+#define LEDS_GPIO_DEFSTATE_OFF 0
+#define LEDS_GPIO_DEFSTATE_ON  1
+#define LEDS_GPIO_DEFSTATE_KEEP        2
 
 struct gpio_led_platform_data {
        int             num_leds;