From patchwork Tue Feb 20 03:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 203394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp174513dyc; Mon, 19 Feb 2024 19:41:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXogutOR2IpQrkklOv9QyuTaKgils24zbMZKbAg9V0xo3FLJer92S/0cCxt87F34+CLkmREmTTvIdLPQDwkrvorbxzU7Q== X-Google-Smtp-Source: AGHT+IEGNL1ZFQsslUY0T9oAV1Yf55WJw3GmLpNpT9WSi9442rohNrI2ul07yQ/DIPYJJc9dPglu X-Received: by 2002:ad4:5ece:0:b0:68f:6f1b:fa41 with SMTP id jm14-20020ad45ece000000b0068f6f1bfa41mr6037259qvb.4.1708400464295; Mon, 19 Feb 2024 19:41:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708400464; cv=pass; d=google.com; s=arc-20160816; b=gy6hJKywG3gwtO7ZDbUl0dY4hhyFRGOCpRxMAjOtr+0Glijt3rORiBp1LtmHLLbskO drxgko2Sk7gbboc6auiXjKhPMnZNTBI+3+6Q3my5c9vddcW6Fe9uCGOBbC25Bb6TgLTR MwMGRRBZhvCgymHqXDHtjxnm9ZruaxwfrjHcQkSTYW3rR0QmsLfpjg5NQUfPYghDRHWN XGNRWviwJJn14v81QHNEC0w6/mg4vkdGNYe0afd0PWsWz4PC6Fm5fvx1s3WP3Y4SKyms fFSh9h9jyetr/4phBzQurTpCzCkjT0MPbw4kjo4h0YerzZ0k9hFP3j+1P2gs5pGvOUyn GJLQ== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72279-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hf5-20020a0562140e8500b0068cbf73af06si6861558qvb.406.2024.02.19.19.41.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 19:41:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72279-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-72279-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72279-ouuuleilei=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 AFAB21C222DC for ; Tue, 20 Feb 2024 03:40:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E05A05812D; Tue, 20 Feb 2024 03:40:08 +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_J=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 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791387725026252397 X-GMAIL-MSGID: 1791387725026252397 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 }, };