commit | 88827905f8e26424fc61d9eb8ea80b5b9cde702e | [log] [tgz] |
---|---|---|
author | Abhishek Pandit-Subedi <abhishekpandit@google.com> | Fri Jan 05 18:26:06 2024 |
committer | Abhishek Pandit-Subedi <abhishekpandit@google.com> | Mon Jan 08 23:42:33 2024 |
tree | eb4ce36097f1adbe5c63537f7966f43587e2f646 | |
parent | 5acc8c11ccb4ffc313a4c463779e451e24d737d2 [diff] |
Add unit tests for common PPM The PPM unit test will be used to make sure the PPM state machine behaves correctly. This commit adds all the state machine test methods, fixtures, etc. but only implements the tests for the Idle state to start. BUG=b:303919041 TEST=make local_tests Change-Id: I6a0e7d6abd37f7761bd4264c7dda236069d571aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/usb/um_ppm/+/5174020 Reviewed-by: Jameson Thies <jthies@google.com> Tested-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>
Usermode UCSI PPM implementation for evaluation and testing usage. Try using this with the ucsi_um_test
kernel driver.
For usermode implementations, we use libi2c and libgpiod to provide an smbus implementation. You will need the right libraries to build:
sudo apt-get install libi2c-dev libgpiod-dev
┌─────────┐ │OPM │ │kernel or│ │cli │ └────┬────┘ │ │ ▼ ┌───────────┐ ┌────────┐ │ PD Driver │ │ ├────►│ │ │ PPM │ ├───────────┤ │ │ │ │ └────────┘ │ I2C Driver│ └───────────┘
The usermode ppm implementation consists of the PPM task, the PD driver and the I2C driver backing it. The OPM will either be a CLI (for locally triggering some functionality) or the ucsi_um_test
kernel module.