#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/extcon.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/pinctrl/consumer.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
#include <linux/usb/chipidea.h>
#include <linux/usb/of.h>
#include <linux/of.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/ehci_def.h>
#include "ci.h"
#include "udc.h"
#include "bits.h"
#include "host.h"
#include "otg.h"
#include "otg_fsm.h"
static const u8 ci_regs_nolpm[] = …;
static const u8 ci_regs_lpm[] = …;
static void hw_alloc_regmap(struct ci_hdrc *ci, bool is_lpm)
{ … }
static enum ci_revision ci_get_revision(struct ci_hdrc *ci)
{ … }
u32 hw_read_intr_enable(struct ci_hdrc *ci)
{ … }
u32 hw_read_intr_status(struct ci_hdrc *ci)
{ … }
int hw_port_test_set(struct ci_hdrc *ci, u8 mode)
{ … }
u8 hw_port_test_get(struct ci_hdrc *ci)
{ … }
static void hw_wait_phy_stable(void)
{ … }
static void ci_hdrc_enter_lpm_common(struct ci_hdrc *ci, bool enable)
{ … }
static void ci_hdrc_enter_lpm(struct ci_hdrc *ci, bool enable)
{ … }
static int hw_device_init(struct ci_hdrc *ci, void __iomem *base)
{ … }
void hw_phymode_configure(struct ci_hdrc *ci)
{ … }
EXPORT_SYMBOL_GPL(…);
static int _ci_usb_phy_init(struct ci_hdrc *ci)
{ … }
static void ci_usb_phy_exit(struct ci_hdrc *ci)
{ … }
static int ci_usb_phy_init(struct ci_hdrc *ci)
{ … }
void ci_platform_configure(struct ci_hdrc *ci)
{ … }
static int hw_controller_reset(struct ci_hdrc *ci)
{ … }
int hw_device_reset(struct ci_hdrc *ci)
{ … }
static irqreturn_t ci_irq_handler(int irq, void *data)
{ … }
static void ci_irq(struct ci_hdrc *ci)
{ … }
static int ci_cable_notifier(struct notifier_block *nb, unsigned long event,
void *ptr)
{ … }
static enum usb_role ci_usb_role_switch_get(struct usb_role_switch *sw)
{ … }
static int ci_usb_role_switch_set(struct usb_role_switch *sw,
enum usb_role role)
{ … }
static enum ci_role ci_get_role(struct ci_hdrc *ci)
{ … }
static struct usb_role_switch_desc ci_role_switch = …;
static int ci_get_platdata(struct device *dev,
struct ci_hdrc_platform_data *platdata)
{ … }
static int ci_extcon_register(struct ci_hdrc *ci)
{ … }
static void ci_power_lost_work(struct work_struct *work)
{ … }
static DEFINE_IDA(ci_ida);
struct platform_device *ci_hdrc_add_device(struct device *dev,
struct resource *res, int nres,
struct ci_hdrc_platform_data *platdata)
{ … }
EXPORT_SYMBOL_GPL(…);
void ci_hdrc_remove_device(struct platform_device *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
enum usb_dr_mode ci_hdrc_query_available_role(struct platform_device *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline void ci_role_destroy(struct ci_hdrc *ci)
{ … }
static void ci_get_otg_capable(struct ci_hdrc *ci)
{ … }
static ssize_t role_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t role_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t n)
{ … }
static DEVICE_ATTR_RW(role);
static struct attribute *ci_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int ci_hdrc_probe(struct platform_device *pdev)
{ … }
static void ci_hdrc_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM
static void ci_otg_fsm_suspend_for_srp(struct ci_hdrc *ci)
{ … }
static void ci_otg_fsm_wakeup_by_srp(struct ci_hdrc *ci)
{ … }
static void ci_controller_suspend(struct ci_hdrc *ci)
{ … }
static void ci_extcon_wakeup_int(struct ci_hdrc *ci)
{ … }
static int ci_controller_resume(struct device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int ci_suspend(struct device *dev)
{ … }
static int ci_resume(struct device *dev)
{ … }
#endif
static int ci_runtime_suspend(struct device *dev)
{ … }
static int ci_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops ci_pm_ops = …;
static struct platform_driver ci_hdrc_driver = …;
static int __init ci_hdrc_platform_register(void)
{ … }
module_init(…) …;
static void __exit ci_hdrc_platform_unregister(void)
{ … }
module_exit(ci_hdrc_platform_unregister);
MODULE_ALIAS(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;