From 737a9f0a47b1ca4314027674de1d775855648bff Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 4 Jun 2015 11:25:59 +0200 Subject: [PATCH v2] acpi-video: Allow using acpi-video backlight control on resume only On some systems acpi-video backlight is broken in the sense that it cannot control the backlight, but it must still be called on resume to power-up the backlight after resume. This commit allows these systems to work by going through all the usual backlight control moves, while not registering a sysfs backlight interface. I wish there was a better way to deal with this, but we've been unable to find one. Signed-off-by: Hans de Goede --- drivers/acpi/video.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 518f0e1..6145b28 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -1391,7 +1391,7 @@ acpi_video_switch_brightness(struct work_struct *work) int result = -EINVAL; /* no warning message if acpi_backlight=vendor or a quirk is used */ - if (!acpi_video_verify_backlight_support()) + if (!acpi_video_verify_backlight_support() || !device->backlight) return; if (!device->brightness) @@ -1666,8 +1666,9 @@ static int acpi_video_resume(struct notifier_block *nb, for (i = 0; i < video->attached_count; i++) { video_device = video->attached_array[i].bind_info; - if (video_device && video_device->backlight) - acpi_video_set_brightness(video_device->backlight); + if (video_device && video_device->brightness) + acpi_video_device_lcd_set_level(video_device, + video_device->brightness->curr); } return NOTIFY_OK; @@ -1716,6 +1717,10 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device) result = acpi_video_init_brightness(device); if (result) return; + + /* FIXME make this happen based on a quirk / cmdline option */ + return; + name = kasprintf(GFP_KERNEL, "acpi_video%d", count); if (!name) return; -- 2.4.2