linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to deal with accelerometers where the ACPI HID indicates the location?
@ 2017-12-27 16:42 Hans de Goede
  2017-12-29 12:14 ` Jonathan Cameron
  2018-01-15 13:28 ` Bastien Nocera
  0 siblings, 2 replies; 6+ messages in thread
From: Hans de Goede @ 2017-12-27 16:42 UTC (permalink / raw)
  To: Bastien Nocera, Jonathan Cameron, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio
  Cc: Enaut Waldmeier

Hi All,

So I've been debugging some touchpad issues on a Tresktor Primebook C13,
unfortunately I've been able to get the touchpad to work.

But I did notice the following in the ACPI tables, and there i2cdetect
confirms there are i2c devices at the expected addresses:

                 Device (KXJ0)
                 {
                     Name (_ADR, Zero)  // _ADR: Address
                     Name (_HID, "KIOX010A")  // _HID: Hardware ID
                     Name (_CID, "KIOX010A")  // _CID: Compatible ID
                     Name (_DDN, "Kionix KXCJ9 Accelerometer Display")  // _DDN:

...

                 Device (KXJ1)
                 {
                     Name (_ADR, Zero)  // _ADR: Address
                     Name (_HID, "KIOX020A")  // _HID: Hardware ID
                     Name (_CID, "KIOX020A")  // _CID: Compatible ID
                     Name (_DDN, "Kionix KXCJ9 Accelerometer Keyboard")  // _DDN:

...

Notice these accelerometers use KIOX010A / KIOX020A as HID rather then
the normal KIOX000A and their DDN lists a location (display vs
keyboard, this is a yoga style convertible).

I'm pretty sure from the kernel side these can be fixed by just adding:

         {"KIOX010A", KXCJ91008},
         {"KIOX020A", KXCJ91008},

Entries to the drivers/iio/accel/kxcjk-1013.c driver. I believe the
different HIDs are just there to allow Windows to determine the
location based on the HID.

But before submitting a patch to add these 2 HIDs to the driver I was
wondering do we want to do anything wrt the location on the kernel side.

I do believe there is a need for an ACCEL_LOCATION udev property on
accelerometer iio-devs for use by iio-sensor-proxy, so that it can
pick the one in the display to provide display rotation info.

But since the HID ends up in the device name we can simply add an
udev rule based on this, without the kernel needing to export any
data AFAICT.

Bastien, do you agree that we don't need the kernel to export this
and that we can use a HID match in a udev rule to set an
ACCEL_LOCATION udev property for this ?

Regards,

Hans

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-22 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-27 16:42 How to deal with accelerometers where the ACPI HID indicates the location? Hans de Goede
2017-12-29 12:14 ` Jonathan Cameron
2018-01-01  9:56   ` Hans de Goede
2018-01-15 13:28 ` Bastien Nocera
2018-01-22 17:40   ` Hans de Goede
2018-01-22 19:12     ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).