summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-04-21 19:50:31 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-12 19:39:49 +0300
commit773139f1759f9dc5efe2c314df9aad88b7364015 (patch)
treecacdb779db63106066be24d900cebb875204cb1f
parentc96c92d893e28d8b8b3161ffb6c3cf0847aaf478 (diff)
OMAP: DSS2: RFBI: add rfbi_bus_lock
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 <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/rfbi.c16
-rw-r--r--include/video/omapdss.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 0985f2fdd75..46817e7fdaf 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -32,6 +32,7 @@
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <linux/seq_file.h>
+#include <linux/semaphore.h>
#include <video/omapdss.h>
#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);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index e3c9e0813f5..943c0e85f2f 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.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(struct omap_dss_device *dssdev);