From nobody Thu Dec 25 08:56:24 2025 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 AA0B21B96A for ; Thu, 18 Jan 2024 08:54:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705568089; cv=none; b=a8IzauGjfRtWMytms1vSQFr4tIJ6rV+t9VO9GcQUz6WVO7vZSt9AFjKLyHVUlAZUF32pCxkSoAi0s5IdXExkqoQxxzneYV0sL1Rr0cqC2rq4pRKCEf/8RQtdOmLrQNX6AhF0oBoCqz7cnfHcUMWksPzGzP0uf00+0qJbeapo2Ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705568089; c=relaxed/simple; bh=MCxZ8z07WUK2BsrAfJ6Bu00FMqAk5lxvFXxpvD9oRSk=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: X-Google-Original-From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; b=B5jL1FOteiKWtp2Ok5bMh//s6nJjkU55Hh2JfDT6bXQ0JjZYOhTlYnkv/ewp+4Aw4TchIRyB44aTRSOILpXoHERw8iTHWEyuU/6czloYM0qvwwbOWUr8uPuT1935UI2+CkUrx46lKq5ylC25977i+kemH9i+iINB8EFTNkVQQ8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=eoaQ1rq7; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eoaQ1rq7" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d5f10052easo12768615ad.1 for ; Thu, 18 Jan 2024 00:54:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1705568088; x=1706172888; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oz9mVOu+ad9eAvvgLiXYxdC8+oSkbRkyUjyWQjx33yM=; b=eoaQ1rq78eTtzh0wFOS9Tz2aySgv13PGt+7LqbFZ58CqGGbyLnBm/JLNfMTa+fnqaj UkoqWg0ZR5VQdEGutJsZNYQMt2hKnQgbYSo//p5u0QIhXYnGv4hHZIxnH5r5Vw8BFaFM b4FV9RVa5L7OM8934MXFkCgDfeN9Wakj4eduM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705568088; x=1706172888; 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=oz9mVOu+ad9eAvvgLiXYxdC8+oSkbRkyUjyWQjx33yM=; b=i23VjTFolcMAr7lUnQ91cUHws8KA5A5nhDYdiAYnVAwIR3HMsO2CQBLYEIXJNdI82r CSAKPEOZFjMdvA37AgcIfVE89ck7RmyG8ZX9DkQj2jvn5x3jY21yN2WqpMMsJTXhNNsS w94EvD6bpIJUhK2qbqu5Mvn1ozgcbkrYDS5+19WSHeL4OX5mXlYucdyTuRaEji+HStn7 O5y+24zuHt8yf0U2jw1HVyoyGM3sY3fSDEINlDtFWtLpkY0gwgaz0gWy0eLY3MhBKmSq MugR6RX/Bx7YtoxA24dibUfnBE6W6pjwT1dcVgZRvzWlpEzNVpcYDdCaHnZ5fNy8ZMHk RRkA== X-Gm-Message-State: AOJu0YyUwxCI1nYu9uw4cQObWPDQSS7Y4CkvY1xTIn8F2SzL1DDrxexV cFho9OC3e/NnZRdbzQh/7X8Nk+0fdNxwtPobPjGeT44bbBEi34PC6g7icEydX2a+bp2oVbMws1f VzQ== X-Google-Smtp-Source: AGHT+IHLBlmDFJj4oPMADbmRUKL9nH9CY9T4nkMaGF60d4eQZV9wC6gpHKuBd5hsyMwfFMYc1IoExw== X-Received: by 2002:a17:902:8606:b0:1d5:845:da16 with SMTP id f6-20020a170902860600b001d50845da16mr467559plo.126.1705568087823; Thu, 18 Jan 2024 00:54:47 -0800 (PST) Received: from localhost ([2401:fa00:1:10:6a83:9579:c455:9664]) by smtp.gmail.com with UTF8SMTPSA id kf13-20020a17090305cd00b001d0ca40158dsm912379plb.280.2024.01.18.00.54.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 00:54:47 -0800 (PST) From: Ting Shen X-Google-Original-From: Ting Shen To: LKML Cc: fshao@chromium.org, Ting Shen , Benson Leung , Dmitry Torokhov , Greg Kroah-Hartman , Guenter Roeck , Tzung-Bi Shih , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , chrome-platform@lists.linux.dev, =?UTF-8?q?joewu=20=28=E5=90=B3=E4=BB=B2=E6=8C=AF=29?= , linux-input@vger.kernel.org Subject: [PATCH] Input: cros_ec_keyb: add support for base attached event Date: Thu, 18 Jan 2024 16:52:43 +0800 Message-ID: <20240118085310.1139545-1-phoenixshen@google.com> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This CL maps ChromeOS EC's BASE_ATTACHED event to SW_DOCK, to allow userspace detect that a keyboard is attached to the detachable device. Signed-off-by: Ting Shen Reviewed-by: Fei Shao --- drivers/input/keyboard/cros_ec_keyb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard= /cros_ec_keyb.c index 30678a34cf647..d2e0d89d4ffdf 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -128,6 +128,11 @@ static const struct cros_ec_bs_map cros_ec_keyb_bs[] = =3D { .code =3D SW_TABLET_MODE, .bit =3D EC_MKBP_TABLET_MODE, }, + { + .ev_type =3D EV_SW, + .code =3D SW_DOCK, + .bit =3D EC_MKBP_BASE_ATTACHED, + }, }; =20 /* --=20 2.43.0.381.gb435a96ce8-goog