From patchwork Mon Feb 8 15:56:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 77762 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o18FsAAZ009970 for ; Mon, 8 Feb 2010 15:54:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460Ab0BHPyJ (ORCPT ); Mon, 8 Feb 2010 10:54:09 -0500 Received: from smtp.nokia.com ([192.100.122.230]:65028 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753458Ab0BHPyI (ORCPT ); Mon, 8 Feb 2010 10:54:08 -0500 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o18Frx6d027008; Mon, 8 Feb 2010 17:54:05 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Feb 2010 17:53:52 +0200 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Feb 2010 17:53:46 +0200 Received: from localhost.localdomain (esdhcp041210.research.nokia.com [172.21.41.210]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o18FrVbE017114; Mon, 8 Feb 2010 17:53:44 +0200 From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 10/13] OMAP: DSS2: DSI: add helpers for DCS read/write Date: Mon, 8 Feb 2010 17:56:09 +0200 Message-Id: <1265644572-3578-11-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1265644572-3578-10-git-send-email-tomi.valkeinen@nokia.com> References: <1265644572-3578-1-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-2-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-3-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-4-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-5-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-6-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-7-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-8-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-9-git-send-email-tomi.valkeinen@nokia.com> <1265644572-3578-10-git-send-email-tomi.valkeinen@nokia.com> X-OriginalArrivalTime: 08 Feb 2010 15:53:46.0050 (UTC) FILETIME=[E582C220:01CAA8D6] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 08 Feb 2010 15:54:11 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index c66e464..47df5f6 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -233,8 +233,11 @@ int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, void dsi_bus_lock(void); void dsi_bus_unlock(void); int dsi_vc_dcs_write(int channel, u8 *data, int len); +int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd); +int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param); int dsi_vc_dcs_write_nosync(int channel, u8 *data, int len); int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen); +int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data); int dsi_vc_set_max_rx_packet_size(int channel, u16 len); int dsi_vc_send_null(int channel); int dsi_vc_send_bta_sync(int channel); diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index b389745..e49f063 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -2176,6 +2176,21 @@ int dsi_vc_dcs_write(int channel, u8 *data, int len) } EXPORT_SYMBOL(dsi_vc_dcs_write); +int dsi_vc_dcs_write_0(int channel, u8 dcs_cmd) +{ + return dsi_vc_dcs_write(channel, &dcs_cmd, 1); +} +EXPORT_SYMBOL(dsi_vc_dcs_write_0); + +int dsi_vc_dcs_write_1(int channel, u8 dcs_cmd, u8 param) +{ + u8 buf[2]; + buf[0] = dcs_cmd; + buf[1] = param; + return dsi_vc_dcs_write(channel, buf, 2); +} +EXPORT_SYMBOL(dsi_vc_dcs_write_1); + int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) { u32 val; @@ -2268,6 +2283,21 @@ int dsi_vc_dcs_read(int channel, u8 dcs_cmd, u8 *buf, int buflen) } EXPORT_SYMBOL(dsi_vc_dcs_read); +int dsi_vc_dcs_read_1(int channel, u8 dcs_cmd, u8 *data) +{ + int r; + + r = dsi_vc_dcs_read(channel, dcs_cmd, data, 1); + + if (r < 0) + return r; + + if (r != 1) + return -EIO; + + return 0; +} +EXPORT_SYMBOL(dsi_vc_dcs_read_1); int dsi_vc_set_max_rx_packet_size(int channel, u16 len) {