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

// SPDX-License-Identifier: GPL-2.0
/*
 *  phy-rtk-usb2.c RTK usb2.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>

/* GUSB2PHYACCn register */
#define PHY_NEW_REG_REQ
#define PHY_VSTS_BUSY
#define PHY_VCTRL_SHIFT
#define PHY_REG_DATA_MASK

#define GET_LOW_NIBBLE(addr)
#define GET_HIGH_NIBBLE(addr)

#define EFUS_USB_DC_CAL_RATE
#define EFUS_USB_DC_CAL_MAX

#define EFUS_USB_DC_DIS_RATE
#define EFUS_USB_DC_DIS_MAX

#define MAX_PHY_DATA_SIZE
#define OFFEST_PHY_READ

#define MAX_USB_PHY_NUM
#define MAX_USB_PHY_PAGE0_DATA_SIZE
#define MAX_USB_PHY_PAGE1_DATA_SIZE
#define MAX_USB_PHY_PAGE2_DATA_SIZE

#define SET_PAGE_OFFSET
#define SET_PAGE_0
#define SET_PAGE_1
#define SET_PAGE_2

#define PAGE_START
#define PAGE0_0XE4
#define PAGE0_0XE6
#define PAGE0_0XE7
#define PAGE1_0XE0
#define PAGE1_0XE2

#define SENSITIVITY_CTRL
#define ENABLE_AUTO_SENSITIVITY_CALIBRATION
#define DEFAULT_DC_DRIVING_VALUE
#define DEFAULT_DC_DISCONNECTION_VALUE
#define HS_CLK_SELECT

struct phy_reg {};

struct phy_data {};

struct phy_cfg {};

struct phy_parameter {};

struct rtk_phy {};

/* mapping 0xE0 to 0 ... 0xE7 to 7, 0xF0 to 8 ,,, 0xF7 to 15 */
static inline int page_addr_to_array_index(u8 addr)
{}

static inline u8 array_index_to_page_addr(int index)
{}

#define PHY_IO_TIMEOUT_USEC
#define PHY_IO_DELAY_US

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

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

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

static int rtk_phy_set_page(struct phy_reg *phy_reg, int page)
{}

static u8 __updated_dc_disconnect_level_page0_0xe4(struct phy_cfg *phy_cfg,
						   struct phy_parameter *phy_parameter, u8 data)
{}

/* updated disconnect level at page0 */
static void update_dc_disconnect_level_at_page0(struct rtk_phy *rtk_phy,
						struct phy_parameter *phy_parameter, bool update)
{}

static u8 __updated_dc_disconnect_level_page1_0xe2(struct phy_cfg *phy_cfg,
						   struct phy_parameter *phy_parameter, u8 data)
{}

/* updated disconnect level at page1 */
static void update_dc_disconnect_level_at_page1(struct rtk_phy *rtk_phy,
						struct phy_parameter *phy_parameter, bool update)
{}

static void update_dc_disconnect_level(struct rtk_phy *rtk_phy,
				       struct phy_parameter *phy_parameter, bool update)
{}

static u8 __update_dc_driving_page0_0xe4(struct phy_cfg *phy_cfg,
					 struct phy_parameter *phy_parameter, u8 data)
{}

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

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

static void do_rtk_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_usb2_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 int parse_phy_data(struct rtk_phy *rtk_phy)
{}

static int rtk_usb2phy_probe(struct platform_device *pdev)
{}

static void rtk_usb2phy_remove(struct platform_device *pdev)
{}

static const struct phy_cfg rtd1295_phy_cfg =;

static const struct phy_cfg rtd1395_phy_cfg =;

static const struct phy_cfg rtd1395_phy_cfg_2port =;

static const struct phy_cfg rtd1619_phy_cfg =;

static const struct phy_cfg rtd1319_phy_cfg =;

static const struct phy_cfg rtd1312c_phy_cfg =;

static const struct phy_cfg rtd1619b_phy_cfg =;

static const struct phy_cfg rtd1319d_phy_cfg =;

static const struct phy_cfg rtd1315e_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_usb2phy_driver =;

module_platform_driver();

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