From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 EC99B380FC9 for ; Tue, 9 Jun 2026 04:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780980090; cv=none; b=rBEpB3poFEJN5PbLJVqhgPnPwwYFTE/PgtzeXv60VkL7hMfMOyLpk4JWaeMM4L6+SOCbSbUFmoTGChaz0cJnakKVVTh6eM8PaCHHwu98Fx9c5coosAuUudOrfJJt32a0R10KbtTX2VB7UXyQSXWLnb2XKgXNDUJgCTiOgRqckdA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780980090; c=relaxed/simple; bh=YyDrdUBLBq9b2tgOr7KWFqA4UmGZ8/EpPqG9WEWTYis=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ptI/QmKqRSlUIBrnewqKpMOc9fR4NaOpr5vVakHhSJD0W2biHsToQWi5ctA1LEptrl094NOorJXUNPZUCUL/Mmg+atC298L22s+aNiiV7ZnGXFqKTQb68CT2kpXpAiKRlutmMtg1CjQ40IjTGMEiMuo18WWTCZgAXZLPkp2PF70= 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=D+V0JQ0D; arc=none smtp.client-ip=209.85.214.182 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="D+V0JQ0D" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2c0bd02d97eso57403245ad.2 for ; Mon, 08 Jun 2026 21:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1780980086; x=1781584886; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=k+QTRbcmVdI1fYK90qnB4ou4kNd5iswSYfzc4M5l2Vk=; b=D+V0JQ0DLMA45PrrUEvXpjMKRk1q9n6NUrbF606c+xIf8aFjbyHaaEQ6UhvCa8wudS o3f0BAP2E3pbtz+8rrrt6/3PvKYciKSNNXLbeeQOustIJunIP9+yU4uf6c91ibY6Edup EiiV9RulG6ScTLTIxL2zT4HMssa42loVdIkgA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780980086; x=1781584886; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=k+QTRbcmVdI1fYK90qnB4ou4kNd5iswSYfzc4M5l2Vk=; b=eycqz2zzbCCuOg7sZjyw3USxrRwfaEdKRRBgAZml4C+RPzBbGxJl1xtp2Cw6yBjY9v 6H87Wy6vvzIwsiwNF0HyTuCmZM2kJY0Zzxo6sit3bNxlfZ91B00df4BwSs8CNjL8F0U3 c8SJtCEqBaFzCAuDL8tdYptCHGZpITnv6V+ZI3tjWXuYro8xDCv8zMxiSH8z7BS8UMcU nSeFOgv8ZTq0edhMeHTOrN4ko4ivYz2MLIXK6/GjToelyIisP4vuYRTZ5vPUDEslzL6b 9rhcSpFsVm6vBiuGy/xybYEn14RO6M+aqq6kIuivPUpx/QAOYA+LnEsSmPaelvVDFTlh dvPw== X-Forwarded-Encrypted: i=1; AFNElJ9cRU7yZr4ZgSYBOl527V8Np3AarlG/ai9Evc0Xadefw81Un/z7CzqhM83KIuWWwfo25SPcHPV1LEy6x2U=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5jQOw4z2V5vL3WGXoesly8BmaNhxhqkpc8zbCzWgqtl9E9F+4 Uoe4AcgLbhntHUqOR84nFk7jJPUzMvo0nt+pvSTHYwJEkiztuaSRgFcScYYffK9LcQ== X-Gm-Gg: Acq92OEFqtmkCJkUJA3bLAKfxXG3iTL8h8FlrxxZ58uBLxG17F+wmpyaZUYPFo5ghPX Be5GMUxtrEnwa7V8LAIY3Z3WsxHm6P0yjEfn4EAYRhol6N7MYtcJdSEAvdNa9yt5BFNMiGcEtqd ZrFEPw4wLKaSl+G/+0V0rirZwnvEzaNRTzmkPsQjFZ0/nCZPh3ur/qfp3ocHqkW42IH6a6DnBvi S0ktjRoklyBMd/yztAmsuml+z4cLJO316Y2dRPe/99Pkp75YYIvn6cPAHWYsLRo3uwWoo13IGDA iM0XmvJAjINvUvtsFobyuZj5xi8PKaURQOTcRUsyHgtwNWJ3b0MDLybqfnDdRYFbOf5YuQMjLLT pmnfQNEzgQBoPzkXQEVYBpiR92RE24pFjk4jSPHf2IW5sVWcoitSEJSPQHQqt5sNKkc5RnlAEXT VNlP5oHHUPH/8vgMDXEN1J4lQPjURhfrv3Esfm0gxJZQqKE4LfhLFrlxh615iVbLXGcjNUCEs6R SZEVqI8Zi65K/LqavE2DordN3j31BBeq1VzoCkpS2iC X-Received: by 2002:a17:902:ef08:b0:2b9:6458:1a2c with SMTP id d9443c01a7336-2c1e820e30bmr230474455ad.13.1780980086496; Mon, 08 Jun 2026 21:41:26 -0700 (PDT) Received: from jingyliang-input-linux.c.googlers.com (111.169.168.34.bc.googleusercontent.com. [34.168.169.111]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c1664a67b0sm200736065ad.80.2026.06.08.21.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 21:41:26 -0700 (PDT) From: Jingyuan Liang Date: Tue, 09 Jun 2026 04:40:53 +0000 Subject: [PATCH v4 02/11] HID: Add BUS_SPI support and define HID_SPI_DEVICE macro Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260609-send-upstream-v4-2-b843d5e6ced3@chromium.org> References: <20260609-send-upstream-v4-0-b843d5e6ced3@chromium.org> In-Reply-To: <20260609-send-upstream-v4-0-b843d5e6ced3@chromium.org> To: Jiri Kosina , Benjamin Tissoires , Jonathan Corbet , Mark Brown , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-trace-kernel@vger.kernel.org, devicetree@vger.kernel.org, hbarnor@chromium.org, tfiga@chromium.org, Jingyuan Liang , Jarrett Schultz , Dmitry Antipov X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1780980084; l=1402; i=jingyliang@chromium.org; s=20260213; h=from:subject:message-id; bh=c6BUXxKRAZp/K8L1Tqkgw56/wp/8GYCQXvql08oS5sc=; b=QyqWiN5wvJWa+DIAzGfwDwT3/7SoEQiPhD1MUJ5W+zX6UPWtdkUNM/6NIrOZhKqZHvKUaVIHE z6+3hgKEB/ECPZ/StEBid/W5+8uPBCG8+qB9iIubXF951pTpnJYNq9l X-Developer-Key: i=jingyliang@chromium.org; a=ed25519; pk=VTYSdqslTtYOjWWoIGgYoWupGWqNSidrggReKMgfPo4= From: Jarrett Schultz If connecting a hid_device with bus field indicating BUS_SPI print out "SPI" in the debug print. Macro sets the bus field to BUS_SPI and uses arguments to set vendor product fields. Signed-off-by: Dmitry Antipov Reviewed-by: Dmitry Torokhov Signed-off-by: Jingyuan Liang --- drivers/hid/hid-core.c | 3 +++ include/linux/hid.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index a5b3a8ca2fcb..813c9c743ccd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2316,6 +2316,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) case BUS_I2C: bus = "I2C"; break; + case BUS_SPI: + bus = "SPI"; + break; case BUS_SDW: bus = "SOUNDWIRE"; break; diff --git a/include/linux/hid.h b/include/linux/hid.h index dce862cafbbd..957f322a0ebd 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -786,6 +786,8 @@ struct hid_descriptor { .bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod) #define HID_I2C_DEVICE(ven, prod) \ .bus = BUS_I2C, .vendor = (ven), .product = (prod) +#define HID_SPI_DEVICE(ven, prod) \ + .bus = BUS_SPI, .vendor = (ven), .product = (prod) #define HID_REPORT_ID(rep) \ .report_type = (rep) -- 2.54.0.1064.gd145956f57-goog