From owner-freebsd-acpi@freebsd.org Mon Mar 29 13:16:30 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 406ED5C7C0E for ; Mon, 29 Mar 2021 13:16:30 +0000 (UTC) (envelope-from timsofteng@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 4F8ClK3vNkz3PCl for ; Mon, 29 Mar 2021 13:16:29 +0000 (UTC) (envelope-from timsofteng@gmail.com) Received: by mail-pg1-x52a.google.com with SMTP id y32so8241837pga.11 for ; Mon, 29 Mar 2021 06:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=QNYwq+mPW+DK0rGy2jqqHZ2hPPfbiTVg/Cd0Zo+Xjt0=; b=PKdV8BJMYr90oe7ciTDg7aa3QNDSg3ut29lT/0v03YsiCWM5AzX213J8msr7p44jUN OODjcWjUxFst3eIbsUdDx6ZPVM4c7O5FP2hHiMu/HwFRwNKQEQ3zrLvW7NxDPr15KmWu Ns/oBWoSG2LMW6XPuuAomVvZgYsmOQKRauCVc4gIZDijMAuMjyCuwaDl9zxUsE7mr++7 mhoDAaJ0KSTJ+eKiFFi/2zQ5cQZcDH7ACfbO39d8vn84quS64H1x0MXkLtZDkpOrQZhB W7cht+sdeJEgNTIdyicApgLfz6u40Js3dbIT4Y04h5I6bUnFMi9ZOse3jsgjk6+iB9VL 2BMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QNYwq+mPW+DK0rGy2jqqHZ2hPPfbiTVg/Cd0Zo+Xjt0=; b=VWB0K9tZv7vAbwBovcxM1Sc+HP9A4CMDEEsTk8ENe0tHuzKwdqV4+O2+gP7H1R+0H3 OoAOofD+xXONhDtcjjwNosi+uW7ITYIq8mDfQDuHodgRfjcCeQrg4U4bdEMIrwJ6ndNY iemBqWyRgNLJj/PIUHWWXD4Kf4eUJKK6+3djyELY/LuZf7O0HQnTSCiHLZeO3haz1tpP ntQ1wSsFDECkAc+WP2JdYilUojkgPHPwnAmXDQn+571u6DIFDvJ/4ioaw3YWwGxuKFof T+j5ZD8JYHj5FbOGTWrojxg/L2m8+19LpUO5wvkchp4913eDhJu7w2TCy05vMMPH4z40 gBbQ== X-Gm-Message-State: AOAM531GBegWGs5zQjHTNE7pLB3gvebv9JMy4GtEY/bbHFJfVj+SbaTr plaWYQti8TGdFVtcVfz1UaQeCB/Hi0nn9sdFHS11Bhq3 X-Google-Smtp-Source: ABdhPJy/eldIFfGRTb1S5+3kdW2br24KcUyqc7kwJmlq2XT0qSK/NKxt+MxHayKm/7W1pRRABWZHM2Lr1AsuTWHoFUM= X-Received: by 2002:a63:ce03:: with SMTP id y3mr23859312pgf.414.1617023787034; Mon, 29 Mar 2021 06:16:27 -0700 (PDT) MIME-Version: 1.0 From: Softwafe Engineer Date: Mon, 29 Mar 2021 16:16:15 +0300 Message-ID: Subject: Thinkpad t460 acpi issues To: freebsd-acpi@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4F8ClK3vNkz3PCl X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=PKdV8BJM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of timsofteng@gmail.com designates 2607:f8b0:4864:20::52a as permitted sender) smtp.mailfrom=timsofteng@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::52a:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-acpi@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::52a:from:127.0.2.255]; NEURAL_SPAM_SHORT(0.01)[0.013]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52a:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-acpi] 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: Mon, 29 Mar 2021 13:16:30 -0000 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? From owner-freebsd-acpi@freebsd.org Mon Mar 29 20:09:08 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 C6D9C5A9862 for ; Mon, 29 Mar 2021 20:09:08 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 4F8NvS0YrKz4c50 for ; Mon, 29 Mar 2021 20:09:07 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-ot1-x329.google.com with SMTP id s11-20020a056830124bb029021bb3524ebeso13519527otp.0 for ; Mon, 29 Mar 2021 13:09:07 -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=dhFTziKq/NDj2PGZouDbP2tB+5kjhFXknuWHuFbWrk0=; b=BZDuFcXEN0W0XKX2Kmyi5mCdGVcGgb1TpZWdIS4Iq23d4BOcABzTtpHJv2oNhdcuYf qXwWoXCAzMQ1Pr+qQ6X5d8YfmDLa1qy4a96e6RzjSHB7B57Sx87aJ8/4vEBaVaGqDRm8 Kw2If3iPmUtmdROFQBat4cad7DrJWJmFATJMUD9TnEb6uxfXlwfyAqeWzUraEzTLeU8U 0hrzNTJB1hitXqZ8e1B88rlkLayWf8mLR6MrCq6yRrJAzkpn9LSzrqR4hhMZc6nkFAB/ WUfqiWuC/6zhud6fXmnYHFSHmceFrcwouarHfZhCjhPLFrlZ61K3/l71Z3dEP9ljbPuE bfaw== 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=dhFTziKq/NDj2PGZouDbP2tB+5kjhFXknuWHuFbWrk0=; b=teRwfSb9awEfs5momazxGw0pgGyRrdUxy1gg6/yCOAbz1lrh50Y2ZqKaDJuSTKQ5KW BUGBHL21MrobCVFImmmIyCBLxf5Lg+12r5SSqJQyUQg9ZKvK12Vylcq5a25D0NH1EFbm mdnNxX5QTzXTs00ebtKbTNScLm6OADyNrGE4njN+CF5wSwZuzMy6dIbHlJ4EKzaF6OCg 6P9d8eP7UQCVGxhl6hzImrT1NkAz6heZMGIPcJCQQ3NVfXMteuYXJh9oJjSkGHpJe6Mo UtaTvqNxV86XZPhQosmJBcijTzYilVYPqXJ5ssQmvAoJvRiCvrU+zg0JyeHuD5Vq2RAI hF/Q== X-Gm-Message-State: AOAM533QbJiA3u0kjU2Qyct06FzF1AAQ9RyTNf/6BmptMmYfmGjAg+Mk Vs9o60q3O116UntLym+HXdagK/2ph+ijqRpZtVQ= X-Google-Smtp-Source: ABdhPJzQf4GsbaoAOJyktfrfY72e8AqwT4BqVwZFOkxNsW7bzx2ggCC/Q47fmurMnaDcbkUNudoLNjXO/ChB8MffaoE= X-Received: by 2002:a05:6830:1e14:: with SMTP id s20mr25345790otr.199.1617048546300; Mon, 29 Mar 2021 13:09:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kevin Oberman Date: Mon, 29 Mar 2021 13:08:49 -0700 Message-ID: Subject: Re: Thinkpad t460 acpi issues To: Softwafe Engineer Cc: "freebsd-acpi@freebsd.org" X-Rspamd-Queue-Id: 4F8NvS0YrKz4c50 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=BZDuFcXE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of kob6558@gmail.com designates 2607:f8b0:4864:20::329 as permitted sender) smtp.mailfrom=kob6558@gmail.com X-Spamd-Result: default: False [-3.61 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.91)[-0.911]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[rkoberman@gmail.com,kob6558@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[rkoberman@gmail.com,kob6558@gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::329:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-acpi@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::329:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::329:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-acpi] Content-Type: text/plain; charset="UTF-8" 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: Mon, 29 Mar 2021 20:09:08 -0000 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`; 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 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? > _______________________________________________ > freebsd-acpi@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-acpi > To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org" > From owner-freebsd-acpi@freebsd.org Fri Apr 2 02:12:58 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 BE9115BED0C for ; Fri, 2 Apr 2021 02:12:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FBNqt56t3z3Q3g; Fri, 2 Apr 2021 02:12:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9919D29FCD; Fri, 2 Apr 2021 02:12:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) To: Kevin Oberman , Softwafe Engineer Cc: "freebsd-acpi@freebsd.org" References: From: Jung-uk Kim Organization: FreeBSD.org Subject: Re: Thinkpad t460 acpi issues Message-ID: <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> Date: Thu, 1 Apr 2021 22:12:53 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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 02:12:58 -0000 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 > 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? From owner-freebsd-acpi@freebsd.org Fri Apr 2 05:08:19 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 DCB4A5C1EB7 for ; Fri, 2 Apr 2021 05:08:19 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 4FBSkC5lxKz3pj8; Fri, 2 Apr 2021 05:08:19 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-ot1-x32f.google.com with SMTP id c24-20020a9d6c980000b02902662e210895so3593886otr.9; Thu, 01 Apr 2021 22:08:19 -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=Am08EZ6Uu9Dli1OHnmnxxDi13O1eaURfVYDFrpDZ+5w=; b=NIWHccFSntb7A82Nlt7FZYRRk/upHCAHxhu9rYFnd4FLvK4JWhdpX1pFKES2EGf0/N YlXToDOedVzlQW8VtKSue+SxGtcWlnLgSVrnAEhttcQUAtLPi41lyHKPou/sBaht0+qB WQL/HMcBeX9pjlczS2JqCFP1S2FmSjB0zOaOMx7uCrKPG/9bwQYsDS78HiYmihXtHX2g E5U4CKqZfqVQo6glMyeSPKIRo2Ek9G5RjKfcGVVR/cfLyxvcxaBitn0Bc+r7bRZvqRr/ uzWp5ETyayq86J2V4VHh9xeFK9X8kjVZNAScbQ4bkFqcB7VbJXYFM9kEBprvzFBegxol 0Ulw== 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=Am08EZ6Uu9Dli1OHnmnxxDi13O1eaURfVYDFrpDZ+5w=; b=j2u9fRbiZuX/ncpYtRWthZDjknGX3iPuSIzs2UofjxSRfI3JHPbvl91B3aN5dXwwC0 RJ5mdwH8Jb2Kc20fpEmcF9jQcR+DF29WRH5Bj4tftXbnkeqEoYe+uq+OsdpjXgyZ379H 0euo4Rbjm/jUAIluLd/6KiddPQU2PNm9YFXoVvTqFsveiMD9u1YFakK4X7wxEXzJD+zN 9hvsKZgIlne9PTEYkfCHewYGblFKO8udfqMh4nD0ci/RIkgZ1gPNxSN2Msd0YV4wKrRL /l8dSglqprszCXyoid4TbHr/sxDUnJG9Y3VKFzVtPPsXiERB1oCYpfS+cAX0dtJKkIvm LVDA== X-Gm-Message-State: AOAM5326HS+E8xCrXy7sYlQ3IcomyuVIOB8VEp2iDcNY92VKyeqF5kDd GgZvLwCGf9hAv6aMK0yXmTf3WvYirPgXzCSTNF13biSdasU= X-Google-Smtp-Source: ABdhPJx/pa6cNGWZTqB8OS3H/OcgGcplcSxA0yfnfNe7W4OMgChlwQZwYwe2X9iMP6YpPOC/rmaVMSNbE3E6CGZUUNE= X-Received: by 2002:a05:6830:1219:: with SMTP id r25mr10212179otp.93.1617340098442; Thu, 01 Apr 2021 22:08:18 -0700 (PDT) MIME-Version: 1.0 References: <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> In-Reply-To: <96f00b23-400b-ed73-b9f6-94f2bd98bd3e@FreeBSD.org> From: Kevin Oberman Date: Thu, 1 Apr 2021 22:08:02 -0700 Message-ID: Subject: Re: Thinkpad t460 acpi issues To: Jung-uk Kim Cc: Softwafe Engineer , "freebsd-acpi@freebsd.org" X-Rspamd-Queue-Id: 4FBSkC5lxKz3pj8 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" 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 05:08:19 -0000 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 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 > > 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? > 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? >> >