#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_data/cros_usbpd_notify.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
#define CHARGER_USBPD_DIR_NAME …
#define CHARGER_DEDICATED_DIR_NAME …
#define CHARGER_DIR_NAME_LENGTH …
#define CHARGER_CACHE_UPDATE_DELAY …
#define CHARGER_MANUFACTURER_MODEL_LENGTH …
#define DRV_NAME …
struct port_data { … };
struct charger_data { … };
static enum power_supply_property cros_usbpd_charger_props[] = …;
static enum power_supply_property cros_usbpd_dedicated_charger_props[] = …;
static enum power_supply_usb_type cros_usbpd_charger_usb_types[] = …;
static u16 input_voltage_limit = …;
static u16 input_current_limit = …;
static bool cros_usbpd_charger_port_is_dedicated(struct port_data *port)
{ … }
static int cros_usbpd_charger_ec_command(struct charger_data *charger,
unsigned int version,
unsigned int command,
void *outdata,
unsigned int outsize,
void *indata,
unsigned int insize)
{ … }
static int cros_usbpd_charger_get_num_ports(struct charger_data *charger)
{ … }
static int cros_usbpd_charger_get_usbpd_num_ports(struct charger_data *charger)
{ … }
static int cros_usbpd_charger_get_discovery_info(struct port_data *port)
{ … }
static int cros_usbpd_charger_get_power_info(struct port_data *port)
{ … }
static int cros_usbpd_charger_get_port_status(struct port_data *port,
bool ratelimit)
{ … }
static int cros_usbpd_charger_set_ext_power_limit(struct charger_data *charger,
u16 current_lim,
u16 voltage_lim)
{ … }
static void cros_usbpd_charger_power_changed(struct power_supply *psy)
{ … }
static int cros_usbpd_charger_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int cros_usbpd_charger_set_prop(struct power_supply *psy,
enum power_supply_property psp,
const union power_supply_propval *val)
{ … }
static int cros_usbpd_charger_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp)
{ … }
static int cros_usbpd_charger_ec_event(struct notifier_block *nb,
unsigned long host_event,
void *_notify)
{ … }
static void cros_usbpd_charger_unregister_notifier(void *data)
{ … }
static int cros_usbpd_charger_probe(struct platform_device *pd)
{ … }
#ifdef CONFIG_PM_SLEEP
static int cros_usbpd_charger_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL,
cros_usbpd_charger_resume);
static const struct platform_device_id cros_usbpd_charger_id[] = …;
MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id);
static struct platform_driver cros_usbpd_charger_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;