Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165745549
D32165.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32165.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h
--- a/sys/compat/linuxkpi/common/include/linux/backlight.h
+++ b/sys/compat/linuxkpi/common/include/linux/backlight.h
@@ -79,10 +79,10 @@
linux_backlight_device_register(name, dev, data, ops, props)
#define backlight_device_unregister(bd) linux_backlight_device_unregister(bd)
-static inline void
+static inline int
backlight_update_status(struct backlight_device *bd)
{
- bd->ops->update_status(bd);
+ return (bd->ops->update_status(bd));
}
static inline void
@@ -91,4 +91,22 @@
bd->props.brightness = bd->ops->get_brightness(bd);
}
+static inline int
+backlight_enable(struct backlight_device *bd)
+{
+ if (bd == NULL)
+ return (0);
+ bd->props.power = 0/* FB_BLANK_UNBLANK */;
+ return (backlight_update_status(bd));
+}
+
+static inline int
+backlight_disable(struct backlight_device *bd)
+{
+ if (bd == NULL)
+ return (0);
+ bd->props.power = 4/* FB_BLANK_POWERDOWN */;
+ return (backlight_update_status(bd));
+}
+
#endif /* _LINUX_BACKLIGHT_H_ */
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -1215,6 +1215,8 @@
pdev->dev.bd->props.brightness = pdev->dev.bd->props.max_brightness *
props->brightness / 100;
+ pdev->dev.bd->props.power = props->brightness == 0 ?
+ 4/* FB_BLANK_POWERDOWN */ : 0/* FB_BLANK_UNBLANK */;
return (pdev->dev.bd->ops->update_status(pdev->dev.bd));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 10, 3:12 PM (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36428242
Default Alt Text
D32165.diff (1 KB)
Attached To
Mode
D32165: LinuxKPI: Implement backlight_enable and backlight_disable functions
Attached
Detach File
Event Timeline
Log In to Comment