Patch "ACPI: video: Fix apple gmux detection" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ACPI: video: Fix apple gmux detection

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-video-fix-apple-gmux-detection.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6b82a732fb7b2105e8460ecc50a8444fbe19aba4
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Tue Jan 24 11:57:54 2023 +0100

    ACPI: video: Fix apple gmux detection
    
    [ Upstream commit b0935f110cff5d70da05c5cb1670bee0b07b631c ]
    
    Some apple laptop models have an ACPI device with a HID of APP000B
    and that device has an IO resource (so it does not describe the new
    unsupported MMIO based gmux type), but there actually is no gmux
    in the laptop at all.
    
    The gmux_probe() function of the actual apple-gmux driver has code
    to detect this, this code has been factored out into a new
    apple_gmux_detect() helper in apple-gmux.h.
    
    Use this new function to fix acpi_video_get_backlight_type() wrongly
    returning apple_gmux as type on the following laptops:
    
    MacBookPro5,4
    https://pastebin.com/8Xjq7RhS
    
    MacBookPro8,1
    https://linux-hardware.org/?probe=e513cfbadb&log=dmesg
    
    MacBookPro9,2
    https://bugzilla.kernel.org/attachment.cgi?id=278961
    
    MacBookPro10,2
    https://lkml.org/lkml/2014/9/22/657
    
    MacBookPro11,2
    https://forums.fedora-fr.org/viewtopic.php?id=70142
    
    MacBookPro11,4
    https://raw.githubusercontent.com/im-0/investigate-card-reader-suspend-problem-on-mbp11.4/mast
    
    Fixes: 21245df307cb ("ACPI: video: Add Apple GMUX brightness control detection")
    Link: https://lore.kernel.org/platform-driver-x86/20230123113750.462144-1-hdegoede@xxxxxxxxxx/
    Reported-by: Emmanouil Kouroupakis <kartebi@xxxxxxxxx>
    Acked-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230124105754.62167-4-hdegoede@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 04f3b26e3a75..5c32b318c173 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -110,26 +110,6 @@ static bool nvidia_wmi_ec_supported(void)
 }
 #endif
 
-static bool apple_gmux_backlight_present(void)
-{
-	struct acpi_device *adev;
-	struct device *dev;
-
-	adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1);
-	if (!adev)
-		return false;
-
-	dev = acpi_get_first_physical_node(adev);
-	if (!dev)
-		return false;
-
-	/*
-	 * drivers/platform/x86/apple-gmux.c only supports old style
-	 * Apple GMUX with an IO-resource.
-	 */
-	return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL;
-}
-
 /* Force to use vendor driver when the ACPI device is known to be
  * buggy */
 static int video_detect_force_vendor(const struct dmi_system_id *d)
@@ -781,6 +761,7 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
 {
 	static DEFINE_MUTEX(init_mutex);
 	static bool nvidia_wmi_ec_present;
+	static bool apple_gmux_present;
 	static bool native_available;
 	static bool init_done;
 	static long video_caps;
@@ -794,6 +775,7 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
 				    ACPI_UINT32_MAX, find_video, NULL,
 				    &video_caps, NULL);
 		nvidia_wmi_ec_present = nvidia_wmi_ec_supported();
+		apple_gmux_present = apple_gmux_detect(NULL, NULL);
 		init_done = true;
 	}
 	if (native)
@@ -815,7 +797,7 @@ 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_backlight_present())
+	if (apple_gmux_present)
 		return acpi_backlight_apple_gmux;
 
 	/* Use ACPI video if available, except when native should be preferred. */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux