summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/src/ps8xxx.c
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: test: move include files to scoped directoryYuval Peress2022-03-291-3/+3
| | | | | | | | | | | | | | | | The include path was getting too cluttered. In some cases seeing an include for "utils.h" and "util.h". These were difficult to understand, follow, and ensure uniqueness. Move all the test specific headers to their own path. BRANCH=none BUG=none TEST=zmake test test-drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Iab5e4d470321edb356c8b30f94c79b2ce1f38866 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3556801 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: test: Migrate drivers test to new ztest APIYuval Peress2022-01-251-136/+204
| | | | | | | | | | | | BRANCH=none BUG=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I3c62d8ad0f7ed472953bc5b159af042d502be79a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398954 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: drivers: Increase ticks per second in testsTomasz Michalec2022-01-211-7/+61
| | | | | | | | | | | | | | | | | | | | | Increase ticks per second to 10000 (10 ticks per ms) from 100. This allows to meassure delays of 1 ms and simulate time related behaviour better. PS8815 test is extended to check if delay of 1 ms is applied when role control register is written. This is workaround for some PS8815 HW revisions (b/171430855). BUG=b:203858808 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ib8b4b38c5994b4040b12225f28b628edf1278049 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3398505 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: drivers: Improve code coverage of ps8xxx.cAl Semjonovs2022-01-191-0/+10
| | | | | | | | | | | | | | Add test cases to improve code coverage of ps8xxx.c. BRANCH=none BUG=b:201602829 TEST=zmake -D configure --coverage --test zephyr/test/drivers/ Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Ie9e7677cb50c7e22bb6a7ae56cd3b8e6a4271e4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3383616 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: emul: Move TCPC emulators to sub directoryTomasz Michalec2021-12-161-2/+2
| | | | | | | | | | | | | | | | | | There are few emulators related to TCPC and each other and new are expected to be created. Because of that, zephyr/emul/tcpc/ subdirectory is created to keep these emulators in one place. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ida4903dd4ab9307f6783af8e14ae99d25ec76edb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3330197 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* ps8xxx: disable low power mode for PS8815Scott Chao2021-11-191-1/+8
| | | | | | | | | | | | | | | | | | | | Don't send TCPC_REG_COMMAND_I2CIDLE to PS8815 since it will enter sleep mode by itself. Also skip the zephyr "tcpc low power mode" test on PS8751/PS8815. BUG=b:206553720 BRANCH=none TEST=make -j BOARD=gimble TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: If49079e30137bc08125c8b58c0a535efd4e9931f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3282971 Tested-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* zephyr: drivers: Add PS8xxx generic TCPCI testsTomasz Michalec2021-10-281-0/+193
| | | | | | | | | | | | | | | | Run generic TCPCI with PS8xxx emulator. These tests makes sure that PS8xxx driver is using gneric layer correctly. BUG=b:184857030 BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6645430222f527a5812fe081c4616f984f520897 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3247177 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: drivers: Add PS8815 unit testsTomasz Michalec2021-10-281-8/+291
| | | | | | | | | | | | | | | | | | | | | This patch adds unit tests for code of PS8xxx driver that is specific for PS8815 device. Config to enable PS8815 and multiple PS8xxx devices is added. Drivers stubs.c is extended with board_get_ps8xxx_product_id() and board_set_ps8xxx_product_id() to allow test to select which PS8xxx variant is tested. BUG=b:184857030 BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I2580c3ac8b54cf1dad9605a7c918735d36ab2ad1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3236728 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: drivers: Add PS8805 unit testsTomasz Michalec2021-10-281-0/+345
| | | | | | | | | | | | | | | | This patch adds unit tests for code of PS8xxx driver that is specific for PS8805 device. BUG=b:184857030 BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Id61f8de697aecfab7f784fce6ca8d9816140cfd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3236727 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: drivers: Add PS8xxx unit testsTomasz Michalec2021-10-281-0/+295
This patch adds unit tests for code of PS8xxx driver that is used for all devices. PS8805 is first device from PS8xxx family which will be tested. All devices that are used for USBC port 1 are moved to i2c1 emulated bus, because addresses required for PS8805 are not available on i2c0 bus. BUG=b:184857030 BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I0f146847c038014258e517c82b3268f42079efc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3236726 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>