2 * linux/drivers/video/bt455.h
4 * Copyright 2003 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
5 * Copyright 2016 Maciej W. Rozycki <macro@linux-mips.org>
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
11 #include <linux/types.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;
33 static inline void bt455_reset_reg(struct bt455_regs *regs)
40 * Read/write to a Bt455 color map register.
42 static inline void bt455_read_cmap_next(struct bt455_regs *regs, u8 *grey)
47 *grey = regs->addr_cmap_data & 0xf;
52 static inline void bt455_write_cmap_next(struct bt455_regs *regs, u8 grey)
55 regs->addr_cmap_data = 0x0;
57 regs->addr_cmap_data = grey & 0xf;
59 regs->addr_cmap_data = 0x0;
62 static inline void bt455_write_ovly_next(struct bt455_regs *regs, u8 grey)
65 regs->addr_ovly = 0x0;
67 regs->addr_ovly = grey & 0xf;
69 regs->addr_ovly = 0x0;
72 static inline void bt455_read_cmap_entry(struct bt455_regs *regs,
75 bt455_select_reg(regs, cr);
76 bt455_read_cmap_next(regs, grey);
79 static inline void bt455_write_cmap_entry(struct bt455_regs *regs,
82 bt455_select_reg(regs, cr);
83 bt455_write_cmap_next(regs, grey);
86 static inline void bt455_write_ovly_entry(struct bt455_regs *regs, u8 grey)
88 bt455_reset_reg(regs);
89 bt455_write_ovly_next(regs, grey);