From nobody Sun Apr 5 16:29:45 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 8DF493C5543 for ; Tue, 24 Mar 2026 06:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774334408; cv=none; b=nsJUZ3+8exA5hmLeHB+1veH/uo41xRIHkIFwY9eC4bATxWXCLheTpNjV3tz0scjolrK4m8QYLp8tsg57//KxMuLmkCRrxDmjU23ckT5Os7NIKuYyGWfSGyN0g6YqsDOPk57Tfcua7N4sCfPxSyW83DVFvY/jAMuhJNeISUxsfZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774334408; c=relaxed/simple; bh=qznTTsH95JMiWz2KpE1aJItnwW6ycamhHq8hzhCMPB8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P/VH/sD7JuNzd6ta4KqQ0ZslxXCK3OFRQEZUt7GKJwyfYjjvKEozae/2dWSKfnLTrFbk4UIssHNzh11foEXczv9xbGnQWGRgwtEZCHYdIJChoaFHOGVdTrDUcAwfXQhnYlzHmBYbnTATe95tUta5/6tc6BceUgFm3qyBaigQ54E= 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=f9aYIaU5; arc=none smtp.client-ip=209.85.214.169 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="f9aYIaU5" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2b04e6a989eso5866555ad.3 for ; Mon, 23 Mar 2026 23:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1774334404; x=1774939204; 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=ws1XJhm562F8Eqr4Gpp6hR2Els0noubs7wtAB+jE3IQ=; b=f9aYIaU5D8+n175pz0sVt1dDRcFNP3LrPfin9laH7FEGhusp3Jum5kWNRAryiFQSA2 ASiCLsCmAb7iuq404pHLcbvo4pcOuGVJJFXChFM8+VOONN16R6/8feAvlAiqj1d/doT3 q2K3lltJ27gylknDg9m+qxUjhX10d7KONwdtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774334404; x=1774939204; 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=ws1XJhm562F8Eqr4Gpp6hR2Els0noubs7wtAB+jE3IQ=; b=ZcFCQmjHdWgu1lgK8Y9IJamJQQ3gmIfxuXWLfJxYDhXurdlolAsKDwHTwv7dq23fsY xsxl8Xme42TRk0nqf0Ejk8aFqWVhfhTlrU/YzcgdIKjIqQ+yU3Xb/qn7yyt2OVOejMwN hVlAGnynN25ZJqFZp7oPttw2JOjlYlJMd2WDiLOlqdn05RDTisJpfuy9jL3VQGt0V9G2 7S0+tC335/sNVfSyyJPd4G99Ybn4vHATYKrmPrr27zZ6SMPFx5qd2kVtrgBvridW6kfR j3BpfjceGxmC1BuolIbXIJNuWak5aB3hAjKO8T3dYSdsaA0ot/TmjKF5ZVzVBrE8rotA xhLw== X-Forwarded-Encrypted: i=1; AJvYcCVV0pOZynuOKHt3KqwkiJxpdpcX5nb7KDaU/DgRQIk2JRRNBa17YK6Jm6M1aHz7v8wdNZZ8vIu84ABkaUc=@vger.kernel.org X-Gm-Message-State: AOJu0YyZwSqq74OYDYbjJ9NMIMJ2GwPb+eO7HqPETT+sWmxH0wLeea+Z iaL/ukstyPxh1d0+ZJXpj50xLgZQS9t6y5G9lZaaa7/psHuI8LNdceyhJS0DJtq+Tg== X-Gm-Gg: ATEYQzxCZVFr0nY/mU8A4wnuL7jhdrYY99yuCJzQ/1ebiEsbzwk8Qx/VHBxQ6XO0332 hMFneFLOvi+YpCWg3jIACMRSFzCfomjxatG9atIDFpQxVXXTLRmM3ibZnIEkbfnxOVDljMJKk6S 0j9pRCFuDClRoPFDBJjMXTTgM2lK84tHWQfpC9lNJjSS9BSzXZ92E5ksQDldb+ImHxDXyT0nDx/ 4ELLr58xPWVD26bQp+w5lFdp7scM0RkUhI2SrxxPmIO0Lwuug8UXhya7DHg/hPzjROiEU6FEQLQ jbvEX+mjS/wWHpkUpEWdvAZumoGuxJ2jOksYI4Xu1firu6FbD2InWA3HB1bS7I+c4FOvxd+6jo/ HMse8CA9LQy3sorUFLgOAcQVwuzj3PhSVOHT9M/+mvHpzsqg5biHY4iBDJ27qq0TJ03lt0PZG0X GwomGE98kj8H6T3Wglj99d0BWcxCACLr3elc4IDgec52UUxFRnlMm2+LrtKmUtRJ7Jsl2SE/Vpz OwYe5fjKzRm/PUIKyvX7vpFacoY0jc7vg== X-Received: by 2002:a17:903:94e:b0:2ae:826f:2c50 with SMTP id d9443c01a7336-2b0826e2f0emr127644455ad.12.1774334403691; Mon, 23 Mar 2026 23:40:03 -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-2b0835429afsm128416545ad.26.2026.03.23.23.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 23:40:02 -0700 (PDT) From: Jingyuan Liang Date: Tue, 24 Mar 2026 06:39:35 +0000 Subject: [PATCH v2 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: quoted-printable Message-Id: <20260324-send-upstream-v2-2-521ce8afff86@chromium.org> References: <20260324-send-upstream-v2-0-521ce8afff86@chromium.org> In-Reply-To: <20260324-send-upstream-v2-0-521ce8afff86@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=1774334401; l=1401; i=jingyliang@chromium.org; s=20260213; h=from:subject:message-id; bh=uFPHOo5tVahmnQsO+3HulhbmLaF0uQlDRKXTc/zQ45Y=; b=FzRz6hRBlzD7ymlf0UgsS6IIaaR2bkVOGVToLSaLqiBXlBFUdjUt7+8GdOcAKeSszYW95MDk7 /3ijkLg5nuzBKxgO95bX3yQFQEwML0ujPgq48j85CrKspcQ4tbxqT5x 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 =3D "I2C"; break; + case BUS_SPI: + bus =3D "SPI"; + break; case BUS_SDW: bus =3D "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 =3D BUS_BLUETOOTH, .vendor =3D (ven), .product =3D (prod) #define HID_I2C_DEVICE(ven, prod) \ .bus =3D BUS_I2C, .vendor =3D (ven), .product =3D (prod) +#define HID_SPI_DEVICE(ven, prod) \ + .bus =3D BUS_SPI, .vendor =3D (ven), .product =3D (prod) =20 #define HID_REPORT_ID(rep) \ .report_type =3D (rep) --=20 2.53.0.983.g0bb29b3bc5-goog