drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c

Source file repositories/reference/linux-study-clean/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c

File Facts

System
Linux kernel
Corpus path
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
Extension
.c
Size
64132 bytes
Lines
1717
Domain
Driver Families
Bucket
drivers/phy
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hs_drv_res_cfg {
	enum hs_drv_res_ohm clk_hs_drv_up_ohm;
	enum hs_drv_res_ohm clk_hs_drv_down_ohm;
	enum hs_drv_res_ohm data_hs_drv_up_ohm;
	enum hs_drv_res_ohm data_hs_drv_down_ohm;
};

struct samsung_mipi_dcphy_plat_data {
	const struct hs_drv_res_cfg *dphy_hs_drv_res_cfg;
	u32 dphy_tx_max_lane_kbps;
};

struct samsung_mipi_dcphy {
	struct device *dev;
	struct clk *ref_clk;
	struct clk *pclk;
	struct regmap *regmap;
	struct regmap *grf_regmap;
	struct reset_control *m_phy_rst;
	struct reset_control *s_phy_rst;
	struct reset_control *apb_rst;
	struct reset_control *grf_apb_rst;
	unsigned int lanes;
	struct phy *phy;
	u8 type;

	const struct samsung_mipi_dcphy_plat_data *pdata;
	struct {
		unsigned long long rate;
		u8 prediv;
		u16 fbdiv;
		long dsm;
		u8 scaler;

		bool ssc_en;
		u8 mfr;
		u8 mrr;
	} pll;
};

struct samsung_mipi_dphy_timing {
	unsigned int max_lane_mbps;
	u8 clk_prepare;
	u8 clk_zero;
	u8 clk_post;
	u8 clk_trail_eot;
	u8 hs_prepare;
	u8 hs_zero;
	u8 hs_trail_eot;
	u8 lpx;
	u8 hs_exit;
	u8 hs_settle;
};

/*
 * Timing values taken from rk3588 vendor kernel.
 * Not documented in hw documentation.
 */
static const
struct samsung_mipi_dphy_timing samsung_mipi_dphy_timing_table[] = {
	{6500, 32, 117, 31, 28, 30, 56, 27, 24, 44, 37},
	{6490, 32, 116, 31, 28, 30, 56, 27, 24, 44, 37},
	{6480, 32, 116, 31, 28, 30, 56, 27, 24, 44, 37},
	{6470, 32, 116, 31, 28, 30, 56, 27, 24, 44, 37},
	{6460, 32, 116, 31, 28, 30, 56, 27, 24, 44, 37},
	{6450, 32, 115, 31, 28, 30, 56, 27, 24, 44, 37},
	{6440, 32, 115, 31, 28, 30, 56, 27, 24, 44, 37},
	{6430, 31, 116, 31, 28, 30, 55, 27, 24, 44, 37},
	{6420, 31, 116, 31, 28, 30, 55, 27, 24, 44, 37},
	{6410, 31, 116, 31, 27, 30, 55, 27, 24, 44, 37},
	{6400, 31, 115, 30, 27, 30, 55, 27, 23, 43, 36},
	{6390, 31, 115, 30, 27, 30, 55, 27, 23, 43, 36},
	{6380, 31, 115, 30, 27, 30, 55, 27, 23, 43, 36},
	{6370, 31, 115, 30, 27, 30, 55, 26, 23, 43, 36},
	{6360, 31, 114, 30, 27, 30, 54, 26, 23, 43, 36},
	{6350, 31, 114, 30, 27, 30, 54, 26, 23, 43, 36},
	{6340, 31, 114, 30, 27, 30, 54, 26, 23, 43, 36},
	{6330, 31, 114, 30, 27, 30, 54, 26, 23, 43, 36},
	{6320, 31, 113, 30, 27, 30, 54, 26, 23, 43, 36},
	{6310, 31, 113, 30, 27, 30, 54, 26, 23, 43, 36},
	{6300, 31, 113, 30, 27, 30, 54, 26, 23, 43, 36},
	{6290, 31, 113, 30, 27, 29, 54, 26, 23, 43, 36},
	{6280, 31, 112, 30, 27, 29, 54, 26, 23, 43, 36},
	{6270, 31, 112, 30, 27, 29, 54, 26, 23, 43, 36},
	{6260, 31, 112, 30, 27, 29, 54, 26, 23, 43, 36},
	{6250, 31, 112, 30, 27, 29, 54, 26, 23, 42, 36},
	{6240, 30, 113, 30, 27, 29, 54, 26, 23, 42, 36},
	{6230, 30, 112, 30, 27, 29, 54, 26, 23, 42, 35},
	{6220, 30, 112, 30, 27, 29, 53, 26, 23, 42, 35},
	{6210, 30, 112, 30, 27, 29, 53, 26, 23, 42, 35},

Annotation

Implementation Notes