From patchwork Mon Aug 1 12:30:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suniel Mahesh X-Patchwork-Id: 2287 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AD06E3F3A4 for ; Mon, 1 Aug 2022 14:30:25 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id s129-20020a632c87000000b00411564fe1fesf4446421pgs.7 for ; Mon, 01 Aug 2022 05:30:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659357024; cv=pass; d=google.com; s=arc-20160816; b=nG25O5am6GQ8vs0eixppK/NEQXNbsDrJ7p7AM50mF8d0HCr5SjBH8ilw+FgyIZ/kaB DqDcdkVnG69tWs6nR0XTMlJgvsnIyc41U+cE1WIO7Mbq/0KNjChA8ws5RIcb8zjxvFLZ QRpAIfU41MUeHpFcV98dvhV6gnok9MLquBd50tcbG8mfhKqVuoLoa/a8V/izuYxMoK1J 8P7/exebV33IuHd0zxJ5Y9MLDrL2YNNeScJDc38TAqCu1RJL/CtB+/ouMV+0Zg/bmLh5 ZsiAqVPlZOZEg+DZ3iQdSG0+OusYuSKsznudtwJvXhTTvjBq+oTfUPs5LZTKPVeErrt1 dvjQ== 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=gx8jHvpJkHPXF9U+WehZyyXxzt7Xj8b9jUXnjCB09nE=; b=jsg6cinI7/JfrUj7UZIKagSCaOpNxTCuDYhMYgB4sIHB7YlN3iaYwIr93fJgMLGNYW eta2D6KM9VPhsPC59CEmv781YcCQYdMwVRTnv7wPc3SX5leUtp8OoUpmZb3j52XhK/vK AylD1aTy1z6jPfWBm6qHG+xHvNmdIhvnvvMYRKECFQJ7ha2SQBCGvYG31g5oifXgthvz feDFVrpEI4Y2x0LUvJ/mXXAkV0CM8G0ITEWYdDXCtkyHyx4JOvm22BuKUlecuLaGYnNP BTsLzeAmf5QdxMbsiBhLCoj5gOPAOJmRGW2mk7tH3Kfnq3dpmIGGKjAE57D+bGxGcpGS yt4A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Si6hwKKH; 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=gx8jHvpJkHPXF9U+WehZyyXxzt7Xj8b9jUXnjCB09nE=; b=mBo83qW8eB2CteWeA6DBMK5cT5N8+tr/U20gTzEn3JNBiA0OAjK3wc2Su723f54fiZ qrNoadyOqI5iEfovEhJzN9rH3ZnuD9fnqOtuOiMeLbkmjW0BCUBMeZQiUq2LBrrb/6SL /TD9lEhwM2Kz70AQxdtqyjPOPFmPLL9qXXtPA= 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=gx8jHvpJkHPXF9U+WehZyyXxzt7Xj8b9jUXnjCB09nE=; b=6zpD/A0CePZbmnO8lLTH0TLMonxyuHbXGNSEdfMTtelimoAJP0WmRS0v7cbECOIkie OntRSpv1WyqOophCALjwEQNBQPx1AgCrLogjoGrEHSZ8Y6G793MXLdqLTKfzKzNZMq23 1BQXoubmLGFMwyPEpleC1YQsmzemmLJbCkb+0Onh2llNTMsw6+LiQ7DMMoqIZQ3ZivDA WERHoDOfAJRMxwbelsltq+vNVgOIrXtCk0J61dfMzQ4Kd9HZhTOl4js0zVtAW9lbFsBq XGBNY6VuZxAV0fBVxkix1/4Z3wOVoi0Oy0fOtr+4QeeHkXtC+Rt/dpOvtazfA/Xh9rhC syag== X-Gm-Message-State: ACgBeo2lyRrV3abxau3XGkeqngZseUR4JJzsApUlhIZF5ZCETUSDxOU3 eToHX6gD2R1LTqzeaY9oZie3dYDx X-Google-Smtp-Source: AA6agR4zFD3MWqEzUaCh9XL/Ww/AUDFWJblKB53Ee0inpLL9AJUhvti1nPC9JoKvvzgztYUPqy8n7g== X-Received: by 2002:a17:90b:3892:b0:1f2:e0a5:8a56 with SMTP id mu18-20020a17090b389200b001f2e0a58a56mr19445963pjb.9.1659357024291; Mon, 01 Aug 2022 05:30:24 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:4e4d:b0:1f5:1b0d:c127 with SMTP id t13-20020a17090a4e4d00b001f51b0dc127ls37135pjl.3.-pod-canary-gmail; Mon, 01 Aug 2022 05:30:23 -0700 (PDT) X-Received: by 2002:a17:902:ec81:b0:16e:df6a:9351 with SMTP id x1-20020a170902ec8100b0016edf6a9351mr7297750plg.141.1659357023427; Mon, 01 Aug 2022 05:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659357023; cv=none; d=google.com; s=arc-20160816; b=dugKSV1HfrWP20Jw9FWtI+RI3j33s/SdnkoDGQGzZOXhPaEkjHjb9TBvbbjUWVa3UW QifrKYQ1uxcSlF7B6o4rsz+A8yq7QC989tAVJDS0z/kei8frEVwFmTaQXXxNn6PxGXyB Xxv5T9c74zJbhelHIfaxU0dWD1tli2iwhl91ZQpS5Bq6unVUC11wMY62k6w+iYh5N6yM DkC5iB7waWEoTSdPWzTdElzmk2mYe20Rz/3WYXI2ocUt9guHDCAFmWLNB/PoZRq3EhXO 5aZFkOpQf3npr9lnYD3obO9p8JFHULip37VnkGFLOneK7n7/Wb+x1C/wawHTz0DS+2Cy hZkw== 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=f5hr8DusGVxBeJGY0y8l2bn+77knSqmGq5nzEyayFUc=; b=UTwAua2pmgEC8awn5B/mmZpOzQwTzhiULYGLLUVgej+TlUUxvr01GPZ3s6E0GVEvE1 NzNbniT4ueYnU9clozCfJQmN4UKiCBrwqhOI3xH/XUMRoFLNhg6TonT07zujkAj/135T 9sUOf9YxjP5scsQ2LHom7iN27sVG9N+yOBTfipQXVLC2Yttzk+XtaFBMVofvK1o7vuS7 65n6ovLAURGjZsw1l1azPMYHswS8NtZlZddNf6DhBsnWGKFX1QcumVNz+W9r7R52GOLj zXT/pQQXy+wF51vZ3pFxDjzfsEzbaABUVkIR4D4hUoZPzU03rHALY8APKQwOtcwFZ7Nl E3Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Si6hwKKH; 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 b8-20020a170902d50800b0016dbcb20c8dsor4910799plg.119.2022.08.01.05.30.23 for (Google Transport Security); Mon, 01 Aug 2022 05:30:23 -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:c406:b0:16e:df76:5267 with SMTP id k6-20020a170902c40600b0016edf765267mr7423088plk.8.1659357023035; Mon, 01 Aug 2022 05:30:23 -0700 (PDT) Received: from localhost.localdomain ([183.83.136.224]) by smtp.gmail.com with ESMTPSA id a14-20020a1709027e4e00b0015e8d4eb219sm3473230pln.99.2022.08.01.05.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 05:30:22 -0700 (PDT) From: Suniel Mahesh To: Felipe Balbi , Greg Kroah-Hartman , Michael Trimarchi , Jagan Teki Cc: linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, USB list Subject: [RFC 0/2] Extend functionality for GET_REPORT Date: Mon, 1 Aug 2022 18:00:08 +0530 Message-Id: <20220801123010.2984864-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=Si6hwKKH; 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. Suniel Mahesh (2): usb: gadget: f_hid: Extend functionality for GET_REPORT mode HID: ghid: add example program for GET_REPORT drivers/usb/gadget/function/f_hid.c | 166 ++++++++++++++++++++++++++- 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, 323 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