linux/drivers/phy/qualcomm/phy-qcom-qmp-usbc.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/mfd/syscon.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/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/usb/typec.h>
#include <linux/usb/typec_mux.h>

#include "phy-qcom-qmp-common.h"

#include "phy-qcom-qmp.h"
#include "phy-qcom-qmp-pcs-misc-v3.h"

#define PHY_INIT_COMPLETE_TIMEOUT

/* 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_v3_usb3phy_regs_layout_qcm2290[QPHY_LAYOUT_SIZE] =;

static const struct qmp_phy_init_tbl msm8998_usb3_serdes_tbl[] =;

static const struct qmp_phy_init_tbl msm8998_usb3_tx_tbl[] =;

static const struct qmp_phy_init_tbl msm8998_usb3_rx_tbl[] =;

static const struct qmp_phy_init_tbl msm8998_usb3_pcs_tbl[] =;

static const struct qmp_phy_init_tbl qcm2290_usb3_serdes_tbl[] =;

static const struct qmp_phy_init_tbl qcm2290_usb3_tx_tbl[] =;

static const struct qmp_phy_init_tbl qcm2290_usb3_rx_tbl[] =;

/* the only difference is QSERDES_V3_RX_UCDR_PI_CONTROLS */
static const struct qmp_phy_init_tbl sdm660_usb3_rx_tbl[] =;

static const struct qmp_phy_init_tbl qcm2290_usb3_pcs_tbl[] =;

struct qmp_usbc_offsets {};

/* struct qmp_phy_cfg - per-PHY initialization config */
struct qmp_phy_cfg {};

struct qmp_usbc {};

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_usbc_phy_clk_l[] =;

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

static const char * const usb3phy_reset_l[] =;

/* list of regulators */
static const char * const qmp_phy_vreg_l[] =;

static const struct qmp_usbc_offsets qmp_usbc_offsets_v3_qcm2290 =;

static const struct qmp_phy_cfg msm8998_usb3phy_cfg =;

static const struct qmp_phy_cfg qcm2290_usb3phy_cfg =;

static const struct qmp_phy_cfg sdm660_usb3phy_cfg =;

static int qmp_usbc_init(struct phy *phy)
{}

static int qmp_usbc_exit(struct phy *phy)
{}

static int qmp_usbc_power_on(struct phy *phy)
{}

static int qmp_usbc_power_off(struct phy *phy)
{}

static int qmp_usbc_enable(struct phy *phy)
{}

static int qmp_usbc_disable(struct phy *phy)
{}

static int qmp_usbc_set_mode(struct phy *phy, enum phy_mode mode, int submode)
{}

static const struct phy_ops qmp_usbc_phy_ops =;

static void qmp_usbc_enable_autonomous_mode(struct qmp_usbc *qmp)
{}

static void qmp_usbc_disable_autonomous_mode(struct qmp_usbc *qmp)
{}

static int __maybe_unused qmp_usbc_runtime_suspend(struct device *dev)
{}

static int __maybe_unused qmp_usbc_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops qmp_usbc_pm_ops =;

static int qmp_usbc_vreg_init(struct qmp_usbc *qmp)
{}

static int qmp_usbc_reset_init(struct qmp_usbc *qmp,
			      const char *const *reset_list,
			      int num_resets)
{}

static int qmp_usbc_clk_init(struct qmp_usbc *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_usbc *qmp, struct device_node *np)
{}

#if IS_ENABLED(CONFIG_TYPEC)
static int qmp_usbc_typec_switch_set(struct typec_switch_dev *sw,
				      enum typec_orientation orientation)
{}

static void qmp_usbc_typec_unregister(void *data)
{}

static int qmp_usbc_typec_switch_register(struct qmp_usbc *qmp)
{}
#else
static int qmp_usbc_typec_switch_register(struct qmp_usbc *qmp)
{
	return 0;
}
#endif

static int qmp_usbc_parse_dt_legacy(struct qmp_usbc *qmp, struct device_node *np)
{}

static int qmp_usbc_parse_dt(struct qmp_usbc *qmp)
{}

static int qmp_usbc_parse_vls_clamp(struct qmp_usbc *qmp)
{}

static int qmp_usbc_probe(struct platform_device *pdev)
{}

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

static struct platform_driver qmp_usbc_driver =;

module_platform_driver();

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