linux/drivers/phy/amlogic/phy-meson8b-usb2.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Meson8, Meson8b and GXBB USB2 PHY driver
 *
 * Copyright (C) 2016 Martin Blumenstingl <[email protected]>
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/usb/of.h>

#define REG_CONFIG
	#define REG_CONFIG_CLK_EN
	#define REG_CONFIG_CLK_SEL_MASK
	#define REG_CONFIG_CLK_DIV_MASK
	#define REG_CONFIG_CLK_32k_ALTSEL
	#define REG_CONFIG_TEST_TRIG

#define REG_CTRL
	#define REG_CTRL_SOFT_PRST
	#define REG_CTRL_SOFT_HRESET
	#define REG_CTRL_SS_SCALEDOWN_MODE_MASK
	#define REG_CTRL_CLK_DET_RST
	#define REG_CTRL_INTR_SEL
	#define REG_CTRL_CLK_DETECTED
	#define REG_CTRL_SOF_SENT_RCVD_TGL
	#define REG_CTRL_SOF_TOGGLE_OUT
	#define REG_CTRL_POWER_ON_RESET
	#define REG_CTRL_SLEEPM
	#define REG_CTRL_TX_BITSTUFF_ENN_H
	#define REG_CTRL_TX_BITSTUFF_ENN
	#define REG_CTRL_COMMON_ON
	#define REG_CTRL_REF_CLK_SEL_MASK
	#define REG_CTRL_REF_CLK_SEL_SHIFT
	#define REG_CTRL_FSEL_MASK
	#define REG_CTRL_FSEL_SHIFT
	#define REG_CTRL_PORT_RESET
	#define REG_CTRL_THREAD_ID_MASK

#define REG_ENDP_INTR

/* bits [31:26], [24:21] and [15:3] seem to be read-only */
#define REG_ADP_BC
	#define REG_ADP_BC_VBUS_VLD_EXT_SEL
	#define REG_ADP_BC_VBUS_VLD_EXT
	#define REG_ADP_BC_OTG_DISABLE
	#define REG_ADP_BC_ID_PULLUP
	#define REG_ADP_BC_DRV_VBUS
	#define REG_ADP_BC_ADP_PRB_EN
	#define REG_ADP_BC_ADP_DISCHARGE
	#define REG_ADP_BC_ADP_CHARGE
	#define REG_ADP_BC_SESS_END
	#define REG_ADP_BC_DEVICE_SESS_VLD
	#define REG_ADP_BC_B_VALID
	#define REG_ADP_BC_A_VALID
	#define REG_ADP_BC_ID_DIG
	#define REG_ADP_BC_VBUS_VALID
	#define REG_ADP_BC_ADP_PROBE
	#define REG_ADP_BC_ADP_SENSE
	#define REG_ADP_BC_ACA_ENABLE
	#define REG_ADP_BC_DCD_ENABLE
	#define REG_ADP_BC_VDAT_DET_EN_B
	#define REG_ADP_BC_VDAT_SRC_EN_B
	#define REG_ADP_BC_CHARGE_SEL
	#define REG_ADP_BC_CHARGE_DETECT
	#define REG_ADP_BC_ACA_PIN_RANGE_C
	#define REG_ADP_BC_ACA_PIN_RANGE_B
	#define REG_ADP_BC_ACA_PIN_RANGE_A
	#define REG_ADP_BC_ACA_PIN_GND
	#define REG_ADP_BC_ACA_PIN_FLOAT

#define REG_DBG_UART
	#define REG_DBG_UART_BYPASS_SEL
	#define REG_DBG_UART_BYPASS_DM_EN
	#define REG_DBG_UART_BYPASS_DP_EN
	#define REG_DBG_UART_BYPASS_DM_DATA
	#define REG_DBG_UART_BYPASS_DP_DATA
	#define REG_DBG_UART_FSV_MINUS
	#define REG_DBG_UART_FSV_PLUS
	#define REG_DBG_UART_FSV_BURN_IN_TEST
	#define REG_DBG_UART_LOOPBACK_EN_B
	#define REG_DBG_UART_SET_IDDQ
	#define REG_DBG_UART_ATE_RESET

#define REG_TEST
	#define REG_TEST_DATA_IN_MASK
	#define REG_TEST_EN_MASK
	#define REG_TEST_ADDR_MASK
	#define REG_TEST_DATA_OUT_SEL
	#define REG_TEST_CLK
	#define REG_TEST_VA_TEST_EN_B_MASK
	#define REG_TEST_DATA_OUT_MASK
	#define REG_TEST_DISABLE_ID_PULLUP

#define REG_TUNE
	#define REG_TUNE_TX_RES_TUNE_MASK
	#define REG_TUNE_TX_HSXV_TUNE_MASK
	#define REG_TUNE_TX_VREF_TUNE_MASK
	#define REG_TUNE_TX_RISE_TUNE_MASK
	#define REG_TUNE_TX_PREEMP_PULSE_TUNE
	#define REG_TUNE_TX_PREEMP_AMP_TUNE_MASK
	#define REG_TUNE_TX_FSLS_TUNE_MASK
	#define REG_TUNE_SQRX_TUNE_MASK
	#define REG_TUNE_OTG_TUNE
	#define REG_TUNE_COMP_DIS_TUNE
	#define REG_TUNE_HOST_DM_PULLDOWN
	#define REG_TUNE_HOST_DP_PULLDOWN

#define RESET_COMPLETE_TIME
#define ACA_ENABLE_COMPLETE_TIME

struct phy_meson8b_usb2_match_data {};

struct phy_meson8b_usb2_priv {};

static const struct regmap_config phy_meson8b_usb2_regmap_conf =;

static int phy_meson8b_usb2_power_on(struct phy *phy)
{}

static int phy_meson8b_usb2_power_off(struct phy *phy)
{}

static const struct phy_ops phy_meson8b_usb2_ops =;

static int phy_meson8b_usb2_probe(struct platform_device *pdev)
{}

static const struct phy_meson8b_usb2_match_data phy_meson8_usb2_match_data =;

static const struct phy_meson8b_usb2_match_data phy_meson8b_usb2_match_data =;

static const struct of_device_id phy_meson8b_usb2_of_match[] =;
MODULE_DEVICE_TABLE(of, phy_meson8b_usb2_of_match);

static struct platform_driver phy_meson8b_usb2_driver =;
module_platform_driver();

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