2 * linux/drivers/video/bt455.h
4 * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file COPYING in the main directory of this
8 * archive for more details.
10 #include <linux/types.h>
11 #include <asm/system.h>
14 * Bt455 byte-wide registers, 32-bit aligned.
17 volatile u8 addr_cmap;
19 volatile u8 addr_cmap_data;
23 volatile u8 addr_ovly;
27 static inline void bt455_select_reg(struct bt455_regs *regs, int ir)
30 regs->addr_cmap = ir & 0x0f;
34 * Read/write to a Bt455 color map register.
36 static inline void bt455_read_cmap_entry(struct bt455_regs *regs, int cr,
37 u8* red, u8* green, u8* blue)
39 bt455_select_reg(regs, cr);
41 *red = regs->addr_cmap_data & 0x0f;
43 *green = regs->addr_cmap_data & 0x0f;
45 *blue = regs->addr_cmap_data & 0x0f;
48 static inline void bt455_write_cmap_entry(struct bt455_regs *regs, int cr,
49 u8 red, u8 green, u8 blue)
51 bt455_select_reg(regs, cr);
53 regs->addr_cmap_data = red & 0x0f;
55 regs->addr_cmap_data = green & 0x0f;
57 regs->addr_cmap_data = blue & 0x0f;
60 static inline void bt455_write_ovly_entry(struct bt455_regs *regs, int cr,
61 u8 red, u8 green, u8 blue)
63 bt455_select_reg(regs, cr);
65 regs->addr_ovly = red & 0x0f;
67 regs->addr_ovly = green & 0x0f;
69 regs->addr_ovly = blue & 0x0f;
72 static inline void bt455_set_cursor(struct bt455_regs *regs)
75 regs->addr_ovly = 0x0f;
77 regs->addr_ovly = 0x0f;
79 regs->addr_ovly = 0x0f;
82 static inline void bt455_erase_cursor(struct bt455_regs *regs)
84 /* bt455_write_cmap_entry(regs, 8, 0x00, 0x00, 0x00); */
85 /* bt455_write_cmap_entry(regs, 9, 0x00, 0x00, 0x00); */
86 bt455_write_ovly_entry(regs, 8, 0x03, 0x03, 0x03);
87 bt455_write_ovly_entry(regs, 9, 0x07, 0x07, 0x07);
90 regs->addr_ovly = 0x09;
92 regs->addr_ovly = 0x09;
94 regs->addr_ovly = 0x09;