From patchwork Tue Dec 20 08:02:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Wu X-Patchwork-Id: 13077606 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C08A184C for ; Tue, 20 Dec 2022 08:02:37 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id e190so3383757pgc.9 for ; Tue, 20 Dec 2022 00:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=msi-corp-partner-google-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h8keCepZ3dfLi7fx2igh9uQOxl5mkPHS3M0dmWSrolk=; b=IZpbA04Y8FkJYIOTO3btzMCktgX15dHzpAYDIPQVUsHlEoNpskIkkn9sBll2LGFYN1 GBzi/zoELV4ZK7kSf462ZlxZrn10xv/Yf23HZ7ULika0ig2qCXIQka2vO6+PzqeXOYJi bPFUaNPZmHrpk+sfCR96v+upBWQ/W6TQACTsQkKOVnOW0AJ3LQfg/ul14K7q5rmD9+il Ei52zQmUKSbIUTa4wGWMskWSHrca/JRtdhBUgm5Uqs6rl5pssVRdxigy/Lhs/2yBu4US 7RD1bgbYXeJBFSkg4nGDEiqZE0GE2HDK77inju8h6dNs75F1wwd/Z0EEYeylAjX6UCgV k6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h8keCepZ3dfLi7fx2igh9uQOxl5mkPHS3M0dmWSrolk=; b=NJfCC5XJDpgep9s2pIgADI2F4lbhPKu0Y0s2Tcdo1meTw98mSyxFstb2wNfSS2WWWK pqxJOAJmkyfx3kjoHDwT2k8kZwahnGsaP5a2Rc216RhpEfG9EImwSrTg9RFyjr0vTXpm yeaV+sTC9PepCGnhF33hEyn4IJtbtz+4sF3Ed6zr2AjSxrFifeYxs3QHETxHBorIQggW znL7u/4Y/YP39yKvMHZ4YV1RMcXhOZ3UpvwZN16UXd34dwWD+l3vHFmQ91sZbU13BtZn bBjpiFvX/W8jQ8B0T/6Bm6MzuWWpwZ0u9kvUxNglJIZ+saTL4kwubNJp4GSXTj0FBD+5 T8XQ== X-Gm-Message-State: ANoB5plwzaFJmtd/kHAuTCTH9s9M+Tvbe5H14lZ7SZ00EXAf470u/1/T RpiS8B+rmym0NpQHYjwpILoJZQ== X-Google-Smtp-Source: AA0mqf6/Bt34QrBTtjaJsqW3ObFxjL3yJ6DNzjLGqoyy//U7Au7orP2xnMuERcjQHgLWMODoIqSxVw== X-Received: by 2002:a05:6a00:d6c:b0:577:a0d:b078 with SMTP id n44-20020a056a000d6c00b005770a0db078mr43609000pfv.20.1671523356632; Tue, 20 Dec 2022 00:02:36 -0800 (PST) Received: from localhost.localdomain (211-20-230-25.hinet-ip.hinet.net. [211.20.230.25]) by smtp.gmail.com with ESMTPSA id o198-20020a62cdcf000000b00574e84ed847sm7980161pfg.24.2022.12.20.00.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 00:02:36 -0800 (PST) From: Joe Wu To: LKML Cc: Tzung-Bi Shih , "Dustin L . Howett" , Benson Leung , Dmitry Torokhov , Xiang wangx , linux-input@vger.kernel.org, Prashant Malani , Stephen Boyd , Douglas Anderson , Daisuke Nojiri , Furquan Shaikh , "Gustavo A . R . Silva" , Derek Huang , Joe Wu , chrome-platform@lists.linux.dev, Guenter Roeck , Greg Kroah-Hartman , Jonathan Cameron , Tinghan Shen Subject: [PATCH] cros_ec_keyb: Add 3 buttons for monitor function Date: Tue, 20 Dec 2022 16:02:26 +0800 Message-Id: <20221220080226.17904-1-joewu@msi.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Add 3 extra buttons: 'brightness up', 'brightness down' and 'screen lock' to support monitor manipulating function. Signed-off-by: Joe Wu --- 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..502f0397a402 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