Conversation
d6876ed to
01bb482
Compare
svenpeter42
left a comment
There was a problem hiding this comment.
Looks good to me except for a few very minor comments
src/spmi.c
Outdated
| #define SPMI_STATUS_TX_EMPTY BIT(8) | ||
| #define SPMI_STATUS_TX_COUNT GENMASK(7, 0) | ||
|
|
||
| #define SPMI_CMD__RESET 0x10 |
There was a problem hiding this comment.
that double __ is a bit unusual but I can't thing of a better name schema here either.
There was a problem hiding this comment.
yeah, same... I think I'll change it to SPMI_OPCODE_ (or SPMI_OPC_) which is what Linux uses (well, Linux uses it for the name of the parameter in methods, not for the constants, but...)
There was a problem hiding this comment.
added a commit with the rename, let me know if it's okay or you prefer something else (or if you want the commit squashed into the previous ones)
There was a problem hiding this comment.
please squash the commit and then i'm going to merge this. you can ignore the pytest CI failure fwiw
b561120 to
3e7d39c
Compare
- refactor into a single raw_command method for simplicity - add timeout when waiting for RX data - implement all slave commands, including the rest of the register access commands (this is necessary for the USB-PD controller, which REQUIRES a reg 0 write command specifically. if written using any other command, it will appear to work but the other registers won't be updated) - parse and check replies (check command / slave, padding, frame parity) - validate command inputs Signed-off-by: Alba Mendez <me@alba.sh>
(especially interrupts) Signed-off-by: Alba Mendez <me@alba.sh>
a straightforward translation of the Python version in hw.spmi, but I was too lazy to implement all of the commands Signed-off-by: Alba Mendez <me@alba.sh>
3e7d39c to
dea7461
Compare
expands the Python driver / regmaps with many of the things in AsahiLinux/docs#225 and implements the basic functionality as a C driver