drivers: usb_c: vbus: Place API into iterable section
Add wrapper DEVICE_API macro to all usbc_vbus_driver_api instances. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
760027cdf6
commit
f52fc52ac1
3 changed files with 8 additions and 6 deletions
|
|
@ -191,7 +191,7 @@ static int adc_vbus_init(const struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static const struct usbc_vbus_driver_api driver_api = {
|
||||
static DEVICE_API(usbc_vbus, driver_api) = {
|
||||
.measure = adc_vbus_measure,
|
||||
.check_level = adc_vbus_check_level,
|
||||
.discharge = adc_vbus_discharge,
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static int numaker_vbus_enable(const struct device *dev, bool enable)
|
|||
return numaker_tcpc_vbus_enable(tcpc_dev, enable);
|
||||
}
|
||||
|
||||
static const struct usbc_vbus_driver_api numaker_vbus_driver_api = {
|
||||
static DEVICE_API(usbc_vbus, numaker_vbus_driver_api) = {
|
||||
.check_level = numaker_vbus_check_level,
|
||||
.measure = numaker_vbus_measure,
|
||||
.discharge = numaker_vbus_discharge,
|
||||
|
|
|
|||
|
|
@ -80,10 +80,12 @@ static int tcpci_enable(const struct device *dev, bool enable)
|
|||
(enable) ? 0 : TCPC_REG_POWER_CTRL_VBUS_VOL_MONITOR_DIS);
|
||||
}
|
||||
|
||||
static const struct usbc_vbus_driver_api vbus_tcpci_api = {.measure = tcpci_measure,
|
||||
static DEVICE_API(usbc_vbus, vbus_tcpci_api) = {
|
||||
.measure = tcpci_measure,
|
||||
.check_level = tcpci_check_level,
|
||||
.discharge = tcpci_discharge,
|
||||
.enable = tcpci_enable};
|
||||
.enable = tcpci_enable,
|
||||
};
|
||||
|
||||
static int tcpci_init(const struct device *dev)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue