drivers/phy/samsung/phy-samsung-ufs.h

Source file repositories/reference/linux-study-clean/drivers/phy/samsung/phy-samsung-ufs.h

File Facts

System
Linux kernel
Corpus path
drivers/phy/samsung/phy-samsung-ufs.h
Extension
.h
Size
4436 bytes
Lines
164
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 samsung_ufs_phy_cfg {
	u32 off_0;
	u32 off_1;
	u32 val;
	u8 desc;
	u8 id;
};

struct samsung_ufs_phy_pmu_isol {
	u32 offset;
	u32 mask;
	u32 en;
};

struct samsung_ufs_phy_drvdata {
	const struct samsung_ufs_phy_cfg **cfgs;
	const struct samsung_ufs_phy_cfg **cfgs_hibern8;
	struct samsung_ufs_phy_pmu_isol isol;
	const char * const *clk_list;
	int num_clks;
	u32 cdr_lock_status_offset;
	/* SoC's specific operations */
	int (*wait_for_cal)(struct phy *phy, u8 lane);
	int (*wait_for_cdr)(struct phy *phy, u8 lane);
};

struct samsung_ufs_phy {
	struct device *dev;
	void __iomem *reg_pma;
	struct regmap *reg_pmu;
	struct clk_bulk_data *clks;
	const struct samsung_ufs_phy_drvdata *drvdata;
	const struct samsung_ufs_phy_cfg * const *cfgs;
	const struct samsung_ufs_phy_cfg * const *cfgs_hibern8;
	struct samsung_ufs_phy_pmu_isol isol;
	u8 lane_cnt;
	int ufs_phy_state;
	enum phy_mode mode;
};

static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy)
{
	return (struct samsung_ufs_phy *)phy_get_drvdata(phy);
}

static inline void samsung_ufs_phy_ctrl_isol(
		struct samsung_ufs_phy *phy, u32 isol)
{
	regmap_update_bits(phy->reg_pmu, phy->isol.offset,
			   phy->isol.mask, isol ? 0 : phy->isol.en);
}

int samsung_ufs_phy_wait_for_lock_acq(struct phy *phy, u8 lane);
int exynosautov920_ufs_phy_wait_cdr_lock(struct phy *phy, u8 lane);
void samsung_ufs_phy_config(struct samsung_ufs_phy *phy,
			    const struct samsung_ufs_phy_cfg *cfg, u8 lane);

extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;
extern const struct samsung_ufs_phy_drvdata exynosautov9_ufs_phy;
extern const struct samsung_ufs_phy_drvdata exynosautov920_ufs_phy;
extern const struct samsung_ufs_phy_drvdata fsd_ufs_phy;
extern const struct samsung_ufs_phy_drvdata tensor_gs101_ufs_phy;

#endif /* _PHY_SAMSUNG_UFS_ */

Annotation

Implementation Notes