From owner-freebsd-acpi@freebsd.org Fri Apr 2 07:06:09 2021 Return-Path: Delivered-To: freebsd-acpi@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B55585C4F0A for ; Fri, 2 Apr 2021 07:06:09 +0000 (UTC) (envelope-from timsofteng@gmail.com) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBWL947lTz4R1l; Fri, 2 Apr 2021 07:06:09 +0000 (UTC) (envelope-from timsofteng@gmail.com) Received: by mail-qv1-xf34.google.com with SMTP id iu14so2155267qvb.4; Fri, 02 Apr 2021 00:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ohp/seMOcHPaClXtIue5yMhntOovdtNbs8o0/nIQ2Ng=; b=U/Elpg6REqVHuh3NvZBEbCh29SpjR75PkHvYFAl8axEUQpAgLJ7ej04FgFlANkE2tR 0gPar41qDv1KQz+DeGrAwuEI5GqW51uaAvAcgoqf1vGxqddCsjVZ55NGOTe7IXmV0u1k fVKAOUG1zmFGAIGXiabK+1ihiTSMYaJUtse2dMA3TcMktUiWMqLlcZgu1BuE4WLsKdwT cNxtq1w5eq1IrlseHkxH4OzfaP61FvPZYNnmCP49D94QK8GujCDiXpRHds4ZEhccRoFo jznBQyiJTyS73Uao+sDCPG1iFsCvyFKbhdN6KGR9vjYrBYdFD9m/cRGcNsOP4fitgbtb IgHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ohp/seMOcHPaClXtIue5yMhntOovdtNbs8o0/nIQ2Ng=; b=Edjq5o+TESTCFYRteeIEjJQSQ9Eye4aGM6+yjj7AtBv05EE/E4a3f7EVOXE5uS8JUZ RTx5bYUfs9nxxuoysvL86FwL+eSnLbTDS/lZwF/I7UiTb1PC6QffnTs+3WUNSrRB2Z9O k473mTvHKv3n3J+/yy2i0jVg6Owlm0/TR+hg+1ITaoFkEGWDVktjATQdwOTyymcNfc1W PgXOb5BwpVYXE5IOmyMtrCaSILtd6Sk53jk3kpj2ronJZFbfhxrZhuJrhfVblPhb9P1j ks2l65IH0+Vfx3j7WW2jP9MwHmhvTx6LXTtiVoYOkgjCDMmSs7vXivJv0pSFtLQ+TcOs Z6ag== X-Gm-Message-State: AOAM530vlibprSngFUzWprVfYDm40s4pBDhQaGHoLyPLHX3M2PTnzy63 ri7NzaPdfxaJKqjlS3vCqNtht2wIOpknsgWkR6vEHGcd X-Google-Smtp-Source: ABdhPJy2yYKoEYvr7lFmUJlMfU2grj2apkyg+IkhQW/SSxcksnysKWuTM492a41rXqjIQpSBON/MkExGHqY7fWPbIUw= X-Received: by 2002:a0c:d7ca:: with SMTP id g10mr11568146qvj.16.1617347168580; Fri, 02 Apr 2021 00:06:08 -0700 (PDT) MIME-Version: 1.0 References: <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> In-Reply-To: From: Softwafe Engineer Date: Fri, 2 Apr 2021 10:05:57 +0300 Message-ID: Subject: Re: Thinkpad t460 acpi issues To: Kevin Oberman Cc: Jung-uk Kim , freebsd-acpi@freebsd.org X-Rspamd-Queue-Id: 4FBWL947lTz4R1l X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 07:06:09 -0000 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 : > 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 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 > > >> > 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? >> >