Add EC clang format file

To aid in migration to EC code base, adopt the EC clang format
rules.

BUG=b:319124515
TEST=None

Change-Id: If612c3df7db8b8c8226a4dcea99813f16292cf5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/usb/um_ppm/+/5255579
Tested-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
1 file changed
tree: 76813f91f0620408efc5a6c886cc2e71571d6aa9
  1. include/
  2. test/
  3. .clang-format
  4. .gitignore
  5. LICENSE
  6. main.c
  7. Makefile
  8. platform_usermode.c
  9. ppm_common.c
  10. ppm_common.h
  11. README.md
  12. rts5453.c
  13. rts5453.h
  14. rts5453_usermode.c
  15. smbus_usermode.c
  16. smbus_usermode.h
  17. um_ppm_chardev.c
  18. um_ppm_chardev.h
README.md

Usermode PPM implementation

Usermode UCSI PPM implementation for evaluation and testing usage. Try using this with the ucsi_um_test kernel driver.

Setup

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

Architecture

┌─────────┐
│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.