linux/drivers/phy/realtek/phy-rtk-usb3.c

// SPDX-License-Identifier: GPL-2.0
/*
 *  phy-rtk-usb3.c RTK usb3.0 phy driver
 *
 * copyright (c) 2023 realtek semiconductor corporation
 *
 */

#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/nvmem-consumer.h>
#include <linux/regmap.h>
#include <linux/sys_soc.h>
#include <linux/mfd/syscon.h>
#include <linux/phy/phy.h>
#include <linux/usb.h>

#define USB_MDIO_CTRL_PHY_BUSY
#define USB_MDIO_CTRL_PHY_WRITE
#define USB_MDIO_CTRL_PHY_ADDR_SHIFT
#define USB_MDIO_CTRL_PHY_DATA_SHIFT

#define MAX_USB_PHY_DATA_SIZE
#define PHY_ADDR_0X09
#define PHY_ADDR_0X0B
#define PHY_ADDR_0X0D
#define PHY_ADDR_0X10
#define PHY_ADDR_0X1F
#define PHY_ADDR_0X20
#define PHY_ADDR_0X21
#define PHY_ADDR_0X30

#define REG_0X09_FORCE_CALIBRATION
#define REG_0X0B_RX_OFFSET_RANGE_MASK
#define REG_0X0D_RX_DEBUG_TEST_EN
#define REG_0X10_DEBUG_MODE_SETTING
#define REG_0X10_DEBUG_MODE_SETTING_MASK
#define REG_0X1F_RX_OFFSET_CODE_MASK

#define USB_U3_TX_LFPS_SWING_TRIM_SHIFT
#define USB_U3_TX_LFPS_SWING_TRIM_MASK
#define AMPLITUDE_CONTROL_COARSE_MASK
#define AMPLITUDE_CONTROL_FINE_MASK
#define AMPLITUDE_CONTROL_COARSE_DEFAULT
#define AMPLITUDE_CONTROL_FINE_DEFAULT

#define PHY_ADDR_MAP_ARRAY_INDEX(addr)
#define ARRAY_INDEX_MAP_PHY_ADDR(index)

struct phy_reg {};

struct phy_data {};

struct phy_cfg {};

struct phy_parameter {};

struct rtk_phy {};

#define PHY_IO_TIMEOUT_USEC
#define PHY_IO_DELAY_US

static inline int utmi_wait_register(void __iomem *reg, u32 mask, u32 result)
{}

static int rtk_phy3_wait_vbusy(struct phy_reg *phy_reg)
{}

static u16 rtk_phy_read(struct phy_reg *phy_reg, char addr)
{}

static int rtk_phy_write(struct phy_reg *phy_reg, char addr, u16 data)
{}

static void do_rtk_usb3_phy_toggle(struct rtk_phy *rtk_phy, int index, bool connect)
{}

static int do_rtk_phy_init(struct rtk_phy *rtk_phy, int index)
{}

static int rtk_phy_init(struct phy *phy)
{}

static int rtk_phy_exit(struct phy *phy)
{}

static void rtk_phy_toggle(struct rtk_phy *rtk_phy, bool connect, int port)
{}

static int rtk_phy_connect(struct phy *phy, int port)
{}

static int rtk_phy_disconnect(struct phy *phy, int port)
{}

static const struct phy_ops ops =;

#ifdef CONFIG_DEBUG_FS
static struct dentry *create_phy_debug_root(void)
{}

static int rtk_usb3_parameter_show(struct seq_file *s, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

static inline void create_debug_files(struct rtk_phy *rtk_phy)
{}

static inline void remove_debug_files(struct rtk_phy *rtk_phy)
{}
#else
static inline void create_debug_files(struct rtk_phy *rtk_phy) { }
static inline void remove_debug_files(struct rtk_phy *rtk_phy) { }
#endif /* CONFIG_DEBUG_FS */

static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,
				 struct phy_parameter *phy_parameter, int index)
{}

static void update_amplitude_control_value(struct rtk_phy *rtk_phy,
					   struct phy_parameter *phy_parameter)
{}

static int parse_phy_data(struct rtk_phy *rtk_phy)
{}

static int rtk_usb3phy_probe(struct platform_device *pdev)
{}

static void rtk_usb3phy_remove(struct platform_device *pdev)
{}

static const struct phy_cfg rtd1295_phy_cfg =;

static const struct phy_cfg rtd1619_phy_cfg =;

static const struct phy_cfg rtd1319_phy_cfg =;

static const struct phy_cfg rtd1619b_phy_cfg =;

static const  struct phy_cfg rtd1319d_phy_cfg =;

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

static struct platform_driver rtk_usb3phy_driver =;

module_platform_driver();

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