From patchwork Fri Oct 7 19:39:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roderick Colenbrander X-Patchwork-Id: 9367439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50521600C8 for ; Fri, 7 Oct 2016 19:40:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EE23297F0 for ; Fri, 7 Oct 2016 19:40:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3368D297EE; Fri, 7 Oct 2016 19:40:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C14AE297EE for ; Fri, 7 Oct 2016 19:40:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932554AbcJGTkT (ORCPT ); Fri, 7 Oct 2016 15:40:19 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:34741 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932565AbcJGTkS (ORCPT ); Fri, 7 Oct 2016 15:40:18 -0400 Received: by mail-io0-f174.google.com with SMTP id r30so57356704ioi.1 for ; Fri, 07 Oct 2016 12:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaikai-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1V+xHLSMmpYNbQRFDVVs0jusJD7If0xpbBLXW8HqmOo=; b=ebtiWBatPGzdSuDy3rYeAluz2LexXrjwiLFwZmyzr9qbmoJGPLM7d09kTX3dqVW3bk T2r04U7anZyonHmjJc2dUR5WNQot7mGEUzd1e7jywQ+UdiP89LcnWORGS4BxwfbsGj4C DwLb08iJ4vW72sENleOm/GMAt2I3EmiWEhVYIZu8leF6Z2UmKR5V6uaQuFU83+4R7OWF KSgN38RBWYLmLMTSUQKq1gpOoJccKHSfFdhD0W7SsUqDPEb2oYg5677BWXUCiYl4kNWn zeK83ph4+LkloGdpeWBkJl+VOkdVFhoXT6dAbzV+JbRVJFblKxTZicR9zMBT4lRJ3Ilz bRSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1V+xHLSMmpYNbQRFDVVs0jusJD7If0xpbBLXW8HqmOo=; b=d7CbU2jVOIWv5M3kmXG+Rn0WB43PfrHcWVE2nEdBbQFpsVLlReX41cWFgH61KaEWgU wlznRl6qRfudTiX4lgUJzKRQP9sMqOtPGh22Xl63uQfTa0c7a4WLIX99HEPSOkpoR9tB REYJYf2+uB0ifuE3kTFHbRzu0fuRwxFQSpXBUrNMK4HvDl3bg9qJXQPz5QUl/dbA57+f aeanqBYjlfXnvR72673XZ3RvBxXRo+oYBitVCC5T1UHlZE7LhaK4xPkQt5xzXCyJ4x8x L0ixrTeKy0+bpwutX8jaMRdCddkGmq0S2b2Zy5pXcL97H59UL0d1TbHi7k7v2ZN/Apif +1pg== X-Gm-Message-State: AA6/9RnQcE6kouCEAMZI5zkLM0gGzVD1ktQduRxTOegjzbZleDxdxZKdqcx7cE7wYyDga9o2 X-Received: by 10.107.14.65 with SMTP id 62mr21246801ioo.142.1475869217528; Fri, 07 Oct 2016 12:40:17 -0700 (PDT) Received: from konan1.dev.biz ([100.42.98.197]) by smtp.gmail.com with ESMTPSA id v7sm1735481itd.6.2016.10.07.12.40.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2016 12:40:17 -0700 (PDT) From: Roderick Colenbrander To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , Jiri Kosina , Tim Bird , Roderick Colenbrander Subject: [PATCH 6/7] HID: sony: Adjust value range for motion sensors Date: Fri, 7 Oct 2016 12:39:39 -0700 Message-Id: <1475869180-26757-7-git-send-email-roderick@gaikai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475869180-26757-1-git-send-email-roderick@gaikai.com> References: <1475869180-26757-1-git-send-email-roderick@gaikai.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roderick Colenbrander The motion sensor values are 16-bit, so make the value range match. It is hard to reach the upper values, but they can be reached. At least the current accelerometer value of 8192 is very easy to pass. It is still not nice that the motion sensors live in no man's land in between ABS_MISC and ABS_MT_SLOT, but that's something for another time, which the proposed ABS_ACCEL_*/ABS_GYRO_* were meant for. Signed-off-by: Roderick Colenbrander --- drivers/hid/hid-sony.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index b206d85..bd84790 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -405,14 +405,14 @@ static u8 dualshock4_usb_rdesc[] = { 0x19, 0x40, /* Usage Minimum (40h), */ 0x29, 0x42, /* Usage Maximum (42h), */ 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */ - 0x26, 0x00, 0x7F, /* Logical Maximum (32767), */ + 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ 0x75, 0x10, /* Report Size (16), */ 0x95, 0x03, /* Report Count (3), */ 0x81, 0x02, /* Input (Variable), */ 0x19, 0x43, /* Usage Minimum (43h), */ 0x29, 0x45, /* Usage Maximum (45h), */ - 0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */ - 0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */ + 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */ + 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ 0x95, 0x03, /* Report Count (3), */ 0x81, 0x02, /* Input (Variable), */ 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */ @@ -714,14 +714,14 @@ static u8 dualshock4_bt_rdesc[] = { 0x19, 0x40, /* Usage Minimum (40h), */ 0x29, 0x42, /* Usage Maximum (42h), */ 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */ - 0x26, 0x00, 0x7F, /* Logical Maximum (32767), */ + 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ 0x75, 0x10, /* Report Size (16), */ 0x95, 0x03, /* Report Count (3), */ 0x81, 0x02, /* Input (Variable), */ 0x19, 0x43, /* Usage Minimum (43h), */ 0x29, 0x45, /* Usage Maximum (45h), */ - 0x16, 0x00, 0xE0, /* Logical Minimum (-8192), */ - 0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */ + 0x16, 0x00, 0x80, /* Logical Minimum (-32768), */ + 0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */ 0x95, 0x03, /* Report Count (3), */ 0x81, 0x02, /* Input (Variable), */ 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */