From patchwork Fri Aug 5 07:05:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suniel Mahesh X-Patchwork-Id: 2293 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9F5A63F047 for ; Fri, 5 Aug 2022 09:05:24 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id b9-20020a170902d50900b0016f0342a417sf1199553plg.21 for ; Fri, 05 Aug 2022 00:05:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659683123; cv=pass; d=google.com; s=arc-20160816; b=j5s1l3G12AZIRjskpvb8pN2cHRsnPRPWibZOcMWgBOBiqRD7wNpRhldogg33IM3tkQ LO4xfMIyObc99JYDNWnCRN2Nfmllync4nkC0+PWszMqgBhC3CRF30POrpPj85U8p1RVB rH0i2g0hh9awf8Wnb4rXAXbAdeYx0eIadmsuQbGCBKC2qNoJ7atOsaLBeWx6ILvw7aqn Bqx2FAivlQJwH8Ljn6ujww4vBa80/bLnujlQ4vGieQDWgm1vHz8uKJ8+7l5Drru7Bms1 NzU5q2+unKonF//8hM3hVvCkZ6xPk1nqeeOAfqn/vBca7T936P77VQHTmEvOaxeF54zq /s+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=psJcn0hNW/4Et0WYETnK/y97aPv1lclOuOdRJrCnw1s=; b=0Ou/oicJXHCBYpAGqrH5ANJBWiUIvNuBa2Gd9pYIhkWUMILUBwMMPkie52G7ylYx2+ PFpDVHQVdd9fvv/jgqoIl4uvGnHpQm6NB6nww+Kv1aGv7YHr1qAW5z2G5UpaPX7XiCYB uJkUd4/Prh1IcAcZeE1R6W3jPoDcMmahrhHUgN2ydn5Iivb/0e58npaLBu3lfws7dl9D dHVC5GSjjlZAwbhRLIBRU1YRrLTGnStm1uFVIdK83XLenD0U7zniS/jLHaCL5rebcLz0 uqEnpeFxAy6Cd1vx6ocXurgKwtKaL64Cc/emVHJY7rlSD4pAkIZrxAlFu12CdmWkomkl 6yqQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YCJdpj3M; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=sunil@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc; bh=psJcn0hNW/4Et0WYETnK/y97aPv1lclOuOdRJrCnw1s=; b=iRttqkHC9z7pVliiWGwUY54OjuFji7My0DYKfjnEzkoDb0/nskuVv/VTsUNqLiy/hM WT19VS2DHPazCCaNFAxrmdWS0XvopLkQ/al1lVicEDWIwzx4yyXPJ+7wmmmSPiupdVe4 zgfI0dt2NNj02UMrRTpB7NISrRSxj/gMuGNY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=psJcn0hNW/4Et0WYETnK/y97aPv1lclOuOdRJrCnw1s=; b=HArYhSy3NdLZvVNbt0lmCuhTqcrJumVwbPexkmMlcaQ264jDT79eX6K59pVjyVo3QT 1V9fycHExhOt41OxamSBfFboNdg3RCfIROkprgVDdqVPKlEDbztNCP0bsB+kSIjNxj9f SkhJ4vlP0WHrQs9oKrjCRJ5kMcNGEzEGnj+eFY+JhwTjw2X5mRE9zUr6S+QYrZ/eh88B KrhYlefHVgx2b73uylKwv6PO+aJTnvA7o1kdfY2irqteQGdDAZQZbNxoV2eSre3KVM2p UWA31QfvtKF4LSar0xn58iVCkD+F4UGRBq1YZdPJwflSBSGDuqGEBkN7kBFdvmrq6hA+ dPkQ== X-Gm-Message-State: ACgBeo2yiGMVjWGiC8bsB3c7hcRVNDQ27L+XjMH43CFQWd/opyBelgx9 L6wdsZNIcHJQRsaQl470Tm5GZF0G X-Google-Smtp-Source: AA6agR6yG2JbAU2TYSaiBcPoFKuhpkHs7MKzgZ1sA6mc7vLgyYRrIa2lPllR1jZkn4ND/Rk8jiRyXQ== X-Received: by 2002:a17:90b:4b05:b0:1f5:b530:af6b with SMTP id lx5-20020a17090b4b0500b001f5b530af6bmr101009pjb.150.1659683123171; Fri, 05 Aug 2022 00:05:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:82c8:0:b0:41a:63e8:2535 with SMTP id w191-20020a6382c8000000b0041a63e82535ls2008251pgd.2.-pod-prod-gmail; Fri, 05 Aug 2022 00:05:22 -0700 (PDT) X-Received: by 2002:a65:6643:0:b0:41b:bc38:f2cb with SMTP id z3-20020a656643000000b0041bbc38f2cbmr4726469pgv.199.1659683122211; Fri, 05 Aug 2022 00:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659683122; cv=none; d=google.com; s=arc-20160816; b=c8jMeb/puX0W/sH3BaWkuNHj5g80+Pm6dMsUQGV6Bz0mnZ2Ulc0FQZ4gZSenX2oBHO UAOBnoZl+1bdIS6COu5TKETLxvqPBZtwdr2Aj5hkLsdiHUhiGoDBVBGuYtZneP/7m8Xc ZP7pJDwH6AcEmHD07LRmu6C7PFeWXLN7ZPqaCLzvo45j+z7LvFVcvT9lDgnaRgvIanXU iA8rgMYk/XXoGBeQ3GtNeEVqKJcywudYhZLdsr7aiOGuRyhmHpPartkVNyhmnYWzO+kw ongyU8cIwNlQguv5YQQN2qT2umwohFIQB/fZWorGEMJx31kJIjPwqajrP1NvsCeLO39W i0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=DM71lYIMNmkmIZ4kdJS0Wn785NNMBrggQC7YERDLEXQ=; b=E02WGUM+BicXUtyIv8KDhJi2DRFebNya4bhznAcjxRPNoHtKoxmVWhO/OJuKn7RUnO hfPetTABnL7/T/1dXsRWvginas+ppboX9rAI7HmEkwqYqPo2kj5OzoCR87zDSKpMyGzw XSnH1WzvqFS9w0rIjqXKbCU41OVe4n6wBmk/N5oN3ac6bUGR8Alkoq2NnKMPFBZhJOeI 2QYn/qD0bvWOe7If9Y6+m38cv7Cp+fTkvk2/dMrXcgbf182hRxSTRSX2Esaj9c/eyT/y GfAZg2qqEPnb6yYtC/z5zzJg72s6PbVeDXhnfiWuLsORnSGR7QJeueZIrGQzY1bmGb3X D6IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YCJdpj3M; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=sunil@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h10-20020a170902704a00b0016f25c374c7sor1619601plt.42.2022.08.05.00.05.22 for (Google Transport Security); Fri, 05 Aug 2022 00:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:e543:b0:16f:8fed:ee1e with SMTP id n3-20020a170902e54300b0016f8fedee1emr1997954plf.74.1659683121791; Fri, 05 Aug 2022 00:05:21 -0700 (PDT) Received: from localhost.localdomain ([183.83.136.224]) by smtp.gmail.com with ESMTPSA id e60-20020a17090a6fc200b001f262f6f717sm4877484pjk.3.2022.08.05.00.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 00:05:21 -0700 (PDT) From: Suniel Mahesh To: Felipe Balbi , Greg Kroah-Hartman , Michael Trimarchi , Jagan Teki , Zachary Holland , Daniel McLean , Rene Samson Ambrose , David Sands Cc: linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, USB list Subject: [RFC v3 0/2] Extend functionality for GET_REPORT Date: Fri, 5 Aug 2022 12:35:05 +0530 Message-Id: <20220805070507.123151-1-sunil@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sunil@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YCJdpj3M; spf=pass (google.com: domain of sunil@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=sunil@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This series does the following: patch 1/2 extends functionality for GET_REPORT. The current kernel implementation for GET_REPORT is that the kernel sends back a zero filled report (of length == report_length), when the Host request's a particular report from the device/gadget. This changeset extends functionality for GET_REPORT by sending a particular report based on report type and report number. patch 2/2 adds a test application to test the extended functionality. please review and share your thoughts. version 2 patches: https://lore.kernel.org/lkml/20220802201556.1510069-1-sunil@amarulasolutions.com/ version 1 patches: https://lore.kernel.org/lkml/20220801123010.2984864-1-sunil@amarulasolutions.com/ Suniel Mahesh (2): usb: gadget: f_hid: Extend functionality for GET_REPORT mode HID: ghid: add example program for GET_REPORT --- Changes for v3: - patch 2/2 got changed, the mapping of report type. Changes for v2: - patch 2/2 got changed. drivers/usb/gadget/function/f_hid.c | 184 ++++++++++++++++++++++++++- include/{ => uapi}/linux/usb/g_hid.h | 10 ++ samples/Kconfig | 10 ++ samples/Makefile | 1 + samples/ghid/Makefile | 4 + samples/ghid/test-hid.c | 134 +++++++++++++++++++ 6 files changed, 341 insertions(+), 2 deletions(-) rename include/{ => uapi}/linux/usb/g_hid.h (72%) create mode 100644 samples/ghid/Makefile create mode 100644 samples/ghid/test-hid.c