summaryrefslogtreecommitdiff
path: root/driver/accelgyro_bmi260.c
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-051-601/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* driver: bmi: Merge list_activities in common codeGwendal Grignou2021-09-101-13/+1
| | | | | | | | | | | | | | | | | Put list_activities in common code, as it is used by both BMI160 and BMI260 driver. Fixes cb3771973de ("Coachz: MotionSensor: Avoid redefine gesture function list_activites") Fixes fc298a0ada0 ("driver: bmi260: integrate body detection") BUG=b:195908820 BRANCH=trogdor TEST=buildall Change-Id: I05591954c825802502328c842b03e8934c497f08 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150056 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Coachz: MotionSensor: Avoid redefine gesture function list_activitespengjunhao52021-09-071-3/+3
| | | | | | | | | | | | | | | | | | | | | This commit is for motion sensor combine(BMI160 & BMI260),Avoid redefine gesture function `list_activites`. BUG=b:195908820 TEST=make -j BOARD=coachz Verify build on SIT board BRANCH=Trogdor Signed-off-by: pengjunhao5 <pengjunhao5@huaqin.corp-partner.google.com> Reviewed-by: tongjian <tongjian@huaqin.corp-partner.google.com> Reviewed-by: yudengwu <yudengwu@huaqin.corp-partner.google.com> Change-Id: If31442d0c00745d124b20188b4e5fad8a9a1d173 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3133188 Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: bmi260: integrate body detectionGwendal Grignou2021-08-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Body detection is accelerometer agnostics. It was added in BMI260, but not finalized. Add list_activity function to enable/disable body detection. BRANCH=volteer BUG=b:195908820 TEST=Check cros-ec-activity is loaded. Enable proximity event: echo 1 > events/in_proximity_change_either_en Load iio_event_monitor, check we get events when moving device on lap to floor: Event: time: 925239910373, type: proximity, channel: 0, evtype: change, direction: falling Event: time: 945020001791, type: proximity, channel: 0, evtype: change, direction: rising ... Change-Id: I423c7044761d2addac36d435781ea19c1f1b18ed Signed-off-by: Gwendal Grignou <gwendal@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3097151 Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Ching-Kang Yen <chingkang@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
* driver: bmi160: bmi260: Minor driver fixesTomasz Michalec2021-07-141-2/+8
| | | | | | | | | | | | | | | | | | | Fix three issues with BMI160 and BMI260 drivers: - get/set acclerometer/gyroscope offset will return error on failed read of offset register - BMI160 calibration function returns error when setting range fail - Invalid temperature is properly recognized by driver BUG=none BRANCH=none TEST=run zmake drivers test Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I545c0a931227ef7efc000ec97c1f6297a48e6d1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3027039 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: DT: support BMI260Hyungwoo Yang2021-03-241-0/+20
| | | | | | | | | | | | | | | | | | This change is to support BMI260 via DT. The change includes, using DT, - creating BMI260 driver specific data - creating motion sensor entry for BMI260 - creating the BMI260 irq event to motion sense task BUG=b:173507858 BRANCH=none TEST=make buildall -j8 build volteer on zephyr Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Change-Id: Id5c64df4d2f14a50709ac15855567a67671b8515 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2778821 Reviewed-by: Simon Glass <sjg@chromium.org>
* No init.rom section support in ZephyrHyungwoo Yang2021-01-221-1/+1
| | | | | | | | | | | | | | | | | Building zephyr generates a warning on init.rom section. This change removes init.rom section declaration in Zephyr build. The change also added third_party into include folders so files in third_party now can be included in Zephyr build. BUG=b:173508071 BRANCH=none TEST=make BOARD=volteer -j8 build volteer on zephyr Change-Id: Ic86866e41d87d83c00a06a207a352a25fe57054b Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638135 Reviewed-by: Keith Short <keithshort@chromium.org>
* Zephyr: Create public headers for bmi260, bma2x2, and tcs3400Hyungwoo Yang2021-01-201-3/+2
| | | | | | | | | | | | | | | Separate out the public part of sensor headers so it can be included from Zephyr. BUG=b:175434113 BRANCH=none TEST=make buildall -j8 build volteer on zephyr Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Change-Id: I899e9aea99d6c7d56a1b6735538b280fe0735313 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637251 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-141-2/+1
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* motion_sense: Make change in range permanentGwendal Grignou2020-11-121-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | When AP changes range, unlike offset or ODR, it was not surviving init() call. If the sensor is powered off in S3, at resume the range would be back to the default. To make it consistent with other attributes, remember range change until EC powers down. - remove get_range - add current_range to store the range currently used. This is modifiable by the AP - when the AP shutdown, revert current_range to default_range - Remove const attribute for sensor structure when init and set_range is called. BUG=chromium:1083791 BRANCH=none TEST=One eve branch, check range is preserved even after 'shutdown -h 0' Change-Id: Ia7126ac0cc9c3fef60b4464d95d6dd15e64b0fc4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2215751 Reviewed-by: Yuval Peress <peress@chromium.org>
* driver: bmi260: Use IS_ENABLED()Gwendal Grignou2020-11-061-27/+23
| | | | | | | | | | | | | | Add IS_ENABLED() instead of #ifdef when possible in bmi260 and bmi_common. BUG=chromium:1140877 BRANCH=none TEST=buildall Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: If8e36ed2a527e8a4ac9582a7b30fe7f7ff589a30 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2489461 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
* driver: bmi: remove unnecessary msleep()Gwendal Grignou2020-10-201-3/+0
| | | | | | | | | | | | | | | | 1ms sleep after every write is not necessary. The only place it is is at init time and it is taken care of. Remove unused function. Remove sleep when ODR changes, it causes EC to stall. BUG=b:170155773 BRANCH=hatch, zork TEST=On volteer check hardware.SensorRing passes continuously. Change-Id: I5fd06c9cd6a79ee6cc7f92c448e18fb71a906184 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2483357 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
* driver: bmi: add get_rms_noise() for body detectionChing-Kang Yen2020-09-031-0/+3
| | | | | | | | | | | | | | | | | | | We will need the amount of noise for body detection. The amount of noise in accelometer will depends on several thing, e.g., output data rate. Add get_rms_noise() function to get the root mean square of noise in BMI. BRANCH=None BUG=b:123434029 TEST=buildall Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: Ia56bbd2cdb36bee771beb9df32451d3e56f4f028 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2329112 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Heng-ruey Hsu <henryhsu@chromium.org>
* bmi260: back out support for compressed config fileKeith Short2020-08-211-165/+6
| | | | | | | | | | | | | | | | | Now that the BMI260 config file can be moved to the .init_rom section, the simple compression scheme is no longer needed. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=Verify BMI260 operation on both volteer and volteer_tcpmv1 builds using "ectool motionsense lid_angle". Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I83bbaadcd3dade2d585b771b6b9ebae7e9fdc0cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2354194 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* bmi260: move BMI260 init file into .init.rom sectionKeith Short2020-08-201-16/+64
| | | | | | | | | | | | | | | | | | | | | Increases Volteer RO and RW flash spaces by 7088 bytes each. This is the net gain after including the init_rom layer. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=On volteer run "ectool motionsense" and "ectool motionsense lid_angle". Verify both RO and RW images. TEST=Program RO image with predecessor CL:2311268. Program this CL into AP firmware image and verify EC software sync updates to RW image. TEST=Verify BMI260 operation with CONFIG_CHIP_INIT_ROM_REGION disabled using volteer_tcpmv1 board. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6849b6c9e96756266528b39ab5e53268dce2a13c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311756 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
* bmi260: Add support for using compressed configKeith Short2020-07-101-11/+190
| | | | | | | | | | | | | | | | | | | | Add a new config option CONFIG_ACCELGYRO_BMI160_COMPRESSED_CONFIG for boards that need to save space. This is intended to be a temporary option until the BMI260 config file can be read from the AP at runtime. This option saves 916 bytes in RW flash space on Volteer. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=boot Volteer, run "ectool motionsense" to verify sensor data is valid. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I294e5e0c3f919527b51e6f7361e74c7bf4afc543 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2289216 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* driver: Add BMI260 basic driver supportChing-Kang Yen2020-04-231-0/+512
Add BMI260 accel/gyro driver code. Be able to do initial configuration, start up sensor, config interrupt and fifo, perform calibration, and access the sensor data from AP. BRANCH=None BUG=b:146144827 TEST=make -j4 BOARD=volteer \ && flash_ec --image build/volteer/ec.bin --board volteer Then, check sensor data is available on DUT by "ectool motionsense". TEST=make buildall -j TEST=tast run ${IP} hardware.SensorRing Cq-Depend: chromium:2148802 Change-Id: I5124ee8359a74f98cfe8d26da640325f5e00cb15 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086534 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>