#include <linux/completion.h>
#include <linux/property.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/usb/typec_dp.h>
#include "ucsi.h"
#include "trace.h"
#define UCSI_TIMEOUT_MS …
#define UCSI_SWAP_TIMEOUT_MS …
void ucsi_notify_common(struct ucsi *ucsi, u32 cci)
{ … }
EXPORT_SYMBOL_GPL(…);
int ucsi_sync_control_common(struct ucsi *ucsi, u64 command)
{ … }
EXPORT_SYMBOL_GPL(…);
static int ucsi_acknowledge(struct ucsi *ucsi, bool conn_ack)
{ … }
static int ucsi_run_command(struct ucsi *ucsi, u64 command, u32 *cci,
void *data, size_t size, bool conn_ack)
{ … }
static int ucsi_read_error(struct ucsi *ucsi, u8 connector_num)
{ … }
static int ucsi_send_command_common(struct ucsi *ucsi, u64 cmd,
void *data, size_t size, bool conn_ack)
{ … }
int ucsi_send_command(struct ucsi *ucsi, u64 command,
void *data, size_t size)
{ … }
EXPORT_SYMBOL_GPL(…);
struct ucsi_work { … };
static void ucsi_poll_worker(struct work_struct *work)
{ … }
static int ucsi_partner_task(struct ucsi_connector *con,
int (*cb)(struct ucsi_connector *),
int retries, unsigned long delay)
{ … }
void ucsi_altmode_update_active(struct ucsi_connector *con)
{ … }
static int ucsi_altmode_next_mode(struct typec_altmode **alt, u16 svid)
{ … }
static int ucsi_next_altmode(struct typec_altmode **alt)
{ … }
static int ucsi_get_num_altmode(struct typec_altmode **alt)
{ … }
static int ucsi_register_altmode(struct ucsi_connector *con,
struct typec_altmode_desc *desc,
u8 recipient)
{ … }
static int
ucsi_register_altmodes_nvidia(struct ucsi_connector *con, u8 recipient)
{ … }
static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
{ … }
static void ucsi_unregister_altmodes(struct ucsi_connector *con, u8 recipient)
{ … }
static int ucsi_read_pdos(struct ucsi_connector *con,
enum typec_role role, int is_partner,
u32 *pdos, int offset, int num_pdos)
{ … }
static int ucsi_get_pdos(struct ucsi_connector *con, enum typec_role role,
int is_partner, u32 *pdos)
{ … }
static int ucsi_get_src_pdos(struct ucsi_connector *con)
{ … }
static struct usb_power_delivery_capabilities *ucsi_get_pd_caps(struct ucsi_connector *con,
enum typec_role role,
bool is_partner)
{ … }
static int ucsi_read_identity(struct ucsi_connector *con, u8 recipient,
u8 offset, u8 bytes, void *resp)
{ … }
static int ucsi_get_identity(struct ucsi_connector *con, u8 recipient,
struct usb_pd_identity *id)
{ … }
static int ucsi_get_partner_identity(struct ucsi_connector *con)
{ … }
static int ucsi_get_cable_identity(struct ucsi_connector *con)
{ … }
static int ucsi_check_altmodes(struct ucsi_connector *con)
{ … }
static void ucsi_register_device_pdos(struct ucsi_connector *con)
{ … }
static int ucsi_register_partner_pdos(struct ucsi_connector *con)
{ … }
static void ucsi_unregister_partner_pdos(struct ucsi_connector *con)
{ … }
static int ucsi_register_plug(struct ucsi_connector *con)
{ … }
static void ucsi_unregister_plug(struct ucsi_connector *con)
{ … }
static int ucsi_register_cable(struct ucsi_connector *con)
{ … }
static void ucsi_unregister_cable(struct ucsi_connector *con)
{ … }
static void ucsi_pwr_opmode_change(struct ucsi_connector *con)
{ … }
static int ucsi_register_partner(struct ucsi_connector *con)
{ … }
static void ucsi_unregister_partner(struct ucsi_connector *con)
{ … }
static void ucsi_partner_change(struct ucsi_connector *con)
{ … }
static int ucsi_check_connector_capability(struct ucsi_connector *con)
{ … }
static int ucsi_check_connection(struct ucsi_connector *con)
{ … }
static int ucsi_check_cable(struct ucsi_connector *con)
{ … }
static void ucsi_handle_connector_change(struct work_struct *work)
{ … }
void ucsi_connector_change(struct ucsi *ucsi, u8 num)
{ … }
EXPORT_SYMBOL_GPL(…);
static int ucsi_reset_connector(struct ucsi_connector *con, bool hard)
{ … }
static int ucsi_reset_ppm(struct ucsi *ucsi)
{ … }
static int ucsi_role_cmd(struct ucsi_connector *con, u64 command)
{ … }
static int ucsi_dr_swap(struct typec_port *port, enum typec_data_role role)
{ … }
static int ucsi_pr_swap(struct typec_port *port, enum typec_role role)
{ … }
static const struct typec_operations ucsi_ops = …;
static struct fwnode_handle *ucsi_find_fwnode(struct ucsi_connector *con)
{ … }
static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
{ … }
static u64 ucsi_get_supported_notifications(struct ucsi *ucsi)
{ … }
static int ucsi_init(struct ucsi *ucsi)
{ … }
static void ucsi_resume_work(struct work_struct *work)
{ … }
int ucsi_resume(struct ucsi *ucsi)
{ … }
EXPORT_SYMBOL_GPL(…);
static void ucsi_init_work(struct work_struct *work)
{ … }
void *ucsi_get_drvdata(struct ucsi *ucsi)
{ … }
EXPORT_SYMBOL_GPL(…);
void ucsi_set_drvdata(struct ucsi *ucsi, void *data)
{ … }
EXPORT_SYMBOL_GPL(…);
struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
void ucsi_destroy(struct ucsi *ucsi)
{ … }
EXPORT_SYMBOL_GPL(…);
int ucsi_register(struct ucsi *ucsi)
{ … }
EXPORT_SYMBOL_GPL(…);
void ucsi_unregister(struct ucsi *ucsi)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init ucsi_module_init(void)
{ … }
module_init(…) …;
static void __exit ucsi_module_exit(void)
{ … }
module_exit(ucsi_module_exit);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;