diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
commit | d635711daa98be86d4c7fd01499c34f566b54ccb (patch) | |
tree | aa5cc3760a27c3d57146498cb82fa549547de06c /drivers/video/fbdev/bt455.h | |
parent | c91265cd0efb83778f015b4d4b1129bd2cfd075e (diff) |
Linux-libre 4.6.2-gnu
Diffstat (limited to 'drivers/video/fbdev/bt455.h')
-rw-r--r-- | drivers/video/fbdev/bt455.h | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/drivers/video/fbdev/bt455.h b/drivers/video/fbdev/bt455.h index 80f61b03e..dd1404b40 100644 --- a/drivers/video/fbdev/bt455.h +++ b/drivers/video/fbdev/bt455.h @@ -2,6 +2,7 @@ * linux/drivers/video/bt455.h * * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + * Copyright 2016 Maciej W. Rozycki <macro@linux-mips.org> * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this @@ -29,66 +30,61 @@ 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* red, u8* green, u8* blue) +static inline void bt455_read_cmap_next(struct bt455_regs *regs, u8 *grey) { - bt455_select_reg(regs, cr); mb(); - *red = regs->addr_cmap_data & 0x0f; + regs->addr_cmap_data; rmb(); - *green = regs->addr_cmap_data & 0x0f; + *grey = regs->addr_cmap_data & 0xf; rmb(); - *blue = regs->addr_cmap_data & 0x0f; + regs->addr_cmap_data; } -static inline void bt455_write_cmap_entry(struct bt455_regs *regs, int cr, - u8 red, u8 green, u8 blue) +static inline void bt455_write_cmap_next(struct bt455_regs *regs, u8 grey) { - bt455_select_reg(regs, cr); wmb(); - regs->addr_cmap_data = red & 0x0f; + regs->addr_cmap_data = 0x0; wmb(); - regs->addr_cmap_data = green & 0x0f; + regs->addr_cmap_data = grey & 0xf; wmb(); - regs->addr_cmap_data = blue & 0x0f; + regs->addr_cmap_data = 0x0; } -static inline void bt455_write_ovly_entry(struct bt455_regs *regs, int cr, - u8 red, u8 green, u8 blue) +static inline void bt455_write_ovly_next(struct bt455_regs *regs, u8 grey) { - bt455_select_reg(regs, cr); wmb(); - regs->addr_ovly = red & 0x0f; + regs->addr_ovly = 0x0; wmb(); - regs->addr_ovly = green & 0x0f; + regs->addr_ovly = grey & 0xf; wmb(); - regs->addr_ovly = blue & 0x0f; + regs->addr_ovly = 0x0; } -static inline void bt455_set_cursor(struct bt455_regs *regs) +static inline void bt455_read_cmap_entry(struct bt455_regs *regs, + int cr, u8 *grey) { - mb(); - regs->addr_ovly = 0x0f; - wmb(); - regs->addr_ovly = 0x0f; - wmb(); - regs->addr_ovly = 0x0f; + bt455_select_reg(regs, cr); + bt455_read_cmap_next(regs, grey); } -static inline void bt455_erase_cursor(struct bt455_regs *regs) +static inline void bt455_write_cmap_entry(struct bt455_regs *regs, + int cr, u8 grey) { - /* bt455_write_cmap_entry(regs, 8, 0x00, 0x00, 0x00); */ - /* bt455_write_cmap_entry(regs, 9, 0x00, 0x00, 0x00); */ - bt455_write_ovly_entry(regs, 8, 0x03, 0x03, 0x03); - bt455_write_ovly_entry(regs, 9, 0x07, 0x07, 0x07); + bt455_select_reg(regs, cr); + bt455_write_cmap_next(regs, grey); +} - wmb(); - regs->addr_ovly = 0x09; - wmb(); - regs->addr_ovly = 0x09; - wmb(); - regs->addr_ovly = 0x09; +static inline void bt455_write_ovly_entry(struct bt455_regs *regs, u8 grey) +{ + bt455_reset_reg(regs); + bt455_write_ovly_next(regs, grey); } |