diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-04-21 12:50:31 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-12 12:39:49 -0400 |
commit | 773139f1759f9dc5efe2c314df9aad88b7364015 (patch) | |
tree | cacdb779db63106066be24d900cebb875204cb1f | |
parent | c96c92d893e28d8b8b3161ffb6c3cf0847aaf478 (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.c | 16 | ||||
-rw-r--r-- | include/video/omapdss.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 0985f2fdd75f..46817e7fdaf4 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/ktime.h> | 32 | #include <linux/ktime.h> |
33 | #include <linux/hrtimer.h> | 33 | #include <linux/hrtimer.h> |
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/semaphore.h> | ||
35 | 36 | ||
36 | #include <video/omapdss.h> | 37 | #include <video/omapdss.h> |
37 | #include "dss.h" | 38 | #include "dss.h" |
@@ -119,6 +120,8 @@ static struct { | |||
119 | struct completion cmd_done; | 120 | struct completion cmd_done; |
120 | atomic_t cmd_fifo_full; | 121 | atomic_t cmd_fifo_full; |
121 | atomic_t cmd_pending; | 122 | atomic_t cmd_pending; |
123 | |||
124 | struct semaphore bus_lock; | ||
122 | } rfbi; | 125 | } rfbi; |
123 | 126 | ||
124 | struct update_region { | 127 | struct update_region { |
@@ -146,6 +149,18 @@ static void rfbi_enable_clocks(bool enable) | |||
146 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK); | 149 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK); |
147 | } | 150 | } |
148 | 151 | ||
152 | void rfbi_bus_lock(void) | ||
153 | { | ||
154 | down(&rfbi.bus_lock); | ||
155 | } | ||
156 | EXPORT_SYMBOL(rfbi_bus_lock); | ||
157 | |||
158 | void rfbi_bus_unlock(void) | ||
159 | { | ||
160 | up(&rfbi.bus_lock); | ||
161 | } | ||
162 | EXPORT_SYMBOL(rfbi_bus_unlock); | ||
163 | |||
149 | void omap_rfbi_write_command(const void *buf, u32 len) | 164 | void omap_rfbi_write_command(const void *buf, u32 len) |
150 | { | 165 | { |
151 | rfbi_enable_clocks(1); | 166 | rfbi_enable_clocks(1); |
@@ -1022,6 +1037,7 @@ static int omap_rfbihw_probe(struct platform_device *pdev) | |||
1022 | rfbi.pdev = pdev; | 1037 | rfbi.pdev = pdev; |
1023 | 1038 | ||
1024 | spin_lock_init(&rfbi.cmd_lock); | 1039 | spin_lock_init(&rfbi.cmd_lock); |
1040 | sema_init(&rfbi.bus_lock, 1); | ||
1025 | 1041 | ||
1026 | init_completion(&rfbi.cmd_done); | 1042 | init_completion(&rfbi.cmd_done); |
1027 | atomic_set(&rfbi.cmd_fifo_full, 0); | 1043 | atomic_set(&rfbi.cmd_fifo_full, 0); |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index e3c9e0813f54..943c0e85f2fc 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -214,6 +214,8 @@ int omap_rfbi_enable_te(bool enable, unsigned line); | |||
214 | int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, | 214 | int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode, |
215 | unsigned hs_pulse_time, unsigned vs_pulse_time, | 215 | unsigned hs_pulse_time, unsigned vs_pulse_time, |
216 | int hs_pol_inv, int vs_pol_inv, int extif_div); | 216 | int hs_pol_inv, int vs_pol_inv, int extif_div); |
217 | void rfbi_bus_lock(void); | ||
218 | void rfbi_bus_unlock(void); | ||
217 | 219 | ||
218 | /* DSI */ | 220 | /* DSI */ |
219 | void dsi_bus_lock(struct omap_dss_device *dssdev); | 221 | void dsi_bus_lock(struct omap_dss_device *dssdev); |