From patchwork Wed Apr 11 15:33:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 151813 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1D4DBB7044 for ; Thu, 12 Apr 2012 01:37:10 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SHzZ3-0006Zt-RK; Wed, 11 Apr 2012 15:34:33 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SHzYu-0006Yj-AA for linux-arm-kernel@merlin.infradead.org; Wed, 11 Apr 2012 15:34:24 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SHzYs-0006Mm-3L for linux-arm-kernel@lists.infradead.org; Wed, 11 Apr 2012 15:34:22 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SHzYd-0005YJ-M2; Wed, 11 Apr 2012 17:34:07 +0200 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.77) (envelope-from ) id 1SHzYP-0006Lr-Gd; Wed, 11 Apr 2012 17:33:53 +0200 From: Sascha Hauer To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/7] ARM i.MX27 pcm038: Add sdrm support Date: Wed, 11 Apr 2012 17:33:47 +0200 Message-Id: <1334158428-23735-7-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1334158428-23735-1-git-send-email-s.hauer@pengutronix.de> References: <1334158428-23735-1-git-send-email-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120411_113422_443311_08891A38 X-CRM114-Status: GOOD ( 13.29 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sascha Hauer , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Signed-off-by: Sascha Hauer --- 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 #include #include +#include +#include +#include #include @@ -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);