Commit b3b3972a8bc806609579530d8291d5062c87b77b

Authored by Hans de Goede
Committed by Greg Kroah-Hartman
1 parent 37ae6d6884

samsung-laptop: Add use_native_backlight quirk, and enable it on some models

commit 4690555e13c48fef07f2762f6b0cd6b181e326d0 upstream.

Since kernel 3.14 the backlight control has been broken on various Samsung
Atom based netbooks. This has been bisected and this problem happens since
commit b35684b8fa94 ("drm/i915: do full backlight setup at enable time")

This has been reported and discussed in detail here:
http://lists.freedesktop.org/archives/intel-gfx/2014-July/049395.html

Unfortunately no-one has been able to fix this. This only affects Samsung
Atom netbooks, and the Linux kernel and the BIOS of those laptops have never
worked well together. All affected laptops already have a quirk to avoid using
the standard acpi-video interface and instead use the samsung specific SABI
interface which samsung-laptop uses. It seems that recent fixes to the i915
driver have also broken backlight control through the SABI interface.

The intel_backlight driver OTOH works fine, and also allows for finer grained
backlight control. So add a new use_native_backlight quirk, and replace the
broken_acpi_video quirk with this quirk for affected models. This new quirk
disables acpi-video as before and also stops samsung-laptop from registering
the SABI based samsung_laptop backlight interface, leaving only the working
intel_backlight interface.

This commit enables this new quirk for 3 models which are known to be affected,
chances are that it needs to be used on other models too.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1094948 # N145P
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1115713 # N250P
Reported-by: Bertrik Sikken <bertrik@sikken.nl> # N150P
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 17 additions and 3 deletions Side-by-side Diff

drivers/platform/x86/samsung-laptop.c
... ... @@ -353,6 +353,7 @@
353 353 bool broken_acpi_video;
354 354 bool four_kbd_backlight_levels;
355 355 bool enable_kbd_backlight;
  356 + bool use_native_backlight;
356 357 };
357 358  
358 359 static struct samsung_quirks samsung_unknown = {};
... ... @@ -361,6 +362,10 @@
361 362 .broken_acpi_video = true,
362 363 };
363 364  
  365 +static struct samsung_quirks samsung_use_native_backlight = {
  366 + .use_native_backlight = true,
  367 +};
  368 +
364 369 static struct samsung_quirks samsung_np740u3e = {
365 370 .four_kbd_backlight_levels = true,
366 371 .enable_kbd_backlight = true,
... ... @@ -1507,7 +1512,7 @@
1507 1512 DMI_MATCH(DMI_PRODUCT_NAME, "N150P"),
1508 1513 DMI_MATCH(DMI_BOARD_NAME, "N150P"),
1509 1514 },
1510   - .driver_data = &samsung_broken_acpi_video,
  1515 + .driver_data = &samsung_use_native_backlight,
1511 1516 },
1512 1517 {
1513 1518 .callback = samsung_dmi_matched,
... ... @@ -1517,7 +1522,7 @@
1517 1522 DMI_MATCH(DMI_PRODUCT_NAME, "N145P/N250P/N260P"),
1518 1523 DMI_MATCH(DMI_BOARD_NAME, "N145P/N250P/N260P"),
1519 1524 },
1520   - .driver_data = &samsung_broken_acpi_video,
  1525 + .driver_data = &samsung_use_native_backlight,
1521 1526 },
1522 1527 {
1523 1528 .callback = samsung_dmi_matched,
... ... @@ -1557,7 +1562,7 @@
1557 1562 DMI_MATCH(DMI_PRODUCT_NAME, "N250P"),
1558 1563 DMI_MATCH(DMI_BOARD_NAME, "N250P"),
1559 1564 },
1560   - .driver_data = &samsung_broken_acpi_video,
  1565 + .driver_data = &samsung_use_native_backlight,
1561 1566 },
1562 1567 {
1563 1568 .callback = samsung_dmi_matched,
... ... @@ -1615,6 +1620,15 @@
1615 1620 } else if (samsung->quirks->broken_acpi_video) {
1616 1621 pr_info("Disabling ACPI video driver\n");
1617 1622 acpi_video_unregister();
  1623 + }
  1624 +
  1625 + if (samsung->quirks->use_native_backlight) {
  1626 + pr_info("Using native backlight driver\n");
  1627 + /* Tell acpi-video to not handle the backlight */
  1628 + acpi_video_dmi_promote_vendor();
  1629 + acpi_video_unregister();
  1630 + /* And also do not handle it ourselves */
  1631 + samsung->handle_backlight = false;
1618 1632 }
1619 1633 #endif
1620 1634