From patchwork Tue May 10 16:24:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 774802 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4AGOaBh024251 for ; Tue, 10 May 2011 16:24:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932981Ab1EJQYf (ORCPT ); Tue, 10 May 2011 12:24:35 -0400 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]:57493 "EHLO na3sys009aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932972Ab1EJQYe (ORCPT ); Tue, 10 May 2011 12:24:34 -0400 Received: from mail-ey0-f178.google.com ([209.85.215.178]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTclmwUlZVDO8nQTBbUzUHglGajWbwI1+@postini.com; Tue, 10 May 2011 09:24:34 PDT Received: by mail-ey0-f178.google.com with SMTP id 25so2148636eya.37 for ; Tue, 10 May 2011 09:24:33 -0700 (PDT) Received: by 10.213.25.74 with SMTP id y10mr2950689ebb.140.1305044672421; Tue, 10 May 2011 09:24:32 -0700 (PDT) Received: from localhost.localdomain (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id s1sm4430927ees.17.2011.05.10.09.24.30 (version=SSLv3 cipher=OTHER); Tue, 10 May 2011 09:24:31 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 3/8] OMAP: DSS2: RFBI: add rfbi_bus_lock Date: Tue, 10 May 2011 19:24:11 +0300 Message-Id: <1305044656-31512-4-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305044656-31512-1-git-send-email-tomi.valkeinen@ti.com> References: <1305044656-31512-1-git-send-email-tomi.valkeinen@ti.com> 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.6 (demeter2.kernel.org [140.211.167.43]); Tue, 10 May 2011 16:24:37 +0000 (UTC) Add similar bus lock to RFBI as is in DSI. The panel driver can use the bus lock to mark that the RFBI bus is currently in use. Signed-off-by: Tomi Valkeinen --- arch/arm/plat-omap/include/plat/display.h | 2 ++ drivers/video/omap2/dss/rfbi.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index bd0f08e..e6629eb 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h @@ -214,6 +214,8 @@ int omap_rfbi_enable_te(bool enable, unsigned line); int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, unsigned hs_pulse_time, unsigned vs_pulse_time, int hs_pol_inv, int vs_pol_inv, int extif_div); +void rfbi_bus_lock(void); +void rfbi_bus_unlock(void); /* DSI */ void dsi_bus_lock(void); diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 5ea17f4..b669071 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "dss.h" @@ -119,6 +120,8 @@ static struct { struct completion cmd_done; atomic_t cmd_fifo_full; atomic_t cmd_pending; + + struct semaphore bus_lock; } rfbi; struct update_region { @@ -146,6 +149,18 @@ static void rfbi_enable_clocks(bool enable) dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK); } +void rfbi_bus_lock(void) +{ + down(&rfbi.bus_lock); +} +EXPORT_SYMBOL(rfbi_bus_lock); + +void rfbi_bus_unlock(void) +{ + up(&rfbi.bus_lock); +} +EXPORT_SYMBOL(rfbi_bus_unlock); + void omap_rfbi_write_command(const void *buf, u32 len) { rfbi_enable_clocks(1); @@ -1022,6 +1037,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev) rfbi.pdev = pdev; spin_lock_init(&rfbi.cmd_lock); + sema_init(&rfbi.bus_lock, 1); init_completion(&rfbi.cmd_done); atomic_set(&rfbi.cmd_fifo_full, 0);