summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/bt455.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/bt455.h')
-rw-r--r--drivers/video/fbdev/bt455.h38
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/video/fbdev/bt455.h b/drivers/video/fbdev/bt455.h
index a4bba5a49d77..dd1404b40611 100644
--- a/drivers/video/fbdev/bt455.h
+++ b/drivers/video/fbdev/bt455.h
@@ -30,13 +30,17 @@ static inline void bt455_select_reg(struct bt455_regs *regs, int ir)
regs->addr_cmap = ir & 0x0f;
}
+static inline void bt455_reset_reg(struct bt455_regs *regs)
+{
+ mb();
+ regs->addr_clr = 0;
+}
+
/*
* Read/write to a Bt455 color map register.
*/
-static inline void bt455_read_cmap_entry(struct bt455_regs *regs,
- int cr, u8 *grey)
+static inline void bt455_read_cmap_next(struct bt455_regs *regs, u8 *grey)
{
- bt455_select_reg(regs, cr);
mb();
regs->addr_cmap_data;
rmb();
@@ -45,10 +49,8 @@ static inline void bt455_read_cmap_entry(struct bt455_regs *regs,
regs->addr_cmap_data;
}
-static inline void bt455_write_cmap_entry(struct bt455_regs *regs,
- int cr, u8 grey)
+static inline void bt455_write_cmap_next(struct bt455_regs *regs, u8 grey)
{
- bt455_select_reg(regs, cr);
wmb();
regs->addr_cmap_data = 0x0;
wmb();
@@ -57,10 +59,8 @@ static inline void bt455_write_cmap_entry(struct bt455_regs *regs,
regs->addr_cmap_data = 0x0;
}
-static inline void bt455_write_ovly_entry(struct bt455_regs *regs,
- int cr, u8 grey)
+static inline void bt455_write_ovly_next(struct bt455_regs *regs, u8 grey)
{
- bt455_select_reg(regs, cr);
wmb();
regs->addr_ovly = 0x0;
wmb();
@@ -68,3 +68,23 @@ static inline void bt455_write_ovly_entry(struct bt455_regs *regs,
wmb();
regs->addr_ovly = 0x0;
}
+
+static inline void bt455_read_cmap_entry(struct bt455_regs *regs,
+ int cr, u8 *grey)
+{
+ bt455_select_reg(regs, cr);
+ bt455_read_cmap_next(regs, grey);
+}
+
+static inline void bt455_write_cmap_entry(struct bt455_regs *regs,
+ int cr, u8 grey)
+{
+ bt455_select_reg(regs, cr);
+ bt455_write_cmap_next(regs, grey);
+}
+
+static inline void bt455_write_ovly_entry(struct bt455_regs *regs, u8 grey)
+{
+ bt455_reset_reg(regs);
+ bt455_write_ovly_next(regs, grey);
+}