From patchwork Fri Dec 23 07:18:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?am9ld3Uo5ZCz5Luy5oyvKQ==?= X-Patchwork-Id: 13080709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B026CC4332F for ; Fri, 23 Dec 2022 07:18:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbiLWHSO (ORCPT ); Fri, 23 Dec 2022 02:18:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiLWHSN (ORCPT ); Fri, 23 Dec 2022 02:18:13 -0500 Received: from mail5.msi.com (mail5.msi.com [114.30.40.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 667EC3055B; Thu, 22 Dec 2022 23:18:10 -0800 (PST) Received: from mail9.msi.com (mail9.msi.com [220.130.147.43]) by mail5.msi.com (Postfix) with ESMTPS id E7850540786; Fri, 23 Dec 2022 15:18:07 +0800 (CST) Received: from mail9.msi.com (localhost [127.0.0.1]) by postfix.imss91 (Postfix) with ESMTP id 5591DF80808; Fri, 23 Dec 2022 15:18:08 +0800 (CST) DKIM-Filter: OpenDKIM Filter v2.11.0 postfix.imss91 5591DF80808 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=msi.com; s=20220711; t=1671779888; bh=oF8F3VqZ2eU9WjS/HIJOG4/gAjngipuR14YmTGJkYtY=; h=From:To:CC:Subject:Date:From; b=Xf/gYlP3xkUz/DyVz575w3s4piGKFQ3jX0Ad8yOW6rjrhXlQiANEKMOA5Zz/BUFnH xnbupcwD9DxL8Atq7yFY/FTDopXMOs3s+H35oYU06nByINFvbstRGU4wUu0V61GTkK oWwGdCf//G4KfkB8zq4G6CKb6wVEM6M5YRadysd1j8PaXeBYI3I1lznhc8YHodOKie pJc7yrhWKqVzz4LtzrFmdyj4lZ6/BtkTSALV5i0FX2VBmf93aUDx7C26lwTVjvleXh J79Qim9119r3jWmFAgMEO8X6lrmGgiFqi3XJicJxDGIfHgovHFEukvzCpxRWCnvXXE NiF4R7UkPj1BA== Received: from EX2016A.msi.com.tw (unknown [172.16.0.54]) by mail9.msi.com (Postfix) with ESMTPS id 4709DF807BF; Fri, 23 Dec 2022 15:18:08 +0800 (CST) Received: from EX2016A.msi.com.tw (172.16.0.54) by EX2016A.msi.com.tw (172.16.0.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 23 Dec 2022 15:18:06 +0800 Received: from EX2016A.msi.com.tw ([fe80::111c:1b9e:5379:1011]) by EX2016A.msi.com.tw ([fe80::111c:1b9e:5379:1011%10]) with mapi id 15.01.2507.016; Fri, 23 Dec 2022 15:18:06 +0800 From: =?big5_tw?b?am9ld3Uop2Sl8q62KQ==?= To: LKML CC: Greg Kroah-Hartman , Xiang wangx , Stephen Boyd , Prashant Malani , "linux-input@vger.kernel.org" , Dmitry Torokhov , "chrome-platform@lists.linux.dev" , "Benson Leung" , "Gustavo A . R . Silva" , Guenter Roeck , Douglas Anderson , Daisuke Nojiri , Derek Huang , "Dustin L . Howett" , "Furquan Shaikh" , Jonathan Cameron , Lee Jones , "Tzung-Bi Shih" , =?big5_tw?b?am9ld3Uop2Sl8q62KQ==?= Subject: [PATCH v2] cros_ec_keyb: Add 3 buttons for monitor function Thread-Topic: [PATCH v2] cros_ec_keyb: Add 3 buttons for monitor function Thread-Index: AdkWnlAIMkExDDtJRR2LmXs3Hf5qFA== Date: Fri, 23 Dec 2022 07:18:06 +0000 Message-ID: Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.252.125] MIME-Version: 1.0 X-RCPT: , , , , , , , , , , , , , , , , , , X-TM-AS-GCONF: 00 X-RCPT: , , , , , , , , , , , , , , , , , , , Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add 3 extra buttons: 'brightness up', 'brightness down' and 'screen lock' to support monitor manipulating function. Signed-off-by: Joe Wu --- v2: - use tabs - use real email to send patch --- drivers/input/keyboard/cros_ec_keyb.c | 15 +++++++++++++++ include/linux/platform_data/cros_ec_commands.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 6f435125ec03..e7ecfca838df 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -100,6 +100,21 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = { .code = KEY_VOLUMEDOWN, .bit = EC_MKBP_VOL_DOWN, }, + { + .ev_type = EV_KEY, + .code = KEY_BRIGHTNESSUP, + .bit = EC_MKBP_BRI_UP, + }, + { + .ev_type = EV_KEY, + .code = KEY_BRIGHTNESSDOWN, + .bit = EC_MKBP_BRI_DOWN, + }, + { + .ev_type = EV_KEY, + .code = KEY_SCREENLOCK, + .bit = EC_MKBP_SCREEN_LOCK, + }, /* Switches */ { diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index 5744a2d746aa..a2073ed43972 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -3471,6 +3471,9 @@ struct ec_response_get_next_event_v1 { #define EC_MKBP_VOL_UP 1 #define EC_MKBP_VOL_DOWN 2 #define EC_MKBP_RECOVERY 3 +#define EC_MKBP_BRI_UP 4 +#define EC_MKBP_BRI_DOWN 5 +#define EC_MKBP_SCREEN_LOCK 6 /* Switches */ #define EC_MKBP_LID_OPEN 0