22 #include <linux/module.h>
24 #include <linux/slab.h>
25 #include <linux/stat.h>
33 static char *viafb_name =
"Via";
34 static u32 pseudo_pal[17];
37 static char *viafb_mode;
38 static char *viafb_mode1;
39 static int viafb_bpp = 32;
40 static int viafb_bpp1 = 32;
42 static unsigned int viafb_second_offset;
43 static int viafb_second_size;
45 static int viafb_accel = 1;
48 static char *viafb_active_dev;
51 static char *viafb_lcd_port =
"";
52 static char *viafb_dvi_port =
"";
59 static struct fb_ops viafb_ops;
68 static const u32 supported_odev_map[] = {
91 var->
red.msb_right = 0;
92 var->
green.msb_right = 0;
93 var->
blue.msb_right = 0;
102 var->
green.offset = 0;
103 var->
blue.offset = 0;
105 var->
green.length = 8;
106 var->
blue.length = 8;
110 var->
red.offset = 10;
111 var->
green.offset = 5;
112 var->
blue.offset = 0;
114 var->
green.length = 5;
115 var->
blue.length = 5;
119 var->
red.offset = 11;
120 var->
green.offset = 5;
121 var->
blue.offset = 0;
123 var->
green.length = 6;
124 var->
blue.length = 5;
128 var->
red.offset = 16;
129 var->
green.offset = 8;
130 var->
blue.offset = 0;
132 var->
green.length = 8;
133 var->
blue.length = 8;
137 var->
red.offset = 20;
138 var->
green.offset = 10;
139 var->
blue.offset = 0;
140 var->
red.length = 10;
141 var->
green.length = 10;
142 var->
blue.length = 10;
153 info->
fix.line_length =
ALIGN(info->
var.xres_virtual * bpp / 8,
217 "viafb: Mode %dx%dx%d not supported!!\n",
226 if (depth < 0 || depth > 32)
232 else if (depth == 30)
236 else if (depth <= 16)
241 viafb_fill_var_color_info(var, depth);
254 get_var_refresh(var));
260 !ppar->
shared->vdev->engine_mmio)
266 static int viafb_set_par(
struct fb_info *info)
272 viafb_update_fix(info);
283 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
290 refresh = get_var_refresh(&info->
var);
292 viafb_bpp1 = info->
var.bits_per_pixel;
295 viafb_bpp = info->
var.bits_per_pixel;
304 viafb_pan_display(&info->
var, info);
310 static int viafb_setcolreg(
unsigned regno,
unsigned red,
unsigned green,
322 green >> 8, blue >> 8);
326 green >> 8, blue >> 8);
331 r = (red >> (16 - info->
var.red.length))
332 << info->
var.red.offset;
333 b = (blue >> (16 - info->
var.blue.length))
334 << info->
var.blue.offset;
335 g = (green >> (16 - info->
var.green.length))
336 << info->
var.green.offset;
349 + var->
xoffset * info->
var.bits_per_pixel / 8;
363 static int viafb_blank(
int blank_mode,
struct fb_info *info)
368 switch (blank_mode) {
406 u32 *viafb_gamma_table;
413 printk(
KERN_WARNING "viafb_ioctl: Please avoid this interface as it is unstable and might change or vanish at any time!\n");
429 info->
var.bits_per_pixel), argp);
446 u.viamode.bpp_sec = viafb_bpp1;
448 u.viamode.xres_sec = 0;
449 u.viamode.yres_sec = 0;
450 u.viamode.virtual_xres_sec = 0;
451 u.viamode.virtual_yres_sec = 0;
452 u.viamode.refresh_sec = 0;
453 u.viamode.bpp_sec = 0;
466 if (viafb_second_size) {
467 u.viasamm.size_prim =
469 viafb_second_size * 1024 * 1024;
471 viafb_second_size * 1024 * 1024;
473 u.viasamm.size_prim =
479 u.viasamm.mem_base = viaparinfo->
fbmem;
480 u.viasamm.offset_sec = viafb_second_offset;
482 u.viasamm.size_prim =
484 u.viasamm.size_sec = 0;
485 u.viasamm.mem_base = viaparinfo->
fbmem;
486 u.viasamm.offset_sec = 0;
506 if (gpu32 & CRT_Device)
508 if (gpu32 & DVI_Device)
510 if (gpu32 & LCD_Device)
530 u.active_dev.bpp = viafb_bpp;
531 u.active_dev.bpp1 = viafb_bpp1;
550 sizeof(
u.driver_version)))
557 retrieve_device_setting(&
u.viafb_setting);
560 sizeof(
u.viafb_setting)))
586 if (
copy_to_user(argp, driver_name,
sizeof(driver_name)))
592 if (IS_ERR(viafb_gamma_table))
593 return PTR_ERR(viafb_gamma_table);
595 kfree(viafb_gamma_table);
600 if (!viafb_gamma_table)
604 256 *
sizeof(
u32))) {
605 kfree(viafb_gamma_table);
608 kfree(viafb_gamma_table);
624 sizeof(
u.panel_pos_size_para)))
626 u.panel_pos_size_para.x =
u.panel_pos_size_para.y = 0;
628 sizeof(
u.panel_pos_size_para)))
633 sizeof(
u.panel_pos_size_para)))
635 u.panel_pos_size_para.x =
u.panel_pos_size_para.y = 0;
637 sizeof(
u.panel_pos_size_para)))
643 sizeof(
u.panel_pos_size_para)))
645 u.panel_pos_size_para.x =
u.panel_pos_size_para.y = 0;
647 sizeof(
u.panel_pos_size_para)))
652 sizeof(
u.panel_pos_size_para)))
654 u.panel_pos_size_para.x =
u.panel_pos_size_para.y = 0;
656 sizeof(
u.panel_pos_size_para)))
662 sizeof(
u.panel_pos_size_para)))
667 sizeof(
u.panel_pos_size_para)))
678 static void viafb_fillrect(
struct fb_info *info,
697 fg_color = rect->
color;
708 NULL, 0, 0, 0, 0, fg_color, 0, rop))
712 static void viafb_copyarea(
struct fb_info *info,
731 area->
sx, area->
sy, 0, 0, 0))
735 static void viafb_imageblit(
struct fb_info *info,
740 u32 fg_color = 0, bg_color = 0;
749 if (image->
depth == 1) {
767 (
u32 *)image->
data, 0, 0, 0, 0, fg_color, bg_color, 0))
775 u32 temp,
xx, yy, bg_color = 0, fg_color = 0,
776 chip_name = viapar->
shared->chip_info.gfx_chip_name;
777 int i,
j = 0, cur_size = 64;
790 temp = (cursor->
hot.x << 16) + cursor->
hot.y;
795 yy = cursor->
image.dy - info->
var.yoffset;
796 xx = cursor->
image.dx - info->
var.xoffset;
802 if (cursor->
image.width <= 32 && cursor->
image.height <= 32)
804 else if (cursor->
image.width <= 64 && cursor->
image.height <= 64)
808 "%dx%d", cursor->
image.width, cursor->
image.height);
823 fg_color = cursor->
image.fg_color;
824 bg_color = cursor->
image.bg_color;
830 ((info->
cmap.red[fg_color] & 0xFFC0) << 14) |
831 ((info->
cmap.green[fg_color] & 0xFFC0) << 4) |
832 ((info->
cmap.blue[fg_color] & 0xFFC0) >> 6);
834 ((info->
cmap.red[bg_color] & 0xFFC0) << 14) |
835 ((info->
cmap.green[bg_color] & 0xFFC0) << 4) |
836 ((info->
cmap.blue[bg_color] & 0xFFC0) >> 6);
839 ((info->
cmap.red[fg_color] & 0xFF00) << 8) |
840 (info->
cmap.green[fg_color] & 0xFF00) |
841 ((info->
cmap.blue[fg_color] & 0xFF00) >> 8);
843 ((info->
cmap.red[bg_color] & 0xFF00) << 8) |
844 (info->
cmap.green[bg_color] & 0xFF00) |
845 ((info->
cmap.blue[bg_color] & 0xFF00) >> 8);
856 } *cr_data = kzalloc(
sizeof(*cr_data),
GFP_ATOMIC);
857 int size = ((cursor->
image.width + 7) >> 3) *
858 cursor->
image.height;
863 if (cur_size == 32) {
865 cr_data->bak[
i] = 0x0;
866 cr_data->bak[i + 1] = 0xFFFFFFFF;
871 cr_data->bak[
i] = 0x0;
872 cr_data->bak[i + 1] = 0x0;
873 cr_data->bak[i + 2] = 0xFFFFFFFF;
874 cr_data->bak[i + 3] = 0xFFFFFFFF;
879 switch (cursor->
rop) {
881 for (i = 0; i <
size; i++)
882 cr_data->data[i] = cursor->
mask[i];
887 cr_data->data[i] = cursor->
mask[i];
893 if (cur_size == 32) {
894 for (i = 0; i <
size; i++) {
895 cr_data->bak[
j] = (
u32) cr_data->data[i];
896 cr_data->bak[j + 1] = ~cr_data->bak[j];
900 for (i = 0; i <
size; i++) {
901 cr_data->bak[
j] = (
u32) cr_data->data[i];
902 cr_data->bak[j + 1] = 0x0;
903 cr_data->bak[j + 2] = ~cr_data->bak[j];
904 cr_data->bak[j + 3] = ~cr_data->bak[j + 1];
920 static int viafb_sync(
struct fb_info *info)
927 static int get_primary_device(
void)
929 int primary_device = 0;
963 return primary_device;
1000 static int __init parse_active_dev(
void)
1011 if (!viafb_active_dev) {
1012 if (machine_is_olpc()) {
1019 }
else if (!
strcmp(viafb_active_dev,
"CRT+DVI")) {
1024 }
else if (!
strcmp(viafb_active_dev,
"DVI+CRT")) {
1029 }
else if (!
strcmp(viafb_active_dev,
"CRT+LCD")) {
1034 }
else if (!
strcmp(viafb_active_dev,
"LCD+CRT")) {
1039 }
else if (!
strcmp(viafb_active_dev,
"DVI+LCD")) {
1044 }
else if (!
strcmp(viafb_active_dev,
"LCD+DVI")) {
1049 }
else if (!
strcmp(viafb_active_dev,
"LCD+LCD2")) {
1053 }
else if (!
strcmp(viafb_active_dev,
"LCD2+LCD")) {
1057 }
else if (!
strcmp(viafb_active_dev,
"CRT")) {
1061 }
else if (!
strcmp(viafb_active_dev,
"DVI")) {
1065 }
else if (!
strcmp(viafb_active_dev,
"LCD")) {
1075 static int __devinit parse_port(
char *opt_str,
int *output_interface)
1077 if (!
strncmp(opt_str,
"DVP0", 4))
1079 else if (!
strncmp(opt_str,
"DVP1", 4))
1081 else if (!
strncmp(opt_str,
"DFP_HIGHLOW", 11))
1083 else if (!
strncmp(opt_str,
"DFP_HIGH", 8))
1085 else if (!
strncmp(opt_str,
"DFP_LOW", 7))
1092 static void __devinit parse_lcd_port(
void)
1094 parse_port(viafb_lcd_port, &viaparinfo->
chip_info->lvds_chip_info.
1097 viaparinfo->
chip_info->lvds_chip_info2.output_interface =
1101 viafb_lcd_port, viaparinfo->
chip_info->lvds_chip_info.
1105 static void __devinit parse_dvi_port(
void)
1107 parse_port(viafb_dvi_port, &viaparinfo->
chip_info->tmds_chip_info.
1111 viafb_dvi_port, viaparinfo->
chip_info->tmds_chip_info.
1115 #ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1123 static int viafb_dvp0_proc_show(
struct seq_file *
m,
void *
v)
1125 u8 dvp0_data_dri = 0, dvp0_clk_dri = 0, dvp0 = 0;
1133 seq_printf(m,
"%x %x %x\n", dvp0, dvp0_data_dri, dvp0_clk_dri);
1150 length = count > 20 ? 20 :
count;
1153 buf[length - 1] =
'\0';
1155 for (i = 0; i < 3; i++) {
1156 value =
strsep(&pbuf,
" ");
1157 if (value !=
NULL) {
1158 if (
kstrtou8(value, 0, ®_val) < 0)
1169 reg_val << 4,
BIT5);
1171 reg_val << 1,
BIT1);
1175 reg_val << 3,
BIT4);
1177 reg_val << 2,
BIT2);
1191 .open = viafb_dvp0_proc_open,
1195 .write = viafb_dvp0_proc_write,
1198 static int viafb_dvp1_proc_show(
struct seq_file *m,
void *v)
1200 u8 dvp1 = 0, dvp1_data_dri = 0, dvp1_clk_dri = 0;
1204 seq_printf(m,
"%x %x %x\n", dvp1, dvp1_data_dri, dvp1_clk_dri);
1208 static int viafb_dvp1_proc_open(
struct inode *
inode,
struct file *file)
1213 static ssize_t viafb_dvp1_proc_write(
struct file *file,
1214 const char __user *buffer,
size_t count, loff_t *pos)
1216 char buf[20], *
value, *pbuf;
1221 length = count > 20 ? 20 :
count;
1224 buf[length - 1] =
'\0';
1226 for (i = 0; i < 3; i++) {
1227 value =
strsep(&pbuf,
" ");
1228 if (value !=
NULL) {
1229 if (
kstrtou8(value, 0, ®_val) < 0)
1238 reg_val << 2, 0x0c);
1256 .open = viafb_dvp1_proc_open,
1260 .write = viafb_dvp1_proc_write,
1263 static int viafb_dfph_proc_show(
struct seq_file *m,
void *v)
1271 static int viafb_dfph_proc_open(
struct inode *
inode,
struct file *file)
1276 static ssize_t viafb_dfph_proc_write(
struct file *file,
1277 const char __user *buffer,
size_t count, loff_t *pos)
1291 .open = viafb_dfph_proc_open,
1295 .write = viafb_dfph_proc_write,
1298 static int viafb_dfpl_proc_show(
struct seq_file *m,
void *v)
1306 static int viafb_dfpl_proc_open(
struct inode *
inode,
struct file *file)
1311 static ssize_t viafb_dfpl_proc_write(
struct file *file,
1312 const char __user *buffer,
size_t count, loff_t *pos)
1326 .open = viafb_dfpl_proc_open,
1330 .write = viafb_dfpl_proc_write,
1333 static int viafb_vt1636_proc_show(
struct seq_file *m,
void *v)
1335 u8 vt1636_08 = 0, vt1636_09 = 0;
1336 switch (viaparinfo->
chip_info->lvds_chip_info.lvds_chip_name) {
1340 &viaparinfo->
chip_info->lvds_chip_info, 0x08) & 0x0f;
1343 &viaparinfo->
chip_info->lvds_chip_info, 0x09) & 0x1f;
1344 seq_printf(m,
"%x %x\n", vt1636_08, vt1636_09);
1349 switch (viaparinfo->
chip_info->lvds_chip_info2.lvds_chip_name) {
1353 &viaparinfo->
chip_info->lvds_chip_info2, 0x08) & 0x0f;
1356 &viaparinfo->
chip_info->lvds_chip_info2, 0x09) & 0x1f;
1357 seq_printf(m,
" %x %x\n", vt1636_08, vt1636_09);
1365 static int viafb_vt1636_proc_open(
struct inode *
inode,
struct file *file)
1370 static ssize_t viafb_vt1636_proc_write(
struct file *file,
1371 const char __user *buffer,
size_t count, loff_t *pos)
1373 char buf[30], *
value, *pbuf;
1378 length = count > 30 ? 30 :
count;
1381 buf[length - 1] =
'\0';
1383 switch (viaparinfo->
chip_info->lvds_chip_info.lvds_chip_name) {
1385 for (i = 0; i < 2; i++) {
1386 value =
strsep(&pbuf,
" ");
1387 if (value !=
NULL) {
1388 if (
kstrtou8(value, 0, ®_val.Data) < 0)
1392 reg_val.Index = 0x08;
1393 reg_val.Mask = 0x0f;
1397 chip_info->lvds_chip_info,
1401 reg_val.Index = 0x09;
1402 reg_val.Mask = 0x1f;
1406 chip_info->lvds_chip_info,
1420 switch (viaparinfo->
chip_info->lvds_chip_info2.lvds_chip_name) {
1422 for (i = 0; i < 2; i++) {
1423 value =
strsep(&pbuf,
" ");
1424 if (value !=
NULL) {
1425 if (
kstrtou8(value, 0, ®_val.Data) < 0)
1429 reg_val.Index = 0x08;
1430 reg_val.Mask = 0x0f;
1434 chip_info->lvds_chip_info2,
1438 reg_val.Index = 0x09;
1439 reg_val.Mask = 0x1f;
1443 chip_info->lvds_chip_info2,
1462 .open = viafb_vt1636_proc_open,
1466 .write = viafb_vt1636_proc_write,
1471 static int viafb_sup_odev_proc_show(
struct seq_file *m,
void *v)
1474 viaparinfo->
shared->chip_info.gfx_chip_name]);
1478 static int viafb_sup_odev_proc_open(
struct inode *
inode,
struct file *file)
1485 .open = viafb_sup_odev_proc_open,
1491 static ssize_t odev_update(
const char __user *buffer,
size_t count,
u32 *odev)
1493 char buf[64], *
ptr =
buf;
1497 if (count < 1 || count > 63)
1502 add = buf[0] ==
'+';
1503 sub = buf[0] ==
'-';
1520 static int viafb_iga1_odev_proc_show(
struct seq_file *m,
void *v)
1526 static int viafb_iga1_odev_proc_open(
struct inode *
inode,
struct file *file)
1531 static ssize_t viafb_iga1_odev_proc_write(
struct file *file,
1532 const char __user *buffer,
size_t count, loff_t *pos)
1534 u32 dev_on, dev_off, dev_old, dev_new;
1537 dev_old = dev_new = viaparinfo->
shared->iga1_devices;
1538 res = odev_update(buffer, count, &dev_new);
1541 dev_off = dev_old & ~dev_new;
1542 dev_on = dev_new & ~dev_old;
1543 viaparinfo->
shared->iga1_devices = dev_new;
1544 viaparinfo->
shared->iga2_devices &= ~dev_new;
1553 .open = viafb_iga1_odev_proc_open,
1557 .write = viafb_iga1_odev_proc_write,
1560 static int viafb_iga2_odev_proc_show(
struct seq_file *m,
void *v)
1566 static int viafb_iga2_odev_proc_open(
struct inode *
inode,
struct file *file)
1571 static ssize_t viafb_iga2_odev_proc_write(
struct file *file,
1572 const char __user *buffer,
size_t count, loff_t *pos)
1574 u32 dev_on, dev_off, dev_old, dev_new;
1577 dev_old = dev_new = viaparinfo->
shared->iga2_devices;
1578 res = odev_update(buffer, count, &dev_new);
1581 dev_off = dev_old & ~dev_new;
1582 dev_on = dev_new & ~dev_old;
1583 viaparinfo->
shared->iga2_devices = dev_new;
1584 viaparinfo->
shared->iga1_devices &= ~dev_new;
1593 .open = viafb_iga2_odev_proc_open,
1597 .write = viafb_iga2_odev_proc_write,
1600 #define IS_VT1636(lvds_chip) ((lvds_chip).lvds_chip_name == VT1636_LVDS)
1601 static void viafb_init_proc(
struct viafb_shared *shared)
1608 #ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1609 proc_create(
"dvp0", 0, viafb_entry, &viafb_dvp0_proc_fops);
1610 proc_create(
"dvp1", 0, viafb_entry, &viafb_dvp1_proc_fops);
1611 proc_create(
"dfph", 0, viafb_entry, &viafb_dfph_proc_fops);
1612 proc_create(
"dfpl", 0, viafb_entry, &viafb_dfpl_proc_fops);
1615 proc_create(
"vt1636", 0, viafb_entry,
1616 &viafb_vt1636_proc_fops);
1619 proc_create(
"supported_output_devices", 0, viafb_entry,
1620 &viafb_sup_odev_proc_fops);
1621 iga1_entry =
proc_mkdir(
"iga1", viafb_entry);
1623 proc_create(
"output_devices", 0, iga1_entry,
1624 &viafb_iga1_odev_proc_fops);
1625 iga2_entry =
proc_mkdir(
"iga2", viafb_entry);
1627 proc_create(
"output_devices", 0, iga2_entry,
1628 &viafb_iga2_odev_proc_fops);
1631 static void viafb_remove_proc(
struct viafb_shared *shared)
1646 #ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1660 static int parse_mode(
const char *
str,
u32 devices,
u32 *xres,
u32 *yres)
1668 viaparinfo->
shared->i2c_26);
1671 viaparinfo->
shared->i2c_31);
1676 }
else if (machine_is_olpc()) {
1699 static int viafb_suspend(
void *
unused)
1709 static int viafb_resume(
void *
unused)
1712 if (viaparinfo->
shared->vdev->engine_mmio)
1723 static struct viafb_pm_hooks viafb_fb_pm_hooks = {
1724 .suspend = viafb_suspend,
1725 .resume = viafb_resume
1741 if (!machine_is_olpc()) {
1758 u32 default_xres, default_yres;
1761 u32 viafb_par_length;
1764 memset(&default_var, 0,
sizeof(default_var));
1780 viaparinfo->
shared->vdev = vdev;
1785 &viaparinfo->
shared->lvds_setting_info2;
1788 i2c_bus_probe(viaparinfo->
shared);
1822 if (viafb_second_size && (viafb_second_size < 8)) {
1823 viafb_second_offset = viaparinfo->
fbmem_free -
1824 viafb_second_size * 1024 * 1024;
1826 viafb_second_size = 8;
1827 viafb_second_offset = viaparinfo->
fbmem_free -
1828 viafb_second_size * 1024 * 1024;
1831 parse_mode(viafb_mode, viaparinfo->
shared->iga1_devices,
1832 &default_xres, &default_yres);
1834 parse_mode(viafb_mode1, viaparinfo->
shared->iga2_devices,
1837 default_var.
xres = default_xres;
1838 default_var.
yres = default_yres;
1844 viafb_setup_fixinfo(&
viafbinfo->fix, viaparinfo);
1852 "allocate the second framebuffer struct error\n");
1854 goto out_fb_release;
1860 viafb_second_offset;
1861 viaparinfo->
memsize = viafb_second_offset;
1875 viafb_second_offset;
1900 goto out_fb1_release;
1906 goto out_dealloc_cmap;
1910 goto out_fb1_unreg_lcd_cle266;
1913 || (viaparinfo->
chip_info->gfx_chip_name !=
1923 viafb_init_proc(viaparinfo->
shared);
1927 viafb_pm_register(&viafb_fb_pm_hooks);
1933 out_fb1_unreg_lcd_cle266:
1943 i2c_bus_free(viaparinfo->
shared);
1955 viafb_remove_proc(viaparinfo->
shared);
1956 i2c_bus_free(viaparinfo->
shared);
1963 static int __init viafb_setup(
void)
1973 if (!options || !*options)
1976 while ((this_opt =
strsep(&options,
",")) !=
NULL) {
1980 if (!
strncmp(this_opt,
"viafb_mode1=", 12)) {
1982 }
else if (!
strncmp(this_opt,
"viafb_mode=", 11)) {
1984 }
else if (!
strncmp(this_opt,
"viafb_bpp1=", 11)) {
1985 if (
kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)
1987 }
else if (!
strncmp(this_opt,
"viafb_bpp=", 10)) {
1988 if (
kstrtouint(this_opt + 10, 0, &viafb_bpp) < 0)
1990 }
else if (!
strncmp(this_opt,
"viafb_refresh1=", 15)) {
1993 }
else if (!
strncmp(this_opt,
"viafb_refresh=", 14)) {
1996 }
else if (!
strncmp(this_opt,
"viafb_lcd_dsp_method=", 21)) {
2000 }
else if (!
strncmp(this_opt,
"viafb_lcd_panel_id=", 19)) {
2004 }
else if (!
strncmp(this_opt,
"viafb_accel=", 12)) {
2005 if (
kstrtoint(this_opt + 12, 0, &viafb_accel) < 0)
2007 }
else if (!
strncmp(this_opt,
"viafb_SAMM_ON=", 14)) {
2010 }
else if (!
strncmp(this_opt,
"viafb_active_dev=", 17)) {
2013 "viafb_display_hardware_layout=", 30)) {
2017 }
else if (!
strncmp(this_opt,
"viafb_second_size=", 18)) {
2018 if (
kstrtoint(this_opt + 18, 0, &viafb_second_size) < 0)
2021 "viafb_platform_epia_dvi=", 24)) {
2026 "viafb_device_lcd_dualedge=", 26)) {
2030 }
else if (!
strncmp(this_opt,
"viafb_bus_width=", 16)) {
2033 }
else if (!
strncmp(this_opt,
"viafb_lcd_mode=", 15)) {
2036 }
else if (!
strncmp(this_opt,
"viafb_lcd_port=", 15)) {
2038 }
else if (!
strncmp(this_opt,
"viafb_dvi_port=", 15)) {
2051 u32 dummy_x, dummy_y;
2054 if (machine_is_olpc())
2063 if (parse_mode(viafb_mode, 0, &dummy_x, &dummy_y)
2065 || parse_mode(viafb_mode1, 0, &dummy_x, &dummy_y)
2067 || viafb_bpp < 0 || viafb_bpp > 32
2068 || viafb_bpp1 < 0 || viafb_bpp1 > 32
2069 || parse_active_dev())
2073 "VIA Graphics Integration Chipset framebuffer %d.%d initializing\n",
2083 static struct fb_ops viafb_ops = {
2085 .fb_open = viafb_open,
2086 .fb_release = viafb_release,
2087 .fb_check_var = viafb_check_var,
2088 .fb_set_par = viafb_set_par,
2089 .fb_setcolreg = viafb_setcolreg,
2090 .fb_pan_display = viafb_pan_display,
2091 .fb_blank = viafb_blank,
2092 .fb_fillrect = viafb_fillrect,
2093 .fb_copyarea = viafb_copyarea,
2094 .fb_imageblit = viafb_imageblit,
2095 .fb_cursor = viafb_cursor,
2096 .fb_ioctl = viafb_ioctl,
2097 .fb_sync = viafb_sync,
2116 "Set CRT viafb_refresh rate (default = 60)");
2120 "Set CRT refresh rate (default = 60)");
2124 "Set Flat Panel type(Default=1024x768)");
2128 "Set Flat Panel display scaling method.(Default=Expandsion)");
2132 "Turn on/off flag of SAMM(Default=OFF)");
2136 "Set 2D Hardware Acceleration: 0 = OFF, 1 = ON (default)");
2143 "Display Hardware Layout (LCD Only, DVI Only...,etc)");
2147 "Set secondary device memory size");
2151 "Turn on/off flag of dual framebuffer devices.(Default = OFF)");
2155 "Turn on/off flag of DVI devices on EPIA board.(Default = OFF)");
2159 "Turn on/off flag of dual edge panel.(Default = OFF)");
2163 "Set bus width of panel.(Default = 12)");
2167 "Set Flat Panel mode(Default=OPENLDI)");