summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/bt455.h
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2016-02-22 01:55:21 (GMT)
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-02-26 11:06:11 (GMT)
commit01ac59c34420d5807724a5bb21c1464e6dfb7a92 (patch)
tree3fa78bdc46ec0b5afbc3854ba9ef7a917fbf5305 /drivers/video/fbdev/bt455.h
parente26d682e929d2e4141a4e08d7acc320896289b62 (diff)
downloadlinux-01ac59c34420d5807724a5bb21c1464e6dfb7a92.tar.xz
video: fbdev: pmag-ba-fb: Fix and rework Bt455 colormap handling
The Bt455 is a greyscale RAMDAC, using the green color palette entries only while still providing registers for the red and blue components, all the three of which have to be loaded on palette updates. Chip documentation [1] mandates that the unused red and blue registers are written with 0. Therefore update code to follow this requirement and given that it makes the red and blue components unusable remove them from internal API calls altogether. References: [1] "Bt454 Bt455 170 MHz Monolithic CMOS 16 Color Palette RAMDAC", Brooktree Corporation, Document Number: L454001, Rev. I Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/bt455.h')
-rw-r--r--drivers/video/fbdev/bt455.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/video/fbdev/bt455.h b/drivers/video/fbdev/bt455.h
index 9d584f9..a4bba5a 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
@@ -32,38 +33,38 @@ static inline void bt455_select_reg(struct bt455_regs *regs, int ir)
/*
* 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_entry(struct bt455_regs *regs,
+ int cr, 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_entry(struct bt455_regs *regs,
+ int cr, 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_entry(struct bt455_regs *regs,
+ int cr, 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;
}