From patchwork Thu Jul 7 16:58:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarrett Schultz X-Patchwork-Id: 12909985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FF4DC433EF for ; Thu, 7 Jul 2022 16:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236163AbiGGQ7Y (ORCPT ); Thu, 7 Jul 2022 12:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235736AbiGGQ7X (ORCPT ); Thu, 7 Jul 2022 12:59:23 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F3F6B86B; Thu, 7 Jul 2022 09:59:23 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id o18so18413260pgu.9; Thu, 07 Jul 2022 09:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ur2SMpGF3lpcKS5cVDXDzlMKPuUxkl+HJdr22eYxiH8=; b=JfTdS+QSCovVQYXsXhxjTUfU6BeTrNLgDp6raooDdEAuB8LZxKiJudxfu/NEvDIWlT 2R3+Zh5TlVc1nl/zhOS9DZYPY3ITXazE7qvOGpSnOPhJAAzThH66Eafbshk7dlycKf4r 3p6nC5IAULGoUUbDbQ7Dn62OSzzHOCoWSyE/hpLZn8POaIRApYHatnSvy1Jfyaar+irD /R5k8lSzv/iSgYeER9ZWJqmq4QSgCNq99Jgar7jQtieMcOoZDVmTnKdm8G262wlTBR+l Wj618LyvvuzxauOgKaL5z3CrDdbzriqweMgmynJSEhXLF4RIuo/tvJbkuqf70MKg9b5i jqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ur2SMpGF3lpcKS5cVDXDzlMKPuUxkl+HJdr22eYxiH8=; b=AblbSTOnj1ISFf9PvEAc1+IlDuU7hW/w7pJovxb81/H24iFJi+OD9aBi9TrBOTdmf+ dUxVm1UGXFTkubr2ohevqnUNgiE63ftVhK/QXV6IeerjtxtnV0qgI1Y+TN7t9E+yFGah zgfE5Db2gfSyPRGgszCL5u0jOVVtCzuXfE2hIlusk2rPpWOdGwFPFa3HYxwC99PK/5oc r+XZ2gOAMHF2NxkEB7RjIJ2WsO/52jRqgbFc6fs6+3RzJ1XdiYImd1WkBrRNLIQayKzt 0V/vIZKH8ZqDio8oJfjY68hfCS+Q/NvpMloBCJEpoGLWzvtDMuTUVCKdAHyXaazV6tiH VCkw== X-Gm-Message-State: AJIora/SgP5fkVHtG9P9xlicgr42A0yzFYnMJcf8EMgK+JcpBc/VV9Te eX3MmyVCzGX9XqszXLXrB47lHe1vx0BxWA== X-Google-Smtp-Source: AGRyM1v47xvyyZ8jUF9j/bSsYWlL0WqSZx4JkF1dpPDFeLq/iPlXoJx8ryDs6MjjUBV6opXRoZxJeQ== X-Received: by 2002:a63:734c:0:b0:40a:88ed:dc3b with SMTP id d12-20020a63734c000000b0040a88eddc3bmr39296930pgn.244.1657213162740; Thu, 07 Jul 2022 09:59:22 -0700 (PDT) Received: from jaschultz-Thelio-Major.corp.microsoft.com ([2001:4898:80e8:37:6a04:c27c:dcee:eb11]) by smtp.gmail.com with ESMTPSA id v14-20020aa7808e000000b00518e1251197sm28184185pff.148.2022.07.07.09.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 09:59:22 -0700 (PDT) From: Jarrett Schultz X-Google-Original-From: Jarrett Schultz To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Catalin Marinas , Will Deacon , Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Shawn Guo , Geert Uytterhoeven , Marcel Ziswiler , Biju Das , Dmitry Baryshkov , Vinod Koul Cc: Dmitry Antipov , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jarrett Schultz Subject: [PATCH v5 0/6] Add spi-hid, transport for HID over SPI bus Date: Thu, 7 Jul 2022 09:58:56 -0700 Message-Id: <20220707165902.3184-1-jaschultzMS@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jarrett Schultz Surface Duo devices use a touch digitizer that communicates to the main SoC via SPI and presents itself as a HID device. This patch's goal is to add the spi-hid transport driver to drivers/hid. The driver follows the publically available HID Over SPI Protocol Specification version 1.0. The specification is available at https://www.microsoft.com/en-us/download/details.aspx?id=103325. In the initial commits there are some HID core changes to support a SPI device, a change to HID documentation, HID over SPI Device Tree bindings, and finally the SPI HID transport driver. Dmitry Antipov (5): HID: Add BUS_SPI support when printing out device info in hid_connect() HID: define HID_SPI_DEVICE macro in hid.h dt-bindings: input: Document Microsoft G6 Touch Digitizer Documentation: Correction in HID output_report callback description. HID: add spi-hid, transport driver for HID over SPI bus Jarrett Schultz (1): Enable building drivers/hid/spi-hid as a module .../input/microsoft,g6-touch-digitizer.yaml | 135 ++ Documentation/hid/hid-transport.rst | 4 +- arch/arm64/configs/defconfig | 1 + drivers/hid/Kconfig | 2 + drivers/hid/Makefile | 1 + drivers/hid/hid-core.c | 3 + drivers/hid/spi-hid/Kconfig | 25 + drivers/hid/spi-hid/Makefile | 12 + drivers/hid/spi-hid/spi-hid-core.c | 1326 +++++++++++++++++ drivers/hid/spi-hid/spi-hid-core.h | 188 +++ drivers/hid/spi-hid/spi-hid-of.c | 141 ++ drivers/hid/spi-hid/spi-hid-of.h | 30 + drivers/hid/spi-hid/spi-hid_trace.h | 194 +++ drivers/hid/spi-hid/trace.c | 9 + include/linux/hid.h | 2 + 15 files changed, 2071 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/microsoft,g6-touch-digitizer.yaml create mode 100644 drivers/hid/spi-hid/Kconfig create mode 100644 drivers/hid/spi-hid/Makefile create mode 100644 drivers/hid/spi-hid/spi-hid-core.c create mode 100644 drivers/hid/spi-hid/spi-hid-core.h create mode 100644 drivers/hid/spi-hid/spi-hid-of.c create mode 100644 drivers/hid/spi-hid/spi-hid-of.h create mode 100644 drivers/hid/spi-hid/spi-hid_trace.h create mode 100644 drivers/hid/spi-hid/trace.c