Commit c5f34757 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://github.com/schandinat/linux-2.6

* 'for-linus' of git://github.com/schandinat/linux-2.6:
  drivers/video/via/via-gpio.c: fix warning
  viafb: Depends on X86
  fbdev: section cleanup in viafb driver
  viafb: fix accel_flags check_var bug
  viafb: probe cleanups
  viafb: remove ioctls which break the framebuffer interface
  viafb: update fix before calculating depth
  viafb: PLL value cleanup
  viafb: simplify lcd size "detection"
  viafb: fix PCI table
  viafb: add lcd scaling support for some IGPs
  viafb: improve lcd code readability
  viafb: remove duplicated scaling code
  MAINTAINERS: update viafb entry
parents 537d8478 f2709837
...@@ -6178,9 +6178,12 @@ F: drivers/mmc/host/via-sdmmc.c ...@@ -6178,9 +6178,12 @@ F: drivers/mmc/host/via-sdmmc.c
VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
M: Joseph Chan <JosephChan@via.com.tw> M: Joseph Chan <JosephChan@via.com.tw>
M: Scott Fang <ScottFang@viatech.com.cn> M: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
L: linux-fbdev@vger.kernel.org L: linux-fbdev@vger.kernel.org
S: Maintained S: Maintained
F: include/linux/via-core.h
F: include/linux/via-gpio.h
F: include/linux/via_i2c.h
F: drivers/video/via/ F: drivers/video/via/
VIA VELOCITY NETWORK DRIVER VIA VELOCITY NETWORK DRIVER
......
...@@ -1505,7 +1505,7 @@ config FB_SIS_315 ...@@ -1505,7 +1505,7 @@ config FB_SIS_315
config FB_VIA config FB_VIA
tristate "VIA UniChrome (Pro) and Chrome9 display support" tristate "VIA UniChrome (Pro) and Chrome9 display support"
depends on FB && PCI depends on FB && PCI && X86
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
......
...@@ -160,7 +160,6 @@ struct lvds_setting_information { ...@@ -160,7 +160,6 @@ struct lvds_setting_information {
int v_active; int v_active;
int bpp; int bpp;
int refresh_rate; int refresh_rate;
int get_lcd_size_method;
int lcd_panel_id; int lcd_panel_id;
int lcd_panel_hres; int lcd_panel_hres;
int lcd_panel_vres; int lcd_panel_vres;
......
This diff is collapsed.
...@@ -700,12 +700,18 @@ struct _lcd_scaling_factor { ...@@ -700,12 +700,18 @@ struct _lcd_scaling_factor {
struct _lcd_ver_scaling_factor lcd_ver_scaling_factor; struct _lcd_ver_scaling_factor lcd_ver_scaling_factor;
}; };
struct pll_config {
u16 multiplier;
u8 divisor;
u8 rshift;
};
struct pll_map { struct pll_map {
u32 clk; u32 clk;
u32 cle266_pll; struct pll_config cle266_pll;
u32 k800_pll; struct pll_config k800_pll;
u32 cx700_pll; struct pll_config cx700_pll;
u32 vx855_pll; struct pll_config vx855_pll;
}; };
struct rgbLUT { struct rgbLUT {
......
...@@ -35,11 +35,9 @@ ...@@ -35,11 +35,9 @@
#define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */ #define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */
#define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */ #define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */
#define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */ #define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */
#define VIAFB_SET_DEVICE 0x5649410A
#define VIAFB_GET_DEVICE 0x5649410B #define VIAFB_GET_DEVICE 0x5649410B
#define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */ #define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */
#define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */ #define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */
#define VIAFB_SET_DEVICE_INFO 0x56494114
#define VIAFB_GET_DEVICE_INFO 0x56494115 #define VIAFB_GET_DEVICE_INFO 0x56494115
#define VIAFB_GET_DEVICE_SUPPORT 0x56494118 #define VIAFB_GET_DEVICE_SUPPORT 0x56494118
...@@ -50,7 +48,6 @@ ...@@ -50,7 +48,6 @@
#define VIAFB_GET_GAMMA_LUT 0x56494124 #define VIAFB_GET_GAMMA_LUT 0x56494124
#define VIAFB_SET_GAMMA_LUT 0x56494125 #define VIAFB_SET_GAMMA_LUT 0x56494125
#define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126 #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126
#define VIAFB_SET_SECOND_MODE 0x56494129
#define VIAFB_SYNC_SURFACE 0x56494130 #define VIAFB_SYNC_SURFACE 0x56494130
#define VIAFB_GET_DRIVER_CAPS 0x56494131 #define VIAFB_GET_DRIVER_CAPS 0x56494131
#define VIAFB_GET_IGA_SCALING_INFO 0x56494132 #define VIAFB_GET_IGA_SCALING_INFO 0x56494132
......
...@@ -75,8 +75,6 @@ static void check_diport_of_integrated_lvds( ...@@ -75,8 +75,6 @@ static void check_diport_of_integrated_lvds(
static struct display_timing lcd_centering_timging(struct display_timing static struct display_timing lcd_centering_timging(struct display_timing
mode_crt_reg, mode_crt_reg,
struct display_timing panel_crt_reg); struct display_timing panel_crt_reg);
static void viafb_load_scaling_factor_for_p4m900(int set_hres,
int set_vres, int panel_hres, int panel_vres);
static int check_lvds_chip(int device_id_subaddr, int device_id) static int check_lvds_chip(int device_id_subaddr, int device_id)
{ {
...@@ -89,33 +87,8 @@ static int check_lvds_chip(int device_id_subaddr, int device_id) ...@@ -89,33 +87,8 @@ static int check_lvds_chip(int device_id_subaddr, int device_id)
void viafb_init_lcd_size(void) void viafb_init_lcd_size(void)
{ {
DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n"); DEBUG_MSG(KERN_INFO "viafb_init_lcd_size()\n");
DEBUG_MSG(KERN_INFO
"viaparinfo->lvds_setting_info->get_lcd_size_method %d\n",
viaparinfo->lvds_setting_info->get_lcd_size_method);
switch (viaparinfo->lvds_setting_info->get_lcd_size_method) { fp_id_to_vindex(viafb_lcd_panel_id);
case GET_LCD_SIZE_BY_SYSTEM_BIOS:
break;
case GET_LCD_SZIE_BY_HW_STRAPPING:
break;
case GET_LCD_SIZE_BY_VGA_BIOS:
DEBUG_MSG(KERN_INFO "Get LCD Size method by VGA BIOS !!\n");
fp_id_to_vindex(viafb_lcd_panel_id);
DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n",
viaparinfo->lvds_setting_info->lcd_panel_id);
break;
case GET_LCD_SIZE_BY_USER_SETTING:
DEBUG_MSG(KERN_INFO "Get LCD Size method by user setting !!\n");
fp_id_to_vindex(viafb_lcd_panel_id);
DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n",
viaparinfo->lvds_setting_info->lcd_panel_id);
break;
default:
DEBUG_MSG(KERN_INFO "viafb_init_lcd_size fail\n");
viaparinfo->lvds_setting_info->lcd_panel_id =
LCD_PANEL_ID1_800X600;
fp_id_to_vindex(LCD_PANEL_ID1_800X600);
}
viaparinfo->lvds_setting_info2->lcd_panel_id = viaparinfo->lvds_setting_info2->lcd_panel_id =
viaparinfo->lvds_setting_info->lcd_panel_id; viaparinfo->lvds_setting_info->lcd_panel_id;
viaparinfo->lvds_setting_info2->lcd_panel_hres = viaparinfo->lvds_setting_info2->lcd_panel_hres =
...@@ -437,14 +410,9 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, ...@@ -437,14 +410,9 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
/* LCD Scaling Enable */ /* LCD Scaling Enable */
viafb_write_reg_mask(CR79, VIACR, 0x07, BIT0 + BIT1 + BIT2); viafb_write_reg_mask(CR79, VIACR, 0x07, BIT0 + BIT1 + BIT2);
if (UNICHROME_P4M900 == viaparinfo->chip_info->gfx_chip_name) {
viafb_load_scaling_factor_for_p4m900(set_hres, set_vres,
panel_hres, panel_vres);
return;
}
/* Check if expansion for horizontal */ /* Check if expansion for horizontal */
if (set_hres != panel_hres) { if (set_hres < panel_hres) {
/* Load Horizontal Scaling Factor */ /* Load Horizontal Scaling Factor */
switch (viaparinfo->chip_info->gfx_chip_name) { switch (viaparinfo->chip_info->gfx_chip_name) {
case UNICHROME_CLE266: case UNICHROME_CLE266:
...@@ -464,6 +432,10 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, ...@@ -464,6 +432,10 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
case UNICHROME_CX700: case UNICHROME_CX700:
case UNICHROME_K8M890: case UNICHROME_K8M890:
case UNICHROME_P4M890: case UNICHROME_P4M890:
case UNICHROME_P4M900:
case UNICHROME_CN750:
case UNICHROME_VX800:
case UNICHROME_VX855:
reg_value = reg_value =
K800_LCD_HOR_SCF_FORMULA(set_hres, panel_hres); K800_LCD_HOR_SCF_FORMULA(set_hres, panel_hres);
/* Horizontal scaling enabled */ /* Horizontal scaling enabled */
...@@ -483,7 +455,7 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, ...@@ -483,7 +455,7 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
} }
/* Check if expansion for vertical */ /* Check if expansion for vertical */
if (set_vres != panel_vres) { if (set_vres < panel_vres) {
/* Load Vertical Scaling Factor */ /* Load Vertical Scaling Factor */
switch (viaparinfo->chip_info->gfx_chip_name) { switch (viaparinfo->chip_info->gfx_chip_name) {
case UNICHROME_CLE266: case UNICHROME_CLE266:
...@@ -503,6 +475,10 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, ...@@ -503,6 +475,10 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
case UNICHROME_CX700: case UNICHROME_CX700:
case UNICHROME_K8M890: case UNICHROME_K8M890:
case UNICHROME_P4M890: case UNICHROME_P4M890:
case UNICHROME_P4M900:
case UNICHROME_CN750:
case UNICHROME_VX800:
case UNICHROME_VX855:
reg_value = reg_value =
K800_LCD_VER_SCF_FORMULA(set_vres, panel_vres); K800_LCD_VER_SCF_FORMULA(set_vres, panel_vres);
/* Vertical scaling enabled */ /* Vertical scaling enabled */
...@@ -648,9 +624,8 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, ...@@ -648,9 +624,8 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
(mode_crt_reg, panel_crt_reg), IGA1); (mode_crt_reg, panel_crt_reg), IGA1);
} else { } else {
/* Expansion */ /* Expansion */
if ((plvds_setting_info->display_method == if (plvds_setting_info->display_method == LCD_EXPANDSION
LCD_EXPANDSION) & ((set_hres != panel_hres) && (set_hres < panel_hres || set_vres < panel_vres)) {
|| (set_vres != panel_vres))) {
/* expansion timing IGA2 loaded panel set timing*/ /* expansion timing IGA2 loaded panel set timing*/
viafb_load_crtc_timing(panel_crt_reg, IGA2); viafb_load_crtc_timing(panel_crt_reg, IGA2);
DEBUG_MSG(KERN_INFO "viafb_load_crtc_timing!!\n"); DEBUG_MSG(KERN_INFO "viafb_load_crtc_timing!!\n");
...@@ -1139,69 +1114,3 @@ bool viafb_lcd_get_mobile_state(bool *mobile) ...@@ -1139,69 +1114,3 @@ bool viafb_lcd_get_mobile_state(bool *mobile)
return false; return false;
} }
} }
static void viafb_load_scaling_factor_for_p4m900(int set_hres,
int set_vres, int panel_hres, int panel_vres)
{
int h_scaling_factor;
int v_scaling_factor;
u8 cra2 = 0;
u8 cr77 = 0;
u8 cr78 = 0;
u8 cr79 = 0;
u8 cr9f = 0;
/* Check if expansion for horizontal */
if (set_hres < panel_hres) {
/* Load Horizontal Scaling Factor */
/* For VIA_K8M800 or later chipsets. */
h_scaling_factor =
K800_LCD_HOR_SCF_FORMULA(set_hres, panel_hres);
/* HSCaleFactor[1:0] at CR9F[1:0] */
cr9f = h_scaling_factor & 0x0003;
/* HSCaleFactor[9:2] at CR77[7:0] */
cr77 = (h_scaling_factor & 0x03FC) >> 2;
/* HSCaleFactor[11:10] at CR79[5:4] */
cr79 = (h_scaling_factor & 0x0C00) >> 10;
cr79 <<= 4;
/* Horizontal scaling enabled */
cra2 = 0xC0;
DEBUG_MSG(KERN_INFO "Horizontal Scaling value = %d\n",
h_scaling_factor);
} else {
/* Horizontal scaling disabled */
cra2 = 0x00;
}
/* Check if expansion for vertical */
if (set_vres < panel_vres) {
/* Load Vertical Scaling Factor */
/* For VIA_K8M800 or later chipsets. */
v_scaling_factor =
K800_LCD_VER_SCF_FORMULA(set_vres, panel_vres);
/* Vertical scaling enabled */
cra2 |= 0x08;
/* VSCaleFactor[0] at CR79[3] */
cr79 |= ((v_scaling_factor & 0x0001) << 3);
/* VSCaleFactor[8:1] at CR78[7:0] */
cr78 |= (v_scaling_factor & 0x01FE) >> 1;
/* VSCaleFactor[10:9] at CR79[7:6] */
cr79 |= ((v_scaling_factor & 0x0600) >> 9) << 6;
DEBUG_MSG(KERN_INFO "Vertical Scaling value = %d\n",
v_scaling_factor);
} else {
/* Vertical scaling disabled */
cra2 |= 0x00;
}
viafb_write_reg_mask(CRA2, VIACR, cra2, BIT3 + BIT6 + BIT7);
viafb_write_reg_mask(CR77, VIACR, cr77, 0xFF);
viafb_write_reg_mask(CR78, VIACR, cr78, 0xFF);
viafb_write_reg_mask(CR79, VIACR, cr79, 0xF8);
viafb_write_reg_mask(CR9F, VIACR, cr9f, BIT0 + BIT1);
}
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
#define VT3271_DEVICE_ID_REG 0x02 #define VT3271_DEVICE_ID_REG 0x02
#define VT3271_DEVICE_ID 0x71 #define VT3271_DEVICE_ID 0x71
#define GET_LCD_SIZE_BY_SYSTEM_BIOS 0x01
#define GET_LCD_SIZE_BY_VGA_BIOS 0x02
#define GET_LCD_SZIE_BY_HW_STRAPPING 0x03
#define GET_LCD_SIZE_BY_USER_SETTING 0x04
/* Definition DVI Panel ID*/ /* Definition DVI Panel ID*/
/* Resolution: 640x480, Channel: single, Dithering: Enable */ /* Resolution: 640x480, Channel: single, Dithering: Enable */
#define LCD_PANEL_ID0_640X480 0x00 #define LCD_PANEL_ID0_640X480 0x00
......
This diff is collapsed.
...@@ -64,7 +64,7 @@ static inline int viafb_mmio_read(int reg) ...@@ -64,7 +64,7 @@ static inline int viafb_mmio_read(int reg)
*/ */
static u32 viafb_enabled_ints; static u32 viafb_enabled_ints;
static void viafb_int_init(void) static void __devinit viafb_int_init(void)
{ {
viafb_enabled_ints = 0; viafb_enabled_ints = 0;
...@@ -489,7 +489,7 @@ static int __devinit via_pci_setup_mmio(struct viafb_dev *vdev) ...@@ -489,7 +489,7 @@ static int __devinit via_pci_setup_mmio(struct viafb_dev *vdev)
return ret; return ret;
} }
static void __devexit via_pci_teardown_mmio(struct viafb_dev *vdev) static void via_pci_teardown_mmio(struct viafb_dev *vdev)
{ {
iounmap(vdev->fbmem); iounmap(vdev->fbmem);
iounmap(vdev->engine_mmio); iounmap(vdev->engine_mmio);
...@@ -548,7 +548,7 @@ static int __devinit via_setup_subdevs(struct viafb_dev *vdev) ...@@ -548,7 +548,7 @@ static int __devinit via_setup_subdevs(struct viafb_dev *vdev)
return 0; return 0;
} }
static void __devexit via_teardown_subdevs(void) static void via_teardown_subdevs(void)
{ {
int i; int i;
...@@ -613,22 +613,24 @@ static void __devexit via_pci_remove(struct pci_dev *pdev) ...@@ -613,22 +613,24 @@ static void __devexit via_pci_remove(struct pci_dev *pdev)
static struct pci_device_id via_pci_table[] __devinitdata = { static struct pci_device_id via_pci_table[] __devinitdata = {
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CLE266_DID),
.driver_data = UNICHROME_CLE266 }, .driver_data = UNICHROME_CLE266 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_PM800_DID),
.driver_data = UNICHROME_PM800 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K400_DID),
.driver_data = UNICHROME_K400 }, .driver_data = UNICHROME_K400 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K800_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K800_DID),
.driver_data = UNICHROME_K800 }, .driver_data = UNICHROME_K800 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M890_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_PM800_DID),
.driver_data = UNICHROME_PM800 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CN700_DID),
.driver_data = UNICHROME_CN700 }, .driver_data = UNICHROME_CN700 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K8M890_DID),
.driver_data = UNICHROME_K8M890 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CX700_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CX700_DID),
.driver_data = UNICHROME_CX700 }, .driver_data = UNICHROME_CX700 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M900_DID),
.driver_data = UNICHROME_P4M900 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CN750_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_CN750_DID),
.driver_data = UNICHROME_CN750 }, .driver_data = UNICHROME_CN750 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_K8M890_DID),
.driver_data = UNICHROME_K8M890 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M890_DID),
.driver_data = UNICHROME_P4M890 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_P4M900_DID),
.driver_data = UNICHROME_P4M900 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX800_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX800_DID),
.driver_data = UNICHROME_VX800 }, .driver_data = UNICHROME_VX800 },
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX855_DID), { PCI_DEVICE(PCI_VENDOR_ID_VIA, UNICHROME_VX855_DID),
......
...@@ -73,7 +73,7 @@ struct viafb_gpio_cfg { ...@@ -73,7 +73,7 @@ struct viafb_gpio_cfg {
struct gpio_chip gpio_chip; struct gpio_chip gpio_chip;
struct viafb_dev *vdev; struct viafb_dev *vdev;
struct viafb_gpio *active_gpios[VIAFB_NUM_GPIOS]; struct viafb_gpio *active_gpios[VIAFB_NUM_GPIOS];
char *gpio_names[VIAFB_NUM_GPIOS]; const char *gpio_names[VIAFB_NUM_GPIOS];
}; };
/* /*
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment