#include <linux/extcon-provider.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/of.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sched.h>
struct cros_ec_extcon_info { … };
static const unsigned int usb_type_c_cable[] = …;
enum usb_data_roles { … };
static int cros_ec_pd_command(struct cros_ec_extcon_info *info,
unsigned int command,
unsigned int version,
void *outdata,
unsigned int outsize,
void *indata,
unsigned int insize)
{ … }
static int cros_ec_usb_get_power_type(struct cros_ec_extcon_info *info)
{ … }
static int cros_ec_usb_get_pd_mux_state(struct cros_ec_extcon_info *info)
{ … }
static int cros_ec_usb_get_role(struct cros_ec_extcon_info *info,
bool *polarity)
{ … }
static int cros_ec_pd_get_num_ports(struct cros_ec_extcon_info *info)
{ … }
static const char *cros_ec_usb_role_string(unsigned int role)
{ … }
static const char *cros_ec_usb_power_type_string(unsigned int type)
{ … }
static bool cros_ec_usb_power_type_is_wall_wart(unsigned int type,
unsigned int role)
{ … }
static int extcon_cros_ec_detect_cable(struct cros_ec_extcon_info *info,
bool force)
{ … }
static int extcon_cros_ec_event(struct notifier_block *nb,
unsigned long queued_during_suspend,
void *_notify)
{ … }
static int extcon_cros_ec_probe(struct platform_device *pdev)
{ … }
static void extcon_cros_ec_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int extcon_cros_ec_suspend(struct device *dev)
{ … }
static int extcon_cros_ec_resume(struct device *dev)
{ … }
static const struct dev_pm_ops extcon_cros_ec_dev_pm_ops = …;
#define DEV_PM_OPS …
#else
#define DEV_PM_OPS …
#endif
#ifdef CONFIG_OF
static const struct of_device_id extcon_cros_ec_of_match[] = …;
MODULE_DEVICE_TABLE(of, extcon_cros_ec_of_match);
#endif
static struct platform_driver extcon_cros_ec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;