Skip to content

drivers: tcpc: add FUSB302B TCPC driver#63479

Closed
ottojo wants to merge 7 commits intozephyrproject-rtos:mainfrom
ottojo:fusb302b
Closed

drivers: tcpc: add FUSB302B TCPC driver#63479
ottojo wants to merge 7 commits intozephyrproject-rtos:mainfrom
ottojo:fusb302b

Conversation

@ottojo
Copy link
Contributor

@ottojo ottojo commented Oct 3, 2023

This adds a driver for the onsemi FUSB302B USB Type-C controller IC, implementing a TCPC and VBUS-sensor.
This IC is present on the otterpill board introduced in #62830.

The driver is pretty minimal, intended to only implement the minimal subset of TCPC functionality required for requesting a higher voltage than 5V from a source.

For testing simplicity, this PR currently contains the otterpill board definition from #62830 as well.

Add OtterPill STM32F072 board configuration.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
@ottojo ottojo force-pushed the fusb302b branch 6 times, most recently from d8fb66d to 39c2eaa Compare October 4, 2023 15:08
ottojo added 2 commits October 4, 2023 23:16
This adds a USB Type-C Port Controller driver
for the FUSB302B chip.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
This adds a VBUS measurement driver
for the FUSB302B chip.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
This adds the builtin FUSB302B on the otterpill board to the devicetree.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
This adds an overlay for the otterpill board to the USB-C SINK sample.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
This adds an emulator for the fusb302b USB-PD IC.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
This adds an emulator for the VBUS part of the fusb302b USB-PD IC.

Signed-off-by: Jonas Otto <jonas@jonasotto.com>
@raveslave
Copy link

curious if anyone is using this?

@ottojo
Copy link
Contributor Author

ottojo commented Dec 6, 2023

To update the current status on this: The driver does work in that it can successfully request a specific voltage from a PD PSU, i didnt test any functionality beyond that.
There are some problems with reliability though, IIRC the continuous measurement of CC states seemed to interrupt communication with the PSU at times (since it meant connecting the measurement block in the chip to each CC one after another). It might be worth using the interrupt functionality of the FUSB302 and just storing the current state in the driver, instead of querying the chip often. (the interrupt functionality is not used at all in this driver currently)

That said, I was just working on that out of personal curiosity, and having the proper devboard laying around. I'm not planning on working on this more in the short term. The latest version of this is found in an OOT module, which i made for easier experimenting: https://github.com/ottojo/zephyr_fusb302b
If anyone wants to make a proper FUSB302 zephyr driver, feel free to use this as a starting point, but also know that there is a linux driver out there for example, which surely is a lot more mature and actually battle tested.

@ottojo ottojo closed this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants