#include <linux/io.h>
#include <linux/irq.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include <linux/module.h>
#include <linux/usb/usb_phy_generic.h>
#include <linux/platform_data/usb-omap.h>
#include <linux/sizes.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/usb/of.h>
#include <linux/debugfs.h>
#include "musb_core.h"
static const struct of_device_id musb_dsps_of_match[];
struct dsps_musb_wrapper { … };
struct dsps_context { … };
struct dsps_glue { … };
static const struct debugfs_reg32 dsps_musb_regs[] = …;
static void dsps_mod_timer(struct dsps_glue *glue, int wait_ms)
{ … }
static void dsps_mod_timer_optional(struct dsps_glue *glue)
{ … }
#define USBSS_IRQ_STATUS …
#define USBSS_IRQ_ENABLER …
#define USBSS_IRQ_CLEARR …
#define USBSS_IRQ_PD_COMP …
static void dsps_musb_enable(struct musb *musb)
{ … }
static void dsps_musb_disable(struct musb *musb)
{ … }
static int dsps_check_status(struct musb *musb, void *unused)
{ … }
static void otg_timer(struct timer_list *t)
{ … }
static void dsps_musb_clear_ep_rxintr(struct musb *musb, int epnum)
{ … }
static irqreturn_t dsps_interrupt(int irq, void *hci)
{ … }
static int dsps_musb_dbg_init(struct musb *musb, struct dsps_glue *glue)
{ … }
static int dsps_musb_init(struct musb *musb)
{ … }
static int dsps_musb_exit(struct musb *musb)
{ … }
static int dsps_musb_set_mode(struct musb *musb, u8 mode)
{ … }
static bool dsps_sw_babble_control(struct musb *musb)
{ … }
static int dsps_musb_recover(struct musb *musb)
{ … }
static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
{ … }
#ifdef CONFIG_USB_TI_CPPI41_DMA
static void dsps_dma_controller_callback(struct dma_controller *c)
{
struct musb *musb = c->musb;
struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent);
void __iomem *usbss_base = glue->usbss_base;
u32 status;
status = musb_readl(usbss_base, USBSS_IRQ_STATUS);
if (status & USBSS_IRQ_PD_COMP)
musb_writel(usbss_base, USBSS_IRQ_STATUS, USBSS_IRQ_PD_COMP);
}
static struct dma_controller *
dsps_dma_controller_create(struct musb *musb, void __iomem *base)
{
struct dma_controller *controller;
struct dsps_glue *glue = dev_get_drvdata(musb->controller->parent);
void __iomem *usbss_base = glue->usbss_base;
controller = cppi41_dma_controller_create(musb, base);
if (IS_ERR_OR_NULL(controller))
return controller;
musb_writel(usbss_base, USBSS_IRQ_ENABLER, USBSS_IRQ_PD_COMP);
controller->dma_callback = dsps_dma_controller_callback;
return controller;
}
#ifdef CONFIG_PM_SLEEP
static void dsps_dma_controller_suspend(struct dsps_glue *glue)
{
void __iomem *usbss_base = glue->usbss_base;
musb_writel(usbss_base, USBSS_IRQ_CLEARR, USBSS_IRQ_PD_COMP);
}
static void dsps_dma_controller_resume(struct dsps_glue *glue)
{
void __iomem *usbss_base = glue->usbss_base;
musb_writel(usbss_base, USBSS_IRQ_ENABLER, USBSS_IRQ_PD_COMP);
}
#endif
#else
#ifdef CONFIG_PM_SLEEP
static void dsps_dma_controller_suspend(struct dsps_glue *glue) { … }
static void dsps_dma_controller_resume(struct dsps_glue *glue) { … }
#endif
#endif
static struct musb_platform_ops dsps_ops = …;
static u64 musb_dmamask = …;
static int get_int_prop(struct device_node *dn, const char *s)
{ … }
static int dsps_create_musb_pdev(struct dsps_glue *glue,
struct platform_device *parent)
{ … }
static irqreturn_t dsps_vbus_threaded_irq(int irq, void *priv)
{ … }
static int dsps_setup_optional_vbus_irq(struct platform_device *pdev,
struct dsps_glue *glue)
{ … }
static int dsps_probe(struct platform_device *pdev)
{ … }
static void dsps_remove(struct platform_device *pdev)
{ … }
static const struct dsps_musb_wrapper am33xx_driver_data = …;
static const struct of_device_id musb_dsps_of_match[] = …;
MODULE_DEVICE_TABLE(of, musb_dsps_of_match);
#ifdef CONFIG_PM_SLEEP
static int dsps_suspend(struct device *dev)
{ … }
static int dsps_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume);
static struct platform_driver dsps_usbss_driver = …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
module_platform_driver(…) …;