summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/pl111/pl111_nomadik.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-06-21 21:44:50 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-07-01 22:36:47 +0300
commite08015e7d6a4b5395e75cc286ab6400667c63dc0 (patch)
tree9061c97394dedd4c9bf7ee361dcad3ff07060581 /drivers/gpu/drm/pl111/pl111_nomadik.c
parent491657a915601febfb9d0c253d843124438ae35d (diff)
downloadlinux-e08015e7d6a4b5395e75cc286ab6400667c63dc0.tar.xz
drm/pl111: Support Nomadik LCDC variant
The Nomadik has a variant of the PL110 known as "Color LCD Controller" LCDC. This variant has the same bit ordering as the DRM subsystem (in difference from the other variants) and adds a few bits for the control of 5551, 565 etc in the control register. Notably it also adds a packed RGB888 24BPP mode. We add support by detecting this variant and also adding a small plug-in that will mux the LCDC out if the ASIC happens to be muxed to the other graphics controller (they are mutually exclusive). Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180621184450.25377-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpu/drm/pl111/pl111_nomadik.c')
-rw-r--r--drivers/gpu/drm/pl111/pl111_nomadik.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/drm/pl111/pl111_nomadik.c b/drivers/gpu/drm/pl111/pl111_nomadik.c
new file mode 100644
index 000000000000..6f385e59be22
--- /dev/null
+++ b/drivers/gpu/drm/pl111/pl111_nomadik.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0+
+#include <linux/device.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <linux/bitops.h>
+#include <linux/module.h>
+#include "pl111_nomadik.h"
+
+#define PMU_CTRL_OFFSET 0x0000
+#define PMU_CTRL_LCDNDIF BIT(26)
+
+void pl111_nomadik_init(struct device *dev)
+{
+ struct regmap *pmu_regmap;
+
+ /*
+ * Just bail out of this is not found, we could be running
+ * multiplatform on something else than Nomadik.
+ */
+ pmu_regmap =
+ syscon_regmap_lookup_by_compatible("stericsson,nomadik-pmu");
+ if (IS_ERR(pmu_regmap))
+ return;
+
+ /*
+ * This bit in the PMU controller multiplexes the two graphics
+ * blocks found in the Nomadik STn8815. The other one is called
+ * MDIF (Master Display Interface) and gets muxed out here.
+ */
+ regmap_update_bits(pmu_regmap,
+ PMU_CTRL_OFFSET,
+ PMU_CTRL_LCDNDIF,
+ 0);
+ dev_info(dev, "set Nomadik PMU mux to CLCD mode\n");
+}
+EXPORT_SYMBOL_GPL(pl111_nomadik_init);