From patchwork Thu Aug 25 04:05:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 1095232 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7P45Nxo028124 for ; Thu, 25 Aug 2011 04:05:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750795Ab1HYEFy (ORCPT ); Thu, 25 Aug 2011 00:05:54 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:43757 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728Ab1HYEFy (ORCPT ); Thu, 25 Aug 2011 00:05:54 -0400 Received: by gwaa12 with SMTP id a12so1423571gwa.19 for ; Wed, 24 Aug 2011 21:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :user-agent:mime-version:content-type; bh=JNSvueT1WRFZF1nA1tDX0IMkcbxUa5hSbjQaIsxNS1U=; b=mRDAWzLl9O9zUUbpmOJX1aLcwDfRdcj4fBl5hFaUl9QgH7E5Q3JRXdt0nYpkS2gnFE VHjQ8DOvHTsowc4kSNOBAFcaFLbhvOVeIXjc7sb3lLrk68GJ9PsXPHQFjNkcSb4SgAwY t1hXFwhx2cIatMHBE6HqfWBnSHQQDRxEhSxkU= Received: by 10.231.0.161 with SMTP id 33mr11727318ibb.40.1314245151173; Wed, 24 Aug 2011 21:05:51 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id ib5sm188716icc.0.2011.08.24.21.05.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 21:05:50 -0700 (PDT) Date: Wed, 24 Aug 2011 21:05:50 -0700 (PDT) Message-ID: <87vctmt9t1.wl%kuninori.morimoto.gx@renesas.com> To: Paul Mundt , Magnus , Guennadi Cc: Linux-SH , Kuninori Morimoto In-Reply-To: <8739gquogt.wl%kuninori.morimoto.gx@renesas.com> References: <8739gquogt.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/7] fbdev: sh_mipi_dsi: add extra dcs settings for platform User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29q?= =?ISO-2022-JP-2?B?GyQoRCtXGyhC?=) APEL/10.8 Emacs/23.2 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 25 Aug 2011 04:06:13 +0000 (UTC) some platform needs extra MIPI dcs to use. this patch add support it. Signed-off-by: Kuninori Morimoto --- drivers/video/sh_mipi_dsi.c | 24 +++++++++++++++++++++++- include/video/sh_mipi_dsi.h | 13 +++++++++++++ 2 files changed, 36 insertions(+), 1 deletions(-) diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 096c76a..bdf687d 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c @@ -46,6 +46,13 @@ /* E.g., sh7372 has 2 MIPI-DSIs - one for each LCDC */ #define MAX_SH_MIPI_DSI 2 +/* + * for extra array + * see sh_mipi_dsi.h + */ +#define GET_EXCMD(p) ((p >> 8) & 0xFF) +#define GET_EXPARAM(p) (p & 0xFF) + struct sh_mipi { void __iomem *base; void __iomem *linkbase; @@ -150,8 +157,9 @@ 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, linelength, vmctr2 = 0x00e00000; + u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000, excmd; bool yuv; + int i; /* * Select data format. MIPI DSI is not hot-pluggable, so, we just use @@ -355,6 +363,20 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, pixfmt << 4); sh_mipi_dcs(ch->chan, MIPI_DCS_SET_DISPLAY_ON); + /* + * FIXME + * + * extra dcs settings for platform + */ + for (i = 0; i < pdata->extra_array_len; i++) { + excmd = pdata->extra_array[i]; + if (0x10000000 & excmd) + sh_mipi_dcs(ch->chan, GET_EXCMD(excmd)); + else + sh_mipi_dcs_param(ch->chan, GET_EXCMD(excmd), + GET_EXPARAM(excmd)); + } + return 0; } diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h index 58b78f8..e52097a 100644 --- a/include/video/sh_mipi_dsi.h +++ b/include/video/sh_mipi_dsi.h @@ -32,12 +32,25 @@ struct sh_mobile_lcdc_chan_cfg; #define SH_MIPI_DSI_HFPBM (1 << 2) #define SH_MIPI_DSI_BL2E (1 << 3) +/* + * x000ccpp + * + * x : 1 use sh_mipi_dcs() + * 0 use sh_mipi_dcs_param() + * cc : cmd + * pp : param + */ +#define SH_MIPI_DCS(cmd) (0x10000000 | (cmd & 0xFF) << 8) +#define SH_MIPI_DCS_PARAM(cmd, param) ((cmd & 0xFF) << 8 | (param & 0xFF)) + struct sh_mipi_dsi_info { enum sh_mipi_dsi_data_fmt data_format; struct sh_mobile_lcdc_chan_cfg *lcd_chan; unsigned long flags; u32 clksrc; unsigned int vsynw_offset; + u32 *extra_array; + int extra_array_len; }; #endif