#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_usbpd_notify.h>
#include <linux/platform_device.h>
#include <linux/usb/pd_vdo.h>
#include <linux/usb/typec_dp.h>
#include <linux/usb/typec_tbt.h>
#include "cros_ec_typec.h"
#include "cros_typec_vdm.h"
#define DRV_NAME …
#define DP_PORT_VDO …
static void cros_typec_role_switch_quirk(struct fwnode_handle *fwnode)
{ … }
static int cros_typec_parse_port_props(struct typec_capability *cap,
struct fwnode_handle *fwnode,
struct device *dev)
{ … }
static int cros_typec_get_switch_handles(struct cros_typec_port *port,
struct fwnode_handle *fwnode,
struct device *dev)
{ … }
static int cros_typec_add_partner(struct cros_typec_data *typec, int port_num,
bool pd_en)
{ … }
static void cros_typec_unregister_altmodes(struct cros_typec_data *typec, int port_num,
bool is_partner)
{ … }
static int cros_typec_retimer_set(struct typec_retimer *retimer, struct typec_mux_state state)
{ … }
static int cros_typec_usb_disconnect_state(struct cros_typec_port *port)
{ … }
static void cros_typec_remove_partner(struct cros_typec_data *typec,
int port_num)
{ … }
static void cros_typec_remove_cable(struct cros_typec_data *typec,
int port_num)
{ … }
static void cros_typec_unregister_port_altmodes(struct cros_typec_port *port)
{ … }
static void cros_unregister_ports(struct cros_typec_data *typec)
{ … }
static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
int port_num)
{ … }
static int cros_typec_init_ports(struct cros_typec_data *typec)
{ … }
static int cros_typec_usb_safe_state(struct cros_typec_port *port)
{ … }
static int cros_typec_get_cable_vdo(struct cros_typec_port *port, u16 svid)
{ … }
static int cros_typec_enable_tbt(struct cros_typec_data *typec,
int port_num,
struct ec_response_usb_pd_control_v2 *pd_ctrl)
{ … }
static int cros_typec_enable_dp(struct cros_typec_data *typec,
int port_num,
struct ec_response_usb_pd_control_v2 *pd_ctrl)
{ … }
static int cros_typec_enable_usb4(struct cros_typec_data *typec,
int port_num,
struct ec_response_usb_pd_control_v2 *pd_ctrl)
{ … }
static int cros_typec_configure_mux(struct cros_typec_data *typec, int port_num,
struct ec_response_usb_pd_control_v2 *pd_ctrl)
{ … }
static void cros_typec_set_port_params_v0(struct cros_typec_data *typec,
int port_num, struct ec_response_usb_pd_control *resp)
{ … }
static void cros_typec_set_port_params_v1(struct cros_typec_data *typec,
int port_num, struct ec_response_usb_pd_control_v1 *resp)
{ … }
static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_num,
bool is_partner)
{ … }
static void cros_typec_parse_pd_identity(struct usb_pd_identity *id,
struct ec_response_typec_discovery *disc)
{ … }
static int cros_typec_handle_sop_prime_disc(struct cros_typec_data *typec, int port_num, u16 pd_revision)
{ … }
static int cros_typec_handle_sop_disc(struct cros_typec_data *typec, int port_num, u16 pd_revision)
{ … }
static int cros_typec_send_clear_event(struct cros_typec_data *typec, int port_num, u32 events_mask)
{ … }
static void cros_typec_register_partner_pdos(struct cros_typec_data *typec,
struct ec_response_typec_status *resp, int port_num)
{ … }
static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num)
{ … }
static int cros_typec_port_update(struct cros_typec_data *typec, int port_num)
{ … }
static int cros_typec_get_cmd_version(struct cros_typec_data *typec)
{ … }
static void cros_typec_port_work(struct work_struct *work)
{ … }
static int cros_ec_typec_event(struct notifier_block *nb,
unsigned long host_event, void *_notify)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id cros_typec_acpi_id[] = …;
MODULE_DEVICE_TABLE(acpi, cros_typec_acpi_id);
#endif
#ifdef CONFIG_OF
static const struct of_device_id cros_typec_of_match[] = …;
MODULE_DEVICE_TABLE(of, cros_typec_of_match);
#endif
static int cros_typec_probe(struct platform_device *pdev)
{ … }
static int __maybe_unused cros_typec_suspend(struct device *dev)
{ … }
static int __maybe_unused cros_typec_resume(struct device *dev)
{ … }
static const struct dev_pm_ops cros_typec_pm_ops = …;
static struct platform_driver cros_typec_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;