mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
backlight: Update cached value when getting the brightness
External events can cause the backlight level to change (AC adapter plug/unplug for example) so cache the value there too. PR: 257796 Sponsored by: Beckhoff Automation GmbH & Co. KG MFC after: 1 week
This commit is contained in:
parent
3ddd6eb688
commit
e26ef41f79
@ -73,8 +73,10 @@ backlight_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
|
||||
/* Call the driver function so it fills up the props */
|
||||
bcopy(data, &props, sizeof(struct backlight_props));
|
||||
error = BACKLIGHT_GET_STATUS(sc->dev, &props);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
bcopy(&props, data, sizeof(struct backlight_props));
|
||||
sc->cached_brightness = props.brightness;
|
||||
}
|
||||
break;
|
||||
case BACKLIGHTUPDATESTATUS:
|
||||
bcopy(data, &props, sizeof(struct backlight_props));
|
||||
|
Loading…
Reference in New Issue
Block a user