Lines Matching refs:dev

121 typedef int (*tcpc_vconn_control_cb_t)(const struct device *dev, enum tc_cc_polarity pol,
123 typedef int (*tcpc_vconn_discharge_cb_t)(const struct device *dev, enum tc_cc_polarity pol,
125 typedef void (*tcpc_alert_handler_cb_t)(const struct device *dev, void *data,
129 int (*init)(const struct device *dev);
130 int (*get_cc)(const struct device *dev, enum tc_cc_voltage_state *cc1,
132 int (*select_rp_value)(const struct device *dev, enum tc_rp_value rp);
133 int (*get_rp_value)(const struct device *dev, enum tc_rp_value *rp);
134 int (*set_cc)(const struct device *dev, enum tc_cc_pull pull);
135 void (*set_vconn_discharge_cb)(const struct device *dev, tcpc_vconn_discharge_cb_t cb);
136 void (*set_vconn_cb)(const struct device *dev, tcpc_vconn_control_cb_t vconn_cb);
137 int (*vconn_discharge)(const struct device *dev, bool enable);
138 int (*set_vconn)(const struct device *dev, bool enable);
139 int (*set_roles)(const struct device *dev, enum tc_power_role power_role,
141 int (*get_rx_pending_msg)(const struct device *dev, struct pd_msg *msg);
142 int (*set_rx_enable)(const struct device *dev, bool enable);
143 int (*set_cc_polarity)(const struct device *dev, enum tc_cc_polarity polarity);
144 int (*transmit_data)(const struct device *dev, struct pd_msg *msg);
145 int (*dump_std_reg)(const struct device *dev);
146 void (*alert_handler_cb)(const struct device *dev, void *data, enum tcpc_alert alert);
147 int (*get_status_register)(const struct device *dev, enum tcpc_status_reg reg,
149 int (*clear_status_register)(const struct device *dev, enum tcpc_status_reg reg,
151 int (*mask_status_register)(const struct device *dev, enum tcpc_status_reg reg,
153 int (*set_debug_accessory)(const struct device *dev, bool enable);
154 int (*set_debug_detach)(const struct device *dev);
155 int (*set_drp_toggle)(const struct device *dev, bool enable);
156 int (*get_snk_ctrl)(const struct device *dev);
157 int (*set_snk_ctrl)(const struct device *dev, bool enable);
158 int (*get_src_ctrl)(const struct device *dev);
159 int (*set_src_ctrl)(const struct device *dev, bool enable);
160 int (*get_chip_info)(const struct device *dev, struct tcpc_chip_info *chip_info);
161 int (*set_low_power_mode)(const struct device *dev, bool enable);
162 int (*sop_prime_enable)(const struct device *dev, bool enable);
163 int (*set_bist_test_mode)(const struct device *dev, bool enable);
164 int (*set_alert_handler_cb)(const struct device *dev, tcpc_alert_handler_cb_t handler,
234 static inline int tcpc_init(const struct device *dev) in tcpc_init() argument
236 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_init()
240 return api->init(dev); in tcpc_init()
254 static inline int tcpc_get_cc(const struct device *dev, enum tc_cc_voltage_state *cc1, in tcpc_get_cc() argument
257 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_cc()
263 return api->get_cc(dev, cc1, cc2); in tcpc_get_cc()
276 static inline int tcpc_select_rp_value(const struct device *dev, enum tc_rp_value rp) in tcpc_select_rp_value() argument
278 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_select_rp_value()
284 return api->select_rp_value(dev, rp); in tcpc_select_rp_value()
297 static inline int tcpc_get_rp_value(const struct device *dev, enum tc_rp_value *rp) in tcpc_get_rp_value() argument
299 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_rp_value()
305 return api->get_rp_value(dev, rp); in tcpc_get_rp_value()
317 static inline int tcpc_set_cc(const struct device *dev, enum tc_cc_pull pull) in tcpc_set_cc() argument
319 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_cc()
323 return api->set_cc(dev, pull); in tcpc_set_cc()
336 static inline void tcpc_set_vconn_cb(const struct device *dev, tcpc_vconn_control_cb_t vconn_cb) in tcpc_set_vconn_cb() argument
338 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_vconn_cb()
342 api->set_vconn_cb(dev, vconn_cb); in tcpc_set_vconn_cb()
355 static inline void tcpc_set_vconn_discharge_cb(const struct device *dev, in tcpc_set_vconn_discharge_cb() argument
358 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_vconn_discharge_cb()
362 api->set_vconn_discharge_cb(dev, cb); in tcpc_set_vconn_discharge_cb()
378 static inline int tcpc_vconn_discharge(const struct device *dev, bool enable) in tcpc_vconn_discharge() argument
380 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_vconn_discharge()
386 return api->vconn_discharge(dev, enable); in tcpc_vconn_discharge()
402 static inline int tcpc_set_vconn(const struct device *dev, bool enable) in tcpc_set_vconn() argument
404 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_vconn()
410 return api->set_vconn(dev, enable); in tcpc_set_vconn()
426 static inline int tcpc_set_roles(const struct device *dev, enum tc_power_role power_role, in tcpc_set_roles() argument
429 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_roles()
435 return api->set_roles(dev, power_role, data_role); in tcpc_set_roles()
451 static inline int tcpc_get_rx_pending_msg(const struct device *dev, struct pd_msg *buf) in tcpc_get_rx_pending_msg() argument
453 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_rx_pending_msg()
457 return api->get_rx_pending_msg(dev, buf); in tcpc_get_rx_pending_msg()
471 static inline int tcpc_set_rx_enable(const struct device *dev, bool enable) in tcpc_set_rx_enable() argument
473 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_rx_enable()
479 return api->set_rx_enable(dev, enable); in tcpc_set_rx_enable()
491 static inline int tcpc_set_cc_polarity(const struct device *dev, enum tc_cc_polarity polarity) in tcpc_set_cc_polarity() argument
493 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_cc_polarity()
497 return api->set_cc_polarity(dev, polarity); in tcpc_set_cc_polarity()
510 static inline int tcpc_transmit_data(const struct device *dev, struct pd_msg *msg) in tcpc_transmit_data() argument
512 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_transmit_data()
518 return api->transmit_data(dev, msg); in tcpc_transmit_data()
530 static inline int tcpc_dump_std_reg(const struct device *dev) in tcpc_dump_std_reg() argument
532 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_dump_std_reg()
538 return api->dump_std_reg(dev); in tcpc_dump_std_reg()
554 static inline int tcpc_set_alert_handler_cb(const struct device *dev, in tcpc_set_alert_handler_cb() argument
557 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_alert_handler_cb()
561 return api->set_alert_handler_cb(dev, handler, data); in tcpc_set_alert_handler_cb()
575 static inline int tcpc_get_status_register(const struct device *dev, enum tcpc_status_reg reg, in tcpc_get_status_register() argument
578 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_status_register()
584 return api->get_status_register(dev, reg, status); in tcpc_get_status_register()
599 static inline int tcpc_clear_status_register(const struct device *dev, enum tcpc_status_reg reg, in tcpc_clear_status_register() argument
602 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_clear_status_register()
608 return api->clear_status_register(dev, reg, mask); in tcpc_clear_status_register()
623 static inline int tcpc_mask_status_register(const struct device *dev, enum tcpc_status_reg reg, in tcpc_mask_status_register() argument
626 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_mask_status_register()
632 return api->mask_status_register(dev, reg, mask); in tcpc_mask_status_register()
645 static inline int tcpc_set_debug_accessory(const struct device *dev, bool enable) in tcpc_set_debug_accessory() argument
647 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_debug_accessory()
653 return api->set_debug_accessory(dev, enable); in tcpc_set_debug_accessory()
665 static inline int tcpc_set_debug_detach(const struct device *dev) in tcpc_set_debug_detach() argument
667 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_debug_detach()
673 return api->set_debug_detach(dev); in tcpc_set_debug_detach()
686 static inline int tcpc_set_drp_toggle(const struct device *dev, bool enable) in tcpc_set_drp_toggle() argument
688 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_drp_toggle()
694 return api->set_drp_toggle(dev, enable); in tcpc_set_drp_toggle()
706 static inline int tcpc_get_snk_ctrl(const struct device *dev) in tcpc_get_snk_ctrl() argument
708 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_snk_ctrl()
714 return api->get_snk_ctrl(dev); in tcpc_get_snk_ctrl()
725 static inline int tcpc_set_snk_ctrl(const struct device *dev, bool enable) in tcpc_set_snk_ctrl() argument
727 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_snk_ctrl()
733 return api->set_snk_ctrl(dev, enable); in tcpc_set_snk_ctrl()
745 static inline int tcpc_get_src_ctrl(const struct device *dev) in tcpc_get_src_ctrl() argument
747 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_src_ctrl()
753 return api->get_src_ctrl(dev); in tcpc_get_src_ctrl()
764 static inline int tcpc_set_src_ctrl(const struct device *dev, bool enable) in tcpc_set_src_ctrl() argument
766 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_src_ctrl()
772 return api->set_src_ctrl(dev, enable); in tcpc_set_src_ctrl()
786 static inline int tcpc_set_bist_test_mode(const struct device *dev, bool enable) in tcpc_set_bist_test_mode() argument
788 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_bist_test_mode()
794 return api->set_bist_test_mode(dev, enable); in tcpc_set_bist_test_mode()
807 static inline int tcpc_get_chip_info(const struct device *dev, struct tcpc_chip_info *chip_info) in tcpc_get_chip_info() argument
809 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_get_chip_info()
815 return api->get_chip_info(dev, chip_info); in tcpc_get_chip_info()
828 static inline int tcpc_set_low_power_mode(const struct device *dev, bool enable) in tcpc_set_low_power_mode() argument
830 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_set_low_power_mode()
836 return api->set_low_power_mode(dev, enable); in tcpc_set_low_power_mode()
849 static inline int tcpc_sop_prime_enable(const struct device *dev, bool enable) in tcpc_sop_prime_enable() argument
851 const struct tcpc_driver_api *api = (const struct tcpc_driver_api *)dev->api; in tcpc_sop_prime_enable()
857 return api->sop_prime_enable(dev, enable); in tcpc_sop_prime_enable()