From patchwork Mon Feb 8 15:56:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 77763 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 o18FsCth010053 for ; Mon, 8 Feb 2010 15:54:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753467Ab0BHPyK (ORCPT ); Mon, 8 Feb 2010 10:54:10 -0500 Received: from smtp.nokia.com ([192.100.122.230]:65035 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937Ab0BHPyJ (ORCPT ); Mon, 8 Feb 2010 10:54:09 -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 o18Frx6f027008; Mon, 8 Feb 2010 17:54:06 +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:44 +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 o18FrVbD017114; Mon, 8 Feb 2010 17:53:43 +0200 From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 09/13] OMAP: DSS2: DSI: add dsi_bus_is_locked() Date: Mon, 8 Feb 2010 17:56:08 +0200 Message-Id: <1265644572-3578-10-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1265644572-3578-9-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> X-OriginalArrivalTime: 08 Feb 2010 15:53:44.0768 (UTC) FILETIME=[E4BF2400: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:12 +0000 (UTC) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 4fdb628..b389745 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -309,6 +309,11 @@ void dsi_bus_unlock(void) } EXPORT_SYMBOL(dsi_bus_unlock); +static bool dsi_bus_is_locked(void) +{ + return mutex_is_locked(&dsi.bus_lock); +} + static inline int wait_for_bit_change(const struct dsi_reg idx, int bitnum, int value) { @@ -1959,7 +1964,7 @@ static int dsi_vc_send_bta(int channel) (dsi.debug_write || dsi.debug_read)) DSSDBG("dsi_vc_send_bta %d\n", channel); - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (REG_GET(DSI_VC_CTRL(channel), 20, 20)) { /* RX_FIFO_NOT_EMPTY */ DSSERR("rx fifo not empty when sending BTA, dumping data:\n"); @@ -2010,7 +2015,7 @@ static inline void dsi_vc_write_long_header(int channel, u8 data_type, u32 val; u8 data_id; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); /*data_id = data_type | channel << 6; */ data_id = data_type | dsi.vc[channel].dest_per << 6; @@ -2105,7 +2110,7 @@ static int dsi_vc_send_short(int channel, u8 data_type, u16 data, u8 ecc) u32 r; u8 data_id; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (dsi.debug_write) DSSDBG("dsi_vc_send_short(ch%d, dt %#x, b1 %#x, b2 %#x)\n", @@ -2895,7 +2900,7 @@ static int dsi_set_update_mode(struct omap_dss_device *dssdev, int r = 0; int i; - WARN_ON(!mutex_is_locked(&dsi.bus_lock)); + WARN_ON(!dsi_bus_is_locked()); if (dsi.update_mode != mode) { dsi.update_mode = mode;