Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1502876rdb; Mon, 19 Feb 2024 19:40:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9of4mHwq2YmEycEW2ZJ5r3z2CArochGl7xutuDS99Hnj1qu8fbO1QR+Ok6AFv2QEItZWxCI7QHk5HnUSRrJddjK+pVV1eOQSXFYSwqg== X-Google-Smtp-Source: AGHT+IGbzrwFRb2lrvDmRrMuvuRdC8TGOiJ6IYpkQu5ZWgwPhxMp7fHJJE1XcrzYr2FpRQtLeL+2 X-Received: by 2002:a05:622a:10b:b0:42e:2955:4645 with SMTP id u11-20020a05622a010b00b0042e29554645mr410222qtw.21.1708400453170; Mon, 19 Feb 2024 19:40:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708400453; cv=pass; d=google.com; s=arc-20160816; b=VSVS8JV0OmKilo0dLMHUpoeBj1t+GNH5EcnLPpy1+0u4xxhtyIrhdwQ8IhvJzmk7FO 2h23fSQZU25JEVocOM2x99tzMfDGUoHn6gO0Eg/B9szrLuokP/Y4TthaoC/Qhzhyx/si e+KV5bEDWIJ/NPPkZOdkRpda39mTMsd+4SUJiKrCYM4eELOKDej0zOGV/n4ZasgRMTg9 M4L7GwMo7XU+kdRRLKUD8RNJO+qnaExLG8YyO7989EKI8MQht1IE8OiICeYekeUOsePE tycnxU6zvmHnSVcO62JYmNaJAfJiQrMYGK3Sykl9VrF76F70geATeOp7JAUX6Olh5sSw XcwQ== 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=4V2hU+m/wyPVBAj9piUmKp8+PjzUkWJxJ23x+nBgY0g=; fh=pUadl2wNriNRNgSk6HblFoWJzIWMP/JJG3bNQeUlSko=; b=k2ll63lBtX8rqQmJwGi7hxg54IyCnpiSvJ0mduCdMUEdD5sHV/IvJ0tX/sarLa7Wt/ 1hhiP0rToNxGpDkCLgJrCHEPkGxNh9luU8argaP3ApHa/l1gwjq8YzFpx94vIfrV1M4n Q5MWhCwb6IW6wE3SrDU09SJyC1mSrXhlfd5X+BIvz4b9bvTT/VeupgBO1CAb/eayAK3P H+4pN4rxmYyETtWThSTypAOlUyjEh7dQDEMtrL0QNByGj+YeEJWvHpzzElPZcUZ1pCA3 2EgZj5Kl1S560hOdqqLLIMGfDdB0caa0Osi0F+I0xQc7ksmctPeNtVOMtW1kWsK6DUCw I4WA==; 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-72279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f14-20020ac8498e000000b0042dddccde92si7216674qtq.710.2024.02.19.19.40.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 19:40:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-72279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72279-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7413D1C23CCD for ; Tue, 20 Feb 2024 03:40:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D872056B90; Tue, 20 Feb 2024 03:40:07 +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 80741535C9; Tue, 20 Feb 2024 03:40:05 +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=1708400407; cv=none; b=eknhn3RgsqkXrl52bn949c/0TOrzks++Hmltwx/CYc0taysIT6Q752dDiRJ1Y0luvKVgmWo1OJcSC6B4+VTfXkDKrmNg56UWk2V2SqIjkWwjs6qrGb8lymBnN7vEraZruz1vrGnilWSwvxvgJ08tqqkEkzELNn7njkfk8OZQaVE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708400407; c=relaxed/simple; bh=7t9cqES8MSWTYHCLk+n76X7zRHHCvrwc6p/G92TYeZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Type; b=eeaYrjqW1cXjqtnYzapeoCQ+h6Ml/nWa7kzt5EJlkIUcoPRuf9XnmJgG68gAQ7KLeZ5WH2jhgG8ecnVNiiWoBEb42j0pYl9tZVeVZU8/gfG8WShhJbEhKvHNHD0ZniEz5E3wxwWiDXo7RjY9bBCMoBgnmWVBoc2ijvT9SUJF8NA= 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 (51b68dc5.dsl.pool.telekom.hu [::ffff:81.182.141.197]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 000000000007458F.0000000065D41F13.001D1CBF; Tue, 20 Feb 2024 04:40:03 +0100 From: Gergo Koteles To: Ike Panhc , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Dmitry Torokhov , Philipp Jungkamp Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Gergo Koteles Subject: [PATCH 2/2] platform/x86: ideapad-laptop: map Fn + R key to KEY_FN_R Date: Tue, 20 Feb 2024 04:39:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.2 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 (e.g. Yoga 7 14ARB7) and Legions with 60Hz/90Hz displays send a wmi event when Fn + R is pressed. This is intended for use to adjust refresh rate, but there is no silkscreen print on the R key to indicate this. The Fn + R key is incorrectly assigned to KEY_DISPLAYTOGGLE, as the latter is used to toggle the display on and off. Map the Fn + R key to a more generic KEY_FN_R event code, since the refresh rate toggle feature is not common and is only used by a few Lenovo laptops. 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..c31c96228912 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_FN_R } }, /* 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_FN_R } }, { KE_END }, }; -- 2.43.2