Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adb00581 authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh
Browse files

ACPI: ibm-acpi: fix initial status of backlight device



The brightness class core does not update the initial status of the
device's brightness at register time.  Do it by ourselves.

Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: default avatarRichard Purdie <rpurdie@rpsys.net>
parent c8f71b01
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = {


static int brightness_init(void)
static int brightness_init(void)
{
{
	int b;

	b = brightness_get(NULL);
	if (b < 0)
		return b;

	ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
	ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
							 &ibm_backlight_data);
							 &ibm_backlight_data);
	if (IS_ERR(ibm_backlight_device)) {
	if (IS_ERR(ibm_backlight_device)) {
@@ -1719,6 +1725,8 @@ static int brightness_init(void)
	}
	}


	ibm_backlight_device->props.max_brightness = 7;
	ibm_backlight_device->props.max_brightness = 7;
	ibm_backlight_device->props.brightness = b;
	backlight_update_status(ibm_backlight_device);


	return 0;
	return 0;
}
}