Skip to content

Commit e8b595f

Browse files
lumagrobclark
authored andcommitted
drm/msm/hdmi: make hdmi_phy_8996 OF clk provider
On MSM8996 the HDMI PHY provides the PLL clock to the MMCC. As we are preparing to convert the MSM8996 to use DT clocks properties (rather than global clock names), register the OF clock provider. While we are at it, also change the driver to use clk_parent_data rather parent_names to setup a link to the XO clock. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/492318/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent e3ea01f commit e8b595f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -691,24 +691,21 @@ static const struct clk_ops hdmi_8996_pll_ops = {
691691
.is_enabled = hdmi_8996_pll_is_enabled,
692692
};
693693

694-
static const char * const hdmi_pll_parents[] = {
695-
"xo",
696-
};
697-
698694
static const struct clk_init_data pll_init = {
699695
.name = "hdmipll",
700696
.ops = &hdmi_8996_pll_ops,
701-
.parent_names = hdmi_pll_parents,
702-
.num_parents = ARRAY_SIZE(hdmi_pll_parents),
697+
.parent_data = (const struct clk_parent_data[]){
698+
{ .fw_name = "xo", .name = "xo_board" },
699+
},
700+
.num_parents = 1,
703701
.flags = CLK_IGNORE_UNUSED,
704702
};
705703

706704
int msm_hdmi_pll_8996_init(struct platform_device *pdev)
707705
{
708706
struct device *dev = &pdev->dev;
709707
struct hdmi_pll_8996 *pll;
710-
struct clk *clk;
711-
int i;
708+
int i, ret;
712709

713710
pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL);
714711
if (!pll)
@@ -735,10 +732,16 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev)
735732
}
736733
pll->clk_hw.init = &pll_init;
737734

738-
clk = devm_clk_register(dev, &pll->clk_hw);
739-
if (IS_ERR(clk)) {
735+
ret = devm_clk_hw_register(dev, &pll->clk_hw);
736+
if (ret) {
740737
DRM_DEV_ERROR(dev, "failed to register pll clock\n");
741-
return -EINVAL;
738+
return ret;
739+
}
740+
741+
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &pll->clk_hw);
742+
if (ret) {
743+
DRM_DEV_ERROR(dev, "%s: failed to register clk provider: %d\n", __func__, ret);
744+
return ret;
742745
}
743746

744747
return 0;

0 commit comments

Comments
 (0)