Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2021 10:05:57 +0300
From:      Softwafe Engineer <timsofteng@gmail.com>
To:        Kevin Oberman <rkoberman@gmail.com>
Cc:        Jung-uk Kim <jkim@freebsd.org>, freebsd-acpi@freebsd.org
Subject:   Re: Thinkpad t460 acpi issues
Message-ID:  <CAP7bFfA7SmUP3Vhv7Fc%2BFcpab3NWDT11nD8B9ye6if2pKdvaTg@mail.gmail.com>
In-Reply-To: <CAN6yY1ug07iQahQEuE64agdt-L4CZUQQ9Pg7T4tYc2yt39KtPQ@mail.gmail.com>
References:  <CAP7bFfCQJU6xk1ovYp083_AXcJnshOHXf40=Mp72bz3daaVqgA@mail.gmail.com> <CAN6yY1vnXaV1TSSAJDJyewaOVXJxexbZqVWktUpFCJznZFodUQ@mail.gmail.com> <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> <CAN6yY1ug07iQahQEuE64agdt-L4CZUQQ9Pg7T4tYc2yt39KtPQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I know hack about manual hotkeys configuration and scripting. But... It's
slightly annoying. Could driver be patched or something like that?

There is Intel CPU in t460.

=D0=BF=D1=82, 2 =D0=B0=D0=BF=D1=80. 2021 =D0=B3., 08:08 Kevin Oberman <rkob=
erman@gmail.com>:

> 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_vid=
eo
> 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 a=
nd
>> > 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 =3D $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 !=3D 0) {
>> >   print STDERR "usage: L15-backlight.pl (incr|decr)";
>> >   exit 0;
>> > }
>> > #openlog("brightness", ,);
>> > my $new_bright;
>> > my $notify =3D $ARGV[0];
>> > my $curr_bright =3D `sysctl -n hw.acpi.video.lcd0.brightness`;
>> > if ($notify eq "Brighter") {$new_bright =3D ($curr_bright + 4)};
>> > if ($notify eq "Dimmer") {$new_bright =3D ($curr_bright - 4)};
>> > #syslog ("debug", "Notify =3D $notify, Old =3D $curr_bright, New =3D
>> $new_bright
>> > ");
>> > `sysctl  -n hw.acpi.video.lcd0.brightness=3D$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 t=
he
>> > 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 l=
og
>> > statement in the script are commented out, but can be used to track do=
wn
>> > 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.co=
m
>> >
>> > 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 d=
o
>> >> 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?CAP7bFfA7SmUP3Vhv7Fc%2BFcpab3NWDT11nD8B9ye6if2pKdvaTg>