Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dsi: Set up runtime PM for DSI

Call the pm_runtime_get/put API where we need the clocks enabled.

The main entry/exit points are 1) enabling/disabling the DSI bridge
and 2) Sending commands from the DSI host to the device.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

authored by

Archit Taneja and committed by
Rob Clark
f6be1121 6ed9ed48

+12 -1
+11
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 221 221 goto put_gdsc; 222 222 } 223 223 224 + pm_runtime_get_sync(dev); 225 + 224 226 ret = regulator_enable(gdsc_reg); 225 227 if (ret) { 226 228 pr_err("%s: unable to enable gdsc\n", __func__); ··· 249 247 clk_disable_unprepare(ahb_clk); 250 248 disable_gdsc: 251 249 regulator_disable(gdsc_reg); 250 + pm_runtime_put_autosuspend(dev); 252 251 put_clk: 253 252 clk_put(ahb_clk); 254 253 put_gdsc: ··· 1716 1713 goto fail; 1717 1714 } 1718 1715 1716 + pm_runtime_enable(&pdev->dev); 1717 + 1719 1718 msm_host->cfg_hnd = dsi_get_config(msm_host); 1720 1719 if (!msm_host->cfg_hnd) { 1721 1720 ret = -EINVAL; ··· 1791 1786 mutex_destroy(&msm_host->clk_mutex); 1792 1787 mutex_destroy(&msm_host->cmd_mutex); 1793 1788 mutex_destroy(&msm_host->dev_mutex); 1789 + 1790 + pm_runtime_disable(&msm_host->pdev->dev); 1794 1791 } 1795 1792 1796 1793 int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, ··· 1888 1881 * mdss interrupt is generated in mdp core clock domain 1889 1882 * mdp clock need to be enabled to receive dsi interrupt 1890 1883 */ 1884 + pm_runtime_get_sync(&msm_host->pdev->dev); 1891 1885 dsi_clk_ctrl(msm_host, 1); 1892 1886 1893 1887 /* TODO: vote for bus bandwidth */ ··· 1920 1912 /* TODO: unvote for bus bandwidth */ 1921 1913 1922 1914 dsi_clk_ctrl(msm_host, 0); 1915 + pm_runtime_put_autosuspend(&msm_host->pdev->dev); 1923 1916 } 1924 1917 1925 1918 int msm_dsi_host_cmd_tx(struct mipi_dsi_host *host, ··· 2226 2217 goto unlock_ret; 2227 2218 } 2228 2219 2220 + pm_runtime_get_sync(&msm_host->pdev->dev); 2229 2221 ret = dsi_clk_ctrl(msm_host, 1); 2230 2222 if (ret) { 2231 2223 pr_err("%s: failed to enable clocks. ret=%d\n", __func__, ret); ··· 2279 2269 pinctrl_pm_select_sleep_state(&msm_host->pdev->dev); 2280 2270 2281 2271 dsi_clk_ctrl(msm_host, 0); 2272 + pm_runtime_put_autosuspend(&msm_host->pdev->dev); 2282 2273 2283 2274 dsi_host_regulator_disable(msm_host); 2284 2275
+1 -1
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
··· 373 373 static void dsi_phy_disable_resource(struct msm_dsi_phy *phy) 374 374 { 375 375 clk_disable_unprepare(phy->ahb_clk); 376 - pm_runtime_put_sync(&phy->pdev->dev); 376 + pm_runtime_put_autosuspend(&phy->pdev->dev); 377 377 } 378 378 379 379 static const struct of_device_id dsi_phy_dt_match[] = {