Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp44330lqb; Sun, 10 Mar 2024 04:32:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVC2b7R6PO4RcLguMz/F6TJTHJl41D9LlrHpJZfzoRAa0vHgNR1nfgxlsb/hUaKyS6zQTzJg+oy3Ii6xgWTXgRDDv94Zhd57gG1LgCJPw== X-Google-Smtp-Source: AGHT+IFn5OUxNVTYf9USYJJNWlci36Uaz6l5Zublx8lBRWq5G5ih23ntpYEgLmm7QDwxNapLaOIA X-Received: by 2002:a05:6808:14cd:b0:3c2:3a02:2731 with SMTP id f13-20020a05680814cd00b003c23a022731mr5444249oiw.5.1710070337648; Sun, 10 Mar 2024 04:32:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710070337; cv=pass; d=google.com; s=arc-20160816; b=wRMHa5PoNoH3/tg6DZ5U6sXpggKfCc4BrsjsmjwJlJozc7HWbJBLJe4hoIcOfxd3UZ eEIAy02++2DgXEZ4OYT3Z95LVY0R/6pSZ8IW0LmtJGt/Ff1k/KqRmq0QSZ5AdRU4Gqbh ntKNGMNS1BkHW4a0Bdn/eJd03kaSz5fqP7pB9uZxXn2XdUd3fOIO0IioRyikPIKaBsFv AYhIhWa7So1do5tlMvsgH3ZGoZzV5TRoqHlWvX1w2m1rvZ2ObHgNf119AA2vMGQCkfwK 2Wj4crvGbOlsjMA6R47EoIAccW8TuNAgFusrhHazYtjRn6Xv/e8dYiTZZTO92PVngUqY qkpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/xAfp2HFymf0XRLAQoiHjgaZuymUr7Dowp2TT13nB08=; fh=frKFMPxcN12FnAP0Ruo1zHVlnfiU+QldVXkbXXfnPzs=; b=sx4jloCZwH9zbzq+IGoMn6uwljqZNb5fK6hhQUOC5OhqMVWDWSGnOXhXYyT5w1+7Vx nYfnmt6yuBMUd7+Sv3og3hl6bWNS9ittl3zH5nNdHR6bDFhB0Ph9fN2fWEfqcme5xSRM /0zYbWGmUst6C4yW50Hmqz4MBLexTy2hkxLRxNOzp9P+jQlpam4LV9j2EhrWxntIDRiz Am+N277EVXVVMy9J8AwNBYTY6Ss2Rnfun9XLF/oY9sRNieX0u7TUs90GU9Yp8aVYaXug EKcLXYVC7szla5Deq0FYHU9E55al4zkAskw2tMLW6xoMO+V1F6ZaCi9PwXX/SmyNkb+1 02Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-98193-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98193-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 26-20020a63165a000000b005cee03a5355si2893226pgw.518.2024.03.10.04.32.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 04:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98193-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-98193-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98193-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4D4232817BB for ; Sun, 10 Mar 2024 11:32:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2DEE20B21; Sun, 10 Mar 2024 11:32:05 +0000 (UTC) Received: from irl.hu (irl.hu [95.85.9.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75D331EB42; Sun, 10 Mar 2024 11:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.85.9.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070325; cv=none; b=M46LF/x4xKFwZbe+ZBrmrOqTgsxHcJjP3V0jjylNoiRN2mlZ9oRlhVQsgeLpX5RXLTyu4f1dEn/Zv2agU9j/gSgmUnnIdiAP6OtKnesoT63g3+3Je7lxKmda+BBOWcLJygIjFvXAj440+Grc89c1SoqqqA3bJIMNTvgiCKvkPz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070325; c=relaxed/simple; bh=ahQ+dUubnLbuzl1m1Uxd3EFT/dTYsu0b9bYX0mThnAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Type; b=fIye4yllWiE6rxRp9vykyXAm83RzYkkLqKHTSLIJt4YbF5IUlZOI0O5XsNJc2SW/udSUwxpCrci4nBTJrhzGnRZSklD4D2iPL21Iw7HfNnRymIJ/7eu9EpqYvJditoX2aHVIQrjG7sS+m3IIXKe3Ij/bhPjaRofiYv5QOtFpTRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu; spf=pass smtp.mailfrom=irl.hu; arc=none smtp.client-ip=95.85.9.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=irl.hu Received: from fedori.lan (51b693e7.dsl.pool.telekom.hu [::ffff:81.182.147.231]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000076A0E.0000000065ED9A2C.0020EFD7; Sun, 10 Mar 2024 12:31:55 +0100 From: Gergo Koteles To: Ike Panhc , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Dmitry Torokhov Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Gergo Koteles Subject: [PATCH v2 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_REFRESH_RATE_TOGGLE Date: Sun, 10 Mar 2024 12:31:42 +0100 Message-ID: <8fd36f0f016dde700396d8afaba1979d5dbc30a1.1710065750.git.soyer@irl.hu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event when Fn + R is pressed. This is intended for use to switch between the two refresh rates. The Fn + R key was incorrectly assigned to KEY_DISPLAYTOGGLE because it is used to toggle the display on and off. Map Fn + R key to the KEY_REFRESH_RATE_TOGGLE event code. This commit depends on "platform/x86: ideapad-laptop: support Fn+R dual-function key" Signed-off-by: Gergo Koteles --- drivers/platform/x86/ideapad-laptop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 4c130957f80d..901849810ce2 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -1092,7 +1092,7 @@ static const struct key_entry ideapad_keymap[] = { { KE_KEY, 0x0e | IDEAPAD_WMI_KEY, { KEY_PICKUP_PHONE } }, { KE_KEY, 0x0f | IDEAPAD_WMI_KEY, { KEY_HANGUP_PHONE } }, /* Refresh Rate Toggle (Fn+R) */ - { KE_KEY, 0x10 | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } }, + { KE_KEY, 0x10 | IDEAPAD_WMI_KEY, { KEY_REFRESH_RATE_TOGGLE } }, /* Dark mode toggle */ { KE_KEY, 0x13 | IDEAPAD_WMI_KEY, { KEY_PROG1 } }, /* Sound profile switch */ @@ -1102,7 +1102,7 @@ static const struct key_entry ideapad_keymap[] = { /* Lenovo Support */ { KE_KEY, 0x27 | IDEAPAD_WMI_KEY, { KEY_HELP } }, /* Refresh Rate Toggle */ - { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_DISPLAYTOGGLE } }, + { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_REFRESH_RATE_TOGGLE } }, { KE_END }, }; -- 2.44.0