On MSM8996 the HDMI PHY is the QMP PHY, it provides an HDMI PLL clock used by the MMCC. Add support for providing this clock to the OF framework by registerding the clock provider and adding #clock-cells property to the DT node.
Dmitry Baryshkov (3): dt-bindings: phy: qcom,hdmi-phy-qmp: add clock-cells drm/msm/hdmi: make hdmi_phy_8996 OF clk provider arm64: dts: qcom: msm8996: add #clock-cells to the HDMI PHY node
.../bindings/phy/qcom,hdmi-phy-qmp.yaml | 4 ++++ arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 ++ drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 15 ++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-)
As the QMP HDMI PHY is a clock provider, add constant #clock-cells property. For the compatibility with older DTs the property is not marked as required.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml b/Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml index eea2e02678ed..1ada0d9857c0 100644 --- a/Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,hdmi-phy-qmp.yaml @@ -44,6 +44,9 @@ properties: vddio-supply: description: phandle to VDD I/O supply regulator
+ '#clock-cells': + const: 0 + '#phy-cells': const: 0
@@ -78,6 +81,7 @@ examples: <&gcc 214>; clock-names = "iface", "ref"; + #clock-cells = <0>; #phy-cells = <0>;
vddio-supply = <&vreg_l12a_1p8>;
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.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c index b06d9d25a189..cfb83e9dd810 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c @@ -707,8 +707,7 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hdmi_pll_8996 *pll; - struct clk *clk; - int i; + int i, ret;
pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL); if (!pll) @@ -735,10 +734,16 @@ int msm_hdmi_pll_8996_init(struct platform_device *pdev) } pll->clk_hw.init = &pll_init;
- clk = devm_clk_register(dev, &pll->clk_hw); - if (IS_ERR(clk)) { + ret = devm_clk_hw_register(dev, &pll->clk_hw); + if (ret) { DRM_DEV_ERROR(dev, "failed to register pll clock\n"); - return -EINVAL; + return ret; + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &pll->clk_hw); + if (ret) { + DRM_DEV_ERROR(dev, "%s: failed to register clk provider: %d\n", __func__, ret); + return ret; }
return 0;
Quoting Dmitry Baryshkov (2022-06-17 03:36:07)
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.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org
Reviewed-by: Stephen Boyd swboyd@chromium.org
Add #clock-cells property to the HDMI PHY device node to let other nodes resolve the hdmipll clock.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi index 9932186f7ceb..f94f10947f26 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -964,6 +964,8 @@ hdmi_phy: hdmi-phy@9a0600 { clock-names = "iface", "ref";
+ #clock-cells = <0>; + status = "disabled"; }; };
Quoting Dmitry Baryshkov (2022-06-17 03:36:08)
Add #clock-cells property to the HDMI PHY device node to let other nodes resolve the hdmipll clock.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org
Reviewed-by: Stephen Boyd swboyd@chromium.org
dri-devel@lists.freedesktop.org