linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] ARM i.MX27 pcm038: Add sdrm support
Date: Wed, 11 Apr 2012 17:33:47 +0200	[thread overview]
Message-ID: <1334158428-23735-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1334158428-23735-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/pcm970-baseboard.c |   78 +++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 99afbc3..17758f8 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -20,6 +20,9 @@
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <linux/can/platform/sja1000.h>
+#include <drm/drmP.h>
+#include <drm/sdrm_encon.h>
+#include <generated/mach-types.h>
 
 #include <asm/mach/arch.h>
 
@@ -224,8 +227,81 @@ void __init pcm970_baseboard_init(void)
 	mxc_gpio_setup_multiple_pins(pcm970_pins, ARRAY_SIZE(pcm970_pins),
 			"PCM970");
 
-	imx27_add_imx_fb(&pcm038_fb_data);
+//	imx27_add_imx_fb(&pcm038_fb_data);
 	mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN);
 	imx27_add_mxc_mmc(1, &sdhc_pdata);
 	platform_device_register(&pcm970_sja1000);
 }
+
+static struct platform_device *__init imx_add_imx_drm(
+		struct imx_drm_platform_data *pdata)
+{
+	struct resource res[] = {
+		{
+			.start = MX27_LCDC_BASE_ADDR,
+			.end = MX27_LCDC_BASE_ADDR + SZ_4K - 1,
+			.flags = IORESOURCE_MEM,
+		}, {
+			.start = MX27_INT_LCDC,
+			.end = MX27_INT_LCDC,
+			.flags = IORESOURCE_IRQ,
+		},
+	};
+	return imx_add_platform_device_dmamask("imx-drm", -1,
+			res, ARRAY_SIZE(res),
+			pdata, sizeof(*pdata), DMA_BIT_MASK(32));
+}
+
+static struct drm_display_mode pcm038_modes[] = {
+	{
+		.name = "Sharp-LQ035Q7",
+		.vrefresh = 60,
+		.clock = 5300,
+		.hdisplay = 240,
+		.hsync_start = 240 + 16,
+		.hsync_end = 240 + 16 + 7,
+		.htotal = 240 + 16 + 7 + 5,
+		.vdisplay = 320,
+		.vsync_start = 320 + 9,
+		.vsync_end = 320 + 9 + 1,
+		.vtotal = 320 + 9 + 1 + 7,
+		.type = 0x0,
+		.flags = 0x0,
+	},
+};
+
+static struct sdrm_encon_dummy_pdata pcm038_encon_data = {
+	.drm_name = "imx-drm",
+	.possible_crtcs = 0x1,
+	.possible_clones = 0x1,
+	.modes = pcm038_modes,
+	.num_modes = ARRAY_SIZE(pcm038_modes),
+};
+
+static struct imx_drm_platform_data drm_pdata = {
+	/*
+	 * - HSYNC active high
+	 * - VSYNC active high
+	 * - clk notenabled while idle
+	 * - clock not inverted
+	 * - data not inverted
+	 * - data enable low active
+	 * - enable sharp mode
+	 */
+	.pcr		= 0xf00080c0,
+	.lscr1		= 0x00120300,
+	.pwmr		= 0x00a903ff,
+};
+
+static int add_drm(void)
+{
+	if (!machine_is_pcm038())
+		return 0;
+
+	imx_add_imx_drm(&drm_pdata);
+
+	platform_device_register_data(NULL, "drm-encon-dummy", 0,
+			&pcm038_encon_data, sizeof(pcm038_encon_data));
+	return 0;
+}
+device_initcall(add_drm);
-- 
1.7.9.5

  parent reply	other threads:[~2012-04-11 15:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 15:33 [RFC] DRM helpers for embedded systems Sascha Hauer
2012-04-11 15:33 ` [PATCH 1/7] drm: remove legacy mode_group handling Sascha Hauer
2012-04-11 15:33 ` [PATCH 2/7] drm: make gamma_set optional Sascha Hauer
2012-04-11 15:33 ` [PATCH 3/7] DRM: add sdrm layer for general embedded system support Sascha Hauer
2012-04-11 20:22   ` Alan Cox
2012-04-12  8:58     ` Sascha Hauer
2012-04-20 10:02   ` Dave Airlie
2012-04-20 12:38     ` Thierry Reding
2012-04-20 13:20       ` Sascha Hauer
2012-04-20 14:25       ` Mark Brown
2012-04-20 14:49         ` Thierry Reding
2012-04-20 15:06           ` Mark Brown
2012-04-20 15:13             ` Thierry Reding
2012-04-20 15:15         ` Sascha Hauer
2012-04-20 15:20           ` Mark Brown
2012-04-20 13:10     ` Sascha Hauer
2012-04-20 13:33       ` Daniel Vetter
2012-04-21  8:18         ` Sascha Hauer
2012-04-11 15:33 ` [PATCH 4/7] DRM: Add sdrm 1:1 encoder - connector helper Sascha Hauer
2012-04-11 15:33 ` [PATCH 5/7] DRM: add i.MX kms simple driver Sascha Hauer
2012-04-11 15:33 ` Sascha Hauer [this message]
2012-04-11 15:33 ` [PATCH 7/7] DRM: add PXA " Sascha Hauer

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=1334158428-23735-7-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).