From patchwork Sun Feb 2 04:50:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 3566151 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2BEB7C02DC for ; Sun, 2 Feb 2014 04:51:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FB9F2024F for ; Sun, 2 Feb 2014 04:51:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 606AF2023F for ; Sun, 2 Feb 2014 04:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751110AbaBBEum (ORCPT ); Sat, 1 Feb 2014 23:50:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21434 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbaBBEul (ORCPT ); Sat, 1 Feb 2014 23:50:41 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s124oXo5014533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 1 Feb 2014 23:50:33 -0500 Received: from plouf.redhat.com ([10.3.113.2]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s124oVR6018074; Sat, 1 Feb 2014 23:50:32 -0500 From: Benjamin Tissoires To: Benjamin Tissoires , Jiri Kosina , David Herrmann , Frank Praznik , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] HID: uHID: implement .raw_request Date: Sat, 1 Feb 2014 23:50:20 -0500 Message-Id: <1391316630-29541-2-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1391316630-29541-1-git-send-email-benjamin.tissoires@redhat.com> References: <1391316630-29541-1-git-send-email-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It was missing, so adding it. Signed-off-by: Benjamin Tissoires --- drivers/hid/uhid.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index f5a2b19..438c9f1 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -270,6 +270,22 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf, return count; } +static int uhid_raw_request(struct hid_device *hid, unsigned char reportnum, + __u8 *buf, size_t len, unsigned char rtype, + int reqtype) +{ + switch (reqtype) { + case HID_REQ_GET_REPORT: + return uhid_hid_get_raw(hid, reportnum, buf, len, rtype); + case HID_REQ_SET_REPORT: + if (buf[0] != reportnum) + return -EINVAL; + return uhid_hid_output_raw(hid, buf, len, rtype); + default: + return -EIO; + } +} + static struct hid_ll_driver uhid_hid_driver = { .start = uhid_hid_start, .stop = uhid_hid_stop, @@ -277,6 +293,7 @@ static struct hid_ll_driver uhid_hid_driver = { .close = uhid_hid_close, .parse = uhid_hid_parse, .output_report = uhid_hid_output_report, + .raw_request = uhid_raw_request, }; #ifdef CONFIG_COMPAT