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

Commit c7b3e98e authored by Michał Kępień's avatar Michał Kępień Committed by Andy Shevchenko
Browse files

platform/x86: fujitsu-laptop: Fix radio LED detection



Radio LED detection method implemented in commit 4f62568c
("fujitsu-laptop: Support radio LED") turned out to be incorrect as it
causes a radio LED to be erroneously detected on a Fujitsu Lifebook E751
which has a slide switch (and thus no radio LED).  Use bit 17 of
flags_supported (the value returned by method S000 of ACPI device
FUJ02E3) to determine whether a radio LED is present as it seems to be a
more reliable indicator, based on comparing DSDT tables of four Fujitsu
Lifebook models (E744, E751, S7110, S8420).

Fixes: 4f62568c ("fujitsu-laptop: Support radio LED")
Reported-by: default avatarHeinrich Siebmanns <harv@gmx.de>
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Tested-by: default avatarHeinrich Siebmanns <harv@gmx.de>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 163ca800
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -691,6 +691,7 @@ static enum led_brightness eco_led_get(struct led_classdev *cdev)

static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
{
	struct fujitsu_laptop *priv = acpi_driver_data(device);
	struct led_classdev *led;
	int result;

@@ -724,12 +725,15 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
	}

	/*
	 * BTNI bit 24 seems to indicate the presence of a radio toggle
	 * button in place of a slide switch, and all such machines appear
	 * to also have an RF LED.  Therefore use bit 24 as an indicator
	 * that an RF LED is present.
	 * Some Fujitsu laptops have a radio toggle button in place of a slide
	 * switch and all such machines appear to also have an RF LED.  Based on
	 * comparing DSDT tables of four Fujitsu Lifebook models (E744, E751,
	 * S7110, S8420; the first one has a radio toggle button, the other
	 * three have slide switches), bit 17 of flags_supported (the value
	 * returned by method S000 of ACPI device FUJ02E3) seems to indicate
	 * whether given model has a radio toggle button.
	 */
	if (call_fext_func(device, FUNC_BUTTONS, 0x0, 0x0, 0x0) & BIT(24)) {
	if (priv->flags_supported & BIT(17)) {
		led = devm_kzalloc(&device->dev, sizeof(*led), GFP_KERNEL);
		if (!led)
			return -ENOMEM;