Commit 614ec58
fwk: Allow customizing CCG8 battery messages
Add data structures pd_battery_cap_t and pd_battery_status_t for sending
them to CCG8 to let it respond with the correct data to attached USB-C
devices.
The PD_CONTROL command 0x3D is used for both reading or writing PD
response message data. This command is used to write data into the CCGx
PD Controller internal memory that will be used to automatically respond
to the appropriate PD message requests. Or, the command can be used to
read the data out that has been previously written. Or, the command can
be used to delete response data that has been previously written.
Before writing the 0x3D command value to the PD_CONTROL register, a
structure of data should be stored in the HPI Write Data Memory area.
The structure of data defines the operation and what type of response
data will be read or written. When reading data, the data will be
returned attached to the 0x1E response value of the HPI_RESPONSE
register.
Based on HPI spec revT.
BUG=https://app.clickup.com/t/86eqqrpxk
BRANCH=fwk-lilac-27116
TEST=Can be tested by either Allion Lab or by connecting to another
Framework system with USB-C cable (or just left to right side,
differente PD controller) and then using the below EC commands.
```
> cypdctl verbose 1
[106.531310 verbose=1]
> cypdmsg 3 batterycap
[108.838891 sent extended message]
> [108.843688 PD Controller 1 Port 1 Code 0x02 Event Len: 0x00]
[108.847452 PD Controller 1 Port 1 Code 0xac Response Len: 0x0d]
Port:3 Data:0xa58b0900ac3201005e02580200
cypdmsg 3 batterystatus
[119.565269 sent extended message]
> [119.570445 PD Controller 1 Port 1 Code 0x02 Event Len: 0x00]
[119.575211 PD Controller 1 Port 1 Code 0xa2 Response Len: 0x08]
Port:3 Data:0xa51d000000060e01
cypdmsg 3 test
[138.066727 sent extended message]
> [138.072073 PD Controller 1 Port 1 Code 0x02 Event Len: 0x00]
[138.075480 PD Controller 1 Port 1 Code 0xa4 Response Len: 0x00]
```
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Kieran Levin <ktl@frame.work>
Co-authored-by: Daniel Schaefer <dhs@frame.work>
Co-authored-by: Kieran Levin <ktl@frame.work>1 parent 46dbf9c commit 614ec58
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
| 1479 | + | |
1479 | 1480 | | |
1480 | 1481 | | |
1481 | 1482 | | |
| |||
0 commit comments