commit | 2212ac3a03e8e253b340f9b42777ee646a57ad8e | [log] [tgz] |
---|---|---|
author | Abhishek Pandit-Subedi <abhishekpandit@google.com> | Wed Jan 17 21:07:20 2024 |
committer | Abhishek Pandit-Subedi <abhishekpandit@google.com> | Thu Jan 25 18:48:22 2024 |
tree | a4f92dc878aa229f8f7286b7cd81a5ff687df46f | |
parent | cad33a50eb6613d399666fe70848994d03b16b81 [diff] |
Update interrupt handling and smbus access The PD driver expects to access different chip addresses for different ports and per address values can be different for commands. This refactors the smbus and pd interfaces: * Add chip address parameter to smbus read/write commands. * Split poll_for_alert into block_for_interrupt and read_ara. * Support multiple ports in driver init. * Update Set Notification to send the command to multiple addresses. BUG=b:319124783, b:320579079 TEST=Ran um_ppm and verified both ports are working Change-Id: I898d9c118d5618605feab4481fd143e2cc08dc24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/usb/um_ppm/+/5231622 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.