Skip to contentSkip to conversation

drm/fsl-dcu: Fix endian issue when using clk_register_divider

PATCH Superseded Meng Yi 2 participants 4 messages Aug 11, 2016 – Aug 23, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Meng Yi

author
#0 lore raw

PATCH 1/1 drm/fsl-dcu: Fix endian issue when using clk_register_divider

While clk_register_divider will write register as little endian, Modified the param "shift" from 0 to 24 since DCU is big endian. Or reg "DCU_DIV_RATIO" will be seted as a incorrect value which will cause vblank timing issue etc.

---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
index 7882387..2c1e2f9 100644
@@ -386,7 +386,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
 	snprintf(pix_clk_name, sizeof(pix_clk_name), "%s_pix", pix_clk_in_name);
 	fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name,
 			pix_clk_in_name, 0, base + DCU_DIV_RATIO,
-			0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
+			24, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
 	if (IS_ERR(fsl_dev->pix_clk)) {
 		dev_err(dev, "failed to register pix clk\n");
 		ret = PTR_ERR(fsl_dev->pix_clk);
Signature · 6 lines
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author Tested-by on v1 1/1
#1 lore raw

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389

Quoted 6 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
 	fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name,
 			pix_clk_in_name, 0, base + DCU_DIV_RATIO,
-			0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
+			24, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);

On LS1021A-TWR board.

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 392

Quoted 3 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
 	if (IS_ERR(fsl_dev->pix_clk)) {
 		dev_err(dev, "failed to register pix clk\n");
 		ret = PTR_ERR(fsl_dev->pix_clk);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#2 lore raw
Quoted 8 lines · Meng Yi

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389

Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
 	fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name,
 			pix_clk_in_name, 0, base + DCU_DIV_RATIO,
-			0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
+			24, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);

On LS1021A-TWR board.

Yeah I wanted to give this a try on Vybrid, but I don't think that works since on Vybrid the IP is little endian...

We need to come up with a solution which takes that into account. Alternatively we can put the offset into the SoC specific structure...

--
Stefan

Quoted 4 lines

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 392

Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0 -0
 	if (IS_ERR(fsl_dev->pix_clk)) {
 		dev_err(dev, "failed to register pix clk\n");
 		ret = PTR_ERR(fsl_dev->pix_clk);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#3 lore raw
Quoted 7 lines
Quoted 7 lines

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389

Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
 	fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name,
 			pix_clk_in_name, 0, base + DCU_DIV_RATIO,
-			0, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
+			24, 8, CLK_DIVIDER_ROUND_CLOSEST, NULL);
Quoted 8 lines
Quoted 1 line

On LS1021A-TWR board.

Yeah I wanted to give this a try on Vybrid, but I don't think that works since on Vybrid the IP is little endian...

We need to come up with a solution which takes that into account. Alternatively we can put the offset into the SoC specific structure...

Ok, I will do this these days.

Best Regards,
Meng
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel