MIPS: convert CONFIG_SYS_MIPS_TIMER_FREQ to Kconfig
[platform/kernel/u-boot.git] / include / backlight.h
index a304c36..c841882 100644 (file)
@@ -7,6 +7,15 @@
 #ifndef _BACKLIGHT_H
 #define _BACKLIGHT_H
 
+struct udevice;
+
+enum {
+       BACKLIGHT_MAX           = 100,
+       BACKLIGHT_MIN           = 0,
+       BACKLIGHT_OFF           = -1,
+       BACKLIGHT_DEFAULT       = -2,
+};
+
 struct backlight_ops {
        /**
         * enable() - Enable a backlight
@@ -15,6 +24,15 @@ struct backlight_ops {
         * @return 0 if OK, -ve on error
         */
        int (*enable)(struct udevice *dev);
+
+       /**
+        * set_brightness - Set brightness
+        *
+        * @dev:        Backlight device to update
+        * @percent:    Brightness value (0 to 100, or BACKLIGHT_... value)
+        * @return 0 if OK, -ve on error
+        */
+       int (*set_brightness)(struct udevice *dev, int percent);
 };
 
 #define backlight_get_ops(dev) ((struct backlight_ops *)(dev)->driver->ops)
@@ -23,8 +41,17 @@ struct backlight_ops {
  * backlight_enable() - Enable a backlight
  *
  * @dev:       Backlight device to enable
- * @return 0 if OK, -ve on error
+ * Return: 0 if OK, -ve on error
  */
 int backlight_enable(struct udevice *dev);
 
+/**
+ * backlight_set_brightness - Set brightness
+ *
+ * @dev:       Backlight device to update
+ * @percent:   Brightness value (0 to 100, or BACKLIGHT_... value)
+ * Return: 0 if OK, -ve on error
+ */
+int backlight_set_brightness(struct udevice *dev, int percent);
+
 #endif