Lines Matching +full:hi +full:- +full:fi

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2001, 2002 - Jani Monoses <jani@iv.ro>
30 #include <linux/i2c-algo-bit.h>
79 MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
81 MODULE_PARM_DESC(mode, "Initial video mode e.g. '648x480-8@60' (deprecated)");
166 fb_writeb(val, p->io_virt + reg); in t_outb()
171 return fb_readb(p->io_virt + reg); in t_inb()
176 fb_writel(v, par->io_virt + r); in writemmr()
181 return fb_readl(par->io_virt + r); in readmmr()
193 u8 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK_TGUI; in tridentfb_ddc_setscl_tgui()
196 reg &= ~DDC_SCL_DRIVE_TGUI; /* disable drive - don't drive hi */ in tridentfb_ddc_setscl_tgui()
200 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setscl_tgui()
206 u8 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK_TGUI; in tridentfb_ddc_setsda_tgui()
209 reg &= ~DDC_SDA_DRIVE_TGUI; /* disable drive - don't drive hi */ in tridentfb_ddc_setsda_tgui()
213 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setsda_tgui()
220 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SDA_TGUI); in tridentfb_ddc_getsda_tgui()
234 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK; in tridentfb_ddc_setscl()
239 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setscl()
247 reg = vga_mm_rcrt(par->io_virt, I2C) & DDC_MASK; in tridentfb_ddc_setsda()
252 vga_mm_wcrt(par->io_virt, I2C, reg); in tridentfb_ddc_setsda()
259 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SCL_IN); in tridentfb_ddc_getscl()
266 return !!(vga_mm_rcrt(par->io_virt, I2C) & DDC_SDA_IN); in tridentfb_ddc_getsda()
271 struct tridentfb_par *par = info->par; in tridentfb_setup_ddc_bus()
273 strlcpy(par->ddc_adapter.name, info->fix.id, in tridentfb_setup_ddc_bus()
274 sizeof(par->ddc_adapter.name)); in tridentfb_setup_ddc_bus()
275 par->ddc_adapter.owner = THIS_MODULE; in tridentfb_setup_ddc_bus()
276 par->ddc_adapter.class = I2C_CLASS_DDC; in tridentfb_setup_ddc_bus()
277 par->ddc_adapter.algo_data = &par->ddc_algo; in tridentfb_setup_ddc_bus()
278 par->ddc_adapter.dev.parent = info->device; in tridentfb_setup_ddc_bus()
279 if (is_oldclock(par->chip_id)) { /* not sure if this check is OK */ in tridentfb_setup_ddc_bus()
280 par->ddc_algo.setsda = tridentfb_ddc_setsda_tgui; in tridentfb_setup_ddc_bus()
281 par->ddc_algo.setscl = tridentfb_ddc_setscl_tgui; in tridentfb_setup_ddc_bus()
282 par->ddc_algo.getsda = tridentfb_ddc_getsda_tgui; in tridentfb_setup_ddc_bus()
285 par->ddc_algo.setsda = tridentfb_ddc_setsda; in tridentfb_setup_ddc_bus()
286 par->ddc_algo.setscl = tridentfb_ddc_setscl; in tridentfb_setup_ddc_bus()
287 par->ddc_algo.getsda = tridentfb_ddc_getsda; in tridentfb_setup_ddc_bus()
288 par->ddc_algo.getscl = tridentfb_ddc_getscl; in tridentfb_setup_ddc_bus()
290 par->ddc_algo.udelay = 10; in tridentfb_setup_ddc_bus()
291 par->ddc_algo.timeout = 20; in tridentfb_setup_ddc_bus()
292 par->ddc_algo.data = par; in tridentfb_setup_ddc_bus()
294 i2c_set_adapdata(&par->ddc_adapter, par); in tridentfb_setup_ddc_bus()
296 return i2c_bit_add_bus(&par->ddc_adapter); in tridentfb_setup_ddc_bus()
336 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in blade_fill_rect()
349 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in blade_image_blit()
351 iowrite32_rep(par->io_virt + 0x10000, data, size); in blade_image_blit()
359 u32 s2 = point(x1 + w - 1, y1 + h - 1); in blade_copy_rect()
361 u32 d2 = point(x2 + w - 1, y2 + h - 1); in blade_copy_rect()
402 par->eng_oper = x | 0x40; in xp_init_accel()
439 t_outb(par, par->eng_oper, 0x2125); in xp_fill_rect()
450 x1_tmp = x1 + w - 1; in xp_copy_rect()
451 x2_tmp = x2 + w - 1; in xp_copy_rect()
459 y1_tmp = y1 + h - 1; in xp_copy_rect()
460 y2_tmp = y2 + h - 1; in xp_copy_rect()
511 writemmr(par, DST2, point(x + w - 1, y + h - 1)); in image_fill_rect()
521 u32 s2 = point(x1 + w - 1, y1 + h - 1); in image_copy_rect()
523 u32 d2 = point(x2 + w - 1, y2 + h - 1); in image_copy_rect()
567 fb_writew(x, par->io_virt + 0x2122); in tgui_init_accel()
576 writemmr(par, OLDDIM, point(w - 1, h - 1)); in tgui_fill_rect()
589 x1_tmp = x1 + w - 1; in tgui_copy_rect()
590 x2_tmp = x2 + w - 1; in tgui_copy_rect()
598 y1_tmp = y1 + h - 1; in tgui_copy_rect()
599 y2_tmp = y2 + h - 1; in tgui_copy_rect()
609 writemmr(par, OLDDIM, point(w - 1, h - 1)); in tgui_copy_rect()
619 struct tridentfb_par *par = info->par; in tridentfb_fillrect()
622 if (info->flags & FBINFO_HWACCEL_DISABLED) { in tridentfb_fillrect()
626 if (info->var.bits_per_pixel == 8) { in tridentfb_fillrect()
627 col = fr->color; in tridentfb_fillrect()
631 col = ((u32 *)(info->pseudo_palette))[fr->color]; in tridentfb_fillrect()
633 par->wait_engine(par); in tridentfb_fillrect()
634 par->fill_rect(par, fr->dx, fr->dy, fr->width, in tridentfb_fillrect()
635 fr->height, col, fr->rop); in tridentfb_fillrect()
641 struct tridentfb_par *par = info->par; in tridentfb_imageblit()
644 if ((info->flags & FBINFO_HWACCEL_DISABLED) || img->depth != 1) { in tridentfb_imageblit()
648 if (info->var.bits_per_pixel == 8) { in tridentfb_imageblit()
649 col = img->fg_color; in tridentfb_imageblit()
652 bgcol = img->bg_color; in tridentfb_imageblit()
656 col = ((u32 *)(info->pseudo_palette))[img->fg_color]; in tridentfb_imageblit()
657 bgcol = ((u32 *)(info->pseudo_palette))[img->bg_color]; in tridentfb_imageblit()
660 par->wait_engine(par); in tridentfb_imageblit()
661 if (par->image_blit) in tridentfb_imageblit()
662 par->image_blit(par, img->data, img->dx, img->dy, in tridentfb_imageblit()
663 img->width, img->height, col, bgcol); in tridentfb_imageblit()
671 struct tridentfb_par *par = info->par; in tridentfb_copyarea()
673 if (info->flags & FBINFO_HWACCEL_DISABLED) { in tridentfb_copyarea()
677 par->wait_engine(par); in tridentfb_copyarea()
678 par->copy_rect(par, ca->sx, ca->sy, ca->dx, ca->dy, in tridentfb_copyarea()
679 ca->width, ca->height); in tridentfb_copyarea()
684 struct tridentfb_par *par = info->par; in tridentfb_sync()
686 if (!(info->flags & FBINFO_HWACCEL_DISABLED)) in tridentfb_sync()
687 par->wait_engine(par); in tridentfb_sync()
697 return vga_mm_rcrt(par->io_virt, reg); in read3X4()
703 vga_mm_wcrt(par->io_virt, reg, val); in write3X4()
709 return vga_mm_rgfx(par->io_virt, reg); in read3CE()
715 fb_readb(par->io_virt + VGA_IS1_RC); /* flip-flop to index */ in writeAttr()
716 vga_mm_wattr(par->io_virt, reg, val); in writeAttr()
722 vga_mm_wgfx(par->io_virt, reg, val); in write3CE()
732 if (!is_oldprotect(par->chip_id)) in enable_mmio()
743 vga_mm_rseq(par->io_virt, 0x0B); in disable_mmio()
746 vga_mm_wseq(par->io_virt, NewMode1, 0x80); in disable_mmio()
747 if (!is_oldprotect(par->chip_id)) in disable_mmio()
748 vga_mm_wseq(par->io_virt, Protection, 0x92); in disable_mmio()
797 if (par->chip_id == TGUI9440 || par->chip_id == CYBER9320) in set_lwidth()
808 if (par->chip_id != CYBERBLADEXPAi1) in screen_stretch()
839 unsigned long fi, d, di; in set_vclk() local
841 unsigned char hi, lo; in set_vclk() local
842 unsigned char shift = !is_oldclock(par->chip_id) ? 2 : 1; in set_vclk()
845 for (k = shift; k >= 0; k--) in set_vclk()
847 n = ((m + 2) << shift) - 8; in set_vclk()
849 fi = ((14318l * (n + 8)) / (m + 2)) >> k; in set_vclk()
850 di = abs(fi - freq); in set_vclk()
857 if (fi > freq) in set_vclk()
862 if (is_oldclock(par->chip_id)) { in set_vclk()
864 hi = (best_m >> 1) | (best_k << 4); in set_vclk()
867 hi = best_m | (best_k << 6); in set_vclk()
870 if (is3Dchip(par->chip_id)) { in set_vclk()
871 vga_mm_wseq(par->io_virt, ClockHigh, hi); in set_vclk()
872 vga_mm_wseq(par->io_virt, ClockLow, lo); in set_vclk()
875 t_outb(par, hi, 0x43C9); in set_vclk()
877 debug("VCLK = %X %X\n", hi, lo); in set_vclk()
903 if (crt || !iscyber(par->chip_id)) in is_flatpanel()
918 switch (par->chip_id) { in get_memsize()
955 tmp2 = vga_mm_rseq(par->io_virt, 0xC1); in get_memsize()
984 k -= memdiff * Kb; in get_memsize()
993 struct tridentfb_par *par = info->par; in tridentfb_check_var()
994 int bpp = var->bits_per_pixel; in tridentfb_check_var()
1001 bpp = var->bits_per_pixel = 32; in tridentfb_check_var()
1003 return -EINVAL; in tridentfb_check_var()
1004 if (par->chip_id == TGUI9440 && bpp == 32) in tridentfb_check_var()
1005 return -EINVAL; in tridentfb_check_var()
1007 if (par->flatpanel && nativex && var->xres > nativex) in tridentfb_check_var()
1008 return -EINVAL; in tridentfb_check_var()
1010 var->xres = (var->xres + 7) & ~0x7; in tridentfb_check_var()
1011 if (var->xres > var->xres_virtual) in tridentfb_check_var()
1012 var->xres_virtual = var->xres; in tridentfb_check_var()
1013 if (var->yres > var->yres_virtual) in tridentfb_check_var()
1014 var->yres_virtual = var->yres; in tridentfb_check_var()
1015 if (var->xres_virtual > 4095 || var->yres > 2048) in tridentfb_check_var()
1016 return -EINVAL; in tridentfb_check_var()
1018 if (var->yres_virtual > 0xffff) in tridentfb_check_var()
1019 return -EINVAL; in tridentfb_check_var()
1020 line_length = var->xres_virtual * bpp / 8; in tridentfb_check_var()
1022 if (!is3Dchip(par->chip_id) && in tridentfb_check_var()
1023 !(info->flags & FBINFO_HWACCEL_DISABLED)) { in tridentfb_check_var()
1026 var->xres_virtual = 512 * 8 / bpp; in tridentfb_check_var()
1028 var->xres_virtual = 1024 * 8 / bpp; in tridentfb_check_var()
1030 var->xres_virtual = 2048 * 8 / bpp; in tridentfb_check_var()
1032 var->xres_virtual = 4096 * 8 / bpp; in tridentfb_check_var()
1034 var->xres_virtual = 8192 * 8 / bpp; in tridentfb_check_var()
1036 return -EINVAL; in tridentfb_check_var()
1038 line_length = var->xres_virtual * bpp / 8; in tridentfb_check_var()
1042 if (line_length * (var->yres_virtual - var->yres) > (4 << 20)) in tridentfb_check_var()
1043 var->yres_virtual = ((4 << 20) / line_length) + var->yres; in tridentfb_check_var()
1045 if (line_length * var->yres_virtual > info->fix.smem_len) in tridentfb_check_var()
1046 return -EINVAL; in tridentfb_check_var()
1050 var->red.offset = 0; in tridentfb_check_var()
1051 var->red.length = 8; in tridentfb_check_var()
1052 var->green = var->red; in tridentfb_check_var()
1053 var->blue = var->red; in tridentfb_check_var()
1056 var->red.offset = 11; in tridentfb_check_var()
1057 var->green.offset = 5; in tridentfb_check_var()
1058 var->blue.offset = 0; in tridentfb_check_var()
1059 var->red.length = 5; in tridentfb_check_var()
1060 var->green.length = 6; in tridentfb_check_var()
1061 var->blue.length = 5; in tridentfb_check_var()
1064 var->red.offset = 16; in tridentfb_check_var()
1065 var->green.offset = 8; in tridentfb_check_var()
1066 var->blue.offset = 0; in tridentfb_check_var()
1067 var->red.length = 8; in tridentfb_check_var()
1068 var->green.length = 8; in tridentfb_check_var()
1069 var->blue.length = 8; in tridentfb_check_var()
1072 return -EINVAL; in tridentfb_check_var()
1075 if (is_xp(par->chip_id)) in tridentfb_check_var()
1078 switch (par->chip_id) { in tridentfb_check_var()
1098 if (PICOS2KHZ(var->pixclock) > ramdac) in tridentfb_check_var()
1099 return -EINVAL; in tridentfb_check_var()
1111 struct tridentfb_par *par = info->par; in tridentfb_pan_display()
1115 offset = (var->xoffset + (var->yoffset * info->var.xres_virtual)) in tridentfb_pan_display()
1116 * info->var.bits_per_pixel / 32; in tridentfb_pan_display()
1135 struct tridentfb_par *par = info->par; in tridentfb_set_par()
1138 struct fb_var_screeninfo *var = &info->var; in tridentfb_set_par()
1139 int bpp = var->bits_per_pixel; in tridentfb_set_par()
1144 hdispend = var->xres / 8 - 1; in tridentfb_set_par()
1145 hsyncstart = (var->xres + var->right_margin) / 8; in tridentfb_set_par()
1146 hsyncend = (var->xres + var->right_margin + var->hsync_len) / 8; in tridentfb_set_par()
1147 htotal = (var->xres + var->left_margin + var->right_margin + in tridentfb_set_par()
1148 var->hsync_len) / 8 - 5; in tridentfb_set_par()
1152 vdispend = var->yres - 1; in tridentfb_set_par()
1153 vsyncstart = var->yres + var->lower_margin; in tridentfb_set_par()
1154 vsyncend = vsyncstart + var->vsync_len; in tridentfb_set_par()
1155 vtotal = var->upper_margin + vsyncend - 2; in tridentfb_set_par()
1159 if (info->var.vmode & FB_VMODE_INTERLACED) { in tridentfb_set_par()
1172 if (var->sync & FB_SYNC_HOR_HIGH_ACT) in tridentfb_set_par()
1174 if (var->sync & FB_SYNC_VERT_HIGH_ACT) in tridentfb_set_par()
1177 if (par->flatpanel && var->xres < nativex) { in tridentfb_set_par()
1242 //FIXME if (info->var.vmode & FB_VMODE_DOUBLE) tmp |= 0x80; /* double scan for 200 line modes */ in tridentfb_set_par()
1251 tmp = (info->var.vmode & FB_VMODE_INTERLACED) ? 0x84 : 0x80; in tridentfb_set_par()
1255 if (info->var.vmode & FB_VMODE_INTERLACED) in tridentfb_set_par()
1280 if (!is_oldprotect(par->chip_id)) in tridentfb_set_par()
1282 if (iscyber(par->chip_id)) in tridentfb_set_par()
1287 if (!is_xp(par->chip_id)) in tridentfb_set_par()
1290 if (par->chip_id != TGUI9440 && par->chip_id != IMAGE975) in tridentfb_set_par()
1293 vga_mm_wseq(par->io_virt, 0, 3); in tridentfb_set_par()
1294 vga_mm_wseq(par->io_virt, 1, 1); /* set char clock 8 dots wide */ in tridentfb_set_par()
1296 vga_mm_wseq(par->io_virt, 2, 0x0F); in tridentfb_set_par()
1297 vga_mm_wseq(par->io_virt, 3, 0); in tridentfb_set_par()
1298 vga_mm_wseq(par->io_virt, 4, 0x0E); /* memory mode enable bitmaps ?? */ in tridentfb_set_par()
1301 vclk = PICOS2KHZ(info->var.pixclock); in tridentfb_set_par()
1305 if (bpp == 32 || (par->chip_id == TGUI9440 && bpp == 16)) { in tridentfb_set_par()
1323 fb_readb(par->io_virt + VGA_IS1_RC); /* flip-flop to index */ in tridentfb_set_par()
1347 if (par->flatpanel) in tridentfb_set_par()
1348 set_number_of_lines(par, info->var.yres); in tridentfb_set_par()
1349 info->fix.line_length = info->var.xres_virtual * bpp / 8; in tridentfb_set_par()
1350 set_lwidth(par, info->fix.line_length / 8); in tridentfb_set_par()
1352 if (!(info->flags & FBINFO_HWACCEL_DISABLED)) in tridentfb_set_par()
1353 par->init_accel(par, info->var.xres_virtual, bpp); in tridentfb_set_par()
1355 info->fix.visual = (bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; in tridentfb_set_par()
1356 info->cmap.len = (bpp == 8) ? 256 : 16; in tridentfb_set_par()
1366 int bpp = info->var.bits_per_pixel; in tridentfb_setcolreg()
1367 struct tridentfb_par *par = info->par; in tridentfb_setcolreg()
1369 if (regno >= info->cmap.len) in tridentfb_setcolreg()
1387 ((u32 *)(info->pseudo_palette))[regno] = col; in tridentfb_setcolreg()
1389 ((u32 *)info->pseudo_palette)[regno] = in tridentfb_setcolreg()
1403 struct tridentfb_par *par = info->par; in tridentfb_blank()
1406 if (par->flatpanel) in tridentfb_blank()
1474 info = framebuffer_alloc(sizeof(struct tridentfb_par), &dev->dev); in trident_pci_probe()
1476 return -ENOMEM; in trident_pci_probe()
1477 default_par = info->par; in trident_pci_probe()
1479 chip_id = id->device; in trident_pci_probe()
1520 default_par->init_accel = xp_init_accel; in trident_pci_probe()
1521 default_par->wait_engine = xp_wait_engine; in trident_pci_probe()
1522 default_par->fill_rect = xp_fill_rect; in trident_pci_probe()
1523 default_par->copy_rect = xp_copy_rect; in trident_pci_probe()
1526 default_par->init_accel = blade_init_accel; in trident_pci_probe()
1527 default_par->wait_engine = blade_wait_engine; in trident_pci_probe()
1528 default_par->fill_rect = blade_fill_rect; in trident_pci_probe()
1529 default_par->copy_rect = blade_copy_rect; in trident_pci_probe()
1530 default_par->image_blit = blade_image_blit; in trident_pci_probe()
1533 default_par->init_accel = image_init_accel; in trident_pci_probe()
1534 default_par->wait_engine = image_wait_engine; in trident_pci_probe()
1535 default_par->fill_rect = image_fill_rect; in trident_pci_probe()
1536 default_par->copy_rect = image_copy_rect; in trident_pci_probe()
1539 default_par->init_accel = tgui_init_accel; in trident_pci_probe()
1540 default_par->wait_engine = xp_wait_engine; in trident_pci_probe()
1541 default_par->fill_rect = tgui_fill_rect; in trident_pci_probe()
1542 default_par->copy_rect = tgui_copy_rect; in trident_pci_probe()
1546 default_par->chip_id = chip_id; in trident_pci_probe()
1556 return -1; in trident_pci_probe()
1559 default_par->io_virt = ioremap(tridentfb_fix.mmio_start, in trident_pci_probe()
1562 if (!default_par->io_virt) { in trident_pci_probe()
1564 err = -1; in trident_pci_probe()
1577 disable_mmio(info->par); in trident_pci_probe()
1578 err = -1; in trident_pci_probe()
1582 info->screen_base = ioremap(tridentfb_fix.smem_start, in trident_pci_probe()
1585 if (!info->screen_base) { in trident_pci_probe()
1587 err = -1; in trident_pci_probe()
1591 default_par->flatpanel = is_flatpanel(default_par); in trident_pci_probe()
1593 if (default_par->flatpanel) in trident_pci_probe()
1596 info->fix = tridentfb_fix; in trident_pci_probe()
1597 info->fbops = &tridentfb_ops; in trident_pci_probe()
1598 info->pseudo_palette = default_par->pseudo_pal; in trident_pci_probe()
1600 info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; in trident_pci_probe()
1601 if (!noaccel && default_par->init_accel) { in trident_pci_probe()
1602 info->flags &= ~FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1603 info->flags |= FBINFO_HWACCEL_COPYAREA; in trident_pci_probe()
1604 info->flags |= FBINFO_HWACCEL_FILLRECT; in trident_pci_probe()
1606 info->flags |= FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1609 info->flags |= FBINFO_READS_FAST; in trident_pci_probe()
1611 info->pixmap.addr = kmalloc(4096, GFP_KERNEL); in trident_pci_probe()
1612 if (!info->pixmap.addr) { in trident_pci_probe()
1613 err = -ENOMEM; in trident_pci_probe()
1617 info->pixmap.size = 4096; in trident_pci_probe()
1618 info->pixmap.buf_align = 4; in trident_pci_probe()
1619 info->pixmap.scan_align = 1; in trident_pci_probe()
1620 info->pixmap.access_align = 32; in trident_pci_probe()
1621 info->pixmap.flags = FB_PIXMAP_SYSTEM; in trident_pci_probe()
1622 info->var.bits_per_pixel = 8; in trident_pci_probe()
1624 if (default_par->image_blit) { in trident_pci_probe()
1625 info->flags |= FBINFO_HWACCEL_IMAGEBLIT; in trident_pci_probe()
1626 info->pixmap.scan_align = 4; in trident_pci_probe()
1631 info->flags |= FBINFO_HWACCEL_DISABLED; in trident_pci_probe()
1632 info->pixmap.scan_align = 1; in trident_pci_probe()
1636 u8 *edid = fb_ddc_read(&default_par->ddc_adapter); in trident_pci_probe()
1638 default_par->ddc_registered = true; in trident_pci_probe()
1640 fb_edid_to_monspecs(edid, &info->monspecs); in trident_pci_probe()
1642 if (!info->monspecs.modedb) in trident_pci_probe()
1643 dev_err(info->device, "error getting mode database\n"); in trident_pci_probe()
1647 fb_videomode_to_modelist(info->monspecs.modedb, in trident_pci_probe()
1648 info->monspecs.modedb_len, in trident_pci_probe()
1649 &info->modelist); in trident_pci_probe()
1650 m = fb_find_best_display(&info->monspecs, in trident_pci_probe()
1651 &info->modelist); in trident_pci_probe()
1653 fb_videomode_to_var(&info->var, m); in trident_pci_probe()
1654 /* fill all other info->var's fields */ in trident_pci_probe()
1655 if (tridentfb_check_var(&info->var, in trident_pci_probe()
1664 mode_option = "640x480-8@60"; in trident_pci_probe()
1668 err = fb_find_mode(&info->var, info, mode_option, in trident_pci_probe()
1669 info->monspecs.modedb, in trident_pci_probe()
1670 info->monspecs.modedb_len, in trident_pci_probe()
1671 NULL, info->var.bits_per_pixel); in trident_pci_probe()
1673 err = -EINVAL; in trident_pci_probe()
1674 dev_err(info->device, "mode %s not found\n", in trident_pci_probe()
1676 fb_destroy_modedb(info->monspecs.modedb); in trident_pci_probe()
1677 info->monspecs.modedb = NULL; in trident_pci_probe()
1682 fb_destroy_modedb(info->monspecs.modedb); in trident_pci_probe()
1683 info->monspecs.modedb = NULL; in trident_pci_probe()
1685 err = fb_alloc_cmap(&info->cmap, 256, 0); in trident_pci_probe()
1689 info->var.activate |= FB_ACTIVATE_NOW; in trident_pci_probe()
1690 info->device = &dev->dev; in trident_pci_probe()
1693 fb_dealloc_cmap(&info->cmap); in trident_pci_probe()
1694 err = -EINVAL; in trident_pci_probe()
1697 output("fb%d: %s frame buffer device %dx%d-%dbpp\n", in trident_pci_probe()
1698 info->node, info->fix.id, info->var.xres, in trident_pci_probe()
1699 info->var.yres, info->var.bits_per_pixel); in trident_pci_probe()
1705 if (default_par->ddc_registered) in trident_pci_probe()
1706 i2c_del_adapter(&default_par->ddc_adapter); in trident_pci_probe()
1707 kfree(info->pixmap.addr); in trident_pci_probe()
1708 if (info->screen_base) in trident_pci_probe()
1709 iounmap(info->screen_base); in trident_pci_probe()
1711 disable_mmio(info->par); in trident_pci_probe()
1713 if (default_par->io_virt) in trident_pci_probe()
1714 iounmap(default_par->io_virt); in trident_pci_probe()
1723 struct tridentfb_par *par = info->par; in trident_pci_remove()
1726 if (par->ddc_registered) in trident_pci_remove()
1727 i2c_del_adapter(&par->ddc_adapter); in trident_pci_remove()
1728 iounmap(par->io_virt); in trident_pci_remove()
1729 iounmap(info->screen_base); in trident_pci_remove()
1732 kfree(info->pixmap.addr); in trident_pci_remove()
1733 fb_dealloc_cmap(&info->cmap); in trident_pci_remove()
1817 return -ENODEV; in tridentfb_init()