From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCHv2 3/8] OMAP: DSS2: RFBI: add rfbi_bus_lock
Date: Thu, 12 May 2011 11:40:08 +0000 [thread overview]
Message-ID: <1305200413-23697-4-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1305200413-23697-1-git-send-email-tomi.valkeinen@ti.com>
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>
---
drivers/video/omap2/dss/rfbi.c | 16 ++++++++++++++++
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 0985f2f..46817e7 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 ab7d656..1ea151e 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -212,6 +212,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);
--
1.7.4.1
next prev parent reply other threads:[~2011-05-12 11:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 11:40 [PATCHv2 0/8] OMAP: DSS: Miscellaneous patches Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 1/8] OMAP: DSS2: Add missing dummy functions Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 2/8] OMAPFB: fix wrong clock aliases and device name Tomi Valkeinen
2011-05-12 11:40 ` Tomi Valkeinen [this message]
2011-05-12 11:40 ` [PATCHv2 4/8] OMAP: DSS2: RFBI: clock enable/disable changes Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 5/8] OMAP: DSS2: RFBI: add omap_rfbi_configure Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 6/8] OMAP: DSS2: RFBI: cleanup Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 7/8] OMAP: DSS2: OMAPFB: remove dead code Tomi Valkeinen
2011-05-12 11:40 ` [PATCHv2 8/8] OMAP: DSS2: OMAPFB: Reduce stack usage Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305200413-23697-4-git-send-email-tomi.valkeinen@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).