linux/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (c) 2016 Allwinnertech Co., Ltd.
 * Copyright (C) 2017-2018 Bootlin
 *
 * Maxime Ripard <[email protected]>
 */

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>

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

#define SUN6I_DPHY_GCTL_REG
#define SUN6I_DPHY_GCTL_LANE_NUM(n)
#define SUN6I_DPHY_GCTL_EN

#define SUN6I_DPHY_TX_CTL_REG
#define SUN6I_DPHY_TX_CTL_HS_TX_CLK_CONT

#define SUN6I_DPHY_RX_CTL_REG
#define SUN6I_DPHY_RX_CTL_EN_DBC
#define SUN6I_DPHY_RX_CTL_RX_CLK_FORCE
#define SUN6I_DPHY_RX_CTL_RX_D3_FORCE
#define SUN6I_DPHY_RX_CTL_RX_D2_FORCE
#define SUN6I_DPHY_RX_CTL_RX_D1_FORCE
#define SUN6I_DPHY_RX_CTL_RX_D0_FORCE

#define SUN6I_DPHY_TX_TIME0_REG
#define SUN6I_DPHY_TX_TIME0_HS_TRAIL(n)
#define SUN6I_DPHY_TX_TIME0_HS_PREPARE(n)
#define SUN6I_DPHY_TX_TIME0_LP_CLK_DIV(n)

#define SUN6I_DPHY_TX_TIME1_REG
#define SUN6I_DPHY_TX_TIME1_CLK_POST(n)
#define SUN6I_DPHY_TX_TIME1_CLK_PRE(n)
#define SUN6I_DPHY_TX_TIME1_CLK_ZERO(n)
#define SUN6I_DPHY_TX_TIME1_CLK_PREPARE(n)

#define SUN6I_DPHY_TX_TIME2_REG
#define SUN6I_DPHY_TX_TIME2_CLK_TRAIL(n)

#define SUN6I_DPHY_TX_TIME3_REG

#define SUN6I_DPHY_TX_TIME4_REG
#define SUN6I_DPHY_TX_TIME4_HS_TX_ANA1(n)
#define SUN6I_DPHY_TX_TIME4_HS_TX_ANA0(n)

#define SUN6I_DPHY_RX_TIME0_REG
#define SUN6I_DPHY_RX_TIME0_HS_RX_SYNC(n)
#define SUN6I_DPHY_RX_TIME0_HS_RX_CLK_MISS(n)
#define SUN6I_DPHY_RX_TIME0_LP_RX(n)

#define SUN6I_DPHY_RX_TIME1_REG
#define SUN6I_DPHY_RX_TIME1_RX_DLY(n)
#define SUN6I_DPHY_RX_TIME1_LP_RX_ULPS_WP(n)

#define SUN6I_DPHY_RX_TIME2_REG
#define SUN6I_DPHY_RX_TIME2_HS_RX_ANA1(n)
#define SUN6I_DPHY_RX_TIME2_HS_RX_ANA0(n)

#define SUN6I_DPHY_RX_TIME3_REG
#define SUN6I_DPHY_RX_TIME3_LPRST_DLY(n)

#define SUN6I_DPHY_ANA0_REG
#define SUN6I_DPHY_ANA0_REG_PWS
#define SUN6I_DPHY_ANA0_REG_PWEND
#define SUN6I_DPHY_ANA0_REG_PWENC
#define SUN6I_DPHY_ANA0_REG_DMPC
#define SUN6I_DPHY_ANA0_REG_DMPD(n)
#define SUN6I_DPHY_ANA0_REG_SRXDT(n)
#define SUN6I_DPHY_ANA0_REG_SRXCK(n)
#define SUN6I_DPHY_ANA0_REG_SDIV2
#define SUN6I_DPHY_ANA0_REG_SLV(n)
#define SUN6I_DPHY_ANA0_REG_DEN(n)
#define SUN6I_DPHY_ANA0_REG_PLR(n)
#define SUN6I_DPHY_ANA0_REG_SFB(n)
#define SUN6I_DPHY_ANA0_REG_RSD
#define SUN6I_DPHY_ANA0_REG_SELSCK

#define SUN6I_DPHY_ANA1_REG
#define SUN6I_DPHY_ANA1_REG_VTTMODE
#define SUN6I_DPHY_ANA1_REG_CSMPS(n)
#define SUN6I_DPHY_ANA1_REG_SVTT(n)

#define SUN6I_DPHY_ANA2_REG
#define SUN6I_DPHY_ANA2_EN_P2S_CPU(n)
#define SUN6I_DPHY_ANA2_EN_P2S_CPU_MASK
#define SUN6I_DPHY_ANA2_EN_CK_CPU
#define SUN6I_DPHY_ANA2_REG_ENIB

#define SUN6I_DPHY_ANA3_REG
#define SUN6I_DPHY_ANA3_EN_VTTD(n)
#define SUN6I_DPHY_ANA3_EN_VTTD_MASK
#define SUN6I_DPHY_ANA3_EN_VTTC
#define SUN6I_DPHY_ANA3_EN_DIV
#define SUN6I_DPHY_ANA3_EN_LDOC
#define SUN6I_DPHY_ANA3_EN_LDOD
#define SUN6I_DPHY_ANA3_EN_LDOR

