#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/uaccess.h>
#include <linux/device.h>
#include <linux/proc_fs.h>
#include <linux/clk.h>
#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <linux/usb.h>
#include <linux/usb/ch9.h>
#include <linux/usb/otg.h>
#include <linux/usb/gadget.h>
#include <linux/usb/hcd.h>
#include <linux/platform_data/mv_usb.h>
#include "phy-mv-usb.h"
#define DRIVER_DESC …
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
static const char driver_name[] = …;
static char *state_string[] = …;
static int mv_otg_set_vbus(struct usb_otg *otg, bool on)
{ … }
static int mv_otg_set_host(struct usb_otg *otg,
struct usb_bus *host)
{ … }
static int mv_otg_set_peripheral(struct usb_otg *otg,
struct usb_gadget *gadget)
{ … }
static void mv_otg_run_state_machine(struct mv_otg *mvotg,
unsigned long delay)
{ … }
static void mv_otg_timer_await_bcon(struct timer_list *t)
{ … }
static int mv_otg_cancel_timer(struct mv_otg *mvotg, unsigned int id)
{ … }
static int mv_otg_set_timer(struct mv_otg *mvotg, unsigned int id,
unsigned long interval)
{ … }
static int mv_otg_reset(struct mv_otg *mvotg)
{ … }
static void mv_otg_init_irq(struct mv_otg *mvotg)
{ … }
static void mv_otg_start_host(struct mv_otg *mvotg, int on)
{ … }
static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)
{ … }
static void otg_clock_enable(struct mv_otg *mvotg)
{ … }
static void otg_clock_disable(struct mv_otg *mvotg)
{ … }
static int mv_otg_enable_internal(struct mv_otg *mvotg)
{ … }
static int mv_otg_enable(struct mv_otg *mvotg)
{ … }
static void mv_otg_disable_internal(struct mv_otg *mvotg)
{ … }
static void mv_otg_disable(struct mv_otg *mvotg)
{ … }
static void mv_otg_update_inputs(struct mv_otg *mvotg)
{ … }
static void mv_otg_update_state(struct mv_otg *mvotg)
{ … }
static void mv_otg_work(struct work_struct *work)
{ … }
static irqreturn_t mv_otg_irq(int irq, void *dev)
{ … }
static irqreturn_t mv_otg_inputs_irq(int irq, void *dev)
{ … }
static ssize_t
a_bus_req_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t
a_bus_req_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(a_bus_req);
static ssize_t
a_clr_err_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(a_clr_err);
static ssize_t
a_bus_drop_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t
a_bus_drop_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(a_bus_drop);
static struct attribute *inputs_attrs[] = …;
static const struct attribute_group inputs_attr_group = …;
static const struct attribute_group *mv_otg_groups[] = …;
static void mv_otg_remove(struct platform_device *pdev)
{ … }
static int mv_otg_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM
static int mv_otg_suspend(struct platform_device *pdev, pm_message_t state)
{ … }
static int mv_otg_resume(struct platform_device *pdev)
{ … }
#endif
static struct platform_driver mv_otg_driver = …;
module_platform_driver(…) …;