New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 718919 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add orientation support in EC: report through IIO

Project Member Reported by gwendal@chromium.org, May 5 2017

Issue description

With BMI160, we already have hardware support for double tap and significant motion. orientation is supported.

Kionix also support orientation.

We should add orientation (for the sensor in the screen) support and report to the AP. 

Which interface to use? IIO does not provide a direct interface.

I am thinking of using IIO_ENUM for a channel: UNKONW, .. up to SCREEN_ORIENTATION_REVERSE_LANDSCAPE (see Android interface).

Looking into input as well, where an orientation key is supportted (KEY_ROTATE_DISPLAY) but it is an input key the user press on to rotate the display by 90 degrees.
 
Are we sure we want to add an orientation sensor type?  What version of Android is ARC++ using?  This is what Android is telling developers: "The orientation sensor derives its data by processing the raw sensor data from the accelerometer and the geomagnetic field sensor. Because of the heavy processing that is involved, the accuracy and precision of the orientation sensor is diminished. Specifically, this sensor is reliable only when the roll angle is 0. As a result, the orientation sensor was deprecated in Android 2.2 (API level 8), and the orientation sensor type was deprecated in Android 4.4W (API level 20). Instead of using raw data from the orientation sensor, we recommend that you use the getRotationMatrix() method in conjunction with the getOrientation() method to compute orientation values..."  (from https://developer.android.com/guide/topics/sensors/sensors_position.html#sensors-pos-gamerot).

If we still want to implement an orientation sensor, let me know and assign this to me and I'll run with it.
Owner: nvaccaro@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/e656b970e204309c1a665f154a5972ed85305911

commit e656b970e204309c1a665f154a5972ed85305911
Author: Nick Vaccaro <nvaccaro@chromium.org>
Date: Wed Aug 09 00:34:11 2017

sensors: add bmi160 & kionix orientation driver

BRANCH=none
BUG=chromium:718919
TEST=make buildall -j works, orientation works when enabled on gru
and scarlet.

Change-Id: I16dcfa5d9dea39c082d98190fa1bb6e496168b17
Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/540124
Tested-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>

[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/driver/accelgyro_bmi160.h
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/driver/accel_kionix.c
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/common/motion_sense.c
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/driver/accel_kx022.h
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/driver/accel_kionix.h
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/driver/accelgyro_bmi160.c
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/include/config.h
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/include/motion_sense.h
[modify] https://crrev.com/e656b970e204309c1a665f154a5972ed85305911/include/ec_commands.h

Sign in to add a comment