diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2022-02-15 11:05:07 +0000 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2022-02-17 08:31:12 +0000 |
commit | 2cc3af6e1d795c6d33afaf994c18abaab87a443b (patch) | |
tree | 23da6ebd1f17306a265866599d6b44f91a5042a2 | |
parent | 4f689b302fc49fc11d19169386f6ccfad05f47dd (diff) | |
download | src-2cc3af6e1d795c6d33afaf994c18abaab87a443b.tar.gz src-2cc3af6e1d795c6d33afaf994c18abaab87a443b.zip |
linuxkpi: Add backlight_device_set_brightness
This simply set the brightness of a backlight device.
Needed by drm-kmod v5.8
Reviewed by: bz, emaste
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34285
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/backlight.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 38b3786e738d..9591a4b671ab 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -92,6 +92,16 @@ backlight_force_update(struct backlight_device *bd, int reason) } static inline int +backlight_device_set_brightness(struct backlight_device *bd, int brightness) +{ + + if (brightness > bd->props.max_brightness) + return (EINVAL); + bd->props.brightness = brightness; + return (bd->ops->update_status(bd)); +} + +static inline int backlight_enable(struct backlight_device *bd) { if (bd == NULL) |