All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH/RFC] staging: board: armadillo800eva: Add DRM support
Date: Fri, 31 Mar 2023 16:49:25 +0200	[thread overview]
Message-ID: <c03d4edbd650836bf6a96504df82338ec6d800ff.1680272980.git.geert+renesas@glider.be> (raw)

Add support for using the SH-Mobile DRM driver instead of the SH-Mobile
LCDC framebuffer driver.

Based on old kzm9g conversion prototype code by Laurent Pinchart.

Note that the new timings are slightly different, as they are based on
the AMPIRE AM-800480L1TMQW-T00H-L datasheet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Not intended for upstream merge.
The final solution should be DT-based, and include removal of this file.

proper operation, this depends on "[PATCH 0/5] drm: shmobile: Fixes and
enhancements"
https://lore.kernel.org/r/cover.1680273039.git.geert+renesas@glider.be
---
 drivers/staging/board/armadillo800eva.c | 37 +++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
index 0225234dd7aa6b1c..e5ce61b54b1ca3fb 100644
--- a/drivers/staging/board/armadillo800eva.c
+++ b/drivers/staging/board/armadillo800eva.c
@@ -12,6 +12,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/fb.h>
 #include <linux/kernel.h>
+#include <linux/platform_data/shmob_drm.h>
 #include <linux/platform_device.h>
 #include <linux/videodev2.h>
 
@@ -19,6 +20,33 @@
 
 #include "board.h"
 
+#ifdef CONFIG_DRM_SHMOBILE
+static struct shmob_drm_platform_data lcdc0_info = {
+	.clk_source = SHMOB_DRM_CLK_BUS,
+	.iface = {
+		.interface = SHMOB_DRM_IFACE_RGB24,
+		.clk_div = 5,
+	},
+	.panel = {
+		.width_mm = 111,
+		.height_mm = 68,
+		.mode = {
+			// Timings based on AMPIRE AM-800480L1TMQW-T00H-L
+			// datasheet
+			.name		= "AMPIRE/AM-800480",
+			.clock		= 33264,
+			.hdisplay	= 800,
+			.hsync_start	= 840,
+			.hsync_end	= 968,
+			.htotal		= 1056,
+			.vdisplay	= 480,
+			.vsync_start	= 515,
+			.vsync_end	= 517,
+			.vtotal		= 525,
+		},
+	},
+};
+#else
 static struct fb_videomode lcdc0_mode = {
 	.name		= "AMPIER/AM-800480",
 	.xres		= 800,
@@ -48,6 +76,7 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
 		},
 	},
 };
+#endif
 
 static struct resource lcdc0_resources[] = {
 	DEFINE_RES_MEM_NAMED(0xfe940000, 0x4000, "LCD0"),
@@ -55,7 +84,11 @@ static struct resource lcdc0_resources[] = {
 };
 
 static struct platform_device lcdc0_device = {
+#ifdef CONFIG_DRM_SHMOBILE
+	.name		= "shmob-drm",
+#else
 	.name		= "sh_mobile_lcdc_fb",
+#endif
 	.num_resources	= ARRAY_SIZE(lcdc0_resources),
 	.resource	= lcdc0_resources,
 	.id		= 0,
@@ -66,7 +99,11 @@ static struct platform_device lcdc0_device = {
 };
 
 static const struct board_staging_clk lcdc0_clocks[] __initconst = {
+#ifdef CONFIG_DRM_SHMOBILE
+	{ "lcdc0", NULL, "shmob-drm.0" },
+#else
 	{ "lcdc0", NULL, "sh_mobile_lcdc_fb.0" },
+#endif
 };
 
 static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
-- 
2.34.1


             reply	other threads:[~2023-03-31 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 14:49 Geert Uytterhoeven [this message]
2023-06-22  9:23 [PATCH/RFC] staging: board: armadillo800eva: Add DRM support Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c03d4edbd650836bf6a96504df82338ec6d800ff.1680272980.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.