#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/role.h>
#define USB_GPIO_DEB_MS …
#define USB_GPIO_DEB_US …
#define USB_CONN_IRQF …
struct usb_conn_info { … };
static void usb_conn_detect_cable(struct work_struct *work)
{ … }
static void usb_conn_queue_dwork(struct usb_conn_info *info,
unsigned long delay)
{ … }
static irqreturn_t usb_conn_isr(int irq, void *dev_id)
{ … }
static enum power_supply_property usb_charger_properties[] = …;
static int usb_charger_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int usb_conn_psy_register(struct usb_conn_info *info)
{ … }
static int usb_conn_probe(struct platform_device *pdev)
{ … }
static void usb_conn_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused usb_conn_suspend(struct device *dev)
{ … }
static int __maybe_unused usb_conn_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(usb_conn_pm_ops,
usb_conn_suspend, usb_conn_resume);
static const struct of_device_id usb_conn_dt_match[] = …;
MODULE_DEVICE_TABLE(of, usb_conn_dt_match);
static struct platform_driver usb_conn_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;