diff mbox series

[2/2] hp_accel: fix accelerometer orientation for EliteBook 840

Message ID 20190905064707.7640-2-drake@endlessm.com (mailing list archive)
State Deferred, archived
Headers show
Series [1/2] lis3lv02d: update documentation references to neverball | expand

Commit Message

Daniel Drake Sept. 5, 2019, 6:47 a.m. UTC
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 <drake@endlessm.com>
---
 drivers/platform/x86/hp_accel.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Shevchenko Sept. 7, 2019, 6:23 p.m. UTC | #1
On Thu, Sep 5, 2019 at 9:47 AM Daniel Drake <drake@endlessm.com> wrote:
>
> 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
>

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Daniel Drake <drake@endlessm.com>
> ---
>  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),
> --
> 2.20.1
>
diff mbox series

Patch

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),