From: Hans de Goede <hdegoede@redhat.com>
To: Armin Wolf <W_Armin@gmx.de>,
Joshua Grisham <josh@joshuagrisham.com>,
ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org, corbet@lwn.net,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
rostedt@goodmis.org, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3] platform/x86: samsung-galaxybook: Add samsung-galaxybook driver
Date: Wed, 18 Dec 2024 15:24:10 +0100 [thread overview]
Message-ID: <6d2e175f-0a84-4a6f-9484-c2c299bcc3c5@redhat.com> (raw)
In-Reply-To: <c23c4c88-786a-4662-a448-deb006b7a03c@gmx.de>
Hi Armin,
Thank you for reviewing this new driver.
On 17-Dec-24 10:31 PM, Armin Wolf wrote:
> Am 16.12.24 um 11:38 schrieb Joshua Grisham:
<snip>
>> +/*
>> + * Hotkey work and filters
>> + */
>> +
>> +static void galaxybook_kbd_backlight_hotkey_work(struct work_struct *work)
>> +{
>> + struct samsung_galaxybook *galaxybook =
>> + container_of(work, struct samsung_galaxybook, kbd_backlight_hotkey_work);
>> +
>> + if (galaxybook->kbd_backlight.brightness < galaxybook->kbd_backlight.max_brightness)
>> + kbd_backlight_acpi_set(galaxybook, galaxybook->kbd_backlight.brightness + 1);
>> + else
>> + kbd_backlight_acpi_set(galaxybook, 0);
>> +
>> + led_classdev_notify_brightness_hw_changed(
>> + &galaxybook->kbd_backlight,
>> + galaxybook->kbd_backlight.brightness);
>
> This is the exact reason why i think this should be done in userspace. You can replace this code
> with a simple input event submission using the KBDILLUM* key codes. This would also allow you to
> avoid any special locking in this case.
>
> This would also allow userspace to configure the step with of the brightness changes.
As discussed in an earlier thread, there is really no good way to let
userspace handle this atm. KEY_KBDILLUMTOGGLE gets mapped to XF86KbdLightOnOff
while we really want Cycle, as we have in e.g. XF86MonBrightnessCycle.
I just checked gnome-settings-daemon and it does handle XF86KbdLightOnOff
but it only toggles on/off. In most laptops the cycle key is handled by
the embedded controller and this simply emulates that common setup to
match what userspace currently expects.
Handling this in userspace would require adding a new KEY_KBDILLUMCYCLE
and then adding support for that to xkb and maybe also upower and
gnome-settings-daemon and KDE and then wait for that all to land before
things start to work.
As for your argument about allowing to set the percentage to step,
note that this in kernel handling only increaeses the level by 1 on
the hotkey press that make sense because typically these kbds backlights
only have 2 - 4 levels.
So IMHO handling this in the kernel is an acceptable compromise,
(yes I do realize that this is a compromise).
If some need arises later to do move this to userspace we can always
add a module parameter to completely disable the in kernel handling and
instead send out a new KEY_KBDILLUMCYCLE key-code when this now
module parameter is set.
Regards,
Hans
next prev parent reply other threads:[~2024-12-18 14:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 10:38 Joshua Grisham
2024-12-16 16:46 ` Thomas Weißschuh
2024-12-17 14:23 ` Hans de Goede
2024-12-17 18:54 ` Thomas Weißschuh
2024-12-19 17:31 ` Joshua Grisham
2024-12-22 12:09 ` Thomas Weißschuh
2024-12-25 20:22 ` Armin Wolf
2024-12-26 16:08 ` Joshua Grisham
2024-12-26 23:35 ` Armin Wolf
2025-01-06 11:50 ` Hans de Goede
2025-01-07 11:36 ` Joshua Grisham
2025-01-07 12:06 ` Hans de Goede
2024-12-17 21:31 ` Armin Wolf
2024-12-18 14:24 ` Hans de Goede [this message]
2024-12-18 18:37 ` Armin Wolf
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=6d2e175f-0a84-4a6f-9484-c2c299bcc3c5@redhat.com \
--to=hdegoede@redhat.com \
--cc=W_Armin@gmx.de \
--cc=corbet@lwn.net \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=josh@joshuagrisham.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®