summaryrefslogtreecommitdiff
path: root/zephyr/test/hooks/hooks.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge remote-tracking branch cros/main into factory-brya-14517.B-main"factory-brya-14517.B-mainYH Lin2022-12-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit af25602b15b22b9ef5821dcba9934311f2157c48. Reason for revert: broken build due to ec-utils. Original change's description: > Merge remote-tracking branch cros/main into factory-brya-14517.B-main > > Generated by: util/update_release_branch.py --baseboard brya --relevant_paths_file > baseboard/brya/relevant-paths.txt factory-brya-14517.B-main > > Relevant changes: > > git log --oneline 54462f034b..aa40b859b3 -- baseboard/brya board/agah > board/anahera board/banshee board/brya board/crota board/felwinter > board/gimble board/kano board/mithrax board/osiris board/primus > board/redrix board/taeko board/taniks board/vell board/volmar > driver/bc12/pi3usb9201_public.* driver/charger/bq25710.* > driver/ppc/nx20p348x.* driver/ppc/syv682x_public.* > driver/retimer/bb_retimer_public.* driver/tcpm/nct38xx.* > driver/tcpm/ps8xxx_public.* driver/tcpm/tcpci.* include/power/alderlake* > include/intel_x86.h power/alderlake* power/intel_x86.c > util/getversion.sh > > e6da633c38 driver: Sort header files > 234a87ae2d tcpci: Add FRS enable to driver structure > a56be59ccd tcpm_header: add test for tcpm_dump_registers > 57b3256963 Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMIT > e420c8ff9a marasov: Modify TypeC and TypeA configuration. > 43b53e0045 Add default implementation of board_set_charge_limit > b75dc90677 Add CONFIG_CHARGER_MIN_INPUT_CURRENT_LIMIT > f1b563c350 baseboard: Sort header files > 7d01b1e58d driver/retimer/ps8818.h: Add I2C ADDR FLAGS 0x30, 0x58, 0x70 > ec31407993 Add CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT > 8f89f69a5b crota: disable lid angle sensor for clamshell > > BRANCH=None > BUG=b:259002141 b:255184961 b:247100970 b:259354679 b:260630630 > BUG=b:163093572 b:254328661 > TEST=`emerge-brya chromeos-ec` > > Force-Relevant-Builds: all > Change-Id: Ia85a701fbf6b8e67ec214b9e25e0e55e980a6f47 > Signed-off-by: YH Lin <yueherngl@google.com> Bug: b:259002141 b:255184961 b:247100970 b:259354679 b:260630630 Bug: b:163093572 b:254328661 Change-Id: I48d5aa4cc67a69ee1f6ac9255ac3087d34da4c72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4077248 Tested-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Auto-Submit: YH Lin <yueherngl@chromium.org>
* zephyr/test: Sort header filesJeremy Bettis2022-11-151-3/+4
| | | | | | | | | | | | | | | | | | | Sort all headers in zephyr/test with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=CQ Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I2428eea11e18ee4bed6bc366fd69d4254d936c10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4022253 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: add all missing include/ prefixesFabio Baltieri2022-08-041-1/+1
| | | | | | | | | | | | | | | Add all the missing include/ prefixes to the various #include around the zephyr tests so that they build with LEGACY_INCLUDE_PATH=n. BRANCH=none BUG=none TEST=zmake testall Cq-Depend: chromium:3807663 Change-Id: I81cea4f291eea61e674ef2fa61bdc60407c5f142 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3810411 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr:test: Convert hooks tests to new ZTEST APIAl Semjonovs2022-07-281-19/+8
| | | | | | | | | | | | | | Enable ZTEST_NEW_API for hooks tests BUG=b:240343507 BRANCH=NONE TEST=./twister -T zephyr/test/hooks; zmake test test-hooks Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Id54117cfe806339e58594aab68d7c103ebc6f352 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3792314 Commit-Queue: Tristan Honscheid <honscheid@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr/test/hooks/hooks.c: Format with clang-formatJack Rosenthal2022-06-281-10/+8
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I9fcee8dcf57e0b53dd3662794d5559a6e218a1f2 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730961 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Add unit tests for AP power eventsAndrew McRae2022-03-141-1/+60
| | | | | | | | | | | | | | Add unit tests for AP power event notifications. BUG=b:201000950 TEST=zmake configure --test test-ap_power BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Cq-Depend: chromium:3509611 Change-Id: I17d03e3b6a2e5e28f6001dd240d68346a961c84a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3518774 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* zephyr: hooks: use k_work_reschedule to schedule deferred tasksJack Rosenthal2021-09-081-6/+0
| | | | | | | | | | | | | | | | k_work_reschedule will reschedule a work item if it's already been scheduled. Switching from k_work_schedule to k_work_reschedule fixes us the hooks test snag we saw during the v2.6 uprev. BUG=b:195971523 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I66f6bbad1cd39847e68a178165c9c59922abbb7c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144378 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: switch posix-ec and host tests to v2.6Jack Rosenthal2021-08-101-0/+6
| | | | | | | | | | | | | | | | Switch the host tests and posix-ec build to Zephyr v2.6. Note: need to disable one assert in the hooks test until b/195971523 is resolved. BUG=b:195571108,b:195971523 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I01b386b2f54cf5b752bede707ff9fbda0faad80a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3072414 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: hooks test: bump DEFERRED_DELAY_USJack Rosenthal2021-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently 250ms is too sensitive for Zephyr v2.6 and the test fails: *** Booting Zephyr OS build zephyr-v2.6.0-77-g656dcdda8d73 *** Running test suite hooks_tests =================================================================== START - test_hook_list_multiple PASS - test_hook_list_multiple in 0.0 seconds =================================================================== START - test_hook_list_single PASS - test_hook_list_single in 0.0 seconds =================================================================== START - test_hook_list_empty PASS - test_hook_list_empty in 0.0 seconds =================================================================== START - test_deferred_func PASS - test_deferred_func in 0.510 seconds =================================================================== START - test_deferred_func_push_out Assertion failed at CMAKE_SOURCE_DIR/hooks.c:116: test_deferred_func_push_out: (deferred_func_2_called is true) The deferred function was called, but should not have been FAIL - test_deferred_func_push_out in 0.510 seconds =================================================================== START - test_deferred_func_cancel PASS - test_deferred_func_cancel in 0.510 seconds =================================================================== Test suite hooks_tests failed. =================================================================== PROJECT EXECUTION FAILED Bump to 500ms so we can support Zephyr v2.6. BUG=b:195571108 BRANCH=none TEST=passes on both v2.5 and v2.6 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Id090fe9e678c9f168e3a1c3f90f048089a638fff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3072416 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: add defer cancelingWealian Liao2021-03-101-1/+23
| | | | | | | | | | | | | | | | For the description of hook_call_deferred() in hooks.h, pass delay time -1 to hook_call_deferred() should cancel the deferred call. Add canceling to sync the original behavior in shim hook. BRANCH=none BUG=none TEST=zmake testall TEST=check defer is canceled by ` -1 ` parameter. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I3e9743d5c19efbc8619fd5cbd61ff247db700af9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738912 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim in hooks and deferredJack Rosenthal2020-11-051-0/+134
Implement deferred calls using the Zephyr's delayed work queues. Implement hooks using SYS_INIT and a hooks registry created during init. BUG=b:168030971 BRANCH=none TEST=provided unit tests Build instructions for unit tests: zmake configure -B/tmp/test \ ~/trunk/src/platform/ec/zephyr/test/hooks zmake build /tmp/test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Id019cd1fe7bb3354377773d171036767e7efa706 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2504489 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>