tps6598x: add spmi transport#594
Conversation
d70e31e to
48791d5
Compare
877ed68 to
98fe907
Compare
svenpeter42
left a comment
There was a problem hiding this comment.
just a quick glance, will take a look at the rest probably on the weekend
| return -1; | ||
| if (val == reg) | ||
| break; | ||
| if (val != (reg | 0x80)) |
There was a problem hiding this comment.
do you know what 0x80 means here? please #define these magic numbers here (and further below) if possilbe
| if (dev->spmi) { | ||
| if (tps6598x_spmi_select_reg(dev, reg) < 0) | ||
| return -1; | ||
| if (spmi_ext_write(dev->spmi, dev->addr, 0xa0, data, len) < 0) |
| if (dev->spmi) { | ||
| if (tps6598x_spmi_select_reg(dev, reg) < 0) | ||
| return -1; | ||
| if (spmi_ext_read(dev->spmi, dev->addr, 0x20, data, len) < 0) |
98fe907 to
b45b553
Compare
|
Updated with defines for the offsets. According to https://asahilinux.org/docs/hw/peripherals/ace3/, 0xa0 is an alias to 0x20, so I'm re-using that as TPS_SPMI_REG_DATA. |
a830196 to
b44e722
Compare
|
Marked as draft because something is weird with commands which take >1 byte params, like LOCK |
e4165c4 to
325af1b
Compare
fad5f08 to
f719680
Compare
|
Rebased and marked ready, as USE_DEBUG_USB is working on the J700 / MacBook Neo! |
7f8d34d to
c66784d
Compare
|
i'm a bit confused why there are rust changes in this PR now, I don't see them used anywhere. |
Those look like they were accidentally pulled from #614 somehow |
| int it = mngr_node; | ||
| ADT_FOREACH_CHILD(adt, it) | ||
| { | ||
| if (adt_is_compatible(adt, it, "usbc,cd3217")) |
There was a problem hiding this comment.
maybe it's too late or too hot but I can't really follow what's going on here anymore. can you maybe add a few comments? or maybe split this out into multiple functions?
I think this should be !adt_is_compatible though
|
The Rust changes were required for adt_is_compatible not to crash when running on nodes without a compatible prop (which is the case on some first-children of i2c nodes on M4+ devices). They're now already merged into main (through #614). I will make this into a draft again, because I need to add a check for spmi gen4+ first, otherwise it will crash M5+ devices while trying to initialize the hpm. |
Signed-off-by: Yureka <yureka@cyberchaos.dev>
Signed-off-by: Yureka <yureka@cyberchaos.dev>
Signed-off-by: Yureka <yureka@cyberchaos.dev>
c66784d to
326b79f
Compare
Signed-off-by: Yureka <yureka@cyberchaos.dev>
326b79f to
d5ce749
Compare
No description provided.