#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_address.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include "phy-qcom-qmp.h"
#include "phy-qcom-qmp-pcs-misc-v3.h"
#include "phy-qcom-qmp-pcs-usb-v4.h"
#include "phy-qcom-qmp-pcs-usb-v5.h"
#include "phy-qcom-qmp-dp-com-v3.h"
#define SW_DPPHY_RESET …
#define SW_DPPHY_RESET_MUX …
#define SW_USB3PHY_RESET …
#define SW_USB3PHY_RESET_MUX …
#define USB3_MODE …
#define DP_MODE …
#define PHY_INIT_COMPLETE_TIMEOUT …
struct qmp_phy_init_tbl { … };
#define QMP_PHY_INIT_CFG(o, v) …
#define QMP_PHY_INIT_CFG_LANE(o, v, l) …
enum qphy_reg_layout { … };
static const unsigned int qmp_v3_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
static const unsigned int qmp_v4_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
static const unsigned int qmp_v5_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_pcs_usb_tbl[] = …;
struct qmp_usb_legacy_offsets { … };
struct qmp_phy_cfg { … };
struct qmp_usb { … };
static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val)
{ … }
static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val)
{ … }
static const char * const qmp_v3_phy_clk_l[] = …;
static const char * const qmp_v4_ref_phy_clk_l[] = …;
static const char * const qmp_v4_sm8250_usbphy_clk_l[] = …;
static const char * const msm8996_usb3phy_reset_l[] = …;
static const char * const sc7180_usb3phy_reset_l[] = …;
static const char * const qmp_phy_vreg_l[] = …;
static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = …;
static const struct qmp_phy_cfg sc7180_usb3phy_cfg = …;
static const struct qmp_phy_cfg sm8150_usb3phy_cfg = …;
static const struct qmp_phy_cfg sm8250_usb3phy_cfg = …;
static const struct qmp_phy_cfg sm8350_usb3phy_cfg = …;
static void qmp_usb_legacy_configure_lane(void __iomem *base,
const struct qmp_phy_init_tbl tbl[],
int num,
u8 lane_mask)
{ … }
static void qmp_usb_legacy_configure(void __iomem *base,
const struct qmp_phy_init_tbl tbl[],
int num)
{ … }
static int qmp_usb_legacy_serdes_init(struct qmp_usb *qmp)
{ … }
static void qmp_usb_legacy_init_dp_com(struct phy *phy)
{ … }
static int qmp_usb_legacy_init(struct phy *phy)
{ … }
static int qmp_usb_legacy_exit(struct phy *phy)
{ … }
static int qmp_usb_legacy_power_on(struct phy *phy)
{ … }
static int qmp_usb_legacy_power_off(struct phy *phy)
{ … }
static int qmp_usb_legacy_enable(struct phy *phy)
{ … }
static int qmp_usb_legacy_disable(struct phy *phy)
{ … }
static int qmp_usb_legacy_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{ … }
static const struct phy_ops qmp_usb_legacy_phy_ops = …;
static void qmp_usb_legacy_enable_autonomous_mode(struct qmp_usb *qmp)
{ … }
static void qmp_usb_legacy_disable_autonomous_mode(struct qmp_usb *qmp)
{ … }
static int __maybe_unused qmp_usb_legacy_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused qmp_usb_legacy_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops qmp_usb_legacy_pm_ops = …;
static int qmp_usb_legacy_vreg_init(struct qmp_usb *qmp)
{ … }
static int qmp_usb_legacy_reset_init(struct qmp_usb *qmp)
{ … }
static int qmp_usb_legacy_clk_init(struct qmp_usb *qmp)
{ … }
static void phy_clk_release_provider(void *res)
{ … }
static int phy_pipe_clk_register(struct qmp_usb *qmp, struct device_node *np)
{ … }
static int qmp_usb_legacy_parse_dt_legacy(struct qmp_usb *qmp, struct device_node *np)
{ … }
static int qmp_usb_legacy_parse_dt(struct qmp_usb *qmp)
{ … }
static int qmp_usb_legacy_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id qmp_usb_legacy_of_match_table[] = …;
MODULE_DEVICE_TABLE(of, qmp_usb_legacy_of_match_table);
static struct platform_driver qmp_usb_legacy_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;