hwdb: Add Chromebook accel orientation quirks based on sysfs label
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Thu, 18 Aug 2022 15:24:05 +0000 (18:24 +0300)
committerAlper Nebi Yasak <alpernebiyasak@gmail.com>
Thu, 18 Aug 2022 18:17:19 +0000 (21:17 +0300)
commitfea267f8c71d0edffee5ccbb806755fb626c5e29
tree2d75df0ed1b89b6b17fd8f3c37a896c9ec21c7ca
parente2f25ae64889ea7fe8a7556ee5fba91bc2a0eab8
hwdb: Add Chromebook accel orientation quirks based on sysfs label

The base-mounted accelerometer on Chromebooks return values same as the
display when the lid angle is 180 degrees, instead of when the lid is
closed. To match userspace expectations we must further rotate the
existing accelerometer mounting matrix by 180 degrees around the X axis:

    [[-1,  0,  0],    [[ 1,  0,  0],    [[-1,  0,  0],
     [ 0, -1,  0],  X  [ 0, -1,  0],  =  [ 0,  1,  0],
     [ 0,  0, -1]]     [ 0,  0, -1]]     [ 0,  0,  1]]

A previous commit lets us distinguish between the two cros-ec-accel
devices on these boards by their 'label' sysfs file. Add hwdb entries
that make base-mounted accelerometers use this correct matrix, and
display-mounted ones use the existing one.

Note that the cros-ec-accel drivers use 'label' only since Linux v6.0.
The old match strings are not removed to support older kernels, even
though they are only correct for the display-mounted sensor.
hwdb.d/60-sensor.hwdb