Commit ea184891 authored by Archit Taneja's avatar Archit Taneja Committed by Rob Clark

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: default avatarArchit Taneja <architt@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 15b4a452
...@@ -53,6 +53,7 @@ msm-y := \ ...@@ -53,6 +53,7 @@ msm-y := \
msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o msm-$(CONFIG_COMMON_CLK) += mdp/mdp4/mdp4_lvds_pll.o
msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
msm-$(CONFIG_DRM_MSM_DSI) += dsi/dsi.o \ msm-$(CONFIG_DRM_MSM_DSI) += dsi/dsi.o \
mdp/mdp4/mdp4_dsi_encoder.o \ mdp/mdp4/mdp4_dsi_encoder.o \
......
...@@ -198,6 +198,15 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy); ...@@ -198,6 +198,15 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy);
void __init hdmi_phy_driver_register(void); void __init hdmi_phy_driver_register(void);
void __exit hdmi_phy_driver_unregister(void); void __exit hdmi_phy_driver_unregister(void);
#ifdef CONFIG_COMMON_CLK
int hdmi_pll_8960_init(struct platform_device *pdev);
#else
int hdmi_pll_8960_init(struct platform_device *pdev);
{
return -ENODEV;
}
#endif
/* /*
* audio: * audio:
*/ */
......
...@@ -118,6 +118,28 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy) ...@@ -118,6 +118,28 @@ void hdmi_phy_powerdown(struct hdmi_phy *phy)
phy->cfg->powerdown(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) static int hdmi_phy_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -146,6 +168,19 @@ static int hdmi_phy_probe(struct platform_device *pdev) ...@@ -146,6 +168,19 @@ static int hdmi_phy_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); 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); platform_set_drvdata(pdev, phy);
return 0; return 0;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment