Since pretty much always, we've declared console commands to take
a "longhelp" argument with detailed explanations of what the
command does. But since almost as long, we've never actually used
that argument for anything - we just silently throw it away in
the macro. There's only one command (usbchargemode) that even
thinks it defines that argument.
We're never going to use this, let's just get rid of it.
BUG=none
BRANCH=none
CQ-DEPEND=CL:*279060
CQ-DEPEND=CL:*279158
CQ-DEPEND=CL:*279037
TEST=make buildall; tested on Cr50 hardware
Everything builds. Since we never used this arg anyway, there had
better not be any difference in the result.
Change-Id: Id3f71a53d02e3dc625cfcc12aa71ecb50e35eb9f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/374163
Reviewed-by: Myles Watson <mylesgw@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Fix bug where sometimes on suspend tap for battery would never work,
but open a resume and suspend again it would work fine. Problem is
that if suspended when accel circular buffer index is 1, then
we would never run the detection algorithm, because the check for
if the history buffer has been initialized is incorrect.
This also fixes the algorithm so that on suspend, it requires the
full sensor history buffer be filled up again before starting to
detect the double tap.
BUG=chrome-os-partner:45930
BRANCH=samus
TEST=go in to suspend when history_index is 1 and verify that tap
for battery works. wrote following console command to pause the
circular buffer at a specific index.
static int pause_index = -1;
static int check_pause;
static void gesture_chipset_resume(void)
{
/* disable tap detection */
check_pause = 1;
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, gesture_chipset_resume,
GESTURE_HOOK_PRIO);
void gesture_calc(void)
{
if (check_pause) {
if (pause_index < 0 || history_idx == pause_index) {
ccprintf("Paused at %d\n", pause_index);
tap_detection = 0;
pause_index = -1;
check_pause = 0;
}
}
...
static int command_tap_pause(int argc, char **argv)
{
char *e;
int v;
if (argc == 2) {
v = strtoi(argv[1], &e, 0);
if (*e)
return EC_ERROR_PARAM1;
pause_index = v;
}
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(tappause, command_tap_pause,
"",
"", NULL);
Change-Id: I2ba4ab2c807ec6ac1885a4829efedac3c83b32f1
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/302648
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Change the IRQ interface to allow adding events.
Move code to send the lightbar sequence from gesture.c to motion task.
TEST=compile, works on Ryu.
BRANCH=smaug
BUG=chrome-os-partner:44754
Change-Id: I981ea123ebef0e8e3d6aa320eade89f10e83b6fc
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/296822
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Simplify sensor get_data_rate, get_range and get_resolution.
Error code was not checked and these functions as currently implemented
have no reason to fail.
BRANCH=ryu,samus,cyan,strago
BUG=chromium:513458
TEST=Check on ryu, compile
Change-Id: I40dca41cee29a19f65b2f84d434b4c19eb6cbf3c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295635
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
active state is global, remove it from motion_sensor structure.
Reinit sensors when entering RW, fix regression introduced by CL:284616.
Improve EC polling rate calculation by excluding suspended sensors.
Wake up sensor thread in case the motion task was in deep sleep.
Do not send sense interrupt while suspened. Will revisit once wakeup
sensors are implemented.
BRANCH=smaug
TEST=Check when in RW the sensors are exposed.
Check EC rate are correct in different power state.
Check when jumping from RO to RW and back, after setting the
frequencies parameters via sysfs properly, AndroSensor acquires
the data properly.
BUG=chrome-os-partner:43132,chrome-os-partner:40741
Change-Id: Ie70732b135a432d64935eead4200ddc0e1a7c0b4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288201
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Add absolute threshold on delta_z_inner for tap for battery to guarantee
that we have at least some minimum absolute change in z that has started
the tap for battery.
This change makes it such that if the accel readings are really steady
for a while, then a sudden noisy signal doesn't trigger tap for battery.
BUG=chrome-os-partner:34592
BRANCH=samus
TEST=use tapinfo on to observe tap values and do a double tap of varying
intensities. note that it should be just a little less sensitive to weak
taps.
Change-Id: I95367bc7f99b888e15e9ac3a2bc8c9cca32d30d6
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237666
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Double the output data rate setting for accels for tap
for battery because with the lsm6ds0 sensor, the current
ODR does not guarantee that we get fresh data every time
we do a read.
BUG=chrome-os-partner:34592
BRANCH=samus
TEST=load onto samus, go to G3, use tapinfo on to see
ODR set to 476000Hz. add printf to lsm6ds0 to print when
data is not ready, and see that without this change, the
printf is hit once a minute or so, and with this change,
the printf is never hit, meaning new data is always ready.
Change-Id: Ib09cba0d70642f59df8a35b5b6bb4fd7b9a4fa3d
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237665
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Fix bug in tap gesture. When turning on tap detection, don't
clear the history circular array index. This was causing inconsitent
tap for battery recognition because the inner window sum of z-axis
data (sum_z_inner) was relying on subtracting out old historical
data and adding in the new data, but when the array index changed,
it was subtracting out the wrong old data. This really only came in
to play if there was significant z motion before the last wakeup.
BUG=none
BRANCH=samus
TEST=keep going to sleep and waking up and test that tap for
battery works every time.
Change-Id: I55e00c805d504dd6d257a81f2cd25fe384a53257
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226591
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Move gesture to common directory, 1st step to be reused by
other board.
Cleanup motion_sense shutdown path.
BUG=chrome-os-partner:33102
TEST=Double tap still works on Samus
BRANCH=ToT
Change-Id: I0a3b38c4a7dbe95c27dcdebff04c1176aaf932d1
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225235
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>