From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: Ard Biesheuvel <ardb@kernel.org>,
Hans de Goede <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v4 2/2] platform/apple-gmux: use apple_brightness to save brightness to EFI
Date: Thu, 21 May 2026 15:43:21 +0300 (EEST) [thread overview]
Message-ID: <f5cb54b3-b30d-2e20-874a-824aab1c3eea@linux.intel.com> (raw)
In-Reply-To: <20260316153407.1781-3-atharvatiwarilinuxdev@gmail.com>
On Mon, 16 Mar 2026, Atharva Tiwari wrote:
> use apple_brightness to save brightness to EFI.
Please capitalize changelog text properly.
>
> (tested on iMac20,1)
>
> Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
> ---
> drivers/platform/x86/apple-gmux.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
> index 1417e230edbd..cab3122c1a86 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>
>
> @@ -78,6 +79,8 @@ struct apple_gmux_data {
> /* debugfs data */
> u8 selected_port;
> struct dentry *debug_dentry;
> +
> + bool save_efi;
> };
>
> static struct apple_gmux_data *apple_gmux_data;
> @@ -960,6 +963,13 @@ 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 save: %d\n", ret);
Include for pr_warn() is missing from this file.
> + else
> + gmux_data->save_efi = true;
> + }
> return 0;
>
> err_register_handler:
> @@ -1012,6 +1022,16 @@ static void gmux_remove(struct pnp_dev *pnp)
> kfree(gmux_data);
> }
>
> +static void gmux_shutdown(struct pnp_dev *pnp)
> +{
> + struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp);
> +
> + if (IS_ENABLED(CONFIG_APPLE_BRIGHTNESS) && gmux_data->save_efi)
> + apple_brightness_shutdown();
> +
> + gmux_remove(pnp);
> +}
> +
> static const struct pnp_device_id gmux_device_ids[] = {
> {GMUX_ACPI_HID, 0},
> {"", 0}
> @@ -1026,6 +1046,7 @@ static struct pnp_driver gmux_pnp_driver = {
> .name = "apple-gmux",
> .probe = gmux_probe,
> .remove = gmux_remove,
> + .shutdown = gmux_shutdown,
> .id_table = gmux_device_ids,
> .driver = {
> .pm = &gmux_dev_pm_ops,
>
--
i.
prev parent reply other threads:[~2026-05-21 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 15:33 [PATCH v4 0/2] Save Brightness on Macs Atharva Tiwari
2026-03-16 15:33 ` [PATCH v4 1/2] efi: Save Brightness using EFI " Atharva Tiwari
2026-03-17 9:39 ` Aditya Garg
2026-03-17 9:52 ` Aditya Garg
2026-05-21 12:29 ` Ilpo Järvinen
2026-03-16 15:33 ` [PATCH v4 2/2] platform/apple-gmux: use apple_brightness to save brightness to EFI Atharva Tiwari
2026-05-21 12:43 ` Ilpo Järvinen [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=f5cb54b3-b30d-2e20-874a-824aab1c3eea@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=ardb@kernel.org \
--cc=atharvatiwarilinuxdev@gmail.com \
--cc=hansg@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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