From patchwork Tue Aug 21 18:22:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 1357011 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0DD9540210 for ; Tue, 21 Aug 2012 18:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932199Ab2HUSSJ (ORCPT ); Tue, 21 Aug 2012 14:18:09 -0400 Received: from csmtp3.one.com ([91.198.169.23]:52749 "EHLO csmtp3.one.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196Ab2HUSSI (ORCPT ); Tue, 21 Aug 2012 14:18:08 -0400 Received: from polaris (c-14aae655.710-13-64736c12.cust.bredbandsbolaget.se [85.230.170.20]) by csmtp3.one.com (Postfix) with ESMTPA id 63F3E24134A8; Tue, 21 Aug 2012 18:18:03 +0000 (UTC) Received: by polaris (sSMTP sendmail emulation); Tue, 21 Aug 2012 20:22:48 +0200 From: "Henrik Rydberg" To: Jiri Kosina Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [PATCH] HID: hid-debug: Show rdesc for unclaimed devices Date: Tue, 21 Aug 2012 20:22:44 +0200 Message-Id: <1345573364-341-1-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.11.5 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 patchs make 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 */