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: 13080708 Received: from mail5.msi.com (mail5.msi.com [114.30.40.53]) (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 1E6AF20E6 for ; Fri, 23 Dec 2022 07:18:15 +0000 (UTC) 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] Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-RCPT: , , , , , , , , , , , , , , , , , , X-TM-AS-GCONF: 00 X-RCPT: , , , , , , , , , , , , , , , , , , , 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