aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2016-02-25 11:22:39 +0530
committerRob Clark <robdclark@gmail.com>2016-02-29 09:48:30 -0500
commitea184891b60dd202aa151828c04ec7f7b97502e5 (patch)
treea7a6f087beac52f44a25e8220b810fd811c28f66 /drivers/gpu/drm/msm/hdmi/hdmi_phy.c
parentdrm/msm/hdmi: Create a separate HDMI PHY driver (diff)
downloadlinux-dev-ea184891b60dd202aa151828c04ec7f7b97502e5.tar.xz
linux-dev-ea184891b60dd202aa151828c04ec7f7b97502e5.zip
drm/msm/hdmi: Manage HDMI PLL through PHY driver
Add a helper to initialize PLL in the PHY driver. HDMI PLLs are going to have their own mmio base different from that of PHY. For the clock code in hdmi_phy_8960.c, some changes were needed for it to work with the updated register offsets. Create a copy of the updated clock code in hdmi_pll_8960.c, instead of rewriting it in hdmi_phy_8960.c itself. This removes the need to place CONFIG_COMMON_CLOCK checks all around, makes the code more legible, and also removes some old checkpatch warnings with the original code. The older hdmi pll clock ops in hdmi_phy_8960.c will be removed later. The driver will use these until the HDMI PHY/PLL register offsets aren't considered as separate domains (i.e. their offsets start from 0). Signed-off-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi/hdmi_phy.c')
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi_phy.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
index de3f0f504ede..9ad4573b6fd5 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_phy.c
@@ -118,6 +118,28 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy)
phy->cfg->powerdown(phy);
}
+static int hdmi_phy_pll_init(struct platform_device *pdev,
+ enum hdmi_phy_type type)
+{
+ int ret;
+
+ switch (type) {
+ case MSM_HDMI_PHY_8960:
+ ret = hdmi_pll_8960_init(pdev);
+ break;
+ /*
+ * we don't have PLL support for these, don't report an error for now
+ */
+ case MSM_HDMI_PHY_8x60:
+ case MSM_HDMI_PHY_8x74:
+ default:
+ ret = 0;
+ break;
+ }
+
+ return ret;
+}
+
static int hdmi_phy_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -146,6 +168,19 @@ static int hdmi_phy_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
+ ret = hdmi_phy_resource_enable(phy);
+ if (ret)
+ return ret;
+
+ ret = hdmi_phy_pll_init(pdev, phy->cfg->type);
+ if (ret) {
+ dev_err(dev, "couldn't init PLL\n");
+ hdmi_phy_resource_disable(phy);
+ return ret;
+ }
+
+ hdmi_phy_resource_disable(phy);
+
platform_set_drvdata(pdev, phy);
return 0;