#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_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-common.h"
#include "phy-qcom-qmp.h"
#include "phy-qcom-qmp-pcs-misc-v3.h"
#include "phy-qcom-qmp-pcs-misc-v4.h"
#include "phy-qcom-qmp-pcs-usb-v4.h"
#include "phy-qcom-qmp-pcs-usb-v5.h"
#include "phy-qcom-qmp-pcs-usb-v6.h"
#include "phy-qcom-qmp-pcs-usb-v7.h"
#define PHY_INIT_COMPLETE_TIMEOUT …
enum qphy_reg_layout { … };
static const unsigned int qmp_v2_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
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 unsigned int qmp_v6_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
static const unsigned int qmp_v7_usb3phy_regs_layout[QPHY_LAYOUT_SIZE] = …;
static const struct qmp_phy_init_tbl ipq9574_usb3_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl ipq9574_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl ipq9574_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl ipq9574_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl ipq8074_usb3_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl ipq8074_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl ipq8074_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl msm8996_usb3_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl msm8996_usb3_tx_tbl[] = …;
static const struct qmp_phy_init_tbl msm8996_usb3_rx_tbl[] = …;
static const struct qmp_phy_init_tbl msm8996_usb3_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl qdu1000_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl qdu1000_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_uniphy_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl qmp_v3_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_uniphy_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8150_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8250_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sdx55_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx55_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx65_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx65_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx75_usb3_uniphy_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl sdx75_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx75_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sdx75_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sdx75_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sm8350_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = …;
static const struct qmp_phy_init_tbl x1e80100_usb3_uniphy_serdes_tbl[] = …;
static const struct qmp_phy_init_tbl x1e80100_usb3_uniphy_tx_tbl[] = …;
static const struct qmp_phy_init_tbl x1e80100_usb3_uniphy_rx_tbl[] = …;
static const struct qmp_phy_init_tbl x1e80100_usb3_uniphy_pcs_tbl[] = …;
static const struct qmp_phy_init_tbl x1e80100_usb3_uniphy_pcs_usb_tbl[] = …;
struct qmp_usb_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_usb_phy_clk_l[] = …;
static const char * const usb3phy_legacy_reset_l[] = …;
static const char * const usb3phy_reset_l[] = …;
static const char * const qmp_phy_vreg_l[] = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v3 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_ipq9574 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v3_msm8996 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v4 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v5 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v6 = …;
static const struct qmp_usb_offsets qmp_usb_offsets_v7 = …;
static const struct qmp_phy_cfg ipq6018_usb3phy_cfg = …;
static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = …;
static const struct qmp_phy_cfg ipq9574_usb3phy_cfg = …;
static const struct qmp_phy_cfg msm8996_usb3phy_cfg = …;
static const struct qmp_phy_cfg qdu1000_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sdx75_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = …;
static const struct qmp_phy_cfg x1e80100_usb3_uniphy_cfg = …;
static int qmp_usb_serdes_init(struct qmp_usb *qmp)
{ … }
static int qmp_usb_init(struct phy *phy)
{ … }
static int qmp_usb_exit(struct phy *phy)
{ … }
static int qmp_usb_power_on(struct phy *phy)
{ … }
static int qmp_usb_power_off(struct phy *phy)
{ … }
static int qmp_usb_enable(struct phy *phy)
{ … }
static int qmp_usb_disable(struct phy *phy)
{ … }
static int qmp_usb_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{ … }
static const struct phy_ops qmp_usb_phy_ops = …;
static void qmp_usb_enable_autonomous_mode(struct qmp_usb *qmp)
{ … }
static void qmp_usb_disable_autonomous_mode(struct qmp_usb *qmp)
{ … }
static int __maybe_unused qmp_usb_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused qmp_usb_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops qmp_usb_pm_ops = …;
static int qmp_usb_vreg_init(struct qmp_usb *qmp)
{ … }
static int qmp_usb_reset_init(struct qmp_usb *qmp,
const char *const *reset_list,
int num_resets)
{ … }
static int qmp_usb_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 void __iomem *qmp_usb_iomap(struct device *dev, struct device_node *np,
int index, bool exclusive)
{ … }
static int qmp_usb_parse_dt_legacy(struct qmp_usb *qmp, struct device_node *np)
{ … }
static int qmp_usb_parse_dt(struct qmp_usb *qmp)
{ … }
static int qmp_usb_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id qmp_usb_of_match_table[] = …;
MODULE_DEVICE_TABLE(of, qmp_usb_of_match_table);
static struct platform_driver qmp_usb_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;