Date: Thu, 1 Apr 2021 22:08:02 -0700 From: Kevin Oberman <rkoberman@gmail.com> To: Jung-uk Kim <jkim@freebsd.org> Cc: Softwafe Engineer <timsofteng@gmail.com>, "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org> Subject: Re: Thinkpad t460 acpi issues Message-ID: <CAN6yY1ug07iQahQEuE64agdt-L4CZUQQ9Pg7T4tYc2yt39KtPQ@mail.gmail.com> In-Reply-To: <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> References: <CAP7bFfCQJU6xk1ovYp083_AXcJnshOHXf40=Mp72bz3daaVqgA@mail.gmail.com> <CAN6yY1vnXaV1TSSAJDJyewaOVXJxexbZqVWktUpFCJznZFodUQ@mail.gmail.com> <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks. Works perfectly! I take it that backlight is often better as it can be run as a user and does not require acpi_video to be loaded. I don't see anything in acp_video that I need if I don't need it to adjust/report brightness. I saw a note in the comment about drm-devel-kmod about this, but no specific command was mentioned. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 On Thu, Apr 1, 2021 at 7:13 PM Jung-uk Kim <jkim@freebsd.org> wrote: > On 21. 3. 29., Kevin Oberman wrote: > > The best way to support these keys is to use devd to respond to them and > > dispatch to programs that can do what the key should do. > > > > I wanted my new laptop brightness keys to work. pressing them had no > > obvious effect. I created the following file in /etc/devd/: > > notify 10 { > > match "system" "ACPI"; > > match "subsystem" "IBM"; > > match "notify" "0x10"; > > action "/usr/local/sbin/L15-backlight.pl Brighter"; > > }; > > notify 10 { > > match "system" "ACPI"; > > match "subsystem" "IBM"; > > match "notify" "0x11"; > > action "/usr/local/sbin/L15-backlight.pl Dimmer"; > > }; > > /* > > notify 10 { > > match "system" "ACPI"; > > match "subsystem" "IBM"; > > action "logger Notify = $notify"; > > }; > > */ > > and trivial perl script (probably sh or python would be most people's > > choice) to actually do the job: > > #!/usr/local/bin/perl > > use strict; > > use Sys::Syslog; > > if ($#ARGV != 0) { > > print STDERR "usage: L15-backlight.pl (incr|decr)"; > > exit 0; > > } > > #openlog("brightness", ,); > > my $new_bright; > > my $notify = $ARGV[0]; > > my $curr_bright = `sysctl -n hw.acpi.video.lcd0.brightness`; > > if ($notify eq "Brighter") {$new_bright = ($curr_bright + 4)}; > > if ($notify eq "Dimmer") {$new_bright = ($curr_bright - 4)}; > > #syslog ("debug", "Notify = $notify, Old = $curr_bright, New = > $new_bright > > "); > > `sysctl -n hw.acpi.video.lcd0.brightness=$new_bright`; > > For AMD and Intel GPUs, you may use backlight(8) with amdgpukms.ko or > i915kms.ko rather than sysctl(8) with acpi_video.ko. > > Jung-uk Kim > > > This adjusted the brightness by 5% on each press.You may notice that the > > adjustment is + or - 4, not 5. It turns out that the brightness keys > worked > > fine, but only adjusted the brightness by 1%. > > > > Similar devd entries can work for other keys. The final rule and the log > > statement in the script are commented out, but can be used to track down > > which key maps to which event number. > > > > I should thank the person who gave me the technique, but I can't seem to > > find the e-mail. My apologies to him. > > > > Kevin Oberman, Part time kid herder and retired Network Engineer > > E-mail: rkoberman@gmail.com > > PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 > > > > > > On Mon, Mar 29, 2021 at 6:16 AM Softwafe Engineer <timsofteng@gmail.com> > > wrote: > > > >> Hello. > >> Freebsd 13 rc3 > >> > >> I'm trying to enable acpi hotkeys on my thinkpad t460 but > >> unfortunately looks lite it unsupported. > >> I've loaded acpi_ibm and acpi_video but only three hotkeys works (on > >> my laptop it's fn+F(number)). > >> > >> As well I noticed strange behaviour on closing laptop cover. When I do > >> it then laptop starts to increase funspeed and no keys or trackpad > >> reaction after opening. Only reset works (long pressing on power > >> button). > >> > >> Is it possible to add supporting for my laptop? >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1ug07iQahQEuE64agdt-L4CZUQQ9Pg7T4tYc2yt39KtPQ>