summaryrefslogtreecommitdiff
path: root/zephyr/include/emul/emul_isl923x.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* emul: Correct func docs using i2c_common_emul_dataAaron Massey2022-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | When migrating to the new emulator API there were many functions replaced with ones that either required an i2c_common_emul_data pointer argument or returned one. However, the docstrings for some of these functions never got updated during the migration. Update the function docstrings to accurately describe what they actually do. BRANCH=none BUG=b:243179523 TEST=Examined header files containing "i2c_common_emul_data" TEST=./twister --clobber -T zephyr/test Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I0e67d6f64ff4b5e079c950b895a4a06b9ea092d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3843104 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* emul: Migrate from unnecessary i2c_emul changesAaron Massey2022-08-141-5/+4
| | | | | | | | | | | | | | | | | | | | | Cleanup existing usages and corresponding dependencies on modifying instances of struct i2c_emul so they do not serve as bad code examples for future emulator development. Remove reliance on setting these fields from emulators and tests alike. This includes migrating where we rely on i2c_emul internal fields to get a pointer to an emulator to using the EMUL_DT_GET macro. BRANCH=none BUG=b:241981636 TEST=twister -T ec/zephyr/test/ Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I0ed864eee0795465ed4d54d498199b95f7fddc62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3821052 Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* zephyr: test: Migrate to upstream emulator APIAaron Massey2022-08-011-1/+10
| | | | | | | | | | | | | | | | | Migrate the existing emulators and tests to use the new upstream emulator API. Majority of these changes was the removal of struct i2c_emul usages in favor of direct usages of struct emul. BRANCH=none BUG=b:240291860 TEST=zmake test -a Signed-off-by: Aaron Massey <aaronmassey@google.com> Cq-Depend: chromium:3776856 Change-Id: I09c509ffc34ac3b28fbd4dece0acebcc36cc0932 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3781964 Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Yuval Peress <peress@google.com>
* zephyr: add a zephyr/ prefix to all zephyr includesFabio Baltieri2022-05-091-3/+3
| | | | | | | | | | | | | | | | | | | This adds a zephyr/ prefix to all #include path pointing to Zephyr header files, so that we could drop LEGACY_INCLUD_PATH once all upstream code has been converted. Generated using something similar to the script in: c7b5b3c419 samples: migrate includes to contain <zephyr/...> prefix BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I5ba2c859fe10a34ea8d3a49a612132ea4d02f2cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3634345 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: drivers: Add rule to reset emulated to registersAl Semjonovs2022-03-101-1/+1
| | | | | | | | | | | | | | | Reset emulated registers to successful state after each test BRANCH=none BUG=b:184856906 TEST=zmake testall Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: I2ee77a15a94a176fc7b67d1284ff1d3386b2357b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3459741 Reviewed-by: Tristan Honscheid <honscheid@google.com> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr test: Set ISL923x in natural unitsAbe Levkoy2022-01-311-3/+2
| | | | | | | | | | | | | | Accept voltage in mV as an argument to isl923x_emul_set_adc_vbus. Test using this interface. BUG=b:216497851 TEST=zmake testall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I8a0ec6019f1d4ef7853d731b11726e4fb1bdf136 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3425638 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: emul: use non-deprecated includesAaron Massey2022-01-241-1/+1
| | | | | | | | | | | | | Drop usage of deprecated <emul.h> for <drivers/emul.h> BRANCH=none BUG=none TEST=zmake configute --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I9e221f44fa3b70305916914c0bbeed21b6a6bed8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3413067 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: emul: ISL923x upgradesTristan Honscheid2021-12-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | Make some improvements to the ISL923x emulator for upcoming unit tests * Add support for new registers: * Min. voltage reg * Control 4 * Control 8 * Info 2 * Use macros in the read/write reg functions to cut down on a lot of repeated code * Add a function for manipulating the AC OK status BRANCH=None BUG=b:184856906 TEST=zmake -D configure --test test-drivers; Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I67e9f21ce3903726f87f23c1b2d4e24965d1371f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3327328 Reviewed-by: Sam Hurst <shurst@google.com>
* zephyr: test: isl923x::initYuval Peress2021-10-051-0/+7
| | | | | | | | | | | | | | | | Test the remaining (failure/uncommon) code paths in init(). This includes a mocking of the system_jumped_late function which was already stubbed to always return false. This mock will later need to be cleaned up with a better mock to avoid the custom struct added. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I1be53b0a15850d8b97b7b5a96ccef764f0782816 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201916 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: test: isl923x::get_vbus_voltageYuval Peress2021-10-051-0/+9
| | | | | | | | | | | | | | Verify all the code paths in get_vbus_voltage (including calculated mV value). BRANCH=none BUG=b:201819565 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I508880a8af30c2d546655424b289d521f3c22626 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201915 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: isl923x AC prochotYuval Peress2021-10-051-1/+10
| | | | | | | | | | | | | Verify setting the prochot amps as well as edge conditions BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I306adf1d74eea65a8522c61e5ed71cf8deacfe2a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200054 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: test: isl923x::set_mode always turns off learn modeYuval Peress2021-10-051-0/+17
| | | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ic2481c0de52268cc65475de8e79f1db7834358d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198686 Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: test: verify isl923x device ID code pathYuval Peress2021-10-021-0/+9
| | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I08b24d571e0b27fd7fc5f644efdba18c5a639128 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198237 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: test: verify isl923x manufacturer ID code pathYuval Peress2021-10-021-0/+9
| | | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I2000ea7ea73a311184c5f66c3aa16518261b065d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198236 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: test: isl923x: Test input current get/setYuval Peress2021-10-021-0/+13
| | | | | | | | | | | | | | Test all the code paths for the get/set input current of the isl923x. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I452690a4087c97b67e75bad23e1b82e5b3dc366a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198235 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: test: Add stub isl923x emulatorYuval Peress2021-10-011-0/+9
Add the skeleton code needed to emulate the isl923x charger. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ic9af555ccd7ff6a0be2e7a0818b5e566816a0c13 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3195202 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>