linux/drivers/usb/dwc3/dwc3-st.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * dwc3-st.c Support for dwc3 platform devices on ST Microelectronics platforms
 *
 * This is a small driver for the dwc3 to provide the glue logic
 * to configure the controller. Tested on STi platforms.
 *
 * Copyright (C) 2014 Stmicroelectronics
 *
 * Author: Giuseppe Cavallaro <[email protected]>
 * Contributors: Aymen Bouattay <[email protected]>
 *               Peter Griffin <[email protected]>
 *
 * Inspired by dwc3-omap.c and dwc3-exynos.c.
 */

#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/pinctrl/consumer.h>
#include <linux/usb/of.h>

#include "core.h"
#include "io.h"

/* glue registers */
#define CLKRST_CTRL
#define AUX_CLK_EN
#define SW_PIPEW_RESET_N
#define EXT_CFG_RESET_N
/*
 * 1'b0 : The host controller complies with the xHCI revision 0.96
 * 1'b1 : The host controller complies with the xHCI revision 1.0
 */
#define XHCI_REVISION

#define USB2_VBUS_MNGMNT_SEL1
/*
 * For all fields in USB2_VBUS_MNGMNT_SEL1
 * 2’b00 : Override value from Reg 0x30 is selected
 * 2’b01 : utmiotg_<signal_name> from usb3_top is selected
 * 2’b10 : pipew_<signal_name> from PIPEW instance is selected
 * 2’b11 : value is 1'b0
 */
#define USB2_VBUS_REG30
#define USB2_VBUS_UTMIOTG
#define USB2_VBUS_PIPEW
#define USB2_VBUS_ZERO

#define SEL_OVERRIDE_VBUSVALID(n)
#define SEL_OVERRIDE_POWERPRESENT(n)
#define SEL_OVERRIDE_BVALID(n)

/* Static DRD configuration */
#define USB3_CONTROL_MASK

#define USB3_DEVICE_NOT_HOST
#define USB3_FORCE_VBUSVALID
#define USB3_DELAY_VBUSVALID
#define USB3_SEL_FORCE_OPMODE
#define USB3_FORCE_OPMODE(n)
#define USB3_SEL_FORCE_DPPULLDOWN2
#define USB3_FORCE_DPPULLDOWN2
#define USB3_SEL_FORCE_DMPULLDOWN2
#define USB3_FORCE_DMPULLDOWN2

/**
 * struct st_dwc3 - dwc3-st driver private structure
 * @dev:		device pointer
 * @glue_base:		ioaddr for the glue registers
 * @regmap:		regmap pointer for getting syscfg
 * @syscfg_reg_off:	usb syscfg control offset
 * @dr_mode:		drd static host/device config
 * @rstc_pwrdn:		rest controller for powerdown signal
 * @rstc_rst:		reset controller for softreset signal
 */

struct st_dwc3 {};

static inline u32 st_dwc3_readl(void __iomem *base, u32 offset)
{}

static inline void st_dwc3_writel(void __iomem *base, u32 offset, u32 value)
{}

/**
 * st_dwc3_drd_init: program the port
 * @dwc3_data: driver private structure
 * Description: this function is to program the port as either host or device
 * according to the static configuration passed from devicetree.
 * OTG and dual role are not yet supported!
 */
static int st_dwc3_drd_init(struct st_dwc3 *dwc3_data)
{}

/**
 * st_dwc3_init: init the controller via glue logic
 * @dwc3_data: driver private structure
 */
static void st_dwc3_init(struct st_dwc3 *dwc3_data)
{}

static int st_dwc3_probe(struct platform_device *pdev)
{}

static void st_dwc3_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int st_dwc3_suspend(struct device *dev)
{}

static int st_dwc3_resume(struct device *dev)
{}
#endif /* CONFIG_PM_SLEEP */

static SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume);

static const struct of_device_id st_dwc3_match[] =;

MODULE_DEVICE_TABLE(of, st_dwc3_match);

static struct platform_driver st_dwc3_driver =;

module_platform_driver();

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