Skip to content

Commit

Permalink
ACPI: video: Add Apple GMUX brightness control detection
Browse files Browse the repository at this point in the history
On Apple laptops with an Apple GMUX using this for brightness control,
should take precedence of any other brightness control methods.

Add apple-gmux detection to acpi_video_get_backlight_type() using
the already existing apple_gmux_present() helper function.

This will allow removig the (ab)use of:

	acpi_video_set_dmi_backlight_type(acpi_backlight_vendor);

Inside the apple-gmux driver.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Hans de Goede committed Sep 3, 2022
1 parent fe7aebb commit 21245df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/video_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <linux/export.h>
#include <linux/acpi.h>
#include <linux/apple-gmux.h>
#include <linux/backlight.h>
#include <linux/dmi.h>
#include <linux/module.h>
Expand Down Expand Up @@ -607,6 +608,9 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
if (nvidia_wmi_ec_present)
return acpi_backlight_nvidia_wmi_ec;

if (apple_gmux_present())
return acpi_backlight_apple_gmux;

/* On systems with ACPI video use either native or ACPI video. */
if (video_caps & ACPI_VIDEO_BACKLIGHT) {
/*
Expand Down
1 change: 1 addition & 0 deletions include/acpi/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ enum acpi_backlight_type {
acpi_backlight_vendor,
acpi_backlight_native,
acpi_backlight_nvidia_wmi_ec,
acpi_backlight_apple_gmux,
};

#if IS_ENABLED(CONFIG_ACPI_VIDEO)
Expand Down

0 comments on commit 21245df

Please sign in to comment.