drivers: backlight: Notify userspace on brightness changes

Taken from xiaomi changes in lisa-r-oss.

This is required to notify brightness changes to xiaomi
citsensorservice in userspace, which in turn updates
our under-display light sensor to adjust accordingly.

Suggested-by: Divyanshu-Modi <divyan.m05@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Change-Id: If9696d3a10f4815b69c983b588da01e31cfa0bf2
This commit is contained in:
Adithya R 2022-07-14 21:47:48 +05:30 committed by Giovanni Ricca
parent b79c8098b8
commit 8493bff8e3
No known key found for this signature in database

View File

@ -126,6 +126,7 @@ static void backlight_generate_event(struct backlight_device *bd,
envp[1] = NULL;
kobject_uevent_env(&bd->dev.kobj, KOBJ_CHANGE, envp);
sysfs_notify(&bd->dev.kobj, NULL, "actual_brightness");
sysfs_notify(&bd->dev.kobj, NULL, "brightness");
}
static ssize_t bl_power_show(struct device *dev, struct device_attribute *attr,