linux/drivers/phy/cadence/cdns-dphy.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright: 2017-2018 Cadence Design Systems, Inc.
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset.h>

#include <linux/phy/phy.h>
#include <linux/phy/phy-mipi-dphy.h>

#define REG_WAKEUP_TIME_NS
#define DPHY_PLL_RATE_HZ
#define POLL_TIMEOUT_US

/* DPHY registers */
#define DPHY_PMA_CMN(reg)
#define DPHY_PMA_LCLK(reg)
#define DPHY_PMA_LDATA(lane, reg)
#define DPHY_PMA_RCLK(reg)
#define DPHY_PMA_RDATA(lane, reg)
#define DPHY_PCS(reg)

#define DPHY_CMN_SSM
#define DPHY_CMN_SSM_EN
#define DPHY_CMN_TX_MODE_EN

#define DPHY_CMN_PWM
#define DPHY_CMN_PWM_DIV(x)
#define DPHY_CMN_PWM_LOW(x)
#define DPHY_CMN_PWM_HIGH(x)

#define DPHY_CMN_FBDIV
#define DPHY_CMN_FBDIV_VAL(low, high)
#define DPHY_CMN_FBDIV_FROM_REG

#define DPHY_CMN_OPIPDIV
#define DPHY_CMN_IPDIV_FROM_REG
#define DPHY_CMN_IPDIV(x)
#define DPHY_CMN_OPDIV_FROM_REG
#define DPHY_CMN_OPDIV(x)

#define DPHY_BAND_CFG
#define DPHY_BAND_CFG_LEFT_BAND
#define DPHY_BAND_CFG_RIGHT_BAND

#define DPHY_PSM_CFG
#define DPHY_PSM_CFG_FROM_REG
#define DPHY_PSM_CLK_DIV(x)

#define DSI_HBP_FRAME_OVERHEAD
#define DSI_HSA_FRAME_OVERHEAD
#define DSI_HFP_FRAME_OVERHEAD
#define DSI_HSS_VSS_VSE_FRAME_OVERHEAD
#define DSI_BLANKING_FRAME_OVERHEAD
#define DSI_NULL_FRAME_OVERHEAD
#define DSI_EOT_PKT_SIZE

#define DPHY_TX_J721E_WIZ_PLL_CTRL
#define DPHY_TX_J721E_WIZ_STATUS
#define DPHY_TX_J721E_WIZ_RST_CTRL
#define DPHY_TX_J721E_WIZ_PSM_FREQ

#define DPHY_TX_J721E_WIZ_IPDIV
#define DPHY_TX_J721E_WIZ_OPDIV
#define DPHY_TX_J721E_WIZ_FBDIV
#define DPHY_TX_J721E_WIZ_LANE_RSTB
#define DPHY_TX_WIZ_PLL_LOCK
#define DPHY_TX_WIZ_O_CMN_READY

struct cdns_dphy_cfg {};

enum cdns_dphy_clk_lane_cfg {};

struct cdns_dphy;
struct cdns_dphy_ops {};

struct cdns_dphy {};

/* Order of bands is important since the index is the band number. */
static const unsigned int tx_bands[] =;

static int cdns_dsi_get_dphy_pll_cfg(struct cdns_dphy *dphy,
				     struct cdns_dphy_cfg *cfg,
				     struct phy_configure_opts_mipi_dphy *opts,
				     unsigned int *dsi_hfp_ext)
{}

static int cdns_dphy_setup_psm(struct cdns_dphy *dphy)
{}

static void cdns_dphy_set_clk_lane_cfg(struct cdns_dphy *dphy,
				       enum cdns_dphy_clk_lane_cfg cfg)
{}

static void cdns_dphy_set_pll_cfg(struct cdns_dphy *dphy,
				  const struct cdns_dphy_cfg *cfg)
{}

static unsigned long cdns_dphy_get_wakeup_time_ns(struct cdns_dphy *dphy)
{}

static unsigned long cdns_dphy_ref_get_wakeup_time_ns(struct cdns_dphy *dphy)
{}

static void cdns_dphy_ref_set_pll_cfg(struct cdns_dphy *dphy,
				      const struct cdns_dphy_cfg *cfg)
{}

static void cdns_dphy_ref_set_psm_div(struct cdns_dphy *dphy, u8 div)
{}

static unsigned long cdns_dphy_j721e_get_wakeup_time_ns(struct cdns_dphy *dphy)
{}

static void cdns_dphy_j721e_set_pll_cfg(struct cdns_dphy *dphy,
					const struct cdns_dphy_cfg *cfg)
{}

static void cdns_dphy_j721e_set_psm_div(struct cdns_dphy *dphy, u8 div)
{}

/*
 * This is the reference implementation of DPHY hooks. Specific integration of
 * this IP may have to re-implement some of them depending on how they decided
 * to wire things in the SoC.
 */
static const struct cdns_dphy_ops ref_dphy_ops =;

static const struct cdns_dphy_ops j721e_dphy_ops =;

static int cdns_dphy_config_from_opts(struct phy *phy,
				      struct phy_configure_opts_mipi_dphy *opts,
				      struct cdns_dphy_cfg *cfg)
{}

static int cdns_dphy_tx_get_band_ctrl(unsigned long hs_clk_rate)
{}

static int cdns_dphy_validate(struct phy *phy, enum phy_mode mode, int submode,
			      union phy_configure_opts *opts)
{}

static int cdns_dphy_configure(struct phy *phy, union phy_configure_opts *opts)
{}

static int cdns_dphy_power_on(struct phy *phy)
{}

static int cdns_dphy_power_off(struct phy *phy)
{}

static const struct phy_ops cdns_dphy_ops =;

static int cdns_dphy_probe(struct platform_device *pdev)
{}

static void cdns_dphy_remove(struct platform_device *pdev)
{}

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

static struct platform_driver cdns_dphy_platform_driver =;
module_platform_driver();

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