From patchwork Tue Feb 20 03:39:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 774710 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 F04934C610; Tue, 20 Feb 2024 03:40:04 +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=Q9RV+T0bum7OP6YSHPihnw1ttWlj0YeJy7Y4xCqEJYny3mKsub3SJ/apstEVRyQgTGF37jHc1thzv7RJsBYfKDW+eYEVwsa+gq+zIdUKe4XvJ6P2A60iIKeDUhPFUnv+bjajQ/lY/LWaOuC82Jpv0/NtcyZY/tgN0HGNl4J+2nY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708400407; c=relaxed/simple; bh=O/ojOjVV0gYF/ou8HJynE4YQaLnUsBVUv9Cd5InHGSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Type; b=WQ/9klmp6imCWwt7Fh29ZMIIKF3YrWnvP1bpSAoAnwnxFep9/aE185CbBlajNka24FFx4Gisa/En9YmoB+6Tc3nSpKQvauODrFcl4vwIzGB+4t1dKHdNxPmrjr/eDGfl2tT8mW/UrzNZ5sjrEuiyD2rF7RRlypDFl1Lk8SujZRU= 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 00000000000742C8.0000000065D41F12.001D1CAD; Tue, 20 Feb 2024 04:40:02 +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 1/2] Input: allocate keycode for Fn + R Date: Tue, 20 Feb 2024 04:39:35 +0100 Message-ID: <6af6b923fb73ca9ed5b89f29ca2b8f35730d5cda.1708399689.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 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 adjust refresh rate. But there is no silkscreen print on the R key to indicate this, so add a KEY_FN_R keycode define to use for this key-combo. Signed-off-by: Gergo Koteles --- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 022a520e31fc..ba40af25943a 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -547,6 +547,7 @@ #define KEY_FN_S 0x1e3 #define KEY_FN_B 0x1e4 #define KEY_FN_RIGHT_SHIFT 0x1e5 +#define KEY_FN_R 0x1e6 #define KEY_BRL_DOT1 0x1f1 #define KEY_BRL_DOT2 0x1f2 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: 774401 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-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 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 }, };