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

video: ARM CLCD: runtime check for Versatile

The current compile-time check for inversed IENB/CNTL does not
work in multiplatform boots: as soon as versatile is included
in the build, the IENB/CNTL is switched and breaks graphics.
Convert this to a runtime switch.

Cc: stable@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Fixes: a29da136de34 ("ARM: versatile: convert to multi-platform")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Linus Walleij and committed by
Tomi Valkeinen
f36fdacc c3b46c73

+8 -7
+8 -7
drivers/video/fbdev/amba-clcd.c
··· 440 440 fb->off_ienb = CLCD_PL111_IENB; 441 441 fb->off_cntl = CLCD_PL111_CNTL; 442 442 } else { 443 - #ifdef CONFIG_ARCH_VERSATILE 444 - fb->off_ienb = CLCD_PL111_IENB; 445 - fb->off_cntl = CLCD_PL111_CNTL; 446 - #else 447 - fb->off_ienb = CLCD_PL110_IENB; 448 - fb->off_cntl = CLCD_PL110_CNTL; 449 - #endif 443 + if (of_machine_is_compatible("arm,versatile-ab") || 444 + of_machine_is_compatible("arm,versatile-pb")) { 445 + fb->off_ienb = CLCD_PL111_IENB; 446 + fb->off_cntl = CLCD_PL111_CNTL; 447 + } else { 448 + fb->off_ienb = CLCD_PL110_IENB; 449 + fb->off_cntl = CLCD_PL110_CNTL; 450 + } 450 451 } 451 452 452 453 fb->clk = clk_get(&fb->dev->dev, NULL);