Lines Matching refs:hdmi_phy

18 void mtk_hdmi_phy_clear_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset,
21 void __iomem *reg = hdmi_phy->regs + offset;
29 void mtk_hdmi_phy_set_bits(struct mtk_hdmi_phy *hdmi_phy, u32 offset,
32 void __iomem *reg = hdmi_phy->regs + offset;
40 void mtk_hdmi_phy_mask(struct mtk_hdmi_phy *hdmi_phy, u32 offset,
43 void __iomem *reg = hdmi_phy->regs + offset;
58 struct mtk_hdmi_phy *hdmi_phy = phy_get_drvdata(phy);
61 ret = clk_prepare_enable(hdmi_phy->pll);
65 hdmi_phy->conf->hdmi_phy_enable_tmds(hdmi_phy);
71 struct mtk_hdmi_phy *hdmi_phy = phy_get_drvdata(phy);
73 hdmi_phy->conf->hdmi_phy_disable_tmds(hdmi_phy);
74 clk_disable_unprepare(hdmi_phy->pll);
80 mtk_hdmi_phy_dev_get_ops(const struct mtk_hdmi_phy *hdmi_phy)
82 if (hdmi_phy && hdmi_phy->conf &&
83 hdmi_phy->conf->hdmi_phy_enable_tmds &&
84 hdmi_phy->conf->hdmi_phy_disable_tmds)
87 if (hdmi_phy)
88 dev_err(hdmi_phy->dev, "Failed to get dev ops of phy\n");
92 static void mtk_hdmi_phy_clk_get_data(struct mtk_hdmi_phy *hdmi_phy,
95 clk_init->flags = hdmi_phy->conf->flags;
96 clk_init->ops = hdmi_phy->conf->hdmi_phy_clk_ops;
102 struct mtk_hdmi_phy *hdmi_phy;
115 hdmi_phy = devm_kzalloc(dev, sizeof(*hdmi_phy), GFP_KERNEL);
116 if (!hdmi_phy)
120 hdmi_phy->regs = devm_ioremap_resource(dev, mem);
121 if (IS_ERR(hdmi_phy->regs)) {
122 ret = PTR_ERR(hdmi_phy->regs);
143 hdmi_phy->dev = dev;
144 hdmi_phy->conf =
146 mtk_hdmi_phy_clk_get_data(hdmi_phy, &clk_init);
147 hdmi_phy->pll_hw.init = &clk_init;
148 hdmi_phy->pll = devm_clk_register(dev, &hdmi_phy->pll_hw);
149 if (IS_ERR(hdmi_phy->pll)) {
150 ret = PTR_ERR(hdmi_phy->pll);
156 &hdmi_phy->ibias);
163 &hdmi_phy->ibias_up);
170 hdmi_phy->drv_imp_clk = 0x30;
171 hdmi_phy->drv_imp_d2 = 0x30;
172 hdmi_phy->drv_imp_d1 = 0x30;
173 hdmi_phy->drv_imp_d0 = 0x30;
175 phy = devm_phy_create(dev, NULL, mtk_hdmi_phy_dev_get_ops(hdmi_phy));
180 phy_set_drvdata(phy, hdmi_phy);
188 if (hdmi_phy->conf->pll_default_off)
189 hdmi_phy->conf->hdmi_phy_disable_tmds(hdmi_phy);
192 hdmi_phy->pll);