linux/drivers/mfd/omap-usb-tll.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * omap-usb-tll.c - The USB TLL driver for OMAP EHCI & OHCI
 *
 * Copyright (C) 2012-2013 Texas Instruments Incorporated - https://www.ti.com
 * Author: Keshava Munegowda <[email protected]>
 * Author: Roger Quadros <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/pm_runtime.h>
#include <linux/platform_data/usb-omap.h>
#include <linux/of.h>

#include "omap-usb.h"

#define USBTLL_DRIVER_NAME

/* TLL Register Set */
#define OMAP_USBTLL_REVISION
#define OMAP_USBTLL_SYSCONFIG
#define OMAP_USBTLL_SYSCONFIG_CACTIVITY
#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE
#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP
#define OMAP_USBTLL_SYSCONFIG_SOFTRESET
#define OMAP_USBTLL_SYSCONFIG_AUTOIDLE

#define OMAP_USBTLL_SYSSTATUS
#define OMAP_USBTLL_SYSSTATUS_RESETDONE

#define OMAP_USBTLL_IRQSTATUS
#define OMAP_USBTLL_IRQENABLE

#define OMAP_TLL_SHARED_CONF
#define OMAP_TLL_SHARED_CONF_USB_90D_DDR_EN
#define OMAP_TLL_SHARED_CONF_USB_180D_SDR_EN
#define OMAP_TLL_SHARED_CONF_USB_DIVRATION
#define OMAP_TLL_SHARED_CONF_FCLK_REQ
#define OMAP_TLL_SHARED_CONF_FCLK_IS_ON

#define OMAP_TLL_CHANNEL_CONF(num)
#define OMAP_TLL_CHANNEL_CONF_FSLSMODE_SHIFT
#define OMAP_TLL_CHANNEL_CONF_DRVVBUS
#define OMAP_TLL_CHANNEL_CONF_CHRGVBUS
#define OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
#define OMAP_TLL_CHANNEL_CONF_ULPI_ULPIAUTOIDLE
#define OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE
#define OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE
#define OMAP_TLL_CHANNEL_CONF_MODE_TRANSPARENT_UTMI
#define OMAP_TLL_CHANNEL_CONF_CHANMODE_FSLS
#define OMAP_TLL_CHANNEL_CONF_CHANEN

#define OMAP_TLL_FSLSMODE_6PIN_PHY_DAT_SE0
#define OMAP_TLL_FSLSMODE_6PIN_PHY_DP_DM
#define OMAP_TLL_FSLSMODE_3PIN_PHY
#define OMAP_TLL_FSLSMODE_4PIN_PHY
#define OMAP_TLL_FSLSMODE_6PIN_TLL_DAT_SE0
#define OMAP_TLL_FSLSMODE_6PIN_TLL_DP_DM
#define OMAP_TLL_FSLSMODE_3PIN_TLL
#define OMAP_TLL_FSLSMODE_4PIN_TLL
#define OMAP_TLL_FSLSMODE_2PIN_TLL_DAT_SE0
#define OMAP_TLL_FSLSMODE_2PIN_DAT_DP_DM

#define OMAP_TLL_ULPI_FUNCTION_CTRL(num)
#define OMAP_TLL_ULPI_INTERFACE_CTRL(num)
#define OMAP_TLL_ULPI_OTG_CTRL(num)
#define OMAP_TLL_ULPI_INT_EN_RISE(num)
#define OMAP_TLL_ULPI_INT_EN_FALL(num)
#define OMAP_TLL_ULPI_INT_STATUS(num)
#define OMAP_TLL_ULPI_INT_LATCH(num)
#define OMAP_TLL_ULPI_DEBUG(num)
#define OMAP_TLL_ULPI_SCRATCH_REGISTER(num)

#define OMAP_REV2_TLL_CHANNEL_COUNT
#define OMAP_TLL_CHANNEL_COUNT
#define OMAP_TLL_CHANNEL_1_EN_MASK
#define OMAP_TLL_CHANNEL_2_EN_MASK
#define OMAP_TLL_CHANNEL_3_EN_MASK

/* Values of USBTLL_REVISION - Note: these are not given in the TRM */
#define OMAP_USBTLL_REV1
#define OMAP_USBTLL_REV2
#define OMAP_USBTLL_REV3
#define OMAP_USBTLL_REV4

#define is_ehci_tll_mode(x)

/* only PHY and UNUSED modes don't need TLL */
#define omap_usb_mode_needs_tll(x)

struct usbtll_omap {};

/*-------------------------------------------------------------------------*/

static const char usbtll_driver_name[] =;
static struct device	*tll_dev;
static DEFINE_SPINLOCK(tll_lock);	/* serialize access to tll_dev */

/*-------------------------------------------------------------------------*/

static inline void usbtll_write(void __iomem *base, u32 reg, u32 val)
{}

static inline u32 usbtll_read(void __iomem *base, u32 reg)
{}

static inline void usbtll_writeb(void __iomem *base, u32 reg, u8 val)
{}

/*-------------------------------------------------------------------------*/

static bool is_ohci_port(enum usbhs_omap_port_mode pmode)
{}

/*
 * convert the port-mode enum to a value we can use in the FSLSMODE
 * field of USBTLL_CHANNEL_CONF
 */
static unsigned ohci_omap3_fslsmode(enum usbhs_omap_port_mode mode)
{}

/**
 * usbtll_omap_probe - initialize TI-based HCDs
 *
 * Allocates basic resources for this USB host controller.
 *
 * @pdev: Pointer to this device's platform device structure
 */
static int usbtll_omap_probe(struct platform_device *pdev)
{}

/**
 * usbtll_omap_remove - shutdown processing for UHH & TLL HCDs
 * @pdev: USB Host Controller being removed
 *
 * Reverses the effect of usbtll_omap_probe().
 */
static void usbtll_omap_remove(struct platform_device *pdev)
{}

static const struct of_device_id usbtll_omap_dt_ids[] =;

MODULE_DEVICE_TABLE(of, usbtll_omap_dt_ids);

static struct platform_driver usbtll_omap_driver =;

int omap_tll_init(struct usbhs_omap_platform_data *pdata)
{}
EXPORT_SYMBOL_GPL();

int omap_tll_enable(struct usbhs_omap_platform_data *pdata)
{}
EXPORT_SYMBOL_GPL();

int omap_tll_disable(struct usbhs_omap_platform_data *pdata)
{}
EXPORT_SYMBOL_GPL();

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();

static int __init omap_usbtll_drvinit(void)
{}

/*
 * init before usbhs core driver;
 * The usbtll driver should be initialized before
 * the usbhs core driver probe function is called.
 */
fs_initcall(omap_usbtll_drvinit);

static void __exit omap_usbtll_drvexit(void)
{}
module_exit(omap_usbtll_drvexit);