Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3316376rwb; Fri, 20 Jan 2023 14:24:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsXJV9ATIUKuiAOzkxNcw30ReNI2UERlargJfT00SQj6/Uvt+4+Br26UT77wMqgHRiyjnwx X-Received: by 2002:a17:902:ce0b:b0:194:586a:77ba with SMTP id k11-20020a170902ce0b00b00194586a77bamr19543478plg.52.1674253475231; Fri, 20 Jan 2023 14:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674253475; cv=none; d=google.com; s=arc-20160816; b=GkoUPmnPpEjlL0+JCrVHtAu+vb/McFYeu9ykR4kWRzw6z9PQx054ODe3GCBIaYGItp USj+c2HQUNZYcz7Mac1F7yseUtJZOXVO6V6jguJWK6w7wh0VnhheGDmXdR80377HZcjx OwqwMhY1b+SCXee7reQmWLTUbJFOmZqefPO9dZWDdmE1XFdcVW2MEiX9Fy3svxZblfEh b1zYCLZh+UoRN72tDj7Om28OI3f5IKjdfXFnwuUvklAHCS85hxgw/GlSKSAZO1EolB6W DUYyBohXd7UmQK9e8NyqMhgLvpRuwKBLCn3fiDnAKhSD5+e4SsO5VFTw9OdHcPGGQQQh 6aSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/BLx/kBvpw86ToAVtcXNE5Xz+7HViCTk2DMghDTHwhY=; b=gjCfkKfEObJQWqt3jvJROi7UDyo3ylkgvlm+SvwLhKISBsdi1GY+LW6ilNsB4fjQF1 rVFvO0JHN3C3Q3137AXmPOebTZDD10u6HvDH6nCmvWeAKkdXGeRWEtMoqNQlWDnplpLA rA1lVkh2Bwh4rv4mpERWhv5OW1BBVXrjs87VmIzDvDmXdSRwu9B5GLQm6YkMRY1RCMyN hJt+96GWpnB5vy6VgG7tvFaQuLy7GnIrVZbFU0TiX4AIViGvTQbsemgvoP4+oZL07S+K dD+XKvHONiFblrOeydLrlxXJclNMlS2ojCgM8/robRhvUSrSWGv39W1lg4NOR2VHkdlE UADQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C5YnR9Ws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170902da8400b00180680b8f1bsi20467696plx.264.2023.01.20.14.24.27; Fri, 20 Jan 2023 14:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C5YnR9Ws; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjATWNP (ORCPT + 50 others); Fri, 20 Jan 2023 17:13:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjATWM6 (ORCPT ); Fri, 20 Jan 2023 17:12:58 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F40BF5DB; Fri, 20 Jan 2023 14:12:45 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id d3so6501702plr.10; Fri, 20 Jan 2023 14:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/BLx/kBvpw86ToAVtcXNE5Xz+7HViCTk2DMghDTHwhY=; b=C5YnR9WsRnY6mJENGiO5RCQWH8CMb+20BAZpcKt0iX+4NXcCEmWdQRF1BJEwu4U+8E QQEFyoZNwHDu8HvF3N5loRanY5euTKANIG0mA0l/lUt1s9OuhHNhv+QnzPEe340xQ1os vAXeeNAsdwSwVYK22lNhgllwMpPV+7D5AQhDiVGDaYUYke5mOapwfilb9s72L5bQLv8Z YmTJVjeUEgxA2dT0R8w1gFjvdw5PApx8xvyAtahmdfrQ/BpG67A86CmNaUgD69fMkwKc SwyV3LXOVZytWnnN45NWcdyBvkPZ7Q8cLzKsiVoBp1qiNle6H87NANQwEI+a3YeIyqbl 61+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/BLx/kBvpw86ToAVtcXNE5Xz+7HViCTk2DMghDTHwhY=; b=29X0skF1yDRSxjOTsZPN8qxR+W1wc0DklRpnri2WGV4Xws/UwGEPayjiMt4Cye8HKD K53gPvHzo9m+9KD/cZtpN3hO6MO/srUaWnBRlyqHLvRhafs/XIBJj9tXgWEf26OXFIAS IxihedrSTnz1R3fIVH1xU9cQf65B1bLy60Q9vG0IU61AUU5oPGTBfWzEvYAIBikuQpBd Dv3BfG8YNuhWiBBfvMWqHx/bqmIaC7KT2pnR115jxEySZmXJHLbsq3DYHxCOBXM9DGk6 BpRsKG0tKtu8cKLpxdGTqsUcfPYakK7joOQM6DrgRchp7zJITHIFLvkIYLcmcUQh+gXN FXcA== X-Gm-Message-State: AFqh2kqQ8HDU92U3pHYx3cgdF/swuMcSqUX+JtJonxualPUvxOSepO98 LvyZ2VXEeCXTGXVcfn8ih04= X-Received: by 2002:a17:90a:fe0c:b0:227:1b37:50c9 with SMTP id ck12-20020a17090afe0c00b002271b3750c9mr16487534pjb.5.1674252764404; Fri, 20 Jan 2023 14:12:44 -0800 (PST) Received: from rishit-OMEN-Laptop-15-en0xxx ([171.76.81.196]) by smtp.gmail.com with ESMTPSA id y13-20020a63e24d000000b00478eb777d18sm23237202pgj.72.2023.01.20.14.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 14:12:43 -0800 (PST) From: Rishit Bansal To: Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rishit Bansal Subject: [PATCH v2] platform/x86: hp-wmi: Handle Omen Key event Date: Sat, 21 Jan 2023 03:42:14 +0530 Message-Id: <20230120221214.24426-1-rishitbansal0@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to map the "HP Omen Key" to KEY_PROG2. Laptops in the HP Omen Series open the HP Omen Command Center application on windows. But, on linux it fails with the following message from the hp-wmi driver: [ 5143.415714] hp_wmi: Unknown event_id - 29 - 0x21a5 Also adds support to map Fn+Esc to KEY_FN_ESC. This currently throws the following message on the hp-wmi driver: [ 6082.143785] hp_wmi: Unknown key code - 0x21a7 There is also a "Win-Lock" key on HP Omen Laptops which supports Enabling and Disabling the Windows key, which trigger commands 0x21a4 and 0x121a4 respectively, but I wasn't able to find any KEY in input.h to map this to. Signed-off-by: Rishit Bansal --- Changes since v1: - Add support for FN+Esc Key --- drivers/platform/x86/hp/hp-wmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c index 0a99058be813..ab858db551fb 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -91,6 +91,7 @@ enum hp_wmi_event_ids { HPWMI_BATTERY_CHARGE_PERIOD = 0x10, HPWMI_SANITIZATION_MODE = 0x17, HPWMI_SMART_EXPERIENCE_APP = 0x21, + HPWMI_OMEN_KEY = 0x1D, }; /* @@ -219,6 +220,8 @@ static const struct key_entry hp_wmi_keymap[] = { { KE_KEY, 0x21a9, { KEY_TOUCHPAD_OFF } }, { KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } }, { KE_KEY, 0x231b, { KEY_HELP } }, + { KE_KEY, 0x21a5, { KEY_PROG2 }}, /* HP Omen Key */ + { KE_KEY, 0x21a7, { KEY_FN_ESC }}, { KE_END, 0 } }; @@ -810,6 +813,7 @@ static void hp_wmi_notify(u32 value, void *context) case HPWMI_SMART_ADAPTER: break; case HPWMI_BEZEL_BUTTON: + case HPWMI_OMEN_KEY: key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY); if (key_code < 0) break; -- 2.37.2