From patchwork Thu Oct 6 02:18:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roderick Colenbrander X-Patchwork-Id: 9363615 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 E2F08600C8 for ; Thu, 6 Oct 2016 02:20:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28E628D6F for ; Thu, 6 Oct 2016 02:20:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C50AB28DA2; Thu, 6 Oct 2016 02:20:05 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 40B9A28D6F for ; Thu, 6 Oct 2016 02:20:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934042AbcJFCUE (ORCPT ); Wed, 5 Oct 2016 22:20:04 -0400 Received: from mail-yb0-f179.google.com ([209.85.213.179]:36690 "EHLO mail-yb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933867AbcJFCUD (ORCPT ); Wed, 5 Oct 2016 22:20:03 -0400 Received: by mail-yb0-f179.google.com with SMTP id 191so961298ybv.3 for ; Wed, 05 Oct 2016 19:20:03 -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; bh=M4fM1QNMGoUN1Y43Ox9cHaet4d8YvVP30f56ANgH9QY=; b=NZiEZUYZMb2/h5uhwRmeBZt7Kj569SpRYMoMteRFU6cYSnHDebbKfe5KN8Zxz87YFK odsEE/nyoc7wVozfPxGojpSnb6giQgld8Ixz5VbsONnN6+V+av9/Nc7IIy+8zXXwaUdv s4qDE39eGCfTMkr73mxXQGmNkBgqR65G7YPbWWbofKya0N/LHK6m5j7W4XsX//t8vIW0 PH0Krp/WDMKJU8YgDQbOislntfhAUoDDqiA/5DRrLD9D0hrVdObc1OX1z8AJhCw6c2pQ MHDkxtTREgUXS9inAFaddAf3H6KwNf1edwazT++DLHtxdVRgnRlMgzjak/0GmPu3TmK/ 4axw== 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; bh=M4fM1QNMGoUN1Y43Ox9cHaet4d8YvVP30f56ANgH9QY=; b=BNpyrjC0ec9D5/X7M0b81oTyVeaRGZlaibErpZw84MbrKtZZG5V5lbKYbOJ4v2h3fU QKrP0pN/Xx6BZAZVTopBf8vcJuCf95DRKA3ounKEDVaJLBQgg8Zg43xdt1hlAQ8G2egj kX+Vdod6a+ekEj1fm883e3+W77iqqlzrq4szPu5s0ZT3MAheHoZJ/QsZyfVlEz5LEVH5 Y28rwef7l/mdon/DwG76p2rYASEwQb+6jFjG/q5YumPeg86YLVwEKRKOrlI0ELql0mPU i8tK6EXdQKfmgPBX0+/uDjnIPE8vrFcysyENTXdsaDbtZ+fuSVxf4MZ3pJsaoTz8fSF+ sT5Q== X-Gm-Message-State: AA6/9RmasxKQV6xYRuVT4sNr17TKrcbUD4KWk5kbkOl0e7FVnoR9zFOMBxR9l7GFsoA2aPp/ X-Received: by 10.37.174.7 with SMTP id a7mr8616970ybj.154.1475720402359; Wed, 05 Oct 2016 19:20:02 -0700 (PDT) Received: from konan1.dev.biz ([100.42.98.197]) by smtp.gmail.com with ESMTPSA id i132sm213444ywc.53.2016.10.05.19.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2016 19:20:01 -0700 (PDT) From: Roderick Colenbrander To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , Jiri Kosina , Tim Bird , Roderick Colenbrander Subject: [PATCH 1/2] HID: sony: Adjust value range for motion sensors Date: Wed, 5 Oct 2016 19:18:54 -0700 Message-Id: <1475720335-17447-1-git-send-email-roderick@gaikai.com> X-Mailer: git-send-email 2.7.4 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 2387aaf..c9916cc 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), */