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
This commit is contained in:
Emmanuel Vadot 2022-02-15 12:05:07 +01:00
parent 4f689b302f
commit 2cc3af6e1d

View file

@ -91,6 +91,16 @@ backlight_force_update(struct backlight_device *bd, int reason)
bd->props.brightness = bd->ops->get_brightness(bd);
}
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)
{