f85d7d64d4186238874086af8ec0a50882682edf
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / xgifb / vb_ext.c
1 #include <linux/io.h>
2 #include <linux/types.h>
3 #include "XGIfb.h"
4
5 #include "vb_def.h"
6 #include "vgatypes.h"
7 #include "vb_struct.h"
8 #include "vb_util.h"
9 #include "vb_setmode.h"
10 #include "vb_ext.h"
11
12 /**************************************************************
13  *********************** Dynamic Sense ************************
14  *************************************************************/
15
16 unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension,
17                      struct vb_device_info *pVBInfo)
18 {
19         unsigned short temp;
20
21         /* add lcd sense */
22         if (HwDeviceExtension->ulCRT2LCDType == LCD_UNKNOWN) {
23                 return 0;
24         } else {
25                 temp = (unsigned short) HwDeviceExtension->ulCRT2LCDType;
26                 switch (HwDeviceExtension->ulCRT2LCDType) {
27                 case LCD_INVALID:
28                 case LCD_800x600:
29                 case LCD_1024x768:
30                 case LCD_1280x1024:
31                         break;
32
33                 case LCD_640x480:
34                 case LCD_1024x600:
35                 case LCD_1152x864:
36                 case LCD_1280x960:
37                 case LCD_1152x768:
38                         temp = 0;
39                         break;
40
41                 case LCD_1400x1050:
42                 case LCD_1280x768:
43                 case LCD_1600x1200:
44                         break;
45
46                 case LCD_1920x1440:
47                 case LCD_2048x1536:
48                         temp = 0;
49                         break;
50
51                 default:
52                         break;
53                 }
54                 xgifb_reg_and_or(pVBInfo->P3d4, 0x36, 0xF0, temp);
55                 return 1;
56         }
57 }