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>
13 * Bt455 byte-wide registers, 32-bit aligned.
16 volatile u8 addr_cmap
;
18 volatile u8 addr_cmap_data
;
22 volatile u8 addr_ovly
;
26 static inline void bt455_select_reg(struct bt455_regs
*regs
, int ir
)
29 regs
->addr_cmap
= ir
& 0x0f;
33 * Read/write to a Bt455 color map register.
35 static inline void bt455_read_cmap_entry(struct bt455_regs
*regs
, int cr
,
36 u8
* red
, u8
* green
, u8
* blue
)
38 bt455_select_reg(regs
, cr
);
40 *red
= regs
->addr_cmap_data
& 0x0f;
42 *green
= regs
->addr_cmap_data
& 0x0f;
44 *blue
= regs
->addr_cmap_data
& 0x0f;
47 static inline void bt455_write_cmap_entry(struct bt455_regs
*regs
, int cr
,
48 u8 red
, u8 green
, u8 blue
)
50 bt455_select_reg(regs
, cr
);
52 regs
->addr_cmap_data
= red
& 0x0f;
54 regs
->addr_cmap_data
= green
& 0x0f;
56 regs
->addr_cmap_data
= blue
& 0x0f;
59 static inline void bt455_write_ovly_entry(struct bt455_regs
*regs
, int cr
,
60 u8 red
, u8 green
, u8 blue
)
62 bt455_select_reg(regs
, cr
);
64 regs
->addr_ovly
= red
& 0x0f;
66 regs
->addr_ovly
= green
& 0x0f;
68 regs
->addr_ovly
= blue
& 0x0f;
71 static inline void bt455_set_cursor(struct bt455_regs
*regs
)
74 regs
->addr_ovly
= 0x0f;
76 regs
->addr_ovly
= 0x0f;
78 regs
->addr_ovly
= 0x0f;
81 static inline void bt455_erase_cursor(struct bt455_regs
*regs
)
83 /* bt455_write_cmap_entry(regs, 8, 0x00, 0x00, 0x00); */
84 /* bt455_write_cmap_entry(regs, 9, 0x00, 0x00, 0x00); */
85 bt455_write_ovly_entry(regs
, 8, 0x03, 0x03, 0x03);
86 bt455_write_ovly_entry(regs
, 9, 0x07, 0x07, 0x07);
89 regs
->addr_ovly
= 0x09;
91 regs
->addr_ovly
= 0x09;
93 regs
->addr_ovly
= 0x09;