public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: "Lukas Wunner" <lukas@wunner.de>,
	"Atharva Tiwari" <atharvatiwarilinuxdev@gmail.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: [PATCH 2/2] platform/apple-gmux: use apple_brightness to save brightness to EFI
Date: Fri,  6 Feb 2026 12:56:22 +0000	[thread overview]
Message-ID: <20260206125641.12983-3-atharvatiwarilinuxdev@gmail.com> (raw)
In-Reply-To: <20260206125641.12983-1-atharvatiwarilinuxdev@gmail.com>

use apple_brightness to save brightness to EFI.

(tested on iMac20,1)

Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
---
 drivers/platform/x86/apple-gmux.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index 1417e230edbd..cfb20c115eb0 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <linux/vga_switcheroo.h>
 #include <linux/debugfs.h>
+#include <linux/platform_data/apple-brightness.h>
 #include <acpi/video.h>
 #include <asm/io.h>
 
@@ -960,6 +961,12 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
 	}
 
 	gmux_init_debugfs(gmux_data);
+	if (IS_ENABLED(CONFIG_APPLE_BRIGHTNESS)) {
+		ret = apple_brightness_probe(gmux_data->bdev, &gmux_get_brightness);
+		if (ret)
+			pr_warn("Unable to Enable EFI brightness saver: %d\n", ret);
+	}
+
 	return 0;
 
 err_register_handler:
-- 
2.43.0


      parent reply	other threads:[~2026-02-06 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 12:56 [PATCH 0/2] Save Brightness on Macs Atharva Tiwari
2026-02-06 12:56 ` [PATCH 1/2] efi: Save Brightness using EFI " Atharva Tiwari
2026-02-08 10:45   ` Hans de Goede
2026-02-08 13:16     ` Lukas Wunner
2026-02-09  8:46       ` Hans de Goede
2026-02-06 12:56 ` Atharva Tiwari [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206125641.12983-3-atharvatiwarilinuxdev@gmail.com \
    --to=atharvatiwarilinuxdev@gmail.com \
    --cc=ardb@kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox