|
@@ -130,6 +130,38 @@ static inline int backlight_update_status(struct backlight_device *bd)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * backlight_enable - Enable backlight
|
|
|
+ * @bd: the backlight device to enable
|
|
|
+ */
|
|
|
+static inline int backlight_enable(struct backlight_device *bd)
|
|
|
+{
|
|
|
+ if (!bd)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ bd->props.power = FB_BLANK_UNBLANK;
|
|
|
+ bd->props.fb_blank = FB_BLANK_UNBLANK;
|
|
|
+ bd->props.state &= ~BL_CORE_FBBLANK;
|
|
|
+
|
|
|
+ return backlight_update_status(bd);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * backlight_disable - Disable backlight
|
|
|
+ * @bd: the backlight device to disable
|
|
|
+ */
|
|
|
+static inline int backlight_disable(struct backlight_device *bd)
|
|
|
+{
|
|
|
+ if (!bd)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ bd->props.power = FB_BLANK_POWERDOWN;
|
|
|
+ bd->props.fb_blank = FB_BLANK_POWERDOWN;
|
|
|
+ bd->props.state |= BL_CORE_FBBLANK;
|
|
|
+
|
|
|
+ return backlight_update_status(bd);
|
|
|
+}
|
|
|
+
|
|
|
extern struct backlight_device *backlight_device_register(const char *name,
|
|
|
struct device *dev, void *devdata, const struct backlight_ops *ops,
|
|
|
const struct backlight_properties *props);
|