#define SUN6I_DPHY_ANA4_REG
#define SUN6I_DPHY_ANA4_REG_EN_MIPI
#define SUN6I_DPHY_ANA4_REG_EN_COMTEST
#define SUN6I_DPHY_ANA4_REG_COMTEST(n)
#define SUN6I_DPHY_ANA4_REG_IB(n)
#define SUN6I_DPHY_ANA4_REG_DMPLVC
#define SUN6I_DPHY_ANA4_REG_DMPLVD(n)
#define SUN6I_DPHY_ANA4_REG_VTT_SET(n)
#define SUN6I_DPHY_ANA4_REG_CKDV(n)
#define SUN6I_DPHY_ANA4_REG_TMSC(n)
#define SUN6I_DPHY_ANA4_REG_TMSD(n)
#define SUN6I_DPHY_ANA4_REG_TXDNSC(n)
#define SUN6I_DPHY_ANA4_REG_TXDNSD(n)
#define SUN6I_DPHY_ANA4_REG_TXPUSC(n)
#define SUN6I_DPHY_ANA4_REG_TXPUSD(n)

#define SUN6I_DPHY_DBG5_REG

#define SUN50I_DPHY_TX_SLEW_REG0
#define SUN50I_DPHY_TX_SLEW_REG1
#define SUN50I_DPHY_TX_SLEW_REG2

#define SUN50I_DPHY_PLL_REG0
#define SUN50I_DPHY_PLL_REG0_CP36_EN
#define SUN50I_DPHY_PLL_REG0_LDO_EN
#define SUN50I_DPHY_PLL_REG0_EN_LVS
#define SUN50I_DPHY_PLL_REG0_PLL_EN
#define SUN50I_DPHY_PLL_REG0_P(n)
#define SUN50I_DPHY_PLL_REG0_N(n)
#define SUN50I_DPHY_PLL_REG0_NDET
#define SUN50I_DPHY_PLL_REG0_TDIV
#define SUN50I_DPHY_PLL_REG0_M0(n)
#define SUN50I_DPHY_PLL_REG0_M1(n)

#define SUN50I_DPHY_PLL_REG1
#define SUN50I_DPHY_PLL_REG1_UNLOCK_MDSEL(n)
#define SUN50I_DPHY_PLL_REG1_LOCKMDSEL
#define SUN50I_DPHY_PLL_REG1_LOCKDET_EN
#define SUN50I_DPHY_PLL_REG1_VSETA(n)
#define SUN50I_DPHY_PLL_REG1_VSETD(n)
#define SUN50I_DPHY_PLL_REG1_LPF_SW
#define SUN50I_DPHY_PLL_REG1_ICP_SEL(n)
#define SUN50I_DPHY_PLL_REG1_ATEST_SEL(n)
#define SUN50I_DPHY_PLL_REG1_TEST_EN

#define SUN50I_DPHY_PLL_REG2
#define SUN50I_DPHY_PLL_REG2_SDM_EN
#define SUN50I_DPHY_PLL_REG2_FF_EN
#define SUN50I_DPHY_PLL_REG2_SS_EN
#define SUN50I_DPHY_PLL_REG2_SS_FRAC(n)
#define SUN50I_DPHY_PLL_REG2_SS_INT(n)
#define SUN50I_DPHY_PLL_REG2_FRAC(n)

#define SUN50I_COMBO_PHY_REG0
#define SUN50I_COMBO_PHY_REG0_EN_TEST_COMBOLDO
#define SUN50I_COMBO_PHY_REG0_EN_TEST_0P8
#define SUN50I_COMBO_PHY_REG0_EN_MIPI
#define SUN50I_COMBO_PHY_REG0_EN_LVDS
#define SUN50I_COMBO_PHY_REG0_EN_COMBOLDO
#define SUN50I_COMBO_PHY_REG0_EN_CP

#define SUN50I_COMBO_PHY_REG1
#define SUN50I_COMBO_PHY_REG2_REG_VREF1P6(n)
#define SUN50I_COMBO_PHY_REG2_REG_VREF0P8(n)

#define SUN50I_COMBO_PHY_REG2
#define SUN50I_COMBO_PHY_REG2_HS_STOP_DLY(n)

enum sun6i_dphy_direction {};

struct sun6i_dphy;

struct sun6i_dphy_variant {};

struct sun6i_dphy {};

static int sun6i_dphy_init(struct phy *phy)
{}

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

static void sun6i_a31_mipi_dphy_tx_power_on(struct sun6i_dphy *dphy)
{}

static void sun50i_a100_mipi_dphy_tx_power_on(struct sun6i_dphy *dphy)
{}

static int sun6i_dphy_tx_power_on(struct sun6i_dphy *dphy)
{}

static int sun6i_dphy_rx_power_on(struct sun6i_dphy *dphy)
{}

static int sun6i_dphy_power_on(struct phy *phy)
{}

static int sun6i_dphy_power_off(struct phy *phy)
{}

static int sun6i_dphy_exit(struct phy *phy)
{}


static const struct phy_ops sun6i_dphy_ops =;

static const struct regmap_config sun6i_dphy_regmap_config =;

static int sun6i_dphy_probe(struct platform_device *pdev)
{}

static const struct sun6i_dphy_variant sun6i_a31_mipi_dphy_variant =;

static const struct sun6i_dphy_variant sun50i_a100_mipi_dphy_variant =;

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

static struct platform_driver sun6i_dphy_platform_driver =;
module_platform_driver();

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