Lines Matching +full:dead +full:- +full:battery
3 * SPDX-License-Identifier: Apache-2.0
8 * @brief USB Type-C Power Path Controller device API
25 /** Exit from dead-battery mode failed */
71 * @brief Check if PPC is in the dead battery mode
74 * @retval 1 if PPC is in the dead battery mode
75 * @retval 0 if PPC is not in the dead battery mode
76 * @retval -EIO if I2C communication failed
77 * @retval -ENOSYS if this function is not supported by the driver
81 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_is_dead_battery_mode()
83 if (api->is_dead_battery_mode == NULL) { in ppc_is_dead_battery_mode()
84 return -ENOSYS; in ppc_is_dead_battery_mode()
87 return api->is_dead_battery_mode(dev); in ppc_is_dead_battery_mode()
91 * @brief Request the PPC to exit from the dead battery mode
92 * Return from this call doesn't mean that the PPC is not in the dead battery anymore.
94 * USBC_PPC_EVENT_DEAD_BATTERY_ERROR enum. To check if the PPC disabled the dead battery mode,
99 * @retval -EIO if I2C communication failed
100 * @retval -ENOSYS if this function is not supported by the driver
104 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_exit_dead_battery_mode()
106 if (api->exit_dead_battery_mode == NULL) { in ppc_exit_dead_battery_mode()
107 return -ENOSYS; in ppc_exit_dead_battery_mode()
110 return api->exit_dead_battery_mode(dev); in ppc_exit_dead_battery_mode()
119 * @retval -EIO if I2C communication failed
120 * @retval -ENOSYS if this function is not supported by the driver
124 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_is_vbus_source()
126 if (api->is_vbus_source == NULL) { in ppc_is_vbus_source()
127 return -ENOSYS; in ppc_is_vbus_source()
130 return api->is_vbus_source(dev); in ppc_is_vbus_source()
139 * @retval -EIO if I2C communication failed
140 * @retval -ENOSYS if this function is not supported by the driver
144 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_is_vbus_sink()
146 if (api->is_vbus_sink == NULL) { in ppc_is_vbus_sink()
147 return -ENOSYS; in ppc_is_vbus_sink()
150 return api->is_vbus_sink(dev); in ppc_is_vbus_sink()
159 * @retval -EIO if I2C communication failed
160 * @retval -ENOSYS if this function is not supported by the driver
164 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_set_snk_ctrl()
166 if (api->set_snk_ctrl == NULL) { in ppc_set_snk_ctrl()
167 return -ENOSYS; in ppc_set_snk_ctrl()
170 return api->set_snk_ctrl(dev, enable); in ppc_set_snk_ctrl()
179 * @retval -EIO if I2C communication failed
180 * @retval -ENOSYS if this function is not supported by the driver
184 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_set_src_ctrl()
186 if (api->set_src_ctrl == NULL) { in ppc_set_src_ctrl()
187 return -ENOSYS; in ppc_set_src_ctrl()
190 return api->set_src_ctrl(dev, enable); in ppc_set_src_ctrl()
199 * @retval -EIO if I2C communication failed
200 * @retval -ENOSYS if this function is not supported by the driver
204 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_set_vbus_discharge()
206 if (api->set_vbus_discharge == NULL) { in ppc_set_vbus_discharge()
207 return -ENOSYS; in ppc_set_vbus_discharge()
210 return api->set_vbus_discharge(dev, enable); in ppc_set_vbus_discharge()
219 * @retval -EIO if I2C communication failed
220 * @retval -ENOSYS if this function is not supported by the driver
224 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_is_vbus_present()
226 if (api->is_vbus_present == NULL) { in ppc_is_vbus_present()
227 return -ENOSYS; in ppc_is_vbus_present()
230 return api->is_vbus_present(dev); in ppc_is_vbus_present()
240 * @retval -ENOSYS if this function is not supported by the driver
245 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_set_event_handler()
247 if (api->set_event_handler == NULL) { in ppc_set_event_handler()
248 return -ENOSYS; in ppc_set_event_handler()
251 return api->set_event_handler(dev, handler, data); in ppc_set_event_handler()
259 * @retval -EIO if I2C communication failed
260 * @retval -ENOSYS if this function is not supported by the driver
264 const struct usbc_ppc_driver_api *api = (const struct usbc_ppc_driver_api *)dev->api; in ppc_dump_regs()
266 if (api->dump_regs == NULL) { in ppc_dump_regs()
267 return -ENOSYS; in ppc_dump_regs()
270 return api->dump_regs(dev); in ppc_dump_regs()