From patchwork Sun Aug 26 12:57:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 1375021 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 47EC0DFABE for ; Sun, 26 Aug 2012 12:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755065Ab2HZMyZ (ORCPT ); Sun, 26 Aug 2012 08:54:25 -0400 Received: from smtprelay-b11.telenor.se ([62.127.194.20]:45981 "EHLO smtprelay-b11.telenor.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755047Ab2HZMyW (ORCPT ); Sun, 26 Aug 2012 08:54:22 -0400 Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 11A80C7E3; Sun, 26 Aug 2012 14:54:22 +0200 (CEST) X-SENDER-IP: [85.230.170.20] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApRZALMbOlBV5qoUPGdsb2JhbABFhRqFI7AtGQEBAQEeGQ0ngiEBBScvEwEPEAhJOQoUBgESiBG7SRSSBQObQI0P X-IronPort-AV: E=Sophos;i="4.77,830,1336341600"; d="scan'208";a="180869364" Received: from c-14aae655.710-13-64736c12.cust.bredbandsbolaget.se (HELO polaris) ([85.230.170.20]) by ipb3.telenor.se with SMTP; 26 Aug 2012 14:54:20 +0200 Received: by polaris (sSMTP sendmail emulation); Sun, 26 Aug 2012 14:59:38 +0200 From: "Henrik Rydberg" To: Dmitry Torokhov , Jiri Kosina Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [PATCH 19/20] HID: hid-debug: Show rdesc for unclaimed devices Date: Sun, 26 Aug 2012 14:57:37 +0200 Message-Id: <1345985858-445-20-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1345985858-445-1-git-send-email-rydberg@euromail.se> References: <1345985858-445-1-git-send-email-rydberg@euromail.se> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since commit a7197c2e, the raw report descriptor is available also for unclaimed devices. This patch makes it show in the rdesc debugfs node. Signed-off-by: Henrik Rydberg --- drivers/hid/hid-debug.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 01dd9a7..933fff0 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) } - static int hid_debug_rdesc_show(struct seq_file *f, void *p) { struct hid_device *hdev = f->private; + const __u8 *rdesc = hdev->rdesc; + unsigned rsize = hdev->rsize; int i; + if (!rdesc) { + rdesc = hdev->dev_rdesc; + rsize = hdev->dev_rsize; + } + /* dump HID report descriptor */ - for (i = 0; i < hdev->rsize; i++) - seq_printf(f, "%02x ", hdev->rdesc[i]); + for (i = 0; i < rsize; i++) + seq_printf(f, "%02x ", rdesc[i]); seq_printf(f, "\n\n"); /* dump parsed data and input mappings */