Skip to content

Commit

Permalink
drm: xilinx: dp: Add runtime PM calls in dpms function
Browse files Browse the repository at this point in the history
Call the pm_runtime_get/put() based on the requested DPMS.
These calls are translated into PMU FW APIs at the end.

Signed-off-by: Hyun Kwon <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
xlnx-hyunkwon authored and Michal Simek committed Apr 5, 2017
1 parent ccbef8b commit d29f875
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/drm/xilinx/xilinx_drm_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <linux/phy/phy.h>
#include <linux/phy/phy-zynqmp.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>

#include "xilinx_drm_dp_sub.h"
#include "xilinx_drm_drv.h"
Expand Down Expand Up @@ -870,6 +870,8 @@ static void xilinx_drm_dp_dpms(struct drm_encoder *encoder, int dpms)

switch (dpms) {
case DRM_MODE_DPMS_ON:
pm_runtime_get_sync(dp->dev);

if (dp->aud_clk)
xilinx_drm_writel(iomem, XILINX_DP_TX_AUDIO_CONTROL, 1);

Expand All @@ -895,6 +897,8 @@ static void xilinx_drm_dp_dpms(struct drm_encoder *encoder, int dpms)
if (dp->aud_clk)
xilinx_drm_writel(iomem, XILINX_DP_TX_AUDIO_CONTROL, 0);

pm_runtime_put_sync(dp->dev);

return;
}
}
Expand Down Expand Up @@ -1543,6 +1547,8 @@ static int xilinx_drm_dp_probe(struct platform_device *pdev)
((version & XILINX_DP_TX_CORE_ID_REVISION_MASK) >>
XILINX_DP_TX_CORE_ID_REVISION_SHIFT));

pm_runtime_enable(dp->dev);

return 0;

error:
Expand Down Expand Up @@ -1570,6 +1576,7 @@ static int xilinx_drm_dp_remove(struct platform_device *pdev)
struct xilinx_drm_dp *dp = platform_get_drvdata(pdev);
unsigned int i;

pm_runtime_disable(dp->dev);
xilinx_drm_writel(dp->iomem, XILINX_DP_TX_ENABLE, 0);

drm_dp_aux_unregister(&dp->aux);
Expand Down

0 comments on commit d29f875

Please sign in to comment.