From patchwork Tue Aug 2 20:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suniel Mahesh X-Patchwork-Id: 2290 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7DEB63F1D0 for ; Tue, 2 Aug 2022 22:16:10 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id o3-20020a17090a0a0300b001f3112a9f1csf6584328pjo.8 for ; Tue, 02 Aug 2022 13:16:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659471369; cv=pass; d=google.com; s=arc-20160816; b=sW8AzBoBrRceOghnXJCtl+ZxMAp83dvsixaMhLQNa1Si+HZMO1+PKQkHxuNw7DZl/k tREOfNtQ4z2jrw0+v7p/+dhMimxPGi5zMZlqfJLZUmTiyaVsZXQsublmF5ctPPuW/wi1 NRw/BPOEykO8YE9KFgYLw2ewO9hWAKN8+pV9TCSdyWsuM0GZ/O+okvjopouowvBoHDOD t1X0ar6hW3wD/hNTuK9Z8BnHK4M9Z/plMG2EQW3N/MfISnD55uyA2xfcW98YXdgZog+C ekW3Pte/WloIsOXB+jYpSlzbDTeyiq4tpE4JlB50Ec6+x1oFF3rgxG9LFWHrLLQPluyo RZMg== 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=NFXPahq3Nd3koR5c/1fsEJV1Awjr6a4ZDwYudDOJI6U=; b=vTvW4OsS6btMtD2JeNPaayAztF4mMbrIspSRHaG9kr1wcxvHC7F0c4aHX8apgfL3d5 72qsoPTonf4KNtZbrb2L7eAgbRPecAN5iOupdaAzPii8J7+kgPp4gy4VX32Z/Vg4SwUP 40Ihwnk506g0U1fbCYsk6nsqtSb94hHnq1kZtlud0+RHiC9XojaVYYm46rlWwAaxFX+J tLsyXSALol6C7zQnpg1878OTHYBt8hkegW2NqkAzsBKOZNN7Qd82tR6JQFf3MhrgvsyT JvI+xWGCxJFWES1jitQYpW+k7RM7Qx24Bl7FoewTjMgWxn9TZW85dR7aHadK9O9qRefI Z2uA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QNIGy+vx; 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=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=NFXPahq3Nd3koR5c/1fsEJV1Awjr6a4ZDwYudDOJI6U=; b=DVC0ewJNapbfRjrhf/k05bTPmLk475uiXNBxbb+xetykJuIJOwcyk39hI0d6C1IcQl bFqd79NeGTbNr5Ug996HZDRb4QqLBKR5fdMYPHFNHr23Yta/FnvMzBkx8Pzqg6tosyl8 CdxbezOZVxVuypZ2UKN/sl429d77F6QWLBZg4= 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=NFXPahq3Nd3koR5c/1fsEJV1Awjr6a4ZDwYudDOJI6U=; b=OB39zRTUKqUdGqvdtIMFWBLoNFKlP5+Hucig+27mOgu6vhmtwWdm3Zvo95BugSvd1M ccJo+dQLkzpoi/i47MlaT1SpeRrOfdFKJgfU2UfMNg9Ipea8Hu3UoYg5mMjpSnWi7Vuv jOFh57N/3M4aWaHuyZleHIY4zuGUgKmKJDhoWhzqk61N3+kmuB1FMpuF4f+Vkj8v1UFY V4+rvn67RxwFPpnjYLXSUZLKcS3xzWqd/iZKpnmSbtqa8PpvR7aW6Q4R/utKUmVljjsa N5abRtyKTAjJw4IItKzn3gbg6T8OpN+8FKBGKx8LAmEcTA9hei0OUoY69boJXIWnLFOL +SUQ== X-Gm-Message-State: ACgBeo1dCw2Uk72oAnnN/lYwBJ4djTJZgFpu7i/kJiEPDWgAMCf7+XPI VVU1kB3Oh19B2QND7FFsXe9dJAPD X-Google-Smtp-Source: AA6agR79YrOEuz3nyz34TT7Otxh0VLfh+X7quJm/FQNEOnFe4JX0h9lkvpDyg1cm0bNxQYBNgooIGw== X-Received: by 2002:a17:90b:3a89:b0:1f3:1299:aa10 with SMTP id om9-20020a17090b3a8900b001f31299aa10mr1200305pjb.102.1659471369110; Tue, 02 Aug 2022 13:16:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:83c1:0:b0:41b:c89f:182f with SMTP id h184-20020a6383c1000000b0041bc89f182fls3188775pge.10.-pod-prod-gmail; Tue, 02 Aug 2022 13:16:08 -0700 (PDT) X-Received: by 2002:aa7:82ca:0:b0:51b:cf43:d00a with SMTP id f10-20020aa782ca000000b0051bcf43d00amr22581727pfn.58.1659471368104; Tue, 02 Aug 2022 13:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659471368; cv=none; d=google.com; s=arc-20160816; b=VCRxQ037hp018b6JbPf3txJv64PP0KeHxMjTc6sdnnl8yFLaGb2ldsFWoe/HaMZbne A5U29W9czb7B04w7/7HC5JNWt2b42FDd0pHR4aoCdICC+nIIg5Gz8yKWqCqShnquq9my XJVkNj9wK/gdyRjdzQ8yQfl+28eh1CG3AztTWj7NqHO/9qJDI8GczKiuocAPjN8mczpP 4+GyvQFcQ/5xNcCQX14BJkmlhjXDffUrrn/mBj9VrWlAAByYNRhh2dsE+0834h64cGqF MS5lRqdXGY9XmpSEOxuQaCy6/WH8eanLaUeKhz4ddClVxVjeeWb9Dff+LlVYOi8US9e0 Y5/Q== 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=2Ra8Z84FGiy+WxWESz00m+pAyXWLLHoUcteZqKqQVeQ=; b=aQBMVpvxW0aPHSVDzI3a7hK/gF7eR7jL1clIP02dk3uhk2Mr0oZqATZkEvPYnKrKXG rnQ5HtJUyhz9CFPto/xsCf53+e4N1v2GcabhqUICSbmgVoLWCMD+sFV3MJKzyFtNCeKk uN9KXAA3FS1Uif6nD56FkDTypjiqCxUnc1hUtHKsvhBiW7NiE6pNdHBnQ0b1N83n9r78 PYcPiJ8uCgQzFJsYIoqCk2zMWtWxZaGmv9AaP7wYFO2uleWYV9Wvj9LqiHvDu1aWULCf Qi8QcUXZPwGQVsegNiwTU71jS+7q7MLmhxFv+A5Ruk+j+UDqIkNuqkucJkdS1OYxvrfk Youg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QNIGy+vx; 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 c7-20020a170903234700b0016ed6343939sor126018plh.13.2022.08.02.13.16.08 for (Google Transport Security); Tue, 02 Aug 2022 13:16:08 -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:f78b:b0:168:faff:d6a5 with SMTP id q11-20020a170902f78b00b00168faffd6a5mr22691375pln.76.1659471367735; Tue, 02 Aug 2022 13:16:07 -0700 (PDT) Received: from localhost.localdomain ([183.83.136.224]) by smtp.gmail.com with ESMTPSA id w18-20020a170902a71200b0016ee26224a4sm80863plq.305.2022.08.02.13.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 13:16:07 -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 v2 0/2] Extend functionality for GET_REPORT Date: Wed, 3 Aug 2022 01:45:54 +0530 Message-Id: <20220802201556.1510069-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=QNIGy+vx; 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 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 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