linux/drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 */

#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"

/* QPHY_V3_DP_COM_RESET_OVRD_CTRL register bits */
/* DP PHY soft reset */
#define SW_DPPHY_RESET
/* mux to select DP PHY reset control, 0:HW control, 1: software reset */
#define SW_DPPHY_RESET_MUX
/* USB3 PHY soft reset */
#define SW_USB3PHY_RESET
/* mux to select USB3 PHY reset control, 0:HW control, 1: software reset */
#define SW_USB3PHY_RESET_MUX

/* QPHY_V3_DP_COM_PHY_MODE_CTRL register bits */
#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)

/* set of registers with offsets different per-PHY */
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 - per-PHY initialization config */
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)
{}

/* list of clocks required by phy */
static const char * const qmp_v3_phy_clk_l[] =;

static const char * const qmp_v4_ref_phy_clk_l[] =;

/* the primary usb3 phy on sm8250 doesn't have a ref clock */
static const char * const qmp_v4_sm8250_usbphy_clk_l[] =;

/* list of resets */
static const char * const msm8996_usb3phy_reset_l[] =;

static const char * const sc7180_usb3phy_reset_l[] =;

/* list of regulators */
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)
{}

/*
 * Register a fixed rate pipe clock.
 *
 * The <s>_pipe_clksrc generated by PHY goes to the GCC that gate
 * controls it. The <s>_pipe_clk coming out of the GCC is requested
 * by the PHY driver for its operations.
 * We register the <s>_pipe_clksrc here. The gcc driver takes care
 * of assigning this <s>_pipe_clksrc as parent to <s>_pipe_clk.
 * Below picture shows this relationship.
 *
 *         +---------------+
 *         |   PHY block   |<<---------------------------------------+
 *         |               |                                         |
 *         |   +-------+   |                   +-----+               |
 *   I/P---^-->|  PLL  |---^--->pipe_clksrc--->| GCC |--->pipe_clk---+
 *    clk  |   +-------+   |                   +-----+
 *         +---------------+
 */
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();