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

drm: fsl-dcu: enable PIXCLK on LS1021A

The PIXCLK needs to be enabled in SCFG before accessing certain DCU
registers, or the access will hang. For simplicity, the PIXCLK is enabled
unconditionally, resulting in increased power consumption.

Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com>
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Fixes: 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM driver")
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240926055552.1632448-2-alexander.stein@ew.tq-group.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Matthias Schiffer and committed by
Dmitry Baryshkov
ffcde9e4 5b7abfb2

+19
+1
drivers/gpu/drm/fsl-dcu/Kconfig
··· 9 9 select DRM_PANEL 10 10 select REGMAP_MMIO 11 11 select VIDEOMODE_HELPERS 12 + select MFD_SYSCON if SOC_LS1021A 12 13 help 13 14 Choose this option if you have an Freescale DCU chipset. 14 15 If M is selected the module will be called fsl-dcu-drm.
+15
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
··· 101 101 static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) 102 102 { 103 103 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; 104 + struct regmap *scfg; 104 105 int ret; 105 106 106 107 ret = fsl_dcu_drm_modeset_init(fsl_dev); 107 108 if (ret < 0) 108 109 return dev_err_probe(dev->dev, ret, "failed to initialize mode setting\n"); 110 + 111 + scfg = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg"); 112 + if (PTR_ERR(scfg) != -ENODEV) { 113 + /* 114 + * For simplicity, enable the PIXCLK unconditionally, 115 + * resulting in increased power consumption. Disabling 116 + * the clock in PM or on unload could be implemented as 117 + * a future improvement. 118 + */ 119 + ret = regmap_update_bits(scfg, SCFG_PIXCLKCR, SCFG_PIXCLKCR_PXCEN, 120 + SCFG_PIXCLKCR_PXCEN); 121 + if (ret < 0) 122 + return dev_err_probe(dev->dev, ret, "failed to enable pixclk\n"); 123 + } 109 124 110 125 ret = drm_vblank_init(dev, dev->mode_config.num_crtc); 111 126 if (ret < 0) {
+3
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h
··· 160 160 #define FSL_DCU_ARGB4444 12 161 161 #define FSL_DCU_YUV422 14 162 162 163 + #define SCFG_PIXCLKCR 0x28 164 + #define SCFG_PIXCLKCR_PXCEN BIT(31) 165 + 163 166 #define VF610_LAYER_REG_NUM 9 164 167 #define LS1021A_LAYER_REG_NUM 10 165 168