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

drm/msm/dsi: parse vsync source from device tree

Allow board's device tree to specify the vsync source (aka TE source).
If the property is omitted, the display controller driver will use the
default setting.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
[DB: fixed clearing of return value if there is no TE property]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Patchwork: https://patchwork.freedesktop.org/patch/598740/
Link: https://lore.kernel.org/r/20240613-dpu-handle-te-signal-v2-6-67a0116b5366@linaro.org

+24
+1
drivers/gpu/drm/msm/dsi/dsi.h
··· 37 37 38 38 struct mipi_dsi_host *host; 39 39 struct msm_dsi_phy *phy; 40 + const char *te_source; 40 41 41 42 struct drm_bridge *next_bridge; 42 43
+12
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 1794 1794 1795 1795 static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) 1796 1796 { 1797 + struct msm_dsi *msm_dsi = platform_get_drvdata(msm_host->pdev); 1797 1798 struct device *dev = &msm_host->pdev->dev; 1798 1799 struct device_node *np = dev->of_node; 1799 1800 struct device_node *endpoint; 1801 + const char *te_source; 1800 1802 int ret = 0; 1801 1803 1802 1804 /* ··· 1820 1818 ret = -EINVAL; 1821 1819 goto err; 1822 1820 } 1821 + 1822 + ret = of_property_read_string(endpoint, "qcom,te-source", &te_source); 1823 + if (ret && ret != -EINVAL) { 1824 + DRM_DEV_ERROR(dev, "%s: invalid TE source configuration %d\n", 1825 + __func__, ret); 1826 + goto err; 1827 + } 1828 + if (!ret) 1829 + msm_dsi->te_source = devm_kstrdup(dev, te_source, GFP_KERNEL); 1830 + ret = 0; 1823 1831 1824 1832 if (of_property_read_bool(np, "syscon-sfpb")) { 1825 1833 msm_host->sfpb = syscon_regmap_lookup_by_phandle(np,
+5
drivers/gpu/drm/msm/dsi/dsi_manager.c
··· 603 603 { 604 604 return IS_MASTER_DSI_LINK(msm_dsi->id); 605 605 } 606 + 607 + const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi) 608 + { 609 + return msm_dsi->te_source; 610 + }
+6
drivers/gpu/drm/msm/msm_drv.h
··· 335 335 bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi); 336 336 bool msm_dsi_wide_bus_enabled(struct msm_dsi *msm_dsi); 337 337 struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_dsi); 338 + const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi); 338 339 #else 339 340 static inline void __init msm_dsi_register(void) 340 341 { ··· 370 369 } 371 370 372 371 static inline struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_dsi) 372 + { 373 + return NULL; 374 + } 375 + 376 + static inline const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi) 373 377 { 374 378 return NULL; 375 379 }