From patchwork Thu Sep 5 06:47:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 11132215 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E05D18A6 for ; Thu, 5 Sep 2019 06:47:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A5B220693 for ; Thu, 5 Sep 2019 06:47:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=endlessm-com.20150623.gappssmtp.com header.i=@endlessm-com.20150623.gappssmtp.com header.b="bsEsTeBd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731015AbfIEGrQ (ORCPT ); Thu, 5 Sep 2019 02:47:16 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:45431 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730778AbfIEGrQ (ORCPT ); Thu, 5 Sep 2019 02:47:16 -0400 Received: by mail-pg1-f173.google.com with SMTP id 4so825834pgm.12 for ; Wed, 04 Sep 2019 23:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m+u4gLw6j2OSFXXXBdcLkgNGWPn9jRYBpIqHZ9wSpUY=; b=bsEsTeBdupyvfF18sPED+AfjrT4VkMCIasoVqOQndDqhJ4mW7iCeV12ISAjKLqzlhg brPtWu4/MkGI2kk02sHKg1iE0Q18Av+agkIiL5mU/HAEiRGIJBSmkEPtO2Tg+4ADgr5z i820RYPAu2tWA+zu4Q4MnuP1H5eeYPE7XHB2eB2xhuT+LXVSIIEGKPLZwx+gkmAHv3+L iDezZL8slbCBdb2TWc5/QVeMXYgeaGWY4b6rBaWBVHeZWgaq0vdTWO8W6bjNXJ6lO/Pl 08VBDNG2OzJgaGRxbmvM1kR5m1CGt8z7QVU5Z+KFWwUwgB7cEmS2nIRV27+cCzVak5SB OFqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=m+u4gLw6j2OSFXXXBdcLkgNGWPn9jRYBpIqHZ9wSpUY=; b=IoC+cUWJVR5myzNohkL0B/V0C9Gcfpo1k616CYnqSyT7/3YEZf5YYQok8QNAAcVEk2 6ibYX7x2iiP3Sc6hsN9o8mVlftjYaFyZ8nrJSku3MZb7q7RRdWXFUelPfYNlvp8YTUdM xIkv4792izHyPGTfB2Y+JI5BmuYerOshtO9ywF6ffglVsKhuxvwSz2h524pb7NlsOHDq 1PWXMQ18UXM3c0/0YOE9V0P3fALI1PBuhxgWicM3J+PtCzwRPRmkgjBuLOd0Ffahh3AX pN2rJcLqZA5JogKBbCzstodlOnwWh8ZIeXnTFXZencM7Hs0tRZAU342RMHg8dSOXOfMf BZVg== X-Gm-Message-State: APjAAAXa/e5DTWDSYDFlLDTqwlyLMYu9g8POKGNsIpQbK9jnS7BfP9Cp 2aK1OCqRBApAo230DdrljiXkMg== X-Google-Smtp-Source: APXvYqz4MUHdNeFbp0epKLUhUCIHdeA7O/1oxxGiDdlCc8F4pENinJdiupfeWhMkVhaIUz7yePapsg== X-Received: by 2002:a63:b919:: with SMTP id z25mr1716995pge.201.1567666035648; Wed, 04 Sep 2019 23:47:15 -0700 (PDT) Received: from limbo.local (123-204-46-122.static.seed.net.tw. [123.204.46.122]) by smtp.gmail.com with ESMTPSA id 67sm1016041pjo.29.2019.09.04.23.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 23:47:14 -0700 (PDT) From: Daniel Drake To: eric.piel@tremplin-utc.net, dvhart@infradead.org, andy@infradead.org Cc: pavel@suse.cz, platform-driver-x86@vger.kernel.org, linux@endlessm.com, burman.yan@gmail.com Subject: [PATCH 1/2] lis3lv02d: update documentation references to neverball Date: Thu, 5 Sep 2019 14:47:06 +0800 Message-Id: <20190905064707.7640-1-drake@endlessm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org In 2008 when this documentation was added, it was probably possible to use the accelerometer play neverball "out of the box" as described. That's not the case any more though. After fixing sdl to expose the device again (https://bugzilla.libsdl.org/show_bug.cgi?id=4789), the game is unplayable because modern versions of neverball configure the 3rd axis (usually the twisting action of a physical joystick) to rotate the field of view by default. Since the Z axis is ordinarily fully positive (as documented), this results in the field of view constantly rotating and the game is unplayable. Until I went closer into the details, this had me thinking that the accelerometer was not working correctly. Update the documentation to clarify. Signed-off-by: Daniel Drake --- Documentation/misc-devices/lis3lv02d.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/misc-devices/lis3lv02d.rst b/Documentation/misc-devices/lis3lv02d.rst index 959bd2b822cf..c6d3f2d616a4 100644 --- a/Documentation/misc-devices/lis3lv02d.rst +++ b/Documentation/misc-devices/lis3lv02d.rst @@ -20,7 +20,7 @@ This driver provides support for the accelerometer found in various HP laptops sporting the feature officially called "HP Mobile Data Protection System 3D" or "HP 3D DriveGuard". It detects automatically laptops with this sensor. Known models (full list can be found in drivers/platform/x86/hp_accel.c) will have -their axis automatically oriented on standard way (eg: you can directly play +their axis automatically oriented on standard way (eg: you can play neverball). The accelerometer data is readable via /sys/devices/platform/lis3lv02d. Reported values are scaled to mg values (1/1000th of earth gravity). @@ -72,8 +72,7 @@ Axes orientation ---------------- For better compatibility between the various laptops. The values reported by -the accelerometer are converted into a "standard" organisation of the axes -(aka "can play neverball out of the box"): +the accelerometer are converted into a "standard" organisation of the axes: * When the laptop is horizontal the position reported is about 0 for X and Y and a positive value for Z @@ -82,6 +81,10 @@ the accelerometer are converted into a "standard" organisation of the axes (becomes negative) * If the laptop is put upside-down, Z becomes negative +This configuration of X and Y axes works for playing neverball, as long +as you configure it to ignore the Z axis (e.g. in neverballrc, set +joystick_axis_x1 to point to a non-existent axis). + If your laptop model is not recognized (cf "dmesg"), you can send an email to the maintainer to add it to the database. When reporting a new laptop, please include the output of "dmidecode" plus the value of From patchwork Thu Sep 5 06:47:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 11132217 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6F101399 for ; Thu, 5 Sep 2019 06:47:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8641921848 for ; Thu, 5 Sep 2019 06:47:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=endlessm-com.20150623.gappssmtp.com header.i=@endlessm-com.20150623.gappssmtp.com header.b="OwMu18Ac" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731233AbfIEGrT (ORCPT ); Thu, 5 Sep 2019 02:47:19 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35805 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730778AbfIEGrT (ORCPT ); Thu, 5 Sep 2019 02:47:19 -0400 Received: by mail-pf1-f195.google.com with SMTP id 205so1087098pfw.2 for ; Wed, 04 Sep 2019 23:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0/z/fEHOrsK82Y1ofBetcsSWQGDh48/k+RVElI1RO7o=; b=OwMu18AcOOAyMqJD4wJ/W4yR5pdjw1N258iRYCa0lhZ/jva8bkXn5KSuVZhY5OSHDg 805uhgNtDhYEBo3truJWQ3FrGs/D7i6PmbVPmr+OlbojY014I9BHxPS9g2lmQmMM7esK yIBw34Cq+rSvk5dxoXziSN6ZkA1tBrYLT7eHO2Pb9nT71FI1WUQYX9IAbxeFROkGrZ8s fVc/QU844yVw9UX0wTwYJCKmDa/H79ikDkKldMBUIFiCiCILguz+btbxUd7rPxtrBT2I xRNIQ+GtxSmhQAUCF1ZGFUt+fr0YqUlZW6qlLQl0BnyZ69XfY1hf6iaHNZEdaiIXKZJ6 yWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0/z/fEHOrsK82Y1ofBetcsSWQGDh48/k+RVElI1RO7o=; b=eXt/2asTR5lM/OMyy2s1GVSYdHJ23b5ZzYBxnFnI85ws8px2P96H3mWSZZVBHx02wB ZChjyWZFljnfDyIRxvM+wntLiFXpmPIwkFcCQs60jW1oQpEOWsVa7ctlhHjLXFRC2Tir LamxVuvjZjm8pW1mcwKSShyZQX/Y+QVCppFWj4cRfnSXvISPlgGHrbbbPXPrHSxUQ3Tz RzVBqRpKIY3+CLowzExmYBSb4IydLmpLqltmj6JNrEWmg6szORy5viYNEoH5uO46Kaiu zHsDgQr4lZMHKL1+pSPRrAEuHabPbaa+z3tXQwEmXScHRmlGddC8RuuK0i8p/9dKgBe5 9nPQ== X-Gm-Message-State: APjAAAU7Ny4SKdBle8fMx5Cyo6ekDXYP61W1wIiV0r1FjV9VnuQ1sC5z 6d0ldctGpJg8dZFrDPSOod7yYw== X-Google-Smtp-Source: APXvYqyT64f2i5qRmgn1BwnKJl5DRdSKj8YLiQc6JP71plOtfRuizvipZFWJfRIo/YgGnz8mMSaWsg== X-Received: by 2002:a63:fc09:: with SMTP id j9mr1662132pgi.377.1567666038386; Wed, 04 Sep 2019 23:47:18 -0700 (PDT) Received: from limbo.local (123-204-46-122.static.seed.net.tw. [123.204.46.122]) by smtp.gmail.com with ESMTPSA id 67sm1016041pjo.29.2019.09.04.23.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 23:47:17 -0700 (PDT) From: Daniel Drake To: eric.piel@tremplin-utc.net, dvhart@infradead.org, andy@infradead.org Cc: pavel@suse.cz, platform-driver-x86@vger.kernel.org, linux@endlessm.com, burman.yan@gmail.com Subject: [PATCH 2/2] hp_accel: fix accelerometer orientation for EliteBook 840 Date: Thu, 5 Sep 2019 14:47:07 +0800 Message-Id: <20190905064707.7640-2-drake@endlessm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190905064707.7640-1-drake@endlessm.com> References: <20190905064707.7640-1-drake@endlessm.com> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The HP EliteBook 840 G1 accelerometer does not behave according to the current "EliteBook 84" driver quirk. Instead, it needs all three axes inverted in order to achieve the behaviour described in the lis3lv02d.rst documentation. We have confirmed this on multiple units. Add a new product-specific quirk to correct this, but also leave the previous match in place, assuming that it is correct for other models that will continue to match that one instead. DMI data of this product is: Handle 0x000D, DMI type 1, 27 bytes System Information Manufacturer: Hewlett-Packard Product Name: HP EliteBook 840 G1 Version: A3009DD10303 Serial Number: 5CG51115YS SKU Number: F9W96UP#ABA Family: 103C_5336AN G=N L=BUS B=HP S=ELI Handle 0x000E, DMI type 2, 16 bytes Base Board Information Manufacturer: Hewlett-Packard Product Name: 198F Version: KBC Version 15.59 Serial Number: PDXVC00WB8G0Y2 Signed-off-by: Daniel Drake Acked-by: Andy Shevchenko --- drivers/platform/x86/hp_accel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c index 7a2747455237..bbacaa21d539 100644 --- a/drivers/platform/x86/hp_accel.c +++ b/drivers/platform/x86/hp_accel.c @@ -162,6 +162,7 @@ static int lis3lv02d_dmi_matched(const struct dmi_system_id *dmi) DEFINE_CONV(normal, 1, 2, 3); DEFINE_CONV(y_inverted, 1, -2, 3); DEFINE_CONV(x_inverted, -1, 2, 3); +DEFINE_CONV(xyz_inverted, -1, -2, -3); DEFINE_CONV(x_inverted_usd, -1, 2, -3); DEFINE_CONV(z_inverted, 1, 2, -3); DEFINE_CONV(xy_swap, 2, 1, 3); @@ -237,6 +238,7 @@ static const struct dmi_system_id lis3lv02d_dmi_ids[] = { AXIS_DMI_MATCH("Mini510x", "HP Mini 510", xy_rotated_left_usd), AXIS_DMI_MATCH("HPB63xx", "HP ProBook 63", xy_swap), AXIS_DMI_MATCH("HPB64xx", "HP ProBook 64", xy_swap), + AXIS_DMI_MATCH("HPEB840", "HP EliteBook 840", xyz_inverted), AXIS_DMI_MATCH("HPB64xx", "HP EliteBook 84", xy_swap), AXIS_DMI_MATCH("HPB65xx", "HP ProBook 65", x_inverted), AXIS_DMI_MATCH("HPZBook15", "HP ZBook 15", x_inverted),