From a564d301e93f96a23c808b4cf234ac08b073c96d Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 3 Apr 2011 12:54:04 +0000 Subject: savagefb: Replace magic register address with define MM_SERIAL1 was already defined, but not used. Signed-off-by: Tormod Volden Signed-off-by: Paul Mundt --- drivers/video/savage/savagefb-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/savage') diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index b16e6138fdd4..58c8a3ce33c5 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -191,7 +191,7 @@ void savagefb_create_i2c_busses(struct fb_info *info) par->chan.algo.getscl = prosavage_gpio_getscl; break; case FB_ACCEL_SAVAGE2000: - par->chan.reg = 0xff20; + par->chan.reg = MM_SERIAL1; par->chan.ioaddr = par->mmio.vbase; par->chan.algo.setsda = savage4_gpio_setsda; par->chan.algo.setscl = savage4_gpio_setscl; -- cgit v1.2.2 From 21cd72e7cb424f1686855602ec0fdc6e5830f249 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 3 Apr 2011 12:54:05 +0000 Subject: savagefb: Set up I2C based on chip family instead of card id In practice this means enabling I2C (for DDC2) on all prosavage cards, like the xorg ddx does. The savage4 and savage2000 families have only one member each, so there is no change for those. Tested on TwisterK. Signed-off-by: Tormod Volden Signed-off-by: Paul Mundt --- drivers/video/savage/savagefb-i2c.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/video/savage') diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 58c8a3ce33c5..5e7acda2ba90 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -170,9 +170,8 @@ void savagefb_create_i2c_busses(struct fb_info *info) struct savagefb_par *par = info->par; par->chan.par = par; - switch(info->fix.accel) { - case FB_ACCEL_PROSAVAGE_DDRK: - case FB_ACCEL_PROSAVAGE_PM: + switch (par->chip) { + case S3_PROSAVAGE: par->chan.reg = CR_SERIAL2; par->chan.ioaddr = par->mmio.vbase; par->chan.algo.setsda = prosavage_gpio_setsda; @@ -180,7 +179,7 @@ void savagefb_create_i2c_busses(struct fb_info *info) par->chan.algo.getsda = prosavage_gpio_getsda; par->chan.algo.getscl = prosavage_gpio_getscl; break; - case FB_ACCEL_SAVAGE4: + case S3_SAVAGE4: par->chan.reg = CR_SERIAL1; if (par->pcidev->revision > 1 && !(VGArCR(0xa6, par) & 0x40)) par->chan.reg = CR_SERIAL2; @@ -190,7 +189,7 @@ void savagefb_create_i2c_busses(struct fb_info *info) par->chan.algo.getsda = prosavage_gpio_getsda; par->chan.algo.getscl = prosavage_gpio_getscl; break; - case FB_ACCEL_SAVAGE2000: + case S3_SAVAGE2000: par->chan.reg = MM_SERIAL1; par->chan.ioaddr = par->mmio.vbase; par->chan.algo.setsda = savage4_gpio_setsda; -- cgit v1.2.2 From 787dffa5c790fdae40a0706e0b3847e31282eb3b Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sun, 3 Apr 2011 12:54:06 +0000 Subject: savagefb: Remove obsolete else clause in savage_setup_i2c_bus The else clause was not needed after the cleanup in commit b8901b091db260b0f0101d6395ce5c6016835a47 Signed-off-by: Tormod Volden Signed-off-by: Paul Mundt --- drivers/video/savage/savagefb-i2c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/video/savage') diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 5e7acda2ba90..bb71fea07284 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -159,8 +159,7 @@ static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan, else dev_warn(&chan->par->pcidev->dev, "Failed to register I2C bus %s.\n", name); - } else - chan->par = NULL; + } return rc; } -- cgit v1.2.2