aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/amba-clcd.c54
-rw-r--r--drivers/video/backlight/Kconfig8
-rw-r--r--drivers/video/backlight/Makefile1
-rw-r--r--drivers/video/backlight/hp680_bl.c189
-rw-r--r--drivers/video/console/sticore.c45
-rw-r--r--drivers/video/cyblafb.c1
-rw-r--r--drivers/video/i810/i810-i2c.c6
-rw-r--r--drivers/video/i810/i810.h1
-rw-r--r--drivers/video/i810/i810_main.c13
9 files changed, 260 insertions, 58 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index b2187175d03..6761b68c35e 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -116,9 +116,10 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
int ret = 0;
memset(&var->transp, 0, sizeof(var->transp));
- memset(&var->red, 0, sizeof(var->red));
- memset(&var->green, 0, sizeof(var->green));
- memset(&var->blue, 0, sizeof(var->blue));
+
+ var->red.msb_right = 0;
+ var->green.msb_right = 0;
+ var->blue.msb_right = 0;
switch (var->bits_per_pixel) {
case 1:
@@ -133,34 +134,20 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
var->blue.offset = 0;
break;
case 16:
- var->red.length = 5;
- var->green.length = 6;
- var->blue.length = 5;
- if (fb->panel->cntl & CNTL_BGR) {
- var->red.offset = 11;
- var->green.offset = 5;
- var->blue.offset = 0;
- } else {
- var->red.offset = 0;
- var->green.offset = 5;
- var->blue.offset = 11;
- }
+ var->red.length = 5;
+ var->blue.length = 5;
+ /*
+ * Green length can be 5 or 6 depending whether
+ * we're operating in RGB555 or RGB565 mode.
+ */
+ if (var->green.length != 5 && var->green.length != 6)
+ var->green.length = 6;
break;
case 32:
if (fb->panel->cntl & CNTL_LCDTFT) {
var->red.length = 8;
var->green.length = 8;
var->blue.length = 8;
-
- if (fb->panel->cntl & CNTL_BGR) {
- var->red.offset = 16;
- var->green.offset = 8;
- var->blue.offset = 0;
- } else {
- var->red.offset = 0;
- var->green.offset = 8;
- var->blue.offset = 16;
- }
break;
}
default:
@@ -168,6 +155,23 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
break;
}
+ /*
+ * >= 16bpp displays have separate colour component bitfields
+ * encoded in the pixel data. Calculate their position from
+ * the bitfield length defined above.
+ */
+ if (ret == 0 && var->bits_per_pixel >= 16) {
+ if (fb->panel->cntl & CNTL_BGR) {
+ var->blue.offset = 0;
+ var->green.offset = var->blue.offset + var->blue.length;
+ var->red.offset = var->green.offset + var->green.length;
+ } else {
+ var->red.offset = 0;
+ var->green.offset = var->red.offset + var->red.length;
+ var->blue.offset = var->green.offset + var->green.length;
+ }
+ }
+
return ret;
}
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 996d543d660..9d996f2c10d 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -50,3 +50,11 @@ config BACKLIGHT_CORGI
If you have a Sharp Zaurus SL-C7xx, say y to enable the
backlight driver.
+config BACKLIGHT_HP680
+ tristate "HP Jornada 680 Backlight Driver"
+ depends on BACKLIGHT_DEVICE && SH_HP6XX
+ default y
+ help
+ If you have a HP Jornada 680, say y to enable the
+ backlight driver.
+
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 4af321fae39..744210c38e7 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -3,4 +3,5 @@
obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
+obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
obj-$(CONFIG_SHARP_LOCOMO) += locomolcd.o
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c
new file mode 100644
index 00000000000..95da4c9ed1f
--- /dev/null
+++ b/drivers/video/backlight/hp680_bl.c
@@ -0,0 +1,189 @@
+/*
+ * Backlight Driver for HP Jornada 680
+ *
+ * Copyright (c) 2005 Andriy Skulysh
+ *
+ * Based on Sharp's Corgi Backlight Driver
+ *
+ * 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 archive
+ * for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/spinlock.h>
+#include <linux/fb.h>
+#include <linux/backlight.h>
+
+#include <asm/cpu/dac.h>
+#include <asm/hp6xx/hp6xx.h>
+#include <asm/hd64461/hd64461.h>
+
+#define HP680_MAX_INTENSITY 255
+#define HP680_DEFAULT_INTENSITY 10
+
+static int hp680bl_powermode = FB_BLANK_UNBLANK;
+static int current_intensity = 0;
+static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED;
+
+static void hp680bl_send_intensity(int intensity)
+{
+ unsigned long flags;
+
+ if (hp680bl_powermode != FB_BLANK_UNBLANK)
+ intensity = 0;
+
+ spin_lock_irqsave(&bl_lock, flags);
+ sh_dac_output(255-(u8)intensity, DAC_LCD_BRIGHTNESS);
+ spin_unlock_irqrestore(&bl_lock, flags);
+}
+
+static void hp680bl_blank(int blank)
+{
+ u16 v;
+
+ switch(blank) {
+
+ case FB_BLANK_NORMAL:
+ case FB_BLANK_VSYNC_SUSPEND:
+ case FB_BLANK_HSYNC_SUSPEND:
+ case FB_BLANK_POWERDOWN:
+ if (hp680bl_powermode == FB_BLANK_UNBLANK) {
+ hp680bl_send_intensity(0);
+ hp680bl_powermode = blank;
+ sh_dac_disable(DAC_LCD_BRIGHTNESS);
+ v = inw(HD64461_GPBDR);
+ v |= HD64461_GPBDR_LCDOFF;
+ outw(v, HD64461_GPBDR);
+ }
+ break;
+ case FB_BLANK_UNBLANK:
+ if (hp680bl_powermode != FB_BLANK_UNBLANK) {
+ sh_dac_enable(DAC_LCD_BRIGHTNESS);
+ v = inw(HD64461_GPBDR);
+ v &= ~HD64461_GPBDR_LCDOFF;
+ outw(v, HD64461_GPBDR);
+ hp680bl_powermode = blank;
+ hp680bl_send_intensity(current_intensity);
+ }
+ break;
+ }
+}
+
+#ifdef CONFIG_PM
+static int hp680bl_suspend(struct device *dev, pm_message_t state, u32 level)
+{
+ if (level == SUSPEND_POWER_DOWN)
+ hp680bl_blank(FB_BLANK_POWERDOWN);
+ return 0;
+}
+
+static int hp680bl_resume(struct device *dev, u32 level)
+{
+ if (level == RESUME_POWER_ON)
+ hp680bl_blank(FB_BLANK_UNBLANK);
+ return 0;
+}
+#else
+#define hp680bl_suspend NULL
+#define hp680bl_resume NULL
+#endif
+
+
+static int hp680bl_set_power(struct backlight_device *bd, int state)
+{
+ hp680bl_blank(state);
+ return 0;
+}
+
+static int hp680bl_get_power(struct backlight_device *bd)
+{
+ return hp680bl_powermode;
+}
+
+static int hp680bl_set_intensity(struct backlight_device *bd, int intensity)
+{
+ if (intensity > HP680_MAX_INTENSITY)
+ intensity = HP680_MAX_INTENSITY;
+ hp680bl_send_intensity(intensity);
+ current_intensity = intensity;
+ return 0;
+}
+
+static int hp680bl_get_intensity(struct backlight_device *bd)
+{
+ return current_intensity;
+}
+
+static struct backlight_properties hp680bl_data = {
+ .owner = THIS_MODULE,
+ .get_power = hp680bl_get_power,
+ .set_power = hp680bl_set_power,
+ .max_brightness = HP680_MAX_INTENSITY,
+ .get_brightness = hp680bl_get_intensity,
+ .set_brightness = hp680bl_set_intensity,
+};
+
+static struct backlight_device *hp680_backlight_device;
+
+static int __init hp680bl_probe(struct device *dev)
+{
+ hp680_backlight_device = backlight_device_register ("hp680-bl",
+ NULL, &hp680bl_data);
+ if (IS_ERR (hp680_backlight_device))
+ return PTR_ERR (hp680_backlight_device);
+
+ hp680bl_set_intensity(NULL, HP680_DEFAULT_INTENSITY);
+
+ return 0;
+}
+
+static int hp680bl_remove(struct device *dev)
+{
+ backlight_device_unregister(hp680_backlight_device);
+
+ return 0;
+}
+
+static struct device_driver hp680bl_driver = {
+ .name = "hp680-bl",
+ .bus = &platform_bus_type,
+ .probe = hp680bl_probe,
+ .remove = hp680bl_remove,
+ .suspend = hp680bl_suspend,
+ .resume = hp680bl_resume,
+};
+
+static struct platform_device hp680bl_device = {
+ .name = "hp680-bl",
+ .id = -1,
+};
+
+static int __init hp680bl_init(void)
+{
+ int ret;
+
+ ret=driver_register(&hp680bl_driver);
+ if (!ret) {
+ ret = platform_device_register(&hp680bl_device);
+ if (ret)
+ driver_unregister(&hp680bl_driver);
+ }
+ return ret;
+}
+
+static void __exit hp680bl_exit(void)
+{
+ platform_device_unregister(&hp680bl_device);
+ driver_unregister(&hp680bl_driver);
+}
+
+module_init(hp680bl_init);
+module_exit(hp680bl_exit);
+
+MODULE_AUTHOR("Andriy Skulysh <askulysh@image.kiev.ua>");
+MODULE_DESCRIPTION("HP Jornada 680 Backlight Driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index a7bcd17112c..0339f5640a7 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -30,10 +30,11 @@
#define STI_DRIVERVERSION "Version 0.9a"
-struct sti_struct *default_sti;
+struct sti_struct *default_sti __read_mostly;
-static int num_sti_roms; /* # of STI ROMS found */
-static struct sti_struct *sti_roms[MAX_STI_ROMS]; /* ptr to each sti_struct */
+/* number of STI ROMS found and their ptrs to each struct */
+static int num_sti_roms __read_mostly;
+static struct sti_struct *sti_roms[MAX_STI_ROMS] __read_mostly;
/* The colour indices used by STI are
@@ -266,7 +267,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest)
-static char default_sti_path[21];
+static char default_sti_path[21] __read_mostly;
#ifndef MODULE
static int __init sti_setup(char *str)
@@ -414,10 +415,10 @@ sti_init_glob_cfg(struct sti_struct *sti,
if (!sti->sti_mem_request)
sti->sti_mem_request = 256; /* STI default */
- glob_cfg = kmalloc(sizeof(*sti->glob_cfg), GFP_KERNEL);
- glob_cfg_ext = kmalloc(sizeof(*glob_cfg_ext), GFP_KERNEL);
- save_addr = kmalloc(save_addr_size, GFP_KERNEL);
- sti_mem_addr = kmalloc(sti->sti_mem_request, GFP_KERNEL);
+ glob_cfg = kzalloc(sizeof(*sti->glob_cfg), GFP_KERNEL);
+ glob_cfg_ext = kzalloc(sizeof(*glob_cfg_ext), GFP_KERNEL);
+ save_addr = kzalloc(save_addr_size, GFP_KERNEL);
+ sti_mem_addr = kzalloc(sti->sti_mem_request, GFP_KERNEL);
if (!(glob_cfg && glob_cfg_ext && save_addr && sti_mem_addr)) {
kfree(glob_cfg);
@@ -427,11 +428,6 @@ sti_init_glob_cfg(struct sti_struct *sti,
return -ENOMEM;
}
- memset(glob_cfg, 0, sizeof(*glob_cfg));
- memset(glob_cfg_ext, 0, sizeof(*glob_cfg_ext));
- memset(save_addr, 0, save_addr_size);
- memset(sti_mem_addr, 0, sti->sti_mem_request);
-
glob_cfg->ext_ptr = STI_PTR(glob_cfg_ext);
glob_cfg->save_addr = STI_PTR(save_addr);
for (i=0; i<8; i++) {
@@ -502,9 +498,9 @@ sti_init_glob_cfg(struct sti_struct *sti,
#ifdef CONFIG_FB
struct sti_cooked_font * __init
-sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
+sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
{
- struct font_desc *fbfont;
+ const struct font_desc *fbfont;
unsigned int size, bpc;
void *dest;
struct sti_rom_font *nf;
@@ -525,10 +521,9 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
size = bpc * 256;
size += sizeof(struct sti_rom_font);
- nf = kmalloc(size, GFP_KERNEL);
+ nf = kzalloc(size, GFP_KERNEL);
if (!nf)
return NULL;
- memset(nf, 0, size);
nf->first_char = 0;
nf->last_char = 255;
@@ -544,7 +539,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
dest += sizeof(struct sti_rom_font);
memcpy(dest, fbfont->data, bpc*256);
- cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL);
+ cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
if (!cooked_font) {
kfree(nf);
return NULL;
@@ -559,7 +554,7 @@ sti_select_fbfont( struct sti_cooked_rom *cooked_rom, char *fbfont_name )
}
#else
struct sti_cooked_font * __init
-sti_select_fbfont(struct sti_cooked_rom *cooked_rom, char *fbfont_name)
+sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name)
{
return NULL;
}
@@ -617,7 +612,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
struct sti_rom_font *raw_font, *font_start;
struct sti_cooked_font *cooked_font;
- cooked_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL);
+ cooked_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
if (!cooked_font)
return 0;
@@ -631,7 +626,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom,
while (raw_font->next_font) {
raw_font = ((void *)font_start) + (raw_font->next_font);
- cooked_font->next_font = kmalloc(sizeof(*cooked_font), GFP_KERNEL);
+ cooked_font->next_font = kzalloc(sizeof(*cooked_font), GFP_KERNEL);
if (!cooked_font->next_font)
return 1;
@@ -668,10 +663,9 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
unsigned char *n, *p, *q;
int size = f->raw->bytes_per_char*256+sizeof(struct sti_rom_font);
- n = kmalloc (4*size, GFP_KERNEL);
+ n = kzalloc (4*size, GFP_KERNEL);
if (!n)
return NULL;
- memset (n, 0, 4*size);
p = n + 3;
q = (unsigned char *)f->raw;
while (size--) {
@@ -816,13 +810,12 @@ sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd
return NULL;
}
- sti = kmalloc(sizeof(*sti), GFP_KERNEL);
+ sti = kzalloc(sizeof(*sti), GFP_KERNEL);
if (!sti) {
printk(KERN_ERR "Not enough memory !\n");
return NULL;
}
- memset(sti, 0, sizeof(*sti));
spin_lock_init(&sti->lock);
test_rom:
@@ -1035,7 +1028,7 @@ static struct parisc_driver pa_sti_driver = {
* sti_init_roms() - detects all STI ROMs and stores them in sti_roms[]
*/
-static int sticore_initialized;
+static int sticore_initialized __read_mostly;
static void __init sti_init_roms(void)
{
diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c
index 2b972461a03..0ae0a97b0fe 100644
--- a/drivers/video/cyblafb.c
+++ b/drivers/video/cyblafb.c
@@ -1665,7 +1665,6 @@ static int __devinit cyblafb_init(void)
}
#endif
output("CyblaFB version %s initializing\n", VERSION);
- return pci_module_init(&cyblafb_pci_driver);
return pci_register_driver(&cyblafb_pci_driver);
}
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c
index bd410e06db7..e3c8b5f1ca7 100644
--- a/drivers/video/i810/i810-i2c.c
+++ b/drivers/video/i810/i810-i2c.c
@@ -191,11 +191,11 @@ int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn)
u8 *edid = NULL;
int i;
- DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn);
- if (conn < 4) {
+ DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn+1);
+ if (conn < par->ddc_num) {
for (i = 0; i < 3; i++) {
/* Do the real work */
- edid = i810_do_probe_i2c_edid(&par->chan[conn-1]);
+ edid = i810_do_probe_i2c_edid(&par->chan[conn]);
if (edid)
break;
}
diff --git a/drivers/video/i810/i810.h b/drivers/video/i810/i810.h
index 6c187d5fe95..579195c2bea 100644
--- a/drivers/video/i810/i810.h
+++ b/drivers/video/i810/i810.h
@@ -280,6 +280,7 @@ struct i810fb_par {
u32 blit_bpp;
u32 ovract;
u32 cur_state;
+ u32 ddc_num;
int mtrr_reg;
u16 bltcntl;
u8 interlace;
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index 266d0ab9266..d8467c03b49 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -149,6 +149,7 @@ static int vyres __devinitdata;
static int sync __devinitdata;
static int extvga __devinitdata;
static int dcolor __devinitdata;
+static int ddc3 __devinitdata = 2;
/*------------------------------------------------------------*/
@@ -1763,6 +1764,8 @@ static void __devinit i810_init_defaults(struct i810fb_par *par,
if (sync)
par->dev_flags |= ALWAYS_SYNC;
+ par->ddc_num = ddc3;
+
if (bpp < 8)
bpp = 8;
@@ -1885,7 +1888,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
int found = 0;
#ifdef CONFIG_FB_I810_I2C
int i;
- int err;
+ int err = 1;
struct i810fb_par *par = info->par;
#endif
@@ -1895,8 +1898,8 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info)
#ifdef CONFIG_FB_I810_I2C
i810_create_i2c_busses(par);
- for (i = 0; i < 4; i++) {
- err = i810_probe_i2c_connector(info, &par->edid, i+1);
+ for (i = 0; i < par->ddc_num + 1; i++) {
+ err = i810_probe_i2c_connector(info, &par->edid, i);
if (!err)
break;
}
@@ -1983,6 +1986,8 @@ static int __devinit i810fb_setup(char *options)
vsync2 = simple_strtoul(this_opt+7, NULL, 0);
else if (!strncmp(this_opt, "dcolor", 6))
dcolor = 1;
+ else if (!strncmp(this_opt, "ddc3", 4))
+ ddc3 = 3;
else
mode_option = this_opt;
}
@@ -2190,6 +2195,8 @@ MODULE_PARM_DESC(sync, "wait for accel engine to finish drawing"
module_param(dcolor, bool, 0);
MODULE_PARM_DESC(dcolor, "use DirectColor visuals"
" (default = 0 = TrueColor)");
+module_param(ddc3, bool, 0);
+MODULE_PARM_DESC(ddc3, "Probe DDC bus 3 (default = 0 = no)");
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(mode_option, "Specify initial video mode");