-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: regulator: add set callback API and driver for Nordic USB VBUS regulator #97642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: regulator: add set callback API and driver for Nordic USB VBUS regulator #97642
Conversation
The nodelabels do not have any relation to the Nordic MDK and can be named differently between SoCs. Signed-off-by: Johann Fischer <[email protected]>
We need to describe the wrapper separately as a parent node because it is not part of the USB controller but is used to configure, control, and enable/disable the USB PHY, and to enable/disable USB controller. Signed-off-by: Johann Fischer <[email protected]>
The regulator may generate an interrupt when, for example, the voltage is present. The callback can be used for USB VBUS voltage regulators to notify that a device is connected to a port. Signed-off-by: Johann Fischer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be implemented on top of aligned/extended nrfx_power_usb*
API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation of this reg in nrfx may help reach USB support in NCS bare metal option.
cc @lemrey
regulator: | ||
required: true | ||
type: phandle | ||
description: | | ||
USB PHY and controller function depends on the USB regulator VREGUSB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the nordic,nrf-usbhs-wrapper
also be used for nRF54H20? How would the nrfs be modelled then?
usbhs_wrapper: usbhs_wrapper@5a000 { | ||
compatible = "nordic,nrf-usbhs-wrapper"; | ||
reg = <0x5a000 0x1000>; | ||
regulator = <&vregusb>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you expand on what the wrapper does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In short USBHS wrapper provides a way to enable underlying DWC2 controller (core), enable power to both core and USB PHY, configure USB PHY and make it possible to get core and USB PHY out of reset.
Add driver for internal voltage regulator for the USB signaling interface. Signed-off-by: Johann Fischer <[email protected]>
PHY and controller function depends on VREGUSB. Add VREGUSB regulator node to nRF54LM20A and use phandle to reference it in the wrapper node. Signed-off-by: Johann Fischer <[email protected]>
Use Nordic VREGUSB regulator driver in DWC2 nRF54LM20A vendor quirks. Signed-off-by: Johann Fischer <[email protected]>
00ec840
to
3d7218b
Compare
|
*/ | ||
typedef void (*regulator_callback_t)(const struct device *dev, | ||
const struct regulator_event *const evt, | ||
const void *const user_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_data should not be const, see https://docs.zephyrproject.org/latest/develop/api/design_guidelines.html#using-callbacks
Add set callback to regulator API. The regulator may generate an interrupt when, for example, the voltage is present. The callback can be used for USB VBUS voltage regulators to notify that a device is connected to a port.
Add VREGUSB driver for internal voltage regulator for the USB signaling interface.