summaryrefslogtreecommitdiff
path: root/drivers/video/riva
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/riva')
-rw-r--r--drivers/video/riva/fbdev.c10
-rw-r--r--drivers/video/riva/rivafb-i2c.c44
2 files changed, 7 insertions, 47 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 4acde4f7dbf8..a433cc78ef90 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -393,8 +393,8 @@ static void riva_bl_init(struct riva_par *par)
mutex_lock(&info->bl_mutex);
info->bl_dev = bd;
fb_bl_default_curve(info, 0,
- 0x158 * FB_BACKLIGHT_MAX / MAX_LEVEL,
- 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
+ MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL,
+ FB_BACKLIGHT_MAX);
mutex_unlock(&info->bl_mutex);
down(&bd->sem);
@@ -784,7 +784,7 @@ static void riva_load_video_mode(struct fb_info *info)
NVTRACE_ENTER();
/* time to calculate */
- rivafb_blank(1, info);
+ rivafb_blank(FB_BLANK_NORMAL, info);
bpp = info->var.bits_per_pixel;
if (bpp == 16 && info->var.green.length == 5)
@@ -917,7 +917,7 @@ static void riva_load_video_mode(struct fb_info *info)
par->current_state = newmode;
riva_load_state(par, &par->current_state);
par->riva.LockUnlock(&par->riva, 0); /* important for HW cursor */
- rivafb_blank(0, info);
+ rivafb_blank(FB_BLANK_UNBLANK, info);
NVTRACE_LEAVE();
}
@@ -1843,7 +1843,7 @@ static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
for (i = 0; propnames[i] != NULL; ++i) {
pedid = get_property(dp, propnames[i], NULL);
if (pedid != NULL) {
- par->EDID = pedid;
+ par->EDID = (unsigned char *)pedid;
NVTRACE("LCD found.\n");
return 1;
}
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 9751c37c0bfd..c15b259af644 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -25,8 +25,6 @@
#include "rivafb.h"
#include "../edid.h"
-#define RIVA_DDC 0x50
-
static void riva_gpio_setscl(void* data, int state)
{
struct riva_i2c_chan *chan = data;
@@ -158,50 +156,12 @@ void riva_delete_i2c_busses(struct riva_par *par)
par->chan[2].par = NULL;
}
-static u8 *riva_do_probe_i2c_edid(struct riva_i2c_chan *chan)
-{
- u8 start = 0x0;
- struct i2c_msg msgs[] = {
- {
- .addr = RIVA_DDC,
- .len = 1,
- .buf = &start,
- }, {
- .addr = RIVA_DDC,
- .flags = I2C_M_RD,
- .len = EDID_LENGTH,
- },
- };
- u8 *buf;
-
- if (!chan->par)
- return NULL;
-
- buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
- if (!buf) {
- dev_warn(&chan->par->pdev->dev, "Out of memory!\n");
- return NULL;
- }
- msgs[1].buf = buf;
-
- if (i2c_transfer(&chan->adapter, msgs, 2) == 2)
- return buf;
- dev_dbg(&chan->par->pdev->dev, "Unable to read EDID block.\n");
- kfree(buf);
- return NULL;
-}
-
int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid)
{
u8 *edid = NULL;
- int i;
- for (i = 0; i < 3; i++) {
- /* Do the real work */
- edid = riva_do_probe_i2c_edid(&par->chan[conn-1]);
- if (edid)
- break;
- }
+ edid = fb_ddc_read(&par->chan[conn-1].adapter);
+
if (out_edid)
*out_edid = edid;
if (!edid)