From patchwork Wed Dec 29 08:12:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 437951 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBT8CNVY008100 for ; Wed, 29 Dec 2010 08:12:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751447Ab0L2IMc (ORCPT ); Wed, 29 Dec 2010 03:12:32 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:64204 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083Ab0L2IMb (ORCPT ); Wed, 29 Dec 2010 03:12:31 -0500 Received: from axis700.grange (pD9EB929E.dip0.t-ipconnect.de [217.235.146.158]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Mhh2N-1PkjIj12UF-00MvKK; Wed, 29 Dec 2010 09:12:30 +0100 Received: by axis700.grange (Postfix, from userid 1000) id F0748189AE4; Wed, 29 Dec 2010 09:12:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id EE506189AE3; Wed, 29 Dec 2010 09:12:29 +0100 (CET) Date: Wed, 29 Dec 2010 09:12:29 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-fbdev@vger.kernel.org cc: linux-sh@vger.kernel.org Subject: [PATCH 3/3] fbdev: sh_mipi_dsi: use platform provided register layout and values In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:V8bNOAVeerdQaLq424hRcSViYK+ZtVQLZotLRPenDhR 2rYtTavqXYNvA6sjN/AlVHn505asbAM6OlfTzYSx4ifgpXQEfM SS+BQKHR3Ml/vNRGA1FtG9M4bNbFqdlOUaN8oh0shTtDU4Equ9 cpjaDfZ2qA4Jn2yWY1RipgG99ZYwaoGdkOD9KB94bUxBKfTk7D 4GuAIIJWsnrRbeOl3Au0c6DJf72f9z1VfK7Qp835Uk= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Dec 2010 08:12:32 +0000 (UTC) diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 3563188..884af92 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c @@ -123,8 +123,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, { void __iomem *base = mipi->base; struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan; - u32 pctype, datatype, pixfmt; - u32 linelength; + u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000; bool yuv; /* @@ -281,16 +280,22 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, */ iowrite32(0x00000006, base + 0x8000); /* DTCTR */ /* VSYNC width = 2 (<< 17) */ - iowrite32(0x00040000 | (pctype << 12) | datatype, base + 0x8020); /* VMCTR1 */ + iowrite32((ch->lcd_cfg[0].vsync_len << pdata->vsynw_offset) | + (pdata->clksrc << 16) | (pctype << 12) | datatype, + base + 0x8020); /* VMCTR1 */ /* * Non-burst mode with sync pulses: VSE and HSE are output, * HSA period allowed, no commands in LP */ - iowrite32(0x00e00000, base + 0x8024); /* VMCTR2 */ + if (pdata->flags & SH_MIPI_DSI_HSABM) + vmctr2 |= 0x20; + if (pdata->flags & SH_MIPI_DSI_HSPBM) + vmctr2 |= 0x10; + iowrite32(vmctr2, base + 0x8024); /* VMCTR2 */ /* * 0x660 = 1632 bytes per line (RGB24, 544 pixels: see * sh_mobile_lcdc_info.ch[0].lcd_cfg[0].xres), HSALEN = 1 - default - * (unused, since VMCTR2[HSABM] = 0) + * (unused, if VMCTR2[HSABM] = 0) */ iowrite32(1 | (linelength << 16), base + 0x8028); /* VMLEN1 */