Skip to content

Commit 358d6a2

Browse files
jwrdegoededvhart
authored andcommitted
toshiba_acpi: Do not register vendor backlight when acpi_video bl is available
commit a39f46d ("toshiba_acpi: Fix regression caused by backlight extra check code") causes the backlight to no longer work on the Toshiba Z30, reverting that commit fixes this but restores the original issue fixed by that commit. Looking at the toshiba_acpi backlight code for a fix for this I noticed that the toshiba code is the only code under platform/x86 which unconditionally registers a vendor acpi backlight interface, without checking for acpi_video backlight support first. This commit adds the necessary checks bringing toshiba_acpi in line with the other drivers, and fixing the Z30 regression without needing to revert the commit causing it. Chances are that there will be some Toshiba models which have a non working acpi-video implementation while the toshiba vendor backlight interface does work, this commit adds an empty dmi_id table where such systems can be added, this is identical to how other drivers handle such systems. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1206036 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=86521 Signed-off-by: Hans de Goede <[email protected]> Reviewed-and-tested-by: Azael Avalos <[email protected]> Signed-off-by: Darren Hart <[email protected]>
1 parent cdbff61 commit 358d6a2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ config ACPI_TOSHIBA
614614
depends on INPUT
615615
depends on RFKILL || RFKILL = n
616616
depends on SERIO_I8042 || SERIO_I8042 = n
617+
depends on ACPI_VIDEO || ACPI_VIDEO = n
617618
select INPUT_POLLDEV
618619
select INPUT_SPARSEKMAP
619620
---help---

drivers/platform/x86/toshiba_acpi.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
#include <linux/workqueue.h>
5050
#include <linux/i8042.h>
5151
#include <linux/acpi.h>
52+
#include <linux/dmi.h>
5253
#include <linux/uaccess.h>
54+
#include <acpi/video.h>
5355

5456
MODULE_AUTHOR("John Belmonte");
5557
MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
@@ -263,6 +265,14 @@ static const struct key_entry toshiba_acpi_alt_keymap[] = {
263265
{ KE_END, 0 },
264266
};
265267

268+
/*
269+
* List of models which have a broken acpi-video backlight interface and thus
270+
* need to use the toshiba (vendor) interface instead.
271+
*/
272+
static const struct dmi_system_id toshiba_vendor_backlight_dmi[] = {
273+
{}
274+
};
275+
266276
/*
267277
* Utility
268278
*/
@@ -2624,6 +2634,20 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
26242634
ret = get_tr_backlight_status(dev, &enabled);
26252635
dev->tr_backlight_supported = !ret;
26262636

2637+
/*
2638+
* Tell acpi-video-detect code to prefer vendor backlight on all
2639+
* systems with transflective backlight and on dmi matched systems.
2640+
*/
2641+
if (dev->tr_backlight_supported ||
2642+
dmi_check_system(toshiba_vendor_backlight_dmi))
2643+
acpi_video_dmi_promote_vendor();
2644+
2645+
if (acpi_video_backlight_support())
2646+
return 0;
2647+
2648+
/* acpi-video may have loaded before we called dmi_promote_vendor() */
2649+
acpi_video_unregister_backlight();
2650+
26272651
memset(&props, 0, sizeof(props));
26282652
props.type = BACKLIGHT_PLATFORM;
26292653
props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;

0 commit comments

Comments
 (0